vendor: 8,027 bytes, lines 1-31
1import{f as ea,ai as M,r as R,j as h,o as ue,q as bs,ay as Al,B as ye,Z as rc,E as ef,G as tf,I as no,O as nf,a2 as O1,az as D1,H as M1,Q as F1,$ as P1,X as za,i as vr,y as rf,n as Po,t as Lt,aA as k1,aB as B1,S as Xn,aq as j1,g as L1,a as El,b as _e,A as V1,C as Hn,e as $n,x as Fr,af as ki,c as _o,d as Ao,aC as Sl,aD as U1,aE as z1,aF as W1,R as H1}from"./index-bM8UT4Os.js";import{I as Ye}from"./input-BwpLlRYf.js";import{T as Il}from"./textarea-DArC7VX4.js";import{L as Ee}from"./label-2Seh_wFH.js";import{S as Bi,a as ji,b as Li,c as Vi,d as wt}from"./select-CDP2pHh8.js";import{C as $1}from"./chevron-left-Bx_6cTqG.js";import{C as G1}from"./chevron-right-RXMaR5IV.js";import{T as Y1,e as X1,R as K1,C as Z1,P as q1,O as Q1}from"./dialog-CxcTDVnZ.js";import{P as Ea}from"./plus-DSaqw8wa.js";import{U as J1}from"./upload-BrcrR4wG.js";import{C as Rl}from"./chevron-up-TG6jWiKP.js";import{M as ep}from"./minus-DyschO7I.js";import{C as tp}from"./calendar-days-D6maf-Ok.js";import"./useComposition-DO5dIJEj.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Eo=ea("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const np=ea("RefreshCw",[["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"}]]);/** 12 * @license lucide-react v0.453.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const Pa=ea("ScanBarcode",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M8 7v10",key:"23sfjj"}],["path",{d:"M12 7v10",key:"jspqdw"}],["path",{d:"M17 7v10",key:"578dap"}]]);/** 17 * @license lucide-react v0.453.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const Tl=ea("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** 22 * @license lucide-react v0.453.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */const rp=ea("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 27 * @license lucide-react v0.453.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */const Nl=ea("Wheat",[["path",{d:"M2 22 16 8",key:"60hf96"}],["path",{d:"M3.47 12.53 5 11l1.53 1.53a3.5 3.5 0 0 1 0 4.94L5 19l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1rdhi6"}],["path",{d:"M7.47 8.53 9 7l1.53 1.53a3.5 3.5 0 0 1 0 4.94L9 15l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1sdzmb"}],["path",{d:"M11.47 4.53 13 3l1.53 1.53a3.5 3.5 0 0 1 0 4.94L13 11l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"eoatbi"}],["path",{d:"M20 2h2v2a4 4 0 0 1-4 4h-2V6a4 4 0 0 1 4-4Z",key:"19rau1"}],["path",{d:"M11.47 17.47 13 19l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L5 19l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"tc8ph9"}],["path",{d:"M15.47 13.47 17 15l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L9 15l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"2m8kc5"}],["path",{d:"M19.47 9.47 21 11l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L13 11l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"vex3ng"}]]);function ap(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const op={},ka={};function Cr(t,e){try{const r=(op[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in ka?ka[r]:Ol(r,r.split(":"))}catch{if(t in ka)return ka[t];const n=t?.match(ip);return n?Ol(t,n.slice(1)):NaN}}const ip=/([+-]\d\d):?(\d\d)?/;function Ol(t,e){const n=+(e[0]||0),r=+(e[1]||0),a=+(e[2]||0)/60;return ka[t]=n*60+r>0?n*60+r+a:n*60-r-a}class yn extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Cr(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),af(this),Cs(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new yn(...n,e):new yn(Date.now(),e)}withTimeZone(e){return new yn(+this,e)}getTimezoneOffset(){const e=-Cr(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Cs(this),+this}[Symbol.for("constructDateFrom")](e){return new yn(+new Date(e),this.timeZone)}}const Dl=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!Dl.test(t))return;const e=t.replace(Dl,"$1UTC");yn.prototype[e]&&(t.startsWith("get")?yn.prototype[t]=function(){return this.internal[e]()}:(yn.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),sp(this),+this},yn.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Cs(this),+this}))});function Cs(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Cr(t.timeZone,t)*60))}function sp(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),af(t)}function af(t){const e=Cr(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+t).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),i=a-o,s=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();i&&s&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+i);const c=a-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const l=new Date(+t);l.setUTCSeconds(0);const u=a>0?l.getSeconds():(l.getSeconds()-60)%60,d=Math.round(-(Cr(t.timeZone,t)*60))%60;(d||u)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+d+u));const f=Cr(t.timeZone,t),p=f>0?Math.floor(f):Math.ceil(f),m=-new Date(+t).getTimezoneOffset()-p,y=p!==n,v=m-c;if(y&&v){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+v);const w=Cr(t.timeZone,t),b=w>0?Math.floor(w):Math.ceil(w),_=p-b;_&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+_),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+_))}}class Et extends yn{static tz(e,...n){return n.length?new Et(...n,e):new Et(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),a=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()}
31 ${this.toTimeString()}`}toDateString(){const[e,n,r,a]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${e} GMT${n}${r}${a} (${ap(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),a=String(Math.abs(e)%60).padStart(2,"0");return[n,r,a]}withTimeZone(e){return new Et(+this,e)}[Symbol.for("constructDateFrom")](e){return new Et(+new Date(e),this.timeZone)}}const of=6048e5,cp=864e5,Ml=Symbol.for("constructDateFrom");function it(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Ml in t?t[Ml](e):t instanceof Date?new t.constructor(e):new Date(e)}function Oe(t,e){return it(e||t,t)}function sf(t,e,n){const r=Oe(t,n?.in);return isNaN(e)?it(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function cf(t,e,n){const r=Oe(t,n?.in);if(isNaN(e))return it(t,NaN);if(!e)return r;const a=r.getDate(),o=it(t,r.getTime());o.setMonth(r.getMonth()+e+1,0);const i=o.getDate();return a>=i?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}let lp={};function ro(){return lp}function Zr(t,e){const n=ro(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Oe(t,e?.in),o=a.getDay(),i=(o<r?7:0)+o-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function Xa(t,e){return Zr(t,{...e,weekStartsOn:1})}function lf(t,e){const n=Oe(t,e?.in),r=n.getFullYear(),a=it(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const o=Xa(a),i=it(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=Xa(i);return n.getTime()>=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Fl(t){const e=Oe(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function ta(t,...e){const n=it.bind(null,e.find(r=>typeof r=="object"));return e.map(n)}function Ka(t,e){const n=Oe(t,e?.in);return n.setHours(0,0,0,0),n}function uf(t,e,n){const[r,a]=ta(n?.in,t,e),o=Ka(r),i=Ka(a),s=+o-Fl(o),c=+i-Fl(i);return Math.round((s-c)/cp)}function up(t,e){const n=lf(t,e),r=it(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Xa(r)}function dp(t,e,n){return sf(t,e*7,n)}function fp(t,e,n){return cf(t,e*12,n)}function hp(t,e){let n,r=e?.in;return t.forEach(a=>{!r&&typeof a=="object"&&(r=it.bind(null,a));const o=Oe(a,r);(!n||n<o||isNaN(+o))&&(n=o)}),it(r,n||NaN)}function pp(t,e){let n,r=e?.in;return t.forEach(a=>{!r&&typeof a=="object"&&(r=it.bind(null,a));const o=Oe(a,r);(!n||n>o||isNaN(+o))&&(n=o)}),it(r,n||NaN)}function gp(t,e,n){const[r,a]=ta(n?.in,t,e);return+Ka(r)==+Ka(a)}function df(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function mp(t){return!(!df(t)&&typeof t!="number"||isNaN(+Oe(t)))}function xp(t,e,n){const[r,a]=ta(n?.in,t,e),o=r.getFullYear()-a.getFullYear(),i=r.getMonth()-a.getMonth();return o*12+i}function vp(t,e){const n=Oe(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function ff(t,e){const[n,r]=ta(t,e.start,e.end);return{start:n,end:r}}function yp(t,e){const{start:n,end:r}=ff(e?.in,t);let a=+n>+r;const o=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0),i.setDate(1);let s=1;const c=[];for(;+i<=o;)c.push(it(n,i)),i.setMonth(i.getMonth()+s);return a?c.reverse():c}function wp(t,e){const n=Oe(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function bp(t,e){const n=Oe(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function hf(t,e){const n=Oe(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Cp(t,e){const{start:n,end:r}=ff(e?.in,t);let a=+n>+r;const o=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0),i.setMonth(0,1);let s=1;const c=[];for(;+i<=o;)c.push(it(n,i)),i.setFullYear(i.getFullYear()+s);return a?c.reverse():c}function pf(t,e){const n=ro(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Oe(t,e?.in),o=a.getDay(),i=(o<r?-7:0)+6-(o-r);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function _p(t,e){return pf(t,{...e,weekStartsOn:1}
vendor: 4,486 bytes, line 31
31)}const Ap={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ep=(t,e,n)=>{let r;const a=Ap[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Ui(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Sp={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ip={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rp={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Tp={date:Ui({formats:Sp,defaultWidth:"full"}),time:Ui({formats:Ip,defaultWidth:"full"}),dateTime:Ui({formats:Rp,defaultWidth:"full"})},Np={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Op=(t,e,n,r)=>Np[t];function Sa(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,s=n?.width?String(n.width):i;a=t.formattingValues[s]||t.formattingValues[i]}else{const i=t.defaultWidth,s=n?.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[i]}const o=t.argumentCallback?t.argumentCallback(e):e;return a[o]}}const Dp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Mp={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fp={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Pp={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},kp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jp=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Lp={ordinalNumber:jp,era:Sa({values:Dp,defaultWidth:"wide"}),quarter:Sa({values:Mp,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Sa({values:Fp,defaultWidth:"wide"}),day:Sa({values:Pp,defaultWidth:"wide"}),dayPeriod:Sa({values:kp,defaultWidth:"wide",formattingValues:Bp,defaultFormattingWidth:"wide"})};function Ia(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?Up(s,d=>d.test(i)):Vp(s,d=>
vendor: 8,964 bytes, line 31
31d.test(i));let l;l=t.valueCallback?t.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=e.slice(i.length);return{value:l,rest:u}}}function Vp(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Up(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function zp(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],o=e.match(t.parsePattern);if(!o)return null;let i=t.valueCallback?t.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;const s=e.slice(a.length);return{value:i,rest:s}}}const Wp=/^(\d+)(th|st|nd|rd)?/i,Hp=/\d+/i,$p={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Gp={any:[/^b/i,/^(a|c)/i]},Yp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xp={any:[/1/i,/2/i,/3/i,/4/i]},Kp={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Zp={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qp={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Qp={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jp={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},eg={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tg={ordinalNumber:zp({matchPattern:Wp,parsePattern:Hp,valueCallback:t=>parseInt(t,10)}),era:Ia({matchPatterns:$p,defaultMatchWidth:"wide",parsePatterns:Gp,defaultParseWidth:"any"}),quarter:Ia({matchPatterns:Yp,defaultMatchWidth:"wide",parsePatterns:Xp,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ia({matchPatterns:Kp,defaultMatchWidth:"wide",parsePatterns:Zp,defaultParseWidth:"any"}),day:Ia({matchPatterns:qp,defaultMatchWidth:"wide",parsePatterns:Qp,defaultParseWidth:"any"}),dayPeriod:Ia({matchPatterns:Jp,defaultMatchWidth:"any",parsePatterns:eg,defaultParseWidth:"any"})},ac={code:"en-US",formatDistance:Ep,formatLong:Tp,formatRelative:Op,localize:Lp,match:tg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ng(t,e){const n=Oe(t,e?.in);return uf(n,hf(n))+1}function gf(t,e){const n=Oe(t,e?.in),r=+Xa(n)-+up(n);return Math.round(r/of)+1}function mf(t,e){const n=Oe(t,e?.in),r=n.getFullYear(),a=ro(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=it(e?.in||t,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const s=Zr(i,e),c=it(e?.in||t,0);c.setFullYear(r,0,o),c.setHours(0,0,0,0);const l=Zr(c,e);return+n>=+s?r+1:+n>=+l?r:r-1}function rg(t,e){const n=ro(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=mf(t,e),o=it(e?.in||t,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),Zr(o,e)}function xf(t,e){const n=Oe(t,e?.in),r=+Zr(n,e)-+rg(n,e);return Math.round(r/of)+1}function Re(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Gn={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Re(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Re(n+1,2)},d(t,e){return Re(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Re(t.getHours()%12||12,e.length)},H(t,e){return Re(t.getHours(),e.length)},m(t,e){return Re(t.getMinutes(),e.length)},s(t,e){return Re(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Re(a,e.length)}},Pr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pl={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Gn.y(t,e)},Y:function(t,e,n,r){const a=mf(t,r),o=a>0?a:1-a;if(e==="YY"){const i=o%100;return Re(i,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):Re(o,e.length)},R:function(t,e){const n=lf(t);return Re(n,e.length)},u:function(t,e){const n=t.getFullYear();return Re(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Re(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Re(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Gn.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Re(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=xf(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):Re(a,e.length)},I:function(t,e,n){const r=gf(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Re(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Gn.d(t,e)},D:function(t,e,n){const r=ng(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Re(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Re(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Re(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return Re(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=Pr.noon:r===0?a=Pr.midnight:a=r/12>
vendor: 4,423 bytes, line 31
31=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=Pr.evening:r>=12?a=Pr.afternoon:r>=4?a=Pr.morning:a=Pr.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Gn.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Gn.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Re(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Re(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Gn.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Gn.s(t,e)},S:function(t,e){return Gn.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Bl(r);case"XXXX":case"XX":return yr(r);case"XXXXX":case"XXX":default:return yr(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Bl(r);case"xxxx":case"xx":return yr(r);case"xxxxx":case"xxx":default:return yr(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+kl(r,":");case"OOOO":default:return"GMT"+yr(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+kl(r,":");case"zzzz":default:return"GMT"+yr(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return Re(r,e.length)},T:function(t,e,n){return Re(+t,e.length)}};function kl(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+e+Re(o,2)}function Bl(t,e){return t%60===0?(t>0?"-":"+")+Re(Math.abs(t)/60,2):yr(t,e)}function yr(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Re(Math.trunc(r/60),2),o=Re(r%60,2);return n+a+e+o}const jl=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},vf=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},ag=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return jl(t,e);let o;switch(r){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",jl(r,e)).replace("{{time}}",vf(a,e))},og={p:vf,P:ag},ig=/^D+$/,sg=/^Y+$/,cg=["D","DD","YY","YYYY"];function lg(t){return ig.test(t)}function ug(t){return sg.test(t)}function dg(t,e,n){const r=fg(t,e,n);if(console.warn(r),cg.includes(t))throw new RangeError(r)}function fg(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const hg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gg=/^'([^]*?)'?$/,mg=/''/g,xg=/[a-zA-Z]/;function vg(t,e,n){const r=ro(),a=n?.locale??r.locale??ac,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Oe(t,n?.in);if(!mp(s))throw new RangeError("Invalid time value");let c=e.match(pg).map(u=>{const d=u[0];if(d==="p"||d==="P"){const f=og[d];return f(u,a.formatLong)}return u}).join("").match(hg).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:yg(u)};if(Pl[d])return{isToken:!0,value:u};
vendor: 5,278 bytes, line 31
31if(d.match(xg))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(c=a.localize.preprocessor(s,c));const l={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return c.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!n?.useAdditionalWeekYearTokens&&ug(d)||!n?.useAdditionalDayOfYearTokens&&lg(d))&&dg(d,e,String(t));const f=Pl[d[0]];return f(s,d,a.localize,l)}).join("")}function yg(t){const e=t.match(gg);return e?e[1].replace(mg,"'"):t}function wg(t,e){const n=Oe(t,e?.in),r=n.getFullYear(),a=n.getMonth(),o=it(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function bg(t,e){return Oe(t,e?.in).getMonth()}function Cg(t,e){return Oe(t,e?.in).getFullYear()}function _g(t,e){return+Oe(t)>+Oe(e)}function Ag(t,e){return+Oe(t)<+Oe(e)}function Eg(t,e,n){const[r,a]=ta(n?.in,t,e);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function Sg(t,e,n){const[r,a]=ta(n?.in,t,e);return r.getFullYear()===a.getFullYear()}function Ig(t,e,n){const r=Oe(t,n?.in),a=r.getFullYear(),o=r.getDate(),i=it(t,0);i.setFullYear(a,e,15),i.setHours(0,0,0,0);const s=wg(i);return r.setMonth(e,Math.min(o,s)),r}function Rg(t,e,n){const r=Oe(t,n?.in);return isNaN(+r)?it(t,NaN):(r.setFullYear(e),r)}const Ll=5,Tg=4;function Ng(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,a=e.addDays(t,-r+1),o=e.addDays(a,Ll*7-1);return e.getMonth(t)===e.getMonth(o)?Ll:Tg}function yf(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-6):e.addDays(n,-1*(r-1))}function Og(t,e){const n=yf(t,e),r=Ng(t,e);return e.addDays(n,r*7-1)}class Gt{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Et.tz(this.options.timeZone):new this.Date,this.newDate=(r,a,o)=>this.overrides?.newDate?this.overrides.newDate(r,a,o):this.options.timeZone?new Et(r,a,o,this.options.timeZone):new Date(r,a,o),this.addDays=(r,a)=>this.overrides?.addDays?this.overrides.addDays(r,a):sf(r,a),this.addMonths=(r,a)=>this.overrides?.addMonths?this.overrides.addMonths(r,a):cf(r,a),this.addWeeks=(r,a)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,a):dp(r,a),this.addYears=(r,a)=>this.overrides?.addYears?this.overrides.addYears(r,a):fp(r,a),this.differenceInCalendarDays=(r,a)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):uf(r,a),this.differenceInCalendarMonths=(r,a)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):xp(r,a),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):yp(r),this.eachYearOfInterval=r=>{const a=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Cp(r),o=new Set(a.map(s=>this.getYear(s)));if(o.size===a.length)return a;const i=[];return o.forEach(s=>{i.push(new Date(s,0,1))}),i},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):Og(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):_p(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):vp(r),this.endOfWeek=(r,a)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,a):pf(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):bp(r),this.format=(r,a,o)=>{const i=this.overrides?.format?this.overrides.format(r,a,this.options):vg(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):gf(r),this.getMonth=(r,a)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):bg(r,this.options),this.getYear=(r,a)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):Cg(r,this.options),this.getWeek=(r,a)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):xf(r,this.options),this.isAfter=(r,a)=>this.overrides?.isAfter?this.overrides.isAfter(r,a):_g(r,a),this.isBefore=(r,a)=>this.overrides?.isBefore?this.overrides.isBefore(r,a):Ag(r,a),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):df(r),this.isSameDay=(r,a)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,a):gp(r,a),this.isSameMonth=(r,a)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,a):Eg(r,a),this.isSameYear=(r,a)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,a):Sg(r,a),this.max=r=>this.overrides?.max?this.overrides.max(r):hp(r),this.min=r=>this.overrides?.min?this.overrides.min(r):pp(r),this.setMonth=(r,a)=>this.overrides?.setMonth?this.overrides.setMonth(r,a):Ig(r,a),this.setYear=(r,a)=>this.overrides?.setYear?this.overrides.setYear(r,a):Rg(r,a),this.startOfBroadcastWeek=(r,a)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):yf(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Ka(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):Xa(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):wp(r),this.startOfWeek=(r,a)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):Zr(r,this.options),this.startOfYear=r=>
vendor: 22,369 bytes, line 31
31this.overrides?.startOfYear?this.overrides.startOfYear(r):hf(r),this.options={locale:ac,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&Gt.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:r,numerals:a}=this.options,o=n?.code;if(o&&Gt.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(e)}catch{}const i=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,i)}}Gt.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const _n=new Gt;class wf{constructor(e,n,r=_n){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class Dg{constructor(e,n){this.date=e,this.weeks=n}}class Mg{constructor(e,n){this.days=n,this.weekNumber=e}}function Fg(t){return M.createElement("button",{...t})}function Pg(t){return M.createElement("span",{...t})}function kg(t){const{size:e=24,orientation:n="left",className:r}=t;return M.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&M.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&M.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&M.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&M.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Bg(t){const{day:e,modifiers:n,...r}=t;return M.createElement("td",{...r})}function jg(t){const{day:e,modifiers:n,...r}=t,a=M.useRef(null);return M.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),M.createElement("button",{ref:a,...r})}var Z;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Z||(Z={}));var $e;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})($e||($e={}));var hn;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(hn||(hn={}));var $t;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})($t||($t={}));function Lg(t){const{options:e,className:n,components:r,classNames:a,...o}=t,i=[a[Z.Dropdown],n].join(" "),s=e?.find(({value:c})=>c===o.value);return M.createElement("span",{"data-disabled":o.disabled,className:a[Z.DropdownRoot]},M.createElement(r.Select,{className:i,...o},e?.map(({value:c,label:l,disabled:u})=>M.createElement(r.Option,{key:c,value:c,disabled:u},l))),M.createElement("span",{className:a[Z.CaptionLabel],"aria-hidden":!0},s?.label,M.createElement(r.Chevron,{orientation:"down",size:18,className:a[Z.Chevron]})))}function Vg(t){return M.createElement("div",{...t})}function Ug(t){return M.createElement("div",{...t})}function zg(t){const{calendarMonth:e,displayIndex:n,...r}=t;return M.createElement("div",{...r},t.children)}function Wg(t){const{calendarMonth:e,displayIndex:n,...r}=t;return M.createElement("div",{...r})}function Hg(t){return M.createElement("table",{...t})}function $g(t){return M.createElement("div",{...t})}const bf=R.createContext(void 0);function ao(){const t=R.useContext(bf);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function Gg(t){const{components:e}=ao();return M.createElement(e.Dropdown,{...t})}function Yg(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:a,...o}=t,{components:i,classNames:s,labels:{labelPrevious:c,labelNext:l}}=ao(),u=R.useCallback(f=>{a&&n?.(f)},[a,n]),d=R.useCallback(f=>{r&&e?.(f)},[r,e]);return M.createElement("nav",{...o},M.createElement(i.PreviousMonthButton,{type:"button",className:s[Z.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},M.createElement(i.Chevron,{disabled:r?void 0:!0,className:s[Z.Chevron],orientation:"left"})),M.createElement(i.NextMonthButton,{type:"button",className:s[Z.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":l(a),onClick:u},M.createElement(i.Chevron,{disabled:a?void 0:!0,orientation:"right",className:s[Z.Chevron]})))}function Xg(t){const{components:e}=ao();return M.createElement(e.Button,{...t})}function Kg(t){return M.createElement("option",{...t})}function Zg(t){const{components:e}=ao();return M.createElement(e.Button,{...t})}function qg(t){const{rootRef:e,...n}=t;return M.createElement("div",{...n,ref:e})}function Qg(t){return M.createElement("select",{...t})}function Jg(t){const{week:e,...n}=t;return M.createElement("tr",{...n})}function em(t){return M.createElement("th",{...t})}function tm(t){return M.createElement("thead",{"aria-hidden":!0},M.createElement("tr",{...t}))}function nm(t){const{week:e,...n}=t;return M.createElement("th",{...n})}function rm(t){return M.createElement("th",{...t})}function am(t){return M.createElement("tbody",{...t})}function om(t){const{components:e}=ao();return M.createElement(e.Dropdown,{...t})}const im=Object.freeze(Object.defineProperty({__proto__:null,Button:Fg,CaptionLabel:Pg,Chevron:kg,Day:Bg,DayButton:jg,Dropdown:Lg,DropdownNav:Vg,Footer:Ug,Month:zg,MonthCaption:Wg,MonthGrid:Hg,Months:$g,MonthsDropdown:Gg,Nav:Yg,NextMonthButton:Xg,Option:Kg,PreviousMonthButton:Zg,Root:qg,Select:Qg,Week:Jg,WeekNumber:nm,WeekNumberHeader:rm,Weekday:em,Weekdays:tm,Weeks:am,YearsDropdown:om},Symbol.toStringTag,{value:"Module"}));function Rn(t,e,n=!1,r=_n){let{from:a,to:o}=t;const{differenceInCalendarDays:i,isSameDay:s}=r;return a&&o?(i(o,a)<0&&([a,o]=[o,a]),i(e,a)>=(n?1:0)&&i(o,e)>=(n?1:0)):!n&&o?s(o,e):!n&&a?s(a,e):!1}function Cf(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function oc(t){return!!(t&&typeof t=="object"&&"from"in t)}function _f(t){return!!(t&&typeof t=="object"&&"after"in t)}function Af(t){return!!(t&&typeof t=="object"&&"before"in t)}function Ef(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Sf(t,e){return Array.isArray(t)&&t.every(e.isDate)}function Tn(t,e,n=_n){const r=Array.isArray(e)?e:[e],{isSameDay:a,differenceInCalendarDays:o,isAfter:i}=n;return r.some(s=>{if(typeof s=="boolean")return s;if(n.isDate(s))return a(t,s);if(Sf(s,n))return s.includes(t);if(oc(s))return Rn(s,t,!1,n);if(Ef(s))return Array.isArray(s.dayOfWeek)?s.dayOfWeek.includes(t.getDay()):s.dayOfWeek===t.getDay();if(Cf(s)){const c=o(s.before,t),l=o(s.after,t),u=c>0,d=l<0;return i(s.before,s.after)?d&&u:u||d}return _f(s)?o(t,s.after)>0:Af(s)?o(s.before,t)>0:typeof s=="function"?s(t):!1})}function sm(t,e,n,r,a){const{disabled:o,hidden:i,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u}=e,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:g,endOfMonth:m,isAfter:y}=a,v=n&&p(n),w=r&&m(r),b={[$e.focused]:[],[$e.outside]:[],[$e.disabled]:[],[$e.hidden]:[],[$e.today]:[]},_={};for(const A of t){const{date:T,displayMonth:S}=A,E=!!(S&&!f(T,S)),F=!!(v&&g(T,v)),k=!!(w&&y(T,w)),W=!!(o&&Tn(T,o,a)),z=!!(i&&Tn(T,i,a))||F||k||!l&&!c&&E||l&&c===!1&&E,L=d(T,u??a.today());E&&b.outside.push(A),W&&b.disabled.push(A),z&&b.hidden.push(A),L&&b.today.push(A),s&&Object.keys(s).forEach(le=>{const fe=s?.[le];fe&&Tn(T,fe,a)&&(_[le]?_[le].push(A):_[le]=[A])})}return A=>{const T={[$e.focused]:!1,[$e.disabled]:!1,[$e.hidden]:!1,[$e.outside]:!1,[$e.today]:!1},S={};for(const E in b){const F=b[E];T[E]=F.some(k=>k===A)}for(const E in _)S[E]=_[E].some(F=>F===A);return{...T,...S}}}function cm(t,e,n={}){return Object.entries(t).filter(([,a])=>a===!0).reduce((a,[o])=>(n[o]?a.push(n[o]):e[$e[o]]?a.push(e[$e[o]]):e[hn[o]]&&a.push(e[hn[o]]),a),[e[Z.Day]])}function lm(t){return{...im,...t}}function um(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function ic(){const t={};for(const e in Z)t[Z[e]]=`rdp-${Z[e]}`;for(const e in $e)t[$e[e]]=`rdp-${$e[e]}`;for(const e in hn)t[hn[e]]=`rdp-${hn[e]}`;for(const e in $t)t[$t[e]]=`rdp-${$t[e]}`;return t}function If(t,e,n){return(n??new Gt(e)).formatMonthYear(t)}const dm=If;function fm(t,e,n){return(n??new Gt(e)).format(t,"d")}function hm(t,e=_n){return e.format(t,"LLLL")}function pm(t,e,n){return(n??new Gt(e)).format(t,"cccccc")}function gm(t,e=_n){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function mm(){return""}function Rf(t,e=_n){return e.format(t,"yyyy")}const xm=Rf,vm=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:If,formatDay:fm,formatMonthCaption:dm,formatMonthDropdown:hm,formatWeekNumber:gm,formatWeekNumberHeader:mm,formatWeekdayName:pm,formatYearCaption:xm,formatYearDropdown:Rf},Symbol.toStringTag,{value:"Module"}));function ym(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...vm,...t}}function wm(t,e,n,r,a){const{startOfMonth:o,startOfYear:i,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=a;return c({start:i(t),end:s(t)}).map(f=>{const p=r.formatMonthDropdown(f,a),g=l(f),m=e&&f<o(e)||n&&f>o(n)||!1;return{value:g,label:p,disabled:m}})}function bm(t,e={},n={}){let r={...e?.[Z.Day]};return Object.entries(t).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n?.[a]}}),r}function Cm(t,e,n){const r=t.today(),a=e?t.startOfISOWeek(r):t.startOfWeek(r),o=[];for(let i=0;i<7;i++){const s=t.addDays(a,i);o.push(s)}return o}function _m(t,e,n,r,a=!1){if(!t||!e)return;const{startOfYear:o,endOfYear:i,eachYearOfInterval:s,getYear:c}=r,l=o(t),u=i(e),d=s({start:l,end:u});return a&&d.reverse(),d.map(f=>{const p=n.formatYearDropdown(f,r);return{value:c(f),label:p,disabled:!1}})}function Tf(t,e,n,r){let a=(r??new Gt(n)).format(t,"PPPP");return e.today&&(a=`Today, ${a}`),e.selected&&(a=`${a}, selected`),a}const Am=Tf;function Nf(t,e,n){return(n??new Gt(e)).formatMonthYear(t)}const Em=Nf;function Sm(t,e,n,r){let a=(r??new Gt(n)).format(t,"PPPP");return e?.today&&(a=`Today, ${a}`),a}function Im(t){return"Choose the Month"}function Rm(){return""}function Tm(t){return"Go to the Next Month"}function Nm(t){return"Go to the Previous Month"}function Om(t,e,n){return(n??new Gt(e)).format(t,"cccc")}function Dm(t,e){return`Week ${t}`}function Mm(t){return"Week Number"}function Fm(t){return"Choose the Year"}const Pm=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Em,labelDay:Am,labelDayButton:Tf,labelGrid:Nf,labelGridcell:Sm,labelMonthDropdown:Im,labelNav:Rm,labelNext:Tm,labelPrevious:Nm,labelWeekNumber:Dm,labelWeekNumberHeader:Mm,labelWeekday:Om,labelYearDropdown:Fm},Symbol.toStringTag,{value:"Module"})),oo=t=>t instanceof HTMLElement?t:null,zi=t=>[...t.querySelectorAll("[data-animated-month]")??[]],km=t=>oo(t.querySelector("[data-animated-month]")),Wi=t=>oo(t.querySelector("[data-animated-caption]")),Hi=t=>oo(t.querySelector("[data-animated-weeks]")),Bm=t=>oo(t.querySelector("[data-animated-nav]")),jm=t=>oo(t.querySelector("[data-animated-weekdays]"));function Lm(t,e,{classNames:n,months:r,focused:a,dateLib:o}){const i=R.useRef(null),s=R.useRef(r),c=R.useRef(!1);R.useLayoutEffect(()=>{const l=s.current;if(s.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;const u=o.isSameMonth(r[0].date,l[0].date),d=o.isAfter(r[0].date,l[0].date),f=d?n[$t.caption_after_enter]:n[$t.caption_before_enter],p=d?n[$t.weeks_after_enter]:n[$t.weeks_before_enter],g=i.current,m=t.current.cloneNode(!0);if(m instanceof HTMLElement?(zi(m).forEach(b=>{if(!(b instanceof HTMLElement))return;const _=km(b);_&&b.contains(_)&&b.removeChild(_);const A=Wi(b);A&&A.classList.remove(f);const T=Hi(b);T&&T.classList.remove(p)}),i.current=m):i.current=null,c.current||u||a)return;const y=g instanceof HTMLElement?zi(g):[],v=zi(t.current);if(v?.every(w=>w instanceof HTMLElement)&&y&&y.every(w=>w instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const w=Bm(t.current);w&&(w.style.zIndex="1"),v.forEach((b,_)=>{const A=y[_];if(!A)return;b.style.position="relative",b.style.overflow="hidden";const T=Wi(b);T&&T.classList.add(f);const S=Hi(b);S&&S.classList.add(p);const E=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),w&&(w.style.zIndex=""),T&&T.classList.remove(f),S&&S.classList.remove(p),b.style.position="",b.style.overflow="",b.contains(A)&&b.removeChild(A)};A.style.pointerEvents="none",A.style.position="absolute",A.style.overflow="hidden",A.setAttribute("aria-hidden","true");const F=jm(A);F&&(F.style.opacity="0");const k=Wi(A);k&&(k.classList.add(d?n[$t.caption_before_exit]:n[$t.caption_after_exit]),k.addEventListener("animationend",E));const W=Hi(A);W&&W.classList.add(d?n[$t.weeks_before_exit]:n[$t.weeks_after_exit]),b.insertBefore(A,b.firstChild)})}})}function Vm(t,e,n,r){const a=t[0],o=t[t.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:g,endOfWeek:m,isAfter:y,startOfBroadcastWeek:v,startOfISOWeek:w,startOfWeek:b}=r,_=c?v(a,r):i?w(a):b(a),A=c?f(o):i?p(g(o)):m(g(o)),T=u(A,_),S=d(o,a)+1,E=[];for(let W=0;W<=T;W++){const z=l(_,W);if(e&&y(z,e))break;E.push(z)}const k=(c?35:42)*S;if(s&&E.length<k){const W=k-E.length;for(let z=0;z<W;z++){const L=l(E[E.length-1],1);E.push(L)}}return E}function Um(t){const e=[];return t.reduce((n,r)=>{const a=r.weeks.reduce((o,i)=>o.concat(i.days.slice()),e.slice());return n.concat(a.slice())},e.slice())}function zm(t,e,n,r){const{numberOfMonths:a=1}=n,o=[];for(let i=0;i<a;i++){const s=r.addMonths(t,i);if(e&&s>e)break;o.push(s)}return o}function Vl(t,e,n,r){const{month:a,defaultMonth:o,today:i=r.today(),numberOfMonths:s=1}=t;let c=a||o||i;const{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;if(n&&l(n,c)<s-1){const f=-1*(s-1);c=u(n,f)}return e&&l(c,e)<0&&(c=e),d(c)}function Wm(t,e,n,r){const{addDays:a,endOfBroadcastWeek:o,endOfISOWeek:i,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,g=t.reduce((m,y)=>{const v=n.broadcastCalendar?d(y,r):n.ISOWeek?f(y):p(y),w=n.broadcastCalendar?o(y):n.ISOWeek?i(s(y)):c(s(y)),b=e.filter(S=>S>=v&&S<=w),_=n.broadcastCalendar?35:42;if(n.fixedWeeks&&b.length<_){const S=e.filter(E=>{const F=_-b.length;return E>w&&E<=a(w,F)});b.push(...S)}const A=b.reduce((S,E)=>{const F=n.ISOWeek?l(E):u(E),k=S.find(z=>z.weekNumber===F),W=new wf(E,y,r);return k?k.days.push(W):S.push(new Mg(F,[W])),S},[]),T=new Dg(y,A);return m.push(T),m},[]);return n.reverseMonths?g.reverse():g}function Hm(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:a,startOfDay:o,startOfMonth:i,endOfMonth:s,addYears:c,endOfYear:l,newDate:u,today:d}=e,{fromYear:f,toYear:p,fromMonth:g,toMonth:m}=t;!n&&g&&(n=g),!n&&f&&(n=e.newDate(f,0,1)),!r&&m&&(r=m),!r&&p&&(r=u(p,11,31));const y=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=i(n):f?n=u(f,0,1):!n&&y&&(n=a(c(t.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&y&&(r=l(t.today??d())),[n&&o(n),r&&o(r)]}function $m(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:c}=r,l=a?o:1,u=i(t);if(!e)return s(u,l);if(!(c(e,t)<o))return s(u,l)}function Gm(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:c}=r,l=a?o??1:1,u=i(t);if(!e)return s(u,-l);if(!(c(u,e)<=0))return s(u,-l)}function Ym(t){const e=[];return t.reduce((n,r)=>n.concat(r.weeks.slice()),e.slice())}function ri(t,e){const[n,r]=R.useState(t);return[e===void 0?n:e,r]}function Xm(t,e){const[n,r]=Hm(t,e),{startOfMonth:a,endOfMonth:o}=e,i=Vl(t,n,r,e),[s,c]=ri(i,t.month?i:void 0);R.useEffect(()=>{const T=Vl(t,n,r,e);c(T)},[t.timeZone]);const l=zm(s,r,t,e),u=Vm(l,t.endMonth?o(t.endMonth):void 0,t,e),d=Wm(l,u,t,e),f=Ym(d),p=Um(d),g=Gm(s,n,t,e),m=$m(s,r,t,e),{disableNavigation:y,onMonthChange:v}=t,w=T=>f.some(S=>S.days.some(E=>E.isEqualTo(T))),b=T=>{if(y)return;let S=a(T);n&&S<a(n)&&(S=a(n)),r&&S>a(r)&&(S=a(r)),c(S),v?.(S)};return{months:d,weeks:f,days:p,navStart:n,navEnd:r,previousMonth:g,nextMonth:m,goToMonth:b,goToDay:T=>{w(T)||b(T.date)}}}var vn;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(vn||(vn={}));function Ul(t){return!t[$e.disabled]&&!t[$e.hidden]&&!t[$e.outside]}function Km(t,e,n,r){let a,o=-1;for(const i of t){const s=e(i);Ul(s)&&(s[$e.focused]&&o<vn.FocusedModifier?(a=i,o=vn.FocusedModifier):r?.isEqualTo(i)&&o<vn.LastFocused?(a=i,o=vn.LastFocused):n(i.date)&&o<vn.Selected?(a=i,o=vn.Selected):s[$e.today]&&o<vn.Today&&(a=i,o=vn.Today))}return a||(a=t.find(i=>Ul(e(i)))),a}function Zm(t,e,n,r,a,o,i){const{ISOWeek:s,broadcastCalendar:c}=o,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:g,endOfWeek:m,max:y,min:v,startOfBroadcastWeek:w,startOfISOWeek:b,startOfWeek:_}=i;let T={day:l,week:d,month:u,year:f,startOfWeek:S=>c?w(S,i):s?b(S):_(S),endOfWeek:S=>c?p(S):s?g(S):m(S)}[t](n,e==="after"?1:-1);return e==="before"&&r?T=y([r,T]):e==="after"&&a&&(T=v([a,T])),T}function Of(t,e,n,r,a,o,i,s=0){if(s>365)return;const c=Zm(t,e,n.date,r,a,o,i),l=!!(o.disabled&&Tn(c,o.disabled,i)),u=!!(o.hidden&&Tn(c,o.hidden,i)),d=c,f=new wf(c,d,i);return!l&&!u?f:Of(t,e,f,r,a,o,i,s+1)}function qm(t,e,n,r,a){const{autoFocus:o}=t,[i,s]=R.useState(),c=Km(e.days,n,r||(()=>!1),i),[l,u]=R.useState(o?c:void 0);return{isFocusTarget:m=>!!c?.isEqualTo(m),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(m,y)=>{if(!l)return;const v=Of(m,y,l,e.navStart,e.navEnd,t,a);v&&(t.disableNavigation&&!e.days.some(b=>b.isEqualTo(v))||(e.goToDay(v),u(v)))}}}function Qm(t,e){const{selected:n,required:r,onSelect:a}=t,[o,i]=ri(n,a?n:void 0),s=a?n:o,{isSameDay:c}=e,l=p=>s?.some(g=>c(g,p))??!1,{min:u,max:d}=t;return{selected:s,select:(p,g,m)=>{let y=[...s??[]];if(l(p)){if(s?.length===u||r&&s?.length===1)return;y=s?.filter(v=>!c(v,p))}else s?.length===d?y=[p]:y=[...y,p];return a||i(y),a?.(y,p,g,m),y},isSelected:l}}function Jm(t,e,n=0,r=0,a=!1,o=_n){const{from:i,to:s}=e||{},{isSameDay:c,isAfter:l,isBefore:u}=o;let d;if(!i&&!s)d={from:t,to:n>0?void 0:t};else if(i&&!s)c(i,t)?n===0?d={from:i,to:t}:a?d={from:i,to:void 0}:d=void 0:u(t,i)?d={from:t,to:i}:d={from:i,to:t};else if(i&&s)if(c(i,t)&&c(s,t))a?d={from:i,to:s}:d=void 0;else if(c(i,t))d={from:i,to:n>0?void 0:t};else if(c(s,t))d={from:t,to:n>0?void 0:t};else if(u(t,i))d={from:t,to:s};else if(l(t,i))d={from:i,to:t};else if(l(t,s))d={from:i,to:t};else throw new Error("Invalid range");if(d?.from&&d?.to){const f=o.differenceInCalendarDays(d.to,d.from);r>0&&f>r?d={from:t,to:void 0}:n>1&&f<n&&(d={from:t,to:void 0})}return d}function ex(t,e,n=_n){const r=Array.isArray(e)?e:[e];let a=t.from;const o=n.differenceInCalendarDays(t.to,t.from),i=Math.min(o,6);for(let s=0;s<=i;s++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function zl(t,e,n=_n){return Rn(t,e.from,!1,n)||Rn(t,e.to,!1,n)||Rn(e,t.from,!1,n)||Rn(e,t.to,!1,n)}function tx(t,e,n=_n){const r=Array.isArray(e)?e:[e];if(r.filter(s=>typeof s!="function").some(s=>typeof s=="boolean"?s:n.isDate(s)?Rn(t,s,!1,n):Sf(s,n)?s.some(c=>Rn(t,c,!1,n)):oc(s)?s.from&&s.to?zl(t,{from:s.from,to:s.to},n):!1:Ef(s)?ex(t,s.dayOfWeek,n):Cf(s)?n.isAfter(s.before,s.after)?zl(t,{from:n.addDays(s.after,1),to:n.addDays(s.before,-1)},n):Tn(t.from,s,n)||Tn(t.to,s,n):_f(s)||Af(s)?Tn(t.from,s,n)||Tn(t.to,s,n):!1))return!0;const i=r.filter(s=>typeof s=="function");if(i.length){let s=t.from;const c=n.differenceInCalendarDays(t.to,t.from);for(let l=0;l<=c;l++){if(i.some(u=>u(s)))return!0;s=n.addDays(s,1)}}return!1}function nx(t,e){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:i}=t,[s,c]=ri(a,i?a:void 0),l=i?a:s;return{selected:l,select:(f,p,g)=>{const{min:m,max:y}=t,v=f?Jm(f,l,m,y,o,e):void 0;return r&&n&&v?.from&&v.to&&tx({from:v.from,to:v.to},n,e)&&(v.from=f,v.to=void 0),i||c(v),i?.(v,f,p,g),v},isSelected:f=>l&&Rn(l,f,!1,e)}}function rx(t,e){const{selected:n,required:r,onSelect:a}=t,[o,i]=ri(n,a?n:void 0),s=a?n:o,{isSameDay:c}=e;return{selected:s,select:(d,f,p)=>{let g=d;return!r&&s&&s&&c(d,s)&&(g=void 0),a||i(g),a?.(g,d,f,p),g},isSelected:d=>s?c(s,d):!1}}function ax(t,e){const n=rx(t,e),r=Qm(t,e),a=nx(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function ox(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new Et(e.today,e.timeZone)),e.month&&(e.month=new Et(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new Et(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new Et(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new Et(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.
31selected=new Et(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(ae=>new Et(ae,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new Et(e.selected.from,e.timeZone):void 0,to:e.selected.to?new Et(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:o,locale:i,classNames:s}=R.useMemo(()=>{const ae={...ac,...e.locale};return{dateLib:new Gt({locale:ae,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:lm(e.components),formatters:ym(e.formatters),labels:{...Pm,...e.labels},locale:ae,classNames:{...ic(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:c,mode:l,navLayout:u,numberOfMonths:d=1,onDayBlur:f,onDayClick:p,onDayFocus:g,onDayKeyDown:m,onDayMouseEnter:y,onDayMouseLeave:v,onNextClick:w,onPrevClick:b,showWeekNumber:_,styles:A}=e,{formatCaption:T,formatDay:S,formatMonthDropdown:E,formatWeekNumber:F,formatWeekNumberHeader:k,formatWeekdayName:W,formatYearDropdown:z}=r,L=Xm(e,o),{days:le,months:fe,navStart:Ve,navEnd:ne,previousMonth:oe,nextMonth:Ce,goToMonth:Me}=L,sn=sm(le,e,Ve,ne,o),{isSelected:An,select:kt,selected:cn}=ax(e,o)??{},{blur:Yt,focused:pn,isFocusTarget:Bt,moveFocus:gn,setFocused:Xt}=qm(e,L,sn,An??(()=>!1),o),{labelDayButton:Dn,labelGridcell:Kt,labelGrid:nr,labelMonthDropdown:Mn,labelNav:re,labelPrevious:Fn,labelNext:rr,labelWeekday:Pn,labelWeekNumber:ke,labelWeekNumberHeader:ar,labelYearDropdown:st}=a,kn=R.useMemo(()=>Cm(o,e.ISOWeek),[o,e.ISOWeek]),or=l!==void 0||p!==void 0,Zt=R.useCallback(()=>{oe&&(Me(oe),b?.(oe))},[oe,Me,b]),Bn=R.useCallback(()=>{Ce&&(Me(Ce),w?.(Ce))},[Me,Ce,w]),ir=R.useCallback((ae,U)=>V=>{V.preventDefault(),V.stopPropagation(),Xt(ae),kt?.(ae.date,U,V),p?.(ae.date,U,V)},[kt,p,Xt]),Tr=R.useCallback((ae,U)=>V=>{Xt(ae),g?.(ae.date,U,V)},[g,Xt]),ua=R.useCallback((ae,U)=>V=>{Yt(),f?.(ae.date,U,V)},[Yt,f]),Wt=R.useCallback((ae,U)=>V=>{const K={ArrowLeft:[V.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[V.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[V.shiftKey?"year":"week","after"],ArrowUp:[V.shift
vendor: 7,147 bytes, line 31
31Key?"year":"week","before"],PageUp:[V.shiftKey?"year":"month","before"],PageDown:[V.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(K[V.key]){V.preventDefault(),V.stopPropagation();const[ee,G]=K[V.key];gn(ee,G)}m?.(ae.date,U,V)},[gn,m,e.dir]),sr=R.useCallback((ae,U)=>V=>{y?.(ae.date,U,V)},[y]),cr=R.useCallback((ae,U)=>V=>{v?.(ae.date,U,V)},[v]),lr=R.useCallback(ae=>U=>{const V=Number(U.target.value),K=o.setMonth(o.startOfMonth(ae),V);Me(K)},[o,Me]),mn=R.useCallback(ae=>U=>{const V=Number(U.target.value),K=o.setYear(o.startOfMonth(ae),V);Me(K)},[o,Me]),{className:jn,style:da}=R.useMemo(()=>({className:[s[Z.Root],e.className].filter(Boolean).join(" "),style:{...A?.[Z.Root],...e.style}}),[s,e.className,e.style,A]),Nr=um(e),Ln=R.useRef(null);Lm(Ln,!!e.animate,{classNames:s,months:fe,focused:pn,dateLib:o});const Or={dayPickerProps:e,selected:cn,select:kt,isSelected:An,months:fe,nextMonth:Ce,previousMonth:oe,goToMonth:Me,getModifiers:sn,components:n,classNames:s,styles:A,labels:a,formatters:r};return M.createElement(bf.Provider,{value:Or},M.createElement(n.Root,{rootRef:e.animate?Ln:void 0,className:jn,style:da,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...Nr},M.createElement(n.Months,{className:s[Z.Months],style:A?.[Z.Months]},!e.hideNavigation&&!u&&M.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:s[Z.Nav],style:A?.[Z.Nav],"aria-label":re(),onPreviousClick:Zt,onNextClick:Bn,previousMonth:oe,nextMonth:Ce}),fe.map((ae,U)=>M.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:s[Z.Month],style:A?.[Z.Month],key:U,displayIndex:U,calendarMonth:ae},u==="around"&&!e.hideNavigation&&U===0&&M.createElement(n.PreviousMonthButton,{type:"button",className:s[Z.PreviousMonthButton],tabIndex:oe?void 0:-1,"aria-disabled":oe?void 0:!0,"aria-label":Fn(oe),onClick:Zt,"data-animated-button":e.animate?"true":void 0},M.createElement(n.Chevron,{disabled:oe?void 0:!0,className:s[Z.Chevron],orientation:e.dir==="rtl"?"right":"left"})),M.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:s[Z.MonthCaption],style:A?.[Z.MonthCaption],calendarMonth:ae,displayIndex:U},c?.startsWith("dropdown")?M.createElement(n.DropdownNav,{className:s[Z.Dropdowns],style:A?.[Z.Dropdowns]},(()=>{const V=c==="dropdown"||c==="dropdown-months"?M.createElement(n.MonthsDropdown,{key:"month",className:s[Z.MonthsDropdown],"aria-label":Mn(),classNames:s,components:n,disabled:!!e.disableNavigation,onChange:lr(ae.date),options:wm(ae.date,Ve,ne,r,o),style:A?.[Z.Dropdown],value:o.getMonth(ae.date)}):M.createElement("span",{key:"month"},E(ae.date,o)),K=c==="dropdown"||c==="dropdown-years"?M.createElement(n.YearsDropdown,{key:"year",className:s[Z.YearsDropdown],"aria-label":st(o.options),classNames:s,components:n,disabled:!!e.disableNavigation,onChange:mn(ae.date),options:_m(Ve,ne,r,o,!!e.reverseYears),style:A?.[Z.Dropdown],value:o.getYear(ae.date)}):M.createElement("span",{key:"year"},z(ae.date,o));return o.getMonthYearOrder()==="year-first"?[K,V]:[V,K]})(),M.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},T(ae.date,o.options,o))):M.createElement(n.CaptionLabel,{className:s[Z.CaptionLabel],role:"status","aria-live":"polite"},T(ae.date,o.options,o))),u==="around"&&!e.hideNavigation&&U===d-1&&M.createElement(n.NextMonthButton,{type:"button",className:s[Z.NextMonthButton],tabIndex:Ce?void 0:-1,"aria-disabled":Ce?void 0:!0,"aria-label":rr(Ce),onClick:Bn,"data-animated-button":e.animate?"true":void 0},M.createElement(n.Chevron,{disabled:Ce?void 0:!0,className:s[Z.Chevron],orientation:e.dir==="rtl"?"left":"right"})),U===d-1&&u==="after"&&!e.hideNavigation&&M.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:s[Z.Nav],style:A?.[Z.Nav],"aria-label":re(),onPreviousClick:Zt,onNextClick:Bn,previousMonth:oe,nextMonth:Ce}),M.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":nr(ae.date,o.options,o)||void 0,className:s[Z.MonthGrid],style:A?.[Z.MonthGrid]},!e.hideWeekdays&&M.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:s[Z.Weekdays],style:A?.[Z.Weekdays]},_&&M.createElement(n.WeekNumberHeader,{"aria-label":ar(o.options),className:s[Z.WeekNumberHeader],style:A?.[Z.WeekNumberHeader],scope:"col"},k()),kn.map(V=>M.createElement(n.Weekday,{"aria-label":Pn(V,o.options,o),className:s[Z.Weekday],key:String(V),style:A?.[Z.Weekday],scope:"col"},W(V,o.options,o)))),M.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:s[Z.Weeks],style:A?.[Z.Weeks]},ae.weeks.map(V=>M.createElement(n.Week,{className:s[Z.Week],key:V.weekNumber,style:A?.[Z.Week],week:V},_&&M.createElement(n.WeekNumber,{week:V,style:A?.[Z.WeekNumber],"aria-label":ke(V.weekNumber,{locale:i}),className:s[Z.WeekNumber],scope:"row",role:"rowheader"},F(V.weekNumber,o)),V.days.map(K=>{const{date:ee}=K,G=sn(K);if(G[$e.focused]=!G.hidden&&!!pn?.isEqualTo(K),G[hn.selected]=An?.(ee)||G.selected,oc(cn)){const{from:nt,to:Rt}=cn;G[hn.range_start]=!!(nt&&Rt&&o.isSameDay(ee,nt)),G[hn.range_end]=!!(nt&&Rt&&o.isSameDay(ee,Rt)),G[hn.range_middle]=Rn(cn,ee,!0,o)}const Fe=bm(G,A,e.modifiersStyles),Ze=cm(G,s,e.modifiersClassNames),gt=!or&&!G.hidden?Kt(ee,G,o.options,o):void 0;return M.createElement(n.Day,{key:`${o.format(ee,"yyyy-MM-dd")}_${o.format(K.displayMonth,"yyyy-MM")}`,day:K,modifiers:G,className:Ze.join(" "),style:Fe,role:"gridcell","aria-selected":G.selected||void 0,"aria-label":gt,"data-day":o.format(ee,"yyyy-MM-dd"),"data-month":K.outside?o.format(ee,"yyyy-MM"):void 0,"data-selected":G.selected||void 0,"data-disabled":G.disabled||void 0,"data-hidden":G.hidden||void 0,"data-outside":K.outside||void 0,"data-focused":G.focused||void 0,"data-today":G.today||void 0},!G.hidden&&or?M.createElement(n.DayButton,{className:s[Z.DayButton],style:A?.[Z.DayButton],type:"button",day:K,modifiers:G,disabled:G.disabled||void 0,tabIndex:Bt(K)?0:-1,"aria-label":Dn(ee,G,o.options,o),onClick:ir(K,G),onBlur:ua(K,G),onFocus:Tr(K,G),onKeyDown:Wt(K,G),onMouseEnter:sr(K,G),onMouseLeave:cr(K,G)},S(ee,o.options,o)):!G.hidden&&S(K.date,o.options,o))})))))))),e.footer&&M.createElement(n.Footer,{className:s[Z.Footer],style:A?.[Z.Footer],role:"status","aria-live":"polite"},e.footer)))}function ix({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:o,components:i,...s}){const c=ic();return h.jsx(ox,{"data-loc":"client/src/components/ui/calendar.tsx:27",showOutsideDays:n,className:ue("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:r,formatters:{formatMonthDropdown:l=>
vendor: 7,326 bytes, line 31
31l.toLocaleString("default",{month:"short"}),...o},classNames:{root:ue("w-fit",c.root),months:ue("flex gap-4 flex-col md:flex-row relative",c.months),month:ue("flex flex-col w-full gap-4",c.month),nav:ue("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",c.nav),button_previous:ue(Al({variant:a}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",c.button_previous),button_next:ue(Al({variant:a}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",c.button_next),month_caption:ue("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",c.month_caption),dropdowns:ue("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",c.dropdowns),dropdown_root:ue("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",c.dropdown_root),dropdown:ue("absolute bg-popover inset-0 opacity-0",c.dropdown),caption_label:ue("select-none font-medium",r==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:ue("flex",c.weekdays),weekday:ue("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",c.weekday),week:ue("flex w-full mt-2",c.week),week_number_header:ue("select-none w-(--cell-size)",c.week_number_header),week_number:ue("text-[0.8rem] select-none text-muted-foreground",c.week_number),day:ue("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",c.day),range_start:ue("rounded-l-md bg-accent",c.range_start),range_middle:ue("rounded-none",c.range_middle),range_end:ue("rounded-r-md bg-accent",c.range_end),today:ue("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:ue("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:ue("text-muted-foreground opacity-50",c.disabled),hidden:ue("invisible",c.hidden),...e},components:{Root:({className:l,rootRef:u,...d})=>h.jsx("div",{"data-loc":"client/src/components/ui/calendar.tsx:128","data-slot":"calendar",ref:u,className:ue(l),...d}),Chevron:({className:l,orientation:u,...d})=>u==="left"?h.jsx($1,{"data-loc":"client/src/components/ui/calendar.tsx:139",className:ue("size-4",l),...d}):u==="right"?h.jsx(G1,{"data-loc":"client/src/components/ui/calendar.tsx:145",className:ue("size-4",l),...d}):h.jsx(bs,{"data-loc":"client/src/components/ui/calendar.tsx:153",className:ue("size-4",l),...d}),DayButton:sx,WeekNumber:({children:l,...u})=>h.jsx("td",{"data-loc":"client/src/components/ui/calendar.tsx:159",...u,children:h.jsx("div",{"data-loc":"client/src/components/ui/calendar.tsx:160",className:"flex size-(--cell-size) items-center justify-center text-center",children:l})}),...i},...s})}function sx({className:t,day:e,modifiers:n,...r}){const a=ic(),o=R.useRef(null);return R.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),h.jsx(ye,{"data-loc":"client/src/components/ui/calendar.tsx:187",ref:o,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:ue("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",a.day,t),...r})}var ai="Switch",[cx]=tf(ai),[lx,ux]=cx(ai),Df=R.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:i,disabled:s,value:c="on",onCheckedChange:l,form:u,...d}=t,[f,p]=R.useState(null),g=rc(e,b=>p(b)),m=R.useRef(!1),y=f?u||!!f.closest("form"):!0,[v,w]=ef({prop:a,defaultProp:o??!1,onChange:l,caller:ai});return h.jsxs(lx,{scope:n,checked:v,disabled:s,children:[h.jsx(no.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":kf(v),"data-disabled":s?"":void 0,disabled:s,value:c,...d,ref:g,onClick:nf(t.onClick,b=>{w(_=>!_),y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})}),y&&h.jsx(Pf,{control:f,bubbles:!m.current,name:r,value:c,checked:v,required:i,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Df.displayName=ai;var Mf="SwitchThumb",Ff=R.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,a=ux(Mf,n);return h.jsx(no.span,{"data-state":kf(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});Ff.displayName=Mf;var dx="SwitchBubbleInput",Pf=R.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...a},o)=>{const i=R.useRef(null),s=rc(i,o),c=O1(n),l=D1(e);return R.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(g)}},[c,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:s,style:{...a.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Pf.displayName=dx;function kf(t){return t?"checked":"unchecked"}var fx=Df,hx=Ff;function Wl({className:t,...e}){return h.jsx(fx,{"data-loc":"client/src/components/ui/switch.tsx:11","data-slot":"switch",className:ue("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:h.jsx(hx,{"data-loc":"client/src/components/ui/switch.tsx:19","data-slot":"switch-thumb",className:ue("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function px(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const Bf=M.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{}
31,openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),io=()=>{const t=M.useContext(Bf);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};px(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( 32[data-state=closed] 33){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;
33left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function gx(){const t=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(t)&&/Mobile/.test(t)||/FxiOS/.test(t))}function mx(){return sc(/^Mac/)}function xx(){return sc(/^iPhone/)}function Hl(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function vx(){return sc(/^iPad/)||mx()&&navigator.maxTouchPoints>1}function jf(){return xx()||vx()}function sc(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const yx=24,wx=typeof window<"u"?R.useLayoutEffect:R.useEffect;function $l(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const $i=typeof document<"u"&&window.visualViewport;function Gl(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function Lf(t){for(Gl(t)&&(t=t.parentElement);t&&!Gl(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const bx=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let So=0,Gi;function Cx(t={}){let{isDisabled:e}=t;wx(()=>{if(!e)return So++,So===1&&jf()&&(Gi=_x()),()=>{So--,So===0&&Gi?.()}},[e])}function _x(){let t,e=0,n=d=>{t=Lf(d.target),!(t===document.documentElement&&t===document.body)&&(e=d.changedTouches[0].pageY)},r=d=>{if(!t||t===document.documentElement||t===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,p=t.scrollTop,g=t.scrollHeight-t.clientHeight;g!==0&&((p<=0&&f>e||p>=g&&f<e)&&d.preventDefault(),e=f)},a=d=>{let f=d.target;_s(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},o=d=>{let f=d.target;_s(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",$i&&($i.height<window.innerHeight?requestAnimationFrame(()=>{Yl(f)}):$i.addEventListener("resize",()=>Yl(f),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=$l(Ax(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=$l(Ra(document,"touchstart",n,{passive:!1,capture:!0}),Ra(document,"touchmove",r,{passive:!1,capture:!0}),Ra(document,"touchend",a,{passive:!1,capture:!0}),Ra(document,"focus",o,!0),Ra(window,"scroll",i));return()=>{l(),u(),window.scrollTo(s,c)}}function Ax(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function Ra(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function Yl(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=Lf(t);if(n!==document.documentElement&&n!==document.body&&n!==t){let r=n.getBoundingClientRect().top,a=t.getBoundingClientRect().top,o=t.getBoundingClientRect().bottom;const i=n.getBoundingClientRect().bottom+yx;o>i&&(n.scrollTop+=a-r)}t=n.parentElement}}function _s(t){return t instanceof HTMLInputElement&&!bx.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function Ex(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Sx(...t){return e=>t.forEach(n=>Ex(n,e))}function Vf(...t){return R.useCallback(Sx(...t),t)}const Uf=new WeakMap;function ut(t,e,n=!1){if(!t||!(t instanceof HTMLElement))return;let r={};Object.entries(e).forEach(([a,o])=>{if(a.startsWith("--")){t.style.setProperty(a,o);return}r[a]=t.style[a],t.style[a]=o}),!n&&Uf.set(t,r)}function Ix(t,e){if(!t||!(t instanceof HTMLElement))return;let n=Uf.get(t);n&&(t.style[e]=n[e])}const at=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function Io(t,e){if(!t)return null;const n=window.getComputedStyle(t),r=n.transform||n.webkitTransform||n.mozTransform;let a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[at(e)?13:12]):(a=r.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[at(e)?5:4]):null)}function Rx(t){return 8*(Math.log(t+1)-2)}function Yi(t,e){if(!t)return()=>{};const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function Tx(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}const He={DURATION:.5,EASE:[.32,.72,0,1]},zf=.4,Nx=.25,Ox=100,Wf=8,pr=16,As=26,Xi="vaul-dragging";function Hf(t){const e=M.useRef(t);return M.useEffect(()=>{e.current=t}),M.useMemo(()=>(...n)=>e.current==null?void 0:e.current.call(e,...n),[])}function Dx({defaultProp:t,onChange:e}){const n=M.useState(t),[r]=n,a=M.useRef(r),o=Hf(e);return M.useEffect(()=>{a.current!==r&&(o(r),a.current=r)},[r,a,o]),n}function $f({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,a]=Dx({defaultProp:e,onChange:n}),o=t!==void 0,i=o?t:r,s=Hf(n),c=M.useCallback(l=>{if(o){const d=typeof l=="function"?l(t):l;d!==t&&s(d)}else a(l)},[o,t,a,s]);return[i,c]}function Mx({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:a,fadeFromIndex:o,onSnapPointChange:i,direction:s="bottom",container:c,snapToSequentialPoint:l}){const[u,d]=$f({prop:t,defaultProp:n?.[0],onChange:e}),[f,p]=M.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);M.useEffect(()=>{function S(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const g=M.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),m=M.useMemo(()=>{var S;return(S=n?.findIndex(E=>E===u))!=null?S:null},[n,u]),y=n&&n.length>0&&(o||o===0)&&!Number.isNaN(o)&&n[o]===u||!n,v=M.useMemo(()=>{const S=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var E;return(E=n?.map(F=>{const k=typeof F=="string";let W=0;if(k&&(W=parseInt(F,10)),at(s)){const L=k?W:f?F*S.height:0;return f?s==="bottom"?S.height-L:-S.height+L:L}const z=k?W:f?F*S.width:0;return f?s==="right"?S.width-z:-S.width+z:z}))!=null?E:[]},[n,f,c]),w=M.useMemo(()=>m!==null?v?.[m]:null,[v,m]),b=M.useCallback(S=>{var E;const F=(E=v?.findIndex(k=>k===S))!=null?E:null;i(F),ut(r.current,{transition:`transform ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`,transform:at(s)?`translate3d(0, ${S}px, 0)`:`translate3d(${S}px, 0, 0)`}),v&&F!==v.length-1&&o!==void 0&&F!==o&&F<o?ut(a.current,{transition:`opacity ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`,opacity:"0"}):ut(a.current,{transition:`opacity ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(F,0)])},[r.current,n,v,o,a,d]);M.useEffect(()=>{if(u||t){var S;const E=(S=n?.findIndex(F=>F===t||F===u))!=null?S:-1;v&&E!==-1&&typeof v[E]=="number"&&b(v[E])}},[u,t,n,v,b]);function _({draggedDistance:S,closeDrawer:E,velocity:F,dismissible:k}){if(o===void 0)return;const W=s==="bottom"||s==="right"?(w??0)-S:(w??0)+S,z=m===o-1,L=m===0,le=S>0;if(z&&ut(a.current,{transition:`opacity ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`}),!l&&F>2&&!le){k?E():b(v[0]);return}if(!l&&F>2&&le&&v&&n){b(v[n.length-1]);return}const fe=v?.reduce((ne,oe)=>typeof ne!="number"||typeof oe!="number"?ne:Math.abs(oe-W)<Math.abs(ne-W)?oe:ne),Ve=at(s)?window.innerHeight:window.innerWidth;if(F>zf&&Math.abs(S)<Ve*.4){const ne=le?1:-1;if(ne>0&&g&&n){b(v[n.length-1]);return}if(L&&ne<0&&k&&E(),m===null)return;b(v[m+ne]);return}b(fe)}function A({draggedDistance:S}){if(w===null)return;const E=s==="bottom"||s==="right"?w-S:w+S;(s==="bottom"||s==="right")&&E<v[v.length-1]||(s==="top"||s==="left")&&E>v[v.length-1]||ut(r.current,{transform:at(s)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}function T(S,E){if(!n||typeof m!="number"||!v||o===void 0)return null;const F=m===o-1;if(m>=o&&E)return 0;if(F&&!E)return 1;if(!y&&!F)return null;const W=F?m+1:m-1,z=F?v[W]-v[W-1]:v[W+1]-v[W],L=S/Math.abs(z);return F?1-L:L}return{isLastSnapPoint:g,activeSnapPoint:u,shouldFade:y,getPercentageDragged:T,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:_,onDrag:A,snapPointsOffset:v}}const Fx=()=>()=>{};
33function Px(){const{direction:t,isOpen:e,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:a}=io(),o=M.useRef(null),i=R.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-As)/window.innerWidth}M.useEffect(()=>{if(e&&n){o.current&&clearTimeout(o.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;Tx(r&&!a?Yi(document.body,{background:"black"}):Fx,Yi(c,{transformOrigin:at(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${He.DURATION}s`,transitionTimingFunction:`cubic-bezier(${He.EASE.join(",")})`}));const l=Yi(c,{borderRadius:`${Wf}px`,overflow:"hidden",...at(t)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{l(),o.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},He.DURATION*1e3)}}},[e,n,i])}let Ta=null;function kx({isOpen:t,modal:e,nested:n,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:o}){const[i,s]=M.useState(()=>typeof window<"u"?window.location.href:""),c=M.useRef(0),l=M.useCallback(()=>{if(Hl()&&Ta===null&&t&&!o){Ta={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&c.current>=f&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[t]),u=M.useCallback(()=>{if(Hl()&&Ta!==null&&!o){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ta),window.requestAnimationFrame(()=>{if(a&&i!==window.location.href){s(window.location.href);return}window.scrollTo(f,d)}),Ta=null}},[i]);return M.useEffect(()=>{function d(){c.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),M.useEffect(()=>{if(e)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[e,u]),M.useEffect(()=>{n||!r||(t?(!window.matchMedia("(display-mode: standalone)").matches&&l(),e||window.setTimeout(()=>{u()},500)):u())},[t,r,i,e,n,l,u]),{restorePositionSetting:u}}function Bx({open:t,onOpenChange:e,children:n,onDrag:r,onRelease:a,snapPoints:o,shouldScaleBackground:i=!1,setBackgroundColorOnScale:s=!0,closeThreshold:c=Nx,scrollLockTimeout:l=Ox,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=o&&o.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:y=!0,onClose:v,nested:w,noBodyStyles:b=!1,direction:_="bottom",defaultOpen:A=!1,disablePreventScroll:T=!0,snapToSequentialPoint:S=!1,preventScrollRestoration:E=!1,repositionInputs:F=!0,onAnimationEnd:k,container:W,autoFocus:z=!1}){var L,le;const[fe=!1,Ve]=$f({defaultProp:A,prop:t,onChange:U=>{e?.(U),!U&&!w&&ua(),setTimeout(()=>{k?.(U)},He.DURATION*1e3),U&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),U||(document.body.style.pointerEvents="auto")}}
33),[ne,oe]=M.useState(!1),[Ce,Me]=M.useState(!1),[sn,An]=M.useState(!1),kt=M.useRef(null),cn=M.useRef(null),Yt=M.useRef(null),pn=M.useRef(null),Bt=M.useRef(null),gn=M.useRef(!1),Xt=M.useRef(null),Dn=M.useRef(0),Kt=M.useRef(!1),nr=M.useRef(!A),Mn=M.useRef(0),re=M.useRef(null),Fn=M.useRef(((L=re.current)==null?void 0:L.getBoundingClientRect().height)||0),rr=M.useRef(((le=re.current)==null?void 0:le.getBoundingClientRect().width)||0),Pn=M.useRef(0),ke=M.useCallback(U=>{o&&U===Zt.length-1&&(cn.current=new Date)},[]),{activeSnapPoint:ar,activeSnapPointIndex:st,setActiveSnapPoint:kn,onRelease:or,snapPointsOffset:Zt,onDrag:Bn,shouldFade:ir,getPercentageDragged:Tr}=Mx({snapPoints:o,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:re,fadeFromIndex:f,overlayRef:kt,onSnapPointChange:ke,direction:_,container:W,snapToSequentialPoint:S});Cx({isDisabled:!fe||Ce||!y||sn||!ne||!F||!T});const{restorePositionSetting:ua}=kx({isOpen:fe,modal:y,nested:w??!1,hasBeenOpened:ne,preventScrollRestoration:E,noBodyStyles:b});function Wt(){return(window.innerWidth-As)/window.innerWidth}function sr(U){var V,K;!u&&!o||re.current&&!re.current.contains(U.target)||(Fn.current=((V=re.current)==null?void 0:V.getBoundingClientRect().height)||0,rr.current=((K=re.current)==null?void 0:K.getBoundingClientRect().width)||0,Me(!0),Yt.current=new Date,jf()&&window.addEventListener("touchend",()=>gn.current=!1,{once:!0}),U.target.setPointerCapture(U.pointerId),Dn.current=at(_)?U.pageY:U.pageX)}function cr(U,V){var K;let ee=U;const G=(K=window.getSelection())==null?void 0:K.toString(),Fe=re.current?Io(re.current,_):null,Ze=new Date;if(ee.tagName==="SELECT"||ee.hasAttribute("data-vaul-no-drag")||ee.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(cn.current&&Ze.getTime()-cn.current.getTime()<500)return!1;if(Fe!==null&&(_==="bottom"?Fe>0:Fe<0))return!0;if(G&&G.length>0)return!1;if(Bt.current&&Ze.getTime()-Bt.current.getTime()<l&&Fe===0||V)return Bt.current=Ze,!1;for(;ee;){if(ee.scrollHeight>ee.clientHeight){if(ee.scrollTop!==0)return Bt.current=new Date,!1;if(ee.getAttribute("role")==="dialog")return!0}ee=ee.parentNode}return!0}function lr(U){if(re.current&&Ce){const V=_==="bottom"||_==="right"?1:-1,K=(Dn.current-(at(_)?U.pageY:U.pageX))*V,ee=K>0,G=o&&!u&&!ee;if(G&&st===0)return;const Fe=Math.abs(K),Ze=document.querySelector("[data-vaul-drawer-wrapper]"),gt=_==="bottom"||_==="top"?Fn.current:rr.current;let nt=Fe/gt;const Rt=Tr(Fe,ee);if(Rt!==null&&(nt=Rt),G&&nt>=1||!gn.current&&!cr(U.target,ee))return;if(re.current.classList.add(Xi),gn.current=!0,ut(re.current,{transition:"none"}),ut(kt.current,{transition:"none"}),o&&Bn({draggedDistance:K}),ee&&!o){const Ht=Rx(K),Vn=Math.min(Ht*-1,0)*V;ut(re.current,{transform:at(_)?`translate3d(0, ${Vn}px, 0)`:`translate3d(${Vn}px, 0, 0)`});return}const qt=1-nt;if((ir||f&&st===f-1)&&(r?.(U,nt),ut(kt.current,{opacity:`${qt}`,transition:"none"},!0)),Ze&&kt.current&&i){const Ht=Math.min(Wt()+nt*(1-Wt()),1),Vn=8-nt*8,fa=Math.max(0,14-nt*14);ut(Ze,{borderRadius:`${Vn}px`,transform:at(_)?`scale(${Ht}) translate3d(0, ${fa}px, 0)`:`scale(${Ht}) translate3d(${fa}px, 0, 0)`,transition:"none"},!0)}if(!o){const Ht=Fe*V;ut(re.current,{transform:at(_)?`translate3d(0, ${Ht}px, 0)`:`translate3d(${Ht}px, 0, 0)`})}}}M.useEffect(()=>{window.requestAnimationFrame(()=>{nr.current=!0})},[]),M.useEffect(()=>{var U;function V(){if(!re.current||!F)return;const K=document.activeElement;if(_s(K)||Kt.current){var ee;const G=((ee=window.visualViewport)==null?void 0:ee.height)||0,Fe=window.innerHeight;let Ze=Fe-G;const gt=re.current.getBoundingClientRect().height||0,nt=gt>Fe*.8;Pn.current||(Pn.current=gt);const Rt=re.current.getBoundingClientRect().top;if(Math.abs(Mn.current-Ze)>60&&(Kt.current=!Kt.current),o&&o.length>0&&Zt&&st){const qt=Zt[st]||0;Ze+=qt}if(Mn.current=Ze,gt>G||Kt.current){const qt=re.current.getBoundingClientRect().height;let Ht=qt;qt>G&&(Ht=G-(nt?Rt:As)),m?re.current.style.height=`${qt-Math.max(Ze,0)}px`:re.current.style.height=`${Math.max(Ht,G-Rt)}px`}else gx()||(re.current.style.height=`${Pn.current}px`);o&&o.length>0&&!Kt.current?re.current.style.bottom="0px":re.current.style.bottom=`${Math.max(Ze,0)}px`}}
33return(U=window.visualViewport)==null||U.addEventListener("resize",V),()=>{var K;return(K=window.visualViewport)==null?void 0:K.removeEventListener("resize",V)}},[st,o,Zt]);function mn(U){da(),v?.(),U||Ve(!1),setTimeout(()=>{o&&kn(o[0])},He.DURATION*1e3)}function jn(){if(!re.current)return;const U=document.querySelector("[data-vaul-drawer-wrapper]"),V=Io(re.current,_);ut(re.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`}),ut(kt.current,{transition:`opacity ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`,opacity:"1"}),i&&V&&V>0&&fe&&ut(U,{borderRadius:`${Wf}px`,overflow:"hidden",...at(_)?{transform:`scale(${Wt()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Wt()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${He.DURATION}s`,transitionTimingFunction:`cubic-bezier(${He.EASE.join(",")})`},!0)}function da(){!Ce||!re.current||(re.current.classList.remove(Xi),gn.current=!1,Me(!1),pn.current=new Date)}function Nr(U){if(!Ce||!re.current)return;re.current.classList.remove(Xi),gn.current=!1,Me(!1),pn.current=new Date;const V=Io(re.current,_);
33if(!U||!cr(U.target,!1)||!V||Number.isNaN(V)||Yt.current===null)return;const K=pn.current.getTime()-Yt.current.getTime(),ee=Dn.current-(at(_)?U.pageY:U.pageX),G=Math.abs(ee)/K;if(G>.05&&(An(!0),setTimeout(()=>{An(!1)},200)),o){or({draggedDistance:ee*(_==="bottom"||_==="right"?1:-1),closeDrawer:mn,velocity:G,dismissible:u}),a?.(U,!0);return}if(_==="bottom"||_==="right"?ee>0:ee<0){jn(),a?.(U,!0);return}if(G>zf){mn(),a?.(U,!1);return}var Fe;const Ze=Math.min((Fe=re.current.getBoundingClientRect().height)!=null?Fe:0,window.innerHeight);var gt;const nt=Math.min((gt=re.current.getBoundingClientRect().width)!=null?gt:0,window.innerWidth),Rt=_==="left"||_==="right";if(Math.abs(V)>=(Rt?nt:Ze)*c){mn(),a?.(U,!1);return}a?.(U,!0),jn()}M.useEffect(()=>(fe&&(ut(document.documentElement,{scrollBehavior:"auto"}),cn.current=new Date),()=>{Ix(document.documentElement,"scrollBehavior")}),[fe]);function Ln(U){const V=U?(window.innerWidth-pr)/window.innerWidth:1,K=U?-pr:0;Xt.current&&window.clearTimeout(Xt.current),ut(re.current,{transition:`transform ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`,transform:at(_)?`scale(${V}) translate3d(0, ${K}px, 0)`:`scale(${V}) translate3d(${K}px, 0, 0)`}),!U&&re.current&&(Xt.current=setTimeout(()=>{const ee=Io(re.current,_);ut(re.current,{transition:"none",transform:at(_)?`translate3d(0, ${ee}px, 0)`:`translate3d(${ee}px, 0, 0)`})},500))}function Or(U,V){if(V<0)return;const K=(window.innerWidth-pr)/window.innerWidth,ee=K+V*(1-K),G=-pr+V*pr;ut(re.current,{transform:at(_)?`scale(${ee}) translate3d(0, ${G}px, 0)`:`scale(${ee}) translate3d(${G}px, 0, 0)`,transition:"none"})}function ae(U,V){const K=at(_)?window.innerHeight:window.innerWidth,ee=V?(K-pr)/K:1,G=V?-pr:0;V&&ut(re.current,{transition:`transform ${He.DURATION}s cubic-bezier(${He.EASE.join(",")})`,transform:at(_)?`scale(${ee}) translate3d(0, ${G}px, 0)`:`scale(${ee}) translate3d(${G}px, 0, 0)`})}return M.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),M.createElement(K1,{defaultOpen:A,onOpenChange:U=>{!u&&!U||(U?oe(!0):mn(!0),Ve(U))},open:fe},M.createElement(Bf.Provider,{value:{activeSnapPoint:ar,snapPoints:o,setActiveSnapPoint:kn,drawerRef:re,overlayRef:kt,onOpenChange:e,onPress:sr,onRelease:Nr,onDrag:lr,dismissible:u,shouldAnimate:nr,handleOnly:d,isOpen:fe,isDragging:Ce,shouldFade:ir,closeDrawer:mn,onNestedDrag:Or,onNestedOpenChange:Ln,onNestedRelease:ae,keyboardIsOpen:Kt,modal:y,snapPointsOffset:Zt,activeSnapPointIndex:st,direction:_,shouldScaleBackground:i,setBackgroundColorOnScale:s,noBodyStyles:b,container:W,autoFocus:z}},n))}const Gf=M.forwardRef(function({...t},e){const{overlayRef:n,snapPoints:r,onRelease:a,shouldFade:o,isOpen:i,modal:s,shouldAnimate:c}=io(),l=Vf(e,n),u=r&&r.length>0;if(!s)return null;const d=M.useCallback(f=>a(f),[a]);return M.createElement(Q1,{onMouseUp:d,ref:l,"data-vaul-overlay":"","data-vaul-snap-points":i&&u?"true":"false","data-vaul-snap-points-overlay":i&&o?"true":"false","data-vaul-animate":c?.current?"true":"false",...t})});Gf.displayName="Drawer.Overlay";const Yf=M.forwardRef(function({onPointerDownOutside:t,style:e,onOpenAutoFocus:n,...r},a){const{drawerRef:o,onPress:i,onRelease:s,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:m,container:y,handleOnly:v,shouldAnimate:w,autoFocus:b}=io(),[_,A]=M.useState(!1),T=Vf(a,o),S=M.useRef(null),E=M.useRef(null),F=M.useRef(!1),k=m&&m.length>0;Px();const W=(L,le,fe=0)=>{if(F.current)return!0;const Ve=Math.abs(L.y),ne=Math.abs(L.x),oe=ne>Ve,Ce=["bottom","right"].includes(le)?1:-1;if(le==="left"||le==="right"){if(!(L.x*Ce<0)&&ne>=0&&ne<=fe)return oe}else if(!(L.y*Ce<0)&&Ve>=0&&Ve<=fe)return!oe;return F.current=!0,!0};M.useEffect(()=>{k&&window.requestAnimationFrame(()=>{A(!0)})},[]);function z(L){S.current=null,F.current=!1,s(L)}return M.createElement(Z1,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":_?"true":"false","data-vaul-snap-points":p&&k?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":w?.current?"true":"false",...r,ref:T,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...e}:e,onPointerDown:L=>{v||(r.onPointerDown==null||r.onPointerDown.call(r,L),S.current={x:L.pageX,y:L.pageY},i(L))},onOpenAutoFocus:L=>{n?.(L),b||L.preventDefault()},onPointerDownOutside:L=>{if(t?.(L),!f||L.defaultPrevented){L.preventDefault();return}l.current&&(l.current=!1)},onFocusOutside:L=>{if(!f){L.preventDefault();return}},onPointerMove:L=>{if(E.current=L,v||(r.onPointerMove==null||r.onPointerMove.call(r,L),!S.current))return;const le=L.pageY-S.current.y,fe=L.pageX-S.current.x,Ve=L.pointerType==="touch"?10:2;W({x:fe,y:le},g,Ve)?c(L):(Math.abs(fe)>Ve||Math.abs(le)>Ve)&&(S.current=null)},onPointerUp:L=>{r.onPointerUp==null||r.onPointerUp.call(r,L),S.current=null,F.current=!1,s(L)},onPointerOut:L=>{r.onPointerOut==null||r.onPointerOut.call(r,L),z(E.current)},onContextMenu:L=>{r.onContextMenu==null||r.onContextMenu.call(r,L),E.current&&z(E.current)}})});Yf.displayName="Drawer.Content";const jx=250,Lx=120,Vx=M.forwardRef(function({preventCycle:t=!1,children:e,...n},r){const{closeDrawer:a,isDragging:o,snapPoints:i,activeSnapPoint:s,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:d,onPress:f,onDrag:p}=io(),g=M.useRef(null),m=M.useRef(!1);function y(){if(m.current){b();return}window.setTimeout(()=>{v()},Lx)}function v(){if(o||t||m.current){b();return}if(b(),!i||i.length===0){l||a();return}if(s===i[i.length-1]&&l){a();return}const A=i.findIndex(S=>S===s);if(A===-1)return;const T=i[A+1];c(T)}function w(){g.current=window.setTimeout(()=>{m.current=!0},jx)}function b(){g.current&&window.clearTimeout(g.current),m.current=!1}return M.createElement("div",{onClick:y,onPointerCancel:b,onPointerDown:_=>{u&&f(_),w()},onPointerMove:_=>{u&&p(_)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},M.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},e))});Vx.displayName="Drawer.Handle";function Ux(t){const e=io(),{container:n=e.container,...r}=t;return M.createElement(q1,{container:n,...r})}const na={Root:Bx,Content:Yf,Overlay:Gf,Portal:Ux,Title:Y1,Description:X1};function Xf({...t}){return h.jsx(na.Root,{"data-loc":"client/src/components/ui/drawer.tsx:12","data-slot":"drawer",repositionInputs:!1,...t})}function zx({...t}){return h.jsx(na.Portal,{"data-loc":"client/src/components/ui/drawer.tsx:24","data-slot":"drawer-portal",...t})}function Wx({className:t,...e}){return h.jsx(na.Overlay,{"data-loc":"client/src/components/ui/drawer.tsx:38","data-slot":"drawer-overlay",className:ue("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-50 bg-black/50",t),...e})}function Kf({className:t,children:e,style:n,...r}){return h.jsxs(zx,{"data-loc":"client/src/components/ui/drawer.tsx:56","data-slot":"drawer-portal",children:[h.jsx(Wx,{"data-loc":"client/src/components/ui/drawer.tsx:57"}),h.jsxs(na.Content,{"data-loc":"client/src/components/ui/drawer.tsx:58","data-slot":"drawer-content",className:ue("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),style:n,...r,children:[h.jsx("div",{"data-loc":"client/src/components/ui/drawer.tsx:71",className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e]})]})}function Zf({className:t,...e}){return h.jsx("div",{"data-loc":"client/src/components/ui/drawer.tsx:80","data-slot":"drawer-header",className:ue("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",t),...e})}function qf({className:t,...e}){return h.jsx(na.Title,{"data-loc":"client/src/components/ui/drawer.tsx:106","data-slot":"drawer-title",className:ue("text-foreground font-semibold",t),...e})}function Qf({className:t,...e}){return h.jsx(na.Description,{"data-loc":"client/src/components/ui/drawer.tsx:119","data-slot":"drawer-description",className:ue("text-muted-foreground text-sm",t),...e})}var oi="Collapsible",[Hx]=tf(oi),[$x,cc]=Hx(oi),Jf=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:i,...s}=t,[c,l]=ef({prop:r,defaultProp:a??!1,onChange:i,caller:oi});return h.jsx($x,{scope:n,disabled:o,contentId:M1(),open:c,onOpenToggle:R.useCallback(()=>l(u=>!u),[l]),children:h.jsx(no.div,{"data-state":uc(c),"data-disabled":o?"":void 0,...s,ref:e})})});Jf.displayName=oi;var e0="CollapsibleTrigger",t0=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,a=cc(e0,n);return h.jsx(no.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":uc(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:e,onClick:nf(t.onClick,a.onOpenToggle)})});t0.displayName=e0;var lc="CollapsibleContent",n0=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,a=cc(lc,t.__scopeCollapsible);return h.jsx(F1,{present:n||a.open,children:({present:o})=>h.jsx(Gx,{...r,ref:e,present:o})})});n0.displayName=lc;var Gx=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:a,...o}
vendor: 1,375 bytes, line 33
33=t,i=cc(lc,n),[s,c]=R.useState(r),l=R.useRef(null),u=rc(e,l),d=R.useRef(0),f=d.current,p=R.useRef(0),g=p.current,m=i.open||s,y=R.useRef(m),v=R.useRef(void 0);return R.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),P1(()=>{const w=l.current;if(w){v.current=v.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const b=w.getBoundingClientRect();d.current=b.height,p.current=b.width,y.current||(w.style.transitionDuration=v.current.transitionDuration,w.style.animationName=v.current.animationName),c(r)}},[i.open,r]),h.jsx(no.div,{"data-state":uc(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:m&&a})});function uc(t){return t?"open":"closed"}var Yx=Jf;function kr({...t}){return h.jsx(Yx,{"data-loc":"client/src/components/ui/collapsible.tsx:6","data-slot":"collapsible",...t})}function Na({...t}){return h.jsx(t0,{"data-loc":"client/src/components/ui/collapsible.tsx:13","data-slot":"collapsible-trigger",...t})}function Br({...t}){return h.jsx(n0,{"data-loc":"client/src/components/ui/collapsible.tsx:24","data-slot":"collapsible-content",...t})}
33const r0=[{id:"cha_chaan_teng",name:"è¶é¤å»³",nameEn:"Cha Chaan Teng",icon:"ð³",keywords:["è¶é¤å»³","常é¤","å¿«é¤","æ©é¤","åé¤","ä¸åè¶é¤","å
¬ä»éºµ","é¤è麵","å¤å£«"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"oil_level",type:"select",label:"æ²¹é",options:[{value:"less",label:"å°æ²¹",calorieImpact:-15},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"夿²¹",calorieImpact:15}]},{id:"no_butter",type:"toggle",label:"èµ°çæ²¹",calorieImpact:-8},{id:"less_sugar_drink",type:"toggle",label:"å°ç飲å",calorieImpact:-5}]},{id:"roasted_meat",name:"çå³é£¯",nameEn:"Roasted Meat Rice",icon:"ð",keywords:["çå³","åç","çéµ","çé´¨","æ²¹é","çè","çè"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"no_skin",type:"toggle",label:"å»ç®",calorieImpact:-20},{id:"no_sauce",type:"toggle",label:"èµ°æ±",calorieImpact:-10},{id:"no_ginger_oil",type:"toggle",label:"èµ°èè¥æ²¹",calorieImpact:-8},{id:"less_rice",type:"toggle",label:"å°é£¯",calorieImpact:-15}]},{id:"two_dish_rice",name:"é餸飯",nameEn:"Two Dish Rice",icon:"ð±",keywords:["é餸","å
©é¤¸","ä¸é¤¸","ç¢é 飯","ä½å®¶é£¯","èªé¸"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"sauce_level",type:"select",label:"æ±é",options:[{value:"no_sauce",label:"èµ°æ±",calorieImpact:-12},{value:"less",label:"å°æ±",calorieImpact:-6},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"夿±",calorieImpact:8}]},{id:"no_oil_veg",type:"toggle",label:"èèµ°æ²¹",calorieImpact:-8},{id:"less_rice",type:"toggle",label:"å°é£¯",calorieImpact:-15}]},{id:"cart_noodles",name:"è»ä»éºµ",nameEn:"Cart Noodles",icon:"ð",keywords:["è»ä»éºµ","æéºµ","湯麵","ç±³ç·","ç±³ç²","æ²³ç²","ç²éºµ","幼麵","å
¬ä»éºµ"],modifiers:[{id:"noodle_type",type:"select",label:"麵åº",options:[{value:"instant",label:"å
¬ä»éºµ",calorieImpact:10},{value:"thick",label:"ç²éºµ",calorieImpact:0},{value:"thin",label:"幼麵",calorieImpact:-3},{value:"rice_noodle",label:"ç±³ç²",calorieImpact:-8},{value:"vermicelli",label:"ç±³ç·",calorieImpact:-5},{value:"ho_fun",label:"æ²³ç²",calorieImpact:5}]},{id:"soup_type",type:"select",label:"湯åº",options:[{value:"clear",label:"æ¸
湯",calorieImpact:0},{value:"satay",label:"æ²å²",calorieImpact:15},{value:"curry",label:"åå±",calorieImpact:12},{value:"tomato",label:"èè",calorieImpact:5},{value:"dry",label:"æ",calorieImpact:8}]},{id:"extra_toppings",type:"slider",label:"é
ææ¸é",min:3,max:8,step:1,defaultValue:4,calorieImpactPerUnit:5}]},{id:"hotpot",name:"æéç",nameEn:"Hot Pot",icon:"ð«",keywords:["æéç","ç«é","hotpot","涮涮é","麻辣é"],modifiers:[{id:"soup_base",type:"select",label:"湯åº",options:[{value:"clear",label:"æ¸
湯",calorieImpact:0},{value:"tomato",label:"èèæ¹¯",calorieImpact:5},{value:"spicy",label:"麻辣湯",calorieImpact:20},{value:"satay",label:"æ²å²æ¹¯",calorieImpact:18},{value:"pork_bone",label:"豬骨湯",calorieImpact:12}]},{id:"dipping_sauce",type:"toggle",label:"æè¸é¬",calorieImpact:15},{id:"drink_soup",type:"toggle",label:"飲湯",calorieImpact:10},{id:"portion_size",type:"select",label:"é£é",options:[{value:"light",label:"é£å°å²",calorieImpact:-25},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"heavy",label:"é£å¤å²",calorieImpact:30}]}]},{id:"dim_sum",name:"飲è¶é»å¿",nameEn:"Dim Sum",icon:"ð¥",keywords:["飲è¶","é»å¿","è¦é¤","çè³£","åçå
","è
¸ç²","è¸","ç¸"],modifiers:[{id:"cooking_method",type:"select",label:"ç¹èª¿æ¹å¼æ¯ä¾",options:[{value:"mostly_steamed",label:"å¤è¸å°ç¸",calorieImpact:-15},{value:"mixed",label:"è¸ç¸åå",calorieImpact:0},{value:"mostly_fried",label:"å¤ç¸å°è¸",calorieImpact:20}]},{id:"portions",type:"slider",label:"é£å¹¾å¤ç± ",min:2,max:8,step:1,defaultValue:4,calorieImpactPerUnit:8},{id:"congee",type:"toggle",label:"æé£ç²¥",calorieImpact:8},{id:"fried_items",type:"toggle",label:"æç¸å¢ï¼æ¥å·/èè§ï¼",calorieImpact:12}]}
33,{id:"wonton_noodle",name:"é²å麵",nameEn:"Wonton Noodle",icon:"ð",keywords:["é²å","é¤é£©","æ°´é¤","è¦å麵"],modifiers:[{id:"size",type:"select",label:"份é",options:[{value:"small",label:"ç´°ç¢",calorieImpact:-20},{value:"regular",label:"ä¸ç¢",calorieImpact:0},{value:"large",label:"大ç¢",calorieImpact:20}]},{id:"drink_soup",type:"toggle",label:"é£²ææ¹¯",calorieImpact:8},{id:"extra_wontons",type:"toggle",label:"å åº/å é²å",calorieImpact:15}]},{id:"congee",name:"ç²¥å",nameEn:"Congee",icon:"ð¥£",keywords:["ç²¥","ç®èç¦èç²¥","èä»ç²¥","å第粥","ç½ç²¥"],modifiers:[{id:"size",type:"select",label:"份é",options:[{value:"small",label:"ç´°ç¢",calorieImpact:-25},{value:"regular",label:"ä¸ç¢",calorieImpact:0},{value:"large",label:"大ç¢",calorieImpact:25}]},{id:"you_tiao",type:"toggle",label:"é
æ²¹æ¢",calorieImpact:20},{id:"extra_toppings",type:"toggle",label:"å æï¼è/èï¼",calorieImpact:10}]},{id:"japanese",name:"æ¥å¼æç",nameEn:"Japanese",icon:"ð±",keywords:["æ¥æ¬","壽å¸","åºèº«","æéºµ","丼","å®é£","çå¬","天婦ç¾
"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"tempura",type:"toggle",label:"æå¤©å©¦ç¾
/ç¸ç©",calorieImpact:18},{id:"drink_soup",type:"toggle",label:"飲ææéºµæ¹¯",calorieImpact:10},{id:"extra_rice",type:"toggle",label:"å 飯/大ç",calorieImpact:20}]},{id:"ramen",name:"æéºµ",nameEn:"Ramen",icon:"ð",keywords:["æéºµ","è±éª¨","å³å","鬿²¹","é¹½å³"],modifiers:[{id:"soup_richness",type:"select",label:"æ¹¯åºæ¿åº¦",options:[{value:"light",label:"æ·¡å³",calorieImpact:-10},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"rich",label:"æ¿å",calorieImpact:12}]},{id:"noodle_amount",type:"select",label:"麵é",options:[{value:"less",label:"å°éºµ",calorieImpact:-15},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"æ¿ç/å 麵",calorieImpact:20}]},{id:"drink_soup",type:"toggle",label:"é£²ææ¹¯",calorieImpact:12},{id:"extra_chashu",type:"toggle",label:"å åç",calorieImpact:10}]},{id:"korean",name:"é弿ç",nameEn:"Korean",icon:"ð°ð·",keywords:["éå","éå¼","ç³é","æé£¯","ç¸é","泡è","ç¤è","é¨éé"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"banchan",type:"toggle",label:"æé£å°è",calorieImpact:5},{id:"fried",type:"toggle",label:"æç¸ç©ï¼ç¸éçï¼",calorieImpact:15},{id:"cheese",type:"toggle",label:"å è士",calorieImpact:12}]},{id:"thai",name:"æ³°å¼æç",nameEn:"Thai",icon:"ð¹ð",keywords:["æ³°å","æ³°å¼","å¬èå","Pad Thai","ç¶ åå±","èæç³¯ç±³"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"coconut_milk",type:"toggle",label:"ææ¤°æ¼¿",calorieImpact:12},{id:"spice_level",type:"select",label:"辣度",options:[{value:"mild",label:"å°è¾£",calorieImpact:0},{value:"medium",label:"ä¸è¾£",calorieImpact:0},{value:"hot",label:"大辣",calorieImpact:2}]},{id:"fried_items",type:"toggle",label:"æç¸ç©",calorieImpact:15}]},{id:"vietnamese",name:"è¶å¼æç",nameEn:"Vietnamese",icon:"ð»ð³",keywords:["è¶å","è¶å¼","æ²³ç²","æ¥å·","æ³å
","Pho"],modifiers:[{id:"noodle_amount",type:"select",label:"ç²é",options:[{value:"less",label:"å°ç²",calorieImpact:-15},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"å åº",calorieImpact:18}]},{id:"fried_spring_roll",type:"toggle",label:"æç¸æ¥å·",calorieImpact:12},{id:"drink_soup",type:"toggle",label:"é£²ææ¹¯",calorieImpact:8}]},{id:"fast_food_western",name:"西å¼å¿«é¤",nameEn:"Western Fast Food",icon:"ð",keywords:["麥ç¶å","KFC","æ¼¢å ¡","è¯æ¢","ç¸é","McDonald","Burger King"],modifiers:[{id:"meal_size",type:"select",label:"å¥é¤å¤§å°",options:[{value:"regular",label:"æ®é",calorieImpact:0},{value:"large",label:"大",calorieImpact:20},{value:"super",label:"å 大",calorieImpact:35}]},{id:"fries",type:"toggle",label:"æè¯æ¢",calorieImpact:15},{id:"sugary_drink",type:"toggle",label:"ææ±½æ°´",calorieImpact:10}
33,{id:"no_sauce",type:"toggle",label:"èµ°é¬",calorieImpact:-8}]},{id:"cafe_de_coral",name:"大家æ¨/大快活",nameEn:"Cafe de Coral / Fairwood",icon:"ð",keywords:["大家æ¨","大快活","å¿«é¤åº","ç¢é 飯","ç飯","常é¤"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"sauce_level",type:"select",label:"æ±é",options:[{value:"no_sauce",label:"èµ°æ±",calorieImpact:-10},{value:"less",label:"å°æ±",calorieImpact:-5},{value:"normal",label:"æ£å¸¸",calorieImpact:0}]},{id:"drink_type",type:"select",label:"飲å",options:[{value:"water",label:"æ°´/ç¡ç³è¶",calorieImpact:0},{value:"less_sugar",label:"å°ç飲å",calorieImpact:5},{value:"normal",label:"æ£å¸¸ç度",calorieImpact:10}]},{id:"baked",type:"toggle",label:"ç飯ï¼å¤è士ï¼",calorieImpact:15}]},{id:"tai_hing",name:"太è/èä»",nameEn:"Tai Hing / TamJai",icon:"ð²",keywords:["太è","èä»","ä¸å¥","ç±³ç·","é
¸è¾£"],modifiers:[{id:"rice_or_noodle",type:"select",label:"主é£",options:[{value:"rice",label:"飯",calorieImpact:0},{value:"noodle",label:"ç±³ç·/麵",calorieImpact:-5}]},{id:"spice_level",type:"select",label:"辣度",options:[{value:"mild",label:"å°è¾£",calorieImpact:0},{value:"medium",label:"ä¸è¾£",calorieImpact:2},{value:"hot",label:"大辣",calorieImpact:3},{value:"extreme",label:"ç¹è¾£",calorieImpact:5}]},{id:"toppings",type:"slider",label:"é
ææ¸é",min:2,max:6,step:1,defaultValue:3,calorieImpactPerUnit:5},{id:"drink_soup",type:"toggle",label:"é£²ææ¹¯",calorieImpact:10}]},{id:"steak_house",name:"ææ¿/西é¤",nameEn:"Steak House / Western",icon:"ð¥©",keywords:["æ","çæ","豬æ","éæ","æç²","西é¤"],modifiers:[{id:"side_dish",type:"select",label:"é
è",options:[{value:"salad",label:"æ²å¾",calorieImpact:-10},{value:"fries",label:"è¯æ¢",calorieImpact:15},{value:"mash",label:"è¯è",calorieImpact:10},{value:"veg",label:"è¬è",calorieImpact:-5}]},{id:"sauce",type:"select",label:"鬿±",options:[{value:"none",label:"èµ°é¬",calorieImpact:-10},{value:"black_pepper",label:"黿¤æ±",calorieImpact:5},{value:"mushroom",label:"èèæ±",calorieImpact:8},{value:"cream",label:"å¿å»æ±",calorieImpact:15}]},{id:"bread_butter",type:"toggle",label:"æé£é¤å
çæ²¹",calorieImpact:10}]},{id:"sushi",name:"壽å¸",nameEn:"Sushi",icon:"ð£",keywords:["壽å¸","è¿´è½","æå·","è»è¦","åºèº«"],modifiers:[{id:"pieces",type:"slider",label:"é£å¹¾å¤ä»¶",min:4,max:20,step:1,defaultValue:10,calorieImpactPerUnit:3},{id:"fried_items",type:"toggle",label:"æç¸ç©ï¼å¤©å©¦ç¾
å·çï¼",calorieImpact:12},{id:"mayo_items",type:"toggle",label:"ææ²å¾é¬/è士",calorieImpact:10},{id:"miso_soup",type:"toggle",label:"æå³å湯",calorieImpact:3}]},{id:"bbq",name:"çç¤/BBQ",nameEn:"BBQ",icon:"ð¥",keywords:["çç¤","BBQ","串ç","éç","æ¥å¼çè"],modifiers:[{id:"portion_size",type:"select",label:"é£é",options:[{value:"light",label:"é£å°å²",calorieImpact:-25},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"heavy",label:"é£å¤å²",calorieImpact:30}]},{id:"sauce_heavy",type:"toggle",label:"å¤é¬æ±/èç³",calorieImpact:12},{id:"with_rice",type:"toggle",label:"é
飯",calorieImpact:15},{id:"beer",type:"toggle",label:"æé£²é
",calorieImpact:15}]},{id:"pizza",name:"èé¤
/Pizza",nameEn:"Pizza",icon:"ð",keywords:["Pizza","èé¤
","æå¤§å©"],modifiers:[{id:"slices",type:"slider",label:"é£å¹¾å¡",min:1,max:8,step:1,defaultValue:3,calorieImpactPerUnit:10},{id:"crust",type:"select",label:"é¤
åº",options:[{value:"thin",label:"èæ¹",calorieImpact:-10},{value:"regular",label:"æ®é",calorieImpact:0},{value:"thick",label:"åæ¹/èå¿",calorieImpact:15}]},{id:"extra_cheese",type:"toggle",label:"å è士",calorieImpact:10}]},{id:"sandwich_wrap",name:"ä¸ææ²»/Wrap",nameEn:"Sandwich / Wrap",icon:"ð¥ª",keywords:["ä¸ææ²»","Sandwich","Wrap","Subway","è²æ","Bagel"],modifiers:[{id:"bread_type",type:"select",label:"麵å
",options:[{value:"white",label:"ç½éºµå
",calorieImpact:0},{value:"wheat",label:"å
¨éº¥",calorieImpact:-5},{value:"wrap",label:"Wrap",calorieImpact:-8},{value:"croissant",label:"çè§å
",calorieImpact:15}]},{id:"sauce",type:"select",label:"鬿±",options:[{value:"none",label:"èµ°é¬",calorieImpact:-10},{value:"mustard",label:"è¥æ«é¬",calorieImpact:2},{value:"mayo",label:"èé»é¬",calorieImpact:12},{value:"ranch",label:"Ranch",calorieImpact:10}]},{id:"extra_cheese",type:"toggle",label:"å è士",calorieImpact:8}]},{id:"salad",name:"æ²å¾",nameEn:"Salad",icon:"ð¥",keywords:["æ²å¾","Salad","å¥åº·é¤","è¼é£"],modifiers:[{id:"dressing",type:"select",label:"鬿±",options:[{value:"none",label:"èµ°é¬",calorieImpact:-15},{value:"vinaigrette",label:"æ²¹éæ±",calorieImpact:0},{value:"caesar",label:"屿é¬",calorieImpact:12},{value:"ranch",label:"Ranch",calorieImpact:15}
33,{value:"sesame",label:"è麻é¬",calorieImpact:10}]},{id:"protein",type:"toggle",label:"æèç½è³ªï¼é/è/䏿éï¼",calorieImpact:12},{id:"croutons",type:"toggle",label:"æéºµå
ç²",calorieImpact:8}]},{id:"curry",name:"åå±",nameEn:"Curry",icon:"ð",keywords:["åå±","Curry","å°åº¦","æ¥å¼åå±"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"richness",type:"select",label:"æ¿åº¦",options:[{value:"light",label:"æ¸
å²",calorieImpact:-10},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"rich",label:"æ¿å",calorieImpact:12}]},{id:"naan",type:"toggle",label:"æNaan/èé¤
",calorieImpact:15},{id:"fried_items",type:"toggle",label:"æç¸ç©ï¼åå±è§çï¼",calorieImpact:12}]},{id:"noodle_soup",name:"湯ç²éºµ",nameEn:"Noodle Soup",icon:"ð²",keywords:["湯麵","湯ç²","çè
©éºµ","éèç²","豬æéºµ"],modifiers:[{id:"noodle_type",type:"select",label:"麵åº",options:[{value:"thick",label:"ç²éºµ",calorieImpact:0},{value:"thin",label:"幼麵",calorieImpact:-3},{value:"rice_noodle",label:"ç±³ç²",calorieImpact:-8},{value:"ho_fun",label:"æ²³ç²",calorieImpact:5}]},{id:"drink_soup",type:"toggle",label:"é£²ææ¹¯",calorieImpact:10},{id:"extra_noodle",type:"toggle",label:"å åº",calorieImpact:18}]},{id:"fried_rice_noodle",name:"ç飯/ç麵",nameEn:"Fried Rice / Noodles",icon:"ð³",keywords:["ç飯","ç麵","çæ²³","ä¹¾ççæ²³","ææ´²çç±³"],modifiers:[{id:"oil_level",type:"select",label:"æ²¹é",options:[{value:"less",label:"å°æ²¹",calorieImpact:-12},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"夿²¹",calorieImpact:15}]},{id:"portion",type:"select",label:"份é",options:[{value:"small",label:"細份",calorieImpact:-20},{value:"regular",label:"æ£å¸¸",calorieImpact:0},{value:"large",label:"大份",calorieImpact:20}]},{id:"egg",type:"toggle",label:"å è",calorieImpact:5}]},{id:"claypot",name:"ç
²ä»é£¯",nameEn:"Claypot Rice",icon:"ð",keywords:["ç
²ä»é£¯","ç
²ä»","èå³é£¯"],modifiers:[{id:"rice_crust",type:"toggle",label:"é£å飯ç¦",calorieImpact:8},{id:"soy_sauce",type:"select",label:"è±æ²¹é",options:[{value:"less",label:"å°è±æ²¹",calorieImpact:-5},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"å¤è±æ²¹",calorieImpact:5}]},{id:"portion",type:"select",label:"份é",options:[{value:"half",label:"é£ä¸å",calorieImpact:-40},{value:"full",label:"飿",calorieImpact:0}]}]},{id:"dessert_hk",name:"港å¼ç³æ°´/çå",nameEn:"HK Dessert",icon:"ð®",keywords:["ç³æ°´","çå","æ¥æçé²","è麻ç³","è±è
è±","西米é²","éªç³"],modifiers:[{id:"sugar_level",type:"select",label:"ç度",options:[{value:"less",label:"å°ç",calorieImpact:-15},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"å ç",calorieImpact:10}]},{id:"size",type:"select",label:"份é",options:[{value:"small",label:"ç´°ç¢",calorieImpact:-25},{value:"regular",label:"æ£å¸¸",calorieImpact:0},{value:"large",label:"大ç¢",calorieImpact:25}]},{id:"toppings",type:"toggle",label:"å é
æï¼æ¹¯å/èåçï¼",calorieImpact:12}]},{id:"bakery",name:"麵å
/西é¤
",nameEn:"Bakery",icon:"ð¥",keywords:["麵å
","èç³","西é¤
","è è¿å
","èæ»","æ²å¥"],modifiers:[{id:"butter",type:"toggle",label:"æçæ²¹",calorieImpact:12},{id:"cream",type:"toggle",label:"æå¿å»/奶油",calorieImpact:15},{id:"quantity",type:"slider",label:"é£å¹¾å¤å",min:1,max:4,step:1,defaultValue:1,calorieImpactPerUnit:30}]},{id:"bubble_tea",name:"ææé£²å/奶è¶",nameEn:"Bubble Tea / Milk Tea",icon:"ð§",keywords:["çç 奶è¶","ææ","奶è¶","æè¶","Coco","ä¸è³","è¶é£²"],modifiers:[{id:"sugar_level",type:"select",label:"ç度",options:[{value:"zero",label:"èµ°ç",calorieImpact:-40},{value:"less",label:"å°ç",calorieImpact:-20},{value:"half",label:"åç³",calorieImpact:-10},{value:"normal",label:"æ£å¸¸",calorieImpact:0}]},{id:"size",type:"select",label:"æ¯å",options:[{value:"regular",label:"䏿¯",calorieImpact:0},{value:"large",label:"大æ¯",calorieImpact:20}]},{id:"toppings",type:"toggle",label:"æé
æï¼çç /èåçï¼",calorieImpact:15},{id:"milk_type",type:"select",label:"奶åº",options:[{value:"fresh_milk",label:"鮮奶",calorieImpact:5},{value:"oat_milk",label:"ç麥奶",calorieImpact:3},{value:"creamer",label:"奶精",calorieImpact:0},{value:"no_milk",label:"走奶",calorieImpact:-10}]}]},{id:"coffee",name:"åå¡",nameEn:"Coffee",icon:"â",keywords:["åå¡","Starbucks","Latte","Cappuccino","ç¾å¼"],modifiers:[{id:"milk_type",type:"select",label:"奶é¡",options:[{value:"black",label:"é½å¡ï¼èµ°å¥¶ï¼",calorieImpact:-30},{value:"skim",label:"è«è奶",calorieImpact:-15},{value:"oat",label:"ç麥奶",calorieImpact:-5},{value:"whole",label:"å
¨è奶",calorieImpact:0}]},{id:"sugar",type:"select",label:"ç³",options:[{value:"none",label:"èµ°ç³",calorieImpact:-20},{value:"less",label:"å°ç³",calorieImpact:-10},{value:"normal",label:"æ£å¸¸",calorieImpact:0}]},{id:"size",type:"select",label:"æ¯å",options:[{value:"small",label:"ç´°æ¯",calorieImpact:-15},{value:"regular",label:"䏿¯",calorieImpact:0},{value:"large",label:"大æ¯",calorieImpact:15}]},{id:"whipped_cream",type:"toggle",label:"æå¿å»",calorieImpact:12}]},{id:"chinese_soup",name:"èç«æ¹¯/çæ¹¯",nameEn:"Chinese Soup",icon:"ð¥",keywords:["èç«æ¹¯","çæ¹¯","ç
²æ¹¯","湯水"],modifiers:[{id:"bowls",type:"slider",label:"飲幾ç¢",min:1,max:3,step:1,defaultValue:1,calorieImpactPerUnit:25},{id:"with_ingredients",type:"toggle",label:"é£å湯æ",calorieImpact:15}]},{id:"stir_fry",name:"å°ç/家常è",nameEn:"Stir Fry / Home Cook",icon:"ð¥",keywords:["å°ç","家常","çè","è¸é","ç
è"],modifiers:[{id:"rice_amount",type:"slider",label:"飯é",min:50,max:150,step:10,defaultValue:100,calorieImpactPerUnit:1},{id:"oil_level",type:"select",label:"æ²¹é",options:[{value:"less",label:"å°æ²¹",calorieImpact:-12},{value:"normal",label:"æ£å¸¸",calorieImpact:0},{value:"extra",label:"夿²¹",calorieImpact:12}]},{id:"dishes_count",type:"slider",label:"é£å¹¾å¤é¤¸",min:1,max:5,step:1,defaultValue:2,calorieImpactPerUnit:8}]},{id:"breakfast_western",name:"è¥¿å¼æ©é¤",nameEn:"Western Breakfast",icon:"ð³",keywords:["All Day Breakfast","è±å¼æ©é¤","ç尼迪è","Pancake","é¬é¤
"],modifiers:[{id:"eggs",type:"slider",label:"èå¹¾å¤é»",min:1,max:3,step:1,defaultValue:2,calorieImpactPerUnit:5},{id:"bacon_sausage",type:"toggle",label:"æç
è/è
¸ä»",calorieImpact:15},{id:"toast_butter",type:"toggle",label:"æå¤å£«çæ²¹",calorieImpact:10},{id:"hash_brown",type:"toggle",label:"æè¯é¤
",calorieImpact:10}]},{id:"seafood",name:"æµ·é®®",nameEn:"Seafood",icon:"ð¦",keywords:["æµ·é®®","è¦","è¹","è","é","é¾è¦","é®é"],modifiers:[{id:"cooking_method",type:"select",label:"ç¹èª¿æ¹å¼",options:[{value:"steamed",label:"è¸",calorieImpact:-10},{value:"boiled",label:"ç½ç¼",calorieImpact:-5},{value:"stir_fried",label:"ç",calorieImpact:10},{value:"deep_fried",label:"ç¸",calorieImpact:25}]},{id:"with_rice",type:"toggle",label:"é
飯",calorieImpact:15},{id:"sauce",type:"toggle",label:"æé¬æ±ï¼èè/è±æ±çï¼",calorieImpact:8}]},{id:"snack",name:"å°é£/é¶é£",nameEn:"Snack",icon:"ð¿",keywords:["å°é£","é¶é£","è¯ç","æ±å¤å","é¤
ä¹¾","å
æ"],modifiers:[{id:"portion",type:"select",label:"é£å¹¾å¤",options:[{value:"few",label:"é£å°å°",calorieImpact:-30},{value:"half",label:"é£ä¸å",calorieImpact:-15},{value:"full",label:"飿æå
",calorieImpact:0},{value:"more",label:"é£è¶
éä¸å
",calorieImpact:40}]}]}];function Xl(t){return r0.find(e=>e.id===t)}function Xx(t,e){let n=0;for(const r of t.modifiers){const a=e[r.id];if(a!==void 0)switch(r.type){case"slider":{const i=(typeof a=="number"?a:parseFloat(a))-(r.defaultValue||0);n+=i*(r.calorieImpactPerUnit||0);break}case"toggle":{a===!0&&(n+=r.calorieImpact||0);break}case"select":{const o=r.options?.find(i=>i.value===a);o&&(n+=o.calorieImpact);break}}}return n}function Kx(t){switch(t){case"food":return"menu";case"menu":return"nutrition_label";case"nutrition_label":return"receipt";case"receipt":return"raw_ingredient";default:return"food"}}function Zx(t){return t==="nutrition_label"}
33function qx(t,e){var n=Object.setPrototypeOf;n?n(t,e):t.__proto__=e}function Qx(t,e){e===void 0&&(e=t.constructor);var n=Error.captureStackTrace;n&&n(t,e)}var Jx=(function(){var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(a[i]=o[i])},t(n,r)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ev=(function(t){Jx(e,t);function e(n,r){var a=this.constructor,o=t.call(this,n,r)||this;return Object.defineProperty(o,"name",{value:a.name,enumerable:!1,configurable:!0}),qx(o,a.prototype),Qx(o),o}return e})(Error),tv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zt=(function(t){tv(e,t);function e(n){n===void 0&&(n=void 0);var r=t.call(this,n)||this;return r.message=n,r}return e.prototype.getKind=function(){var n=this.constructor;return n.kind},e.kind="Exception",e})(ev),nv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),et=(function(t){nv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ArgumentException",e})(zt),rv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Q=(function(t){rv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="IllegalArgumentException",e})(zt),Es=(function(){function t(e){if(this.binarizer=e,e===null)throw new Q("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(e,n){return this.binarizer.getBlackRow(e,n)},t.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,n,r,a){var o=this.binarizer.getLuminanceSource().crop(e,n,r,a);return new t(this.binarizer.createBinarizer(o))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},t})(),av=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
33e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ke=(function(t){av(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e})(zt),ov=(function(){function t(e){this.source=e}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t})(),Ne=(function(){function t(){}return t.arraycopy=function(e,n,r,a,o){if(e===r&&n<a)for(a+=o-1,n+=o-1;o--;)r[a--]=e[n--];else for(;o--;)r[a++]=e[n++]},t.currentTimeMillis=function(){return Date.now()},t})(),iv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),dc=(function(t){iv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="IndexOutOfBoundsException",e})(zt),sv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Kl=(function(t){sv(e,t);function e(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var a=t.call(this,r)||this;return a.index=n,a.message=r,a}return e.kind="ArrayIndexOutOfBoundsException",e})(dc),cv=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ht=(function(){function t(){}return t.fill=function(e,n){for(var r=0,a=e.length;r<a;r++)e[r]=n},t.fillWithin=function(e,n,r,a){t.rangeCheck(e.length,n,r);for(var o=n;o<r;o++)e[o]=a},t.rangeCheck=function(e,n,r){if(n>r)throw new Q("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new Kl(n);if(r>e)throw new Kl(r)},t.asList=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e},t.create=function(e,n,r){var a=Array.from({length:e});return a.map(function(o){return Array.from({length:n}).fill(r)})},t.createInt32Array=function(e,n,r){var a=Array.from({length:e});return a.map(function(o){return Int32Array.from({length:n}).fill(r)})},t.equals=function(e,n){if(!e||!n||!e.length||!n.length||e.length!==n.length)return!1;for(var r=0,a=e.length;r<a;r++)if(e[r]!==n[r])return!1;return!0},t.hashCode=function(e){var n,r;if(e===null)return 0;var a=1;try{for(var o=cv(e),i=o.next();!i.done;i=o.next()){var s=i.value;a=31*a+s}}catch(c){n={error:c}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a},t.fillUint8Array=function(e,n){for(var r=0;r!==e.length;r++)e[r]=n},t.copyOf=function(e,n){return e.slice(0,n)},t.copyOfUint8Array=function(e,n){if(e.length<=n){var r=new Uint8Array(n);return r.set(e),r}return e.slice(0,n)},t.copyOfRange=function(e,n,r){var a=r-n,o=new Int32Array(a);return Ne.arraycopy(e,n,o,0,a),o},t.binarySearch=function(e,n,r){r===void 0&&(r=t.numberComparator);for(var a=0,o=e.length-1;a<=o;){var i=o+a>>1,s=r(n,e[i]);if(s>0)a=i+1;else if(s<0)o=i-1;else return i}return-a-1},t.numberComparator=function(e,n){return e-n},t})(),ce=(function(){function t(){}return t.numberOfTrailingZeros=function(e){var n;if(e===0)return 32;var r=31;return n=e<<16,n!==0&&(r-=16,e=n),n=e<<8,n!==0&&(r-=8,e=n),n=e<<4,n!==0&&(r-=4,e=n),n=e<<2,n!==0&&(r-=2,e=n),r-(e<<1>>>31)},t.numberOfLeadingZeros=function(e){if(e===0)return 32;var n=1;return e>>>16||(n+=16,e<<=16),e>>>24||(n+=8,e<<=8),e>>>28||(n+=4,e<<=4),e>>>30||(n+=2,e<<=2),n-=e>>>31,n},t.toHexString=function(e){return e.toString(16)},t.toBinaryString=function(e){return String(parseInt(String(e),2))},t.bitCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63},t.truncDivision=function(e,n){return Math.trunc(e/n)},t.parseInt=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t})(),vt=(function(){function t(e,n){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,n==null?this.bits=t.makeArray(e):this.bits=n)}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var n=t.makeArray(e);Ne.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},t.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0},t.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},t.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},t.prototype.getNextSet=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,a=Math.floor(e/32),o=r[a];o&=~((1<<(e&31))-1);for(var i=r.length;o===0;){if(++a===i)return n;o=r[a]}var s=a*32+ce.numberOfTrailingZeros(o);return s>n?n:s},t.prototype.getNextUnset=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,a=Math.floor(e/32),o=~r[a];o&=~((1<<(e&31))-1);for(var i=r.length;o===0;){if(++a===i)return n;o=~r[a]}var s=a*32+ce.numberOfTrailingZeros(o);return s>n?n:s},t.prototype.setBulk=function(e,n){this.bits[Math.floor(e/32)]=n},t.prototype.setRange=function(e,n){if(n<e||e<0||n>this.size)throw new Q;if(n!==e){n--;for(var r=Math.floor(e/32),a=Math.floor(n/32),o=this.bits,i=r;i<=a;i++){var s=i>r?0:e&31,c=i<a?31:n&31,l=(2<<c)-(1<<s);o[i]|=l}}},t.prototype.clear=function(){for(var e=this.bits.length,n=this.bits,r=0;r<e;r++)n[r]=0},t.prototype.isRange=function(e,n,r){if(n<e||e<0||n>this.size)throw new Q;if(n===e)return!0;n--;for(var a=Math.floor(e/32),o=Math.floor(n/32),i=this.bits,s=a;s<=o;s++){var c=s>a?0:e&31,l=s<o?31:n&31,u=(2<<l)-(1<<c)&4294967295;if((i[s]&u)!==(r?u:0))return!1}return!0},t.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},t.prototype.appendBits=function(e,n){if(n<0||n>32)throw new Q("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((e>>r-1&1)===1)},t.prototype.appendBitArray=function(e){var n=e.size;this.ensureCapacity(this.size+n);for(var r=0;r<n;r++)this.appendBit(e.get(r))},t.prototype.xor=function(e){if(this.size!==e.size)throw new Q("Sizes don't match");for(var n=this.bits,r=0,a=n.length;r<a;r++)n[r]^=e.bits[r]},t.prototype.toBytes=function(e,n,r,a){for(var o=0;o<a;o++){for(var i=0,s=0;s<8;s++)this.get(e)&&(i|=1<<7-s),e++;n[r+o]=i}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),n=Math.floor((this.size-1)/32),r=n+1,a=this.bits,o=0;o<r;o++){var i=a[o];i=i>>1&1431655765|(i&1431655765)<<1,i=i>>2&858993459|(i&858993459)<<2,i=i>>4&252645135|(i&252645135)<<4,i=i>>8&16711935|(i&16711935)<<8,i=i>>16&65535|(i&65535)<<16,e[n-o]=i}if(this.size!==r*32){for(var s=r*32-this.size,c=e[0]>>>s,o=1;o<r;o++){var l=e[o];c|=l<<32-s,e[o-1]=c,c=l>>>s}e[r-1]=c}this.bits=e},t.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.size===n.size&&ht.equals(this.bits,n.bits)}
33,t.prototype.hashCode=function(){return 31*this.size+ht.hashCode(this.bits)},t.prototype.toString=function(){for(var e="",n=0,r=this.size;n<r;n++)(n&7)===0&&(e+=" "),e+=this.get(n)?"X":".";return e},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t.prototype.toArray=function(){for(var e=[],n=0,r=this.size;n<r;n++)e.push(this.get(n));return e},t})(),be;(function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ENABLE_CODE_39_EXTENDED_MODE=7]="ENABLE_CODE_39_EXTENDED_MODE",t[t.ASSUME_GS1=8]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=9]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=10]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=11]="ALLOWED_EAN_EXTENSIONS"})(be||(be={}));var lv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),P=(function(t){lv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.getFormatInstance=function(){return new e},e.kind="FormatException",e})(zt),uv=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Se;(function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"})(Se||(Se={}));var ft=(function(){function t(e,n,r){for(var a,o,i=[],s=3;s<arguments.length;s++)i[s-3]=arguments[s];this.valueIdentifier=e,this.name=r,typeof n=="number"?this.values=Int32Array.from([n]):this.values=n,this.otherEncodingNames=i,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(r,this);for(var c=this.values,l=0,u=c.length;l!==u;l++){var d=c[l];t.VALUES_TO_ECI.set(d,this)}try{for(var f=uv(i),p=f.next();!p.done;p=f.next()){var g=p.value;t.NAME_TO_ECI.set(g,this)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new P("incorect value");var n=t.VALUES_TO_ECI.get(e);if(n===void 0)throw new P("incorect value");return n},t.getCharacterSetECIByName=function(e){var n=t.NAME_TO_ECI.get(e);if(n===void 0)throw new P("incorect value");return n},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.getName()===n.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(Se.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(Se.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(Se.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(Se.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4
33=new t(Se.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(Se.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(Se.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(Se.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(Se.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(Se.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(Se.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(Se.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(Se.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(Se.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(Se.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(Se.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(Se.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(Se.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(Se.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(Se.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(Se.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(Se.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(Se.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(Se.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(Se.Big5,28,"Big5"),t.GB18030=new t(Se.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(Se.EUC_KR,30,"EUC_KR","EUC-KR"),t})(),dv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ko=(function(t){dv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="UnsupportedOperationException",e})(zt),Ut=(function(){function t(){}return t.decode=function(e,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(e,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},t.shouldDecodeOnFallback=function(e){return!1},t.encode=function(e,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(e,r):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},t.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},t.encodingName=function(e){return typeof e=="string"?e:e.getName()},t.encodingCharacterSet=function(e){return e instanceof ft?e:ft.getCharacterSetECIByName(e)},t.decodeFallback=function(e,n){var r=this.encodingCharacterSet(n);if(t.isDecodeFallbackSupported(r)){for(var a="",o=0,i=e.length;o<i;o++){var s=e[o].toString(16);s.length<2&&(s="0"+s),a+="%"+s}return decodeURIComponent(a)}if(r.equals(ft.UnicodeBigUnmarked))return String.fromCharCode.apply(null,Array.from(new Uint16Array(e.buffer)));throw new ko("Encoding ".concat(this.encodingName(n)," not supported by fallback."))},t.isDecodeFallbackSupported=function(e){return e.equals(ft.UTF8)||e.equals(ft.ISO8859_1)||e.equals(ft.ASCII)},t.encodeFallback=function(e){for(var n=btoa(unescape(encodeURIComponent(e))),r=n.split(""),a=[],o=0;o<r.length;o++)a.push(r[o].charCodeAt(0));return new Uint8Array(a)},t})(),de=(function(){function t(){}
33return t.castAsNonUtf8Char=function(e,n){n===void 0&&(n=null);var r=n?n.getName():this.ISO88591;return Ut.decode(new Uint8Array([e]),r)},t.guessEncoding=function(e,n){if(n!=null&&n.get(be.CHARACTER_SET)!==void 0)return n.get(be.CHARACTER_SET).toString();for(var r=e.length,a=!0,o=!0,i=!0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,g=0,m=0,y=0,v=0,w=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,b=0;b<r&&(a||o||i);b++){var _=e[b]&255;i&&(s>0?(_&128)===0?i=!1:s--:(_&128)!==0&&((_&64)===0?i=!1:(s++,(_&32)===0?c++:(s++,(_&16)===0?l++:(s++,(_&8)===0?u++:i=!1))))),a&&(_>127&&_<160?a=!1:_>159&&(_<192||_===215||_===247)&&v++),o&&(d>0?_<64||_===127||_>252?o=!1:d--:_===128||_===160||_>239?o=!1:_>160&&_<224?(f++,g=0,p++,p>m&&(m=p)):_>127?(d++,p=0,g++,g>y&&(y=g)):(p=0,g=0))}return i&&s>0&&(i=!1),o&&d>0&&(o=!1),i&&(w||c+l+u>0)?t.UTF8:o&&(t.ASSUME_SHIFT_JIS||m>=3||y>=3)?t.SHIFT_JIS:a&&o?m===2&&f===2||v*10>=r?t.SHIFT_JIS:t.ISO88591:a?t.ISO88591:o?t.SHIFT_JIS:i?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var a=-1;function o(s,c,l,u,d,f){if(s==="%%")return"%";if(n[++a]!==void 0){s=u?parseInt(u.substr(1)):void 0;var p=d?parseInt(d.substr(1)):void 0,g;switch(f){case"s":g=n[a];break;case"c":g=n[a][0];break;case"f":g=parseFloat(n[a]).toFixed(s);break;case"p":g=parseFloat(n[a]).toPrecision(s);break;case"e":g=parseFloat(n[a]).toExponential(s);break;case"x":g=parseInt(n[a]).toString(p||16);break;case"d":g=parseFloat(parseInt(n[a],p||10).toPrecision(s)).toFixed(0);break}g=typeof g=="object"?JSON.stringify(g):(+g).toString(p);for(var m=parseInt(l),y=l&&l[0]+""=="0"?"0":" ";g.length<m;)g=c!==void 0?g+y:y+g;return g}}var i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(i,o)},t.getBytes=function(e,n){return Ut.encode(e,n)},t.getCharCode=function(e,n){return n===void 0&&(n=0),e.charCodeAt(n)},t.getCharAt=function(e){return String.fromCharCode(e)},t.SHIFT_JIS=ft.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=ft.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=ft.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t})(),se=(function(){function t(e){e===void 0&&(e=""),this.value=e}return t.prototype.enableDecoding=function(e){return this.encoding=e,this},t.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=de.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},t.prototype.appendChars=function(e,n,r){for(var a=n;n<n+r;a++)this.append(e[a]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(e){return this.value.charAt(e)},t.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},t.prototype.setCharAt=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+1)},t.prototype.substring=function(e,n){return this.value.substring(e,n)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(e,n){this.value=this.value.substring(0,e)+n+this.value.substring(e)},t})(),on=(function(){function t(e,n,r,a){if(this.width=e,this.height=n,this.rowSize=r,this.bits=a,n==null&&(n=e),this.height=n,e<1||n<1)throw new Q("Both dimensions must be greater than 0");r==null&&(r=e+31>>5),this.rowSize=r,a==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var n=e.length,r=e[0].length,a=new t(r,n),o=0;o<n;o++)for(var i=e[o],s=0;s<r;s++)i[s]&&a.set(s,o);return a},t.parseFromString=function(e,n,r){if(e===null)throw new Q("stringRepresentation cannot be null");for(var a=new Array(e.length),o=0,i=0,s=-1,c=0,l=0;l<e.length;)if(e.charAt(l)===` 34`||e.charAt(l)==="\r"){if(o>i){if(s===-1)s=o-i;else if(o-i!==s)throw new Q("row lengths do not match");i=o,c++}l++}else if(e.substring(l,l+n.length)===n)l+=n.length,a[o]=!0,o++;else if(e.substring(l,l+r.length)===r)l+=r.length,a[o]=!1,o++;else throw new Q("illegal character encountered: "+e.substring(l));if(o>i){if(s===-1)s=o-i;else if(o-i!==s)throw new Q("row lengths do not match");c++}for(var u=new t(s,c),d=0;d<o;d++)a[d]&&u.set(Math.floor(d%s),Math.floor(d/s));return u},t.prototype.get=function(e,n){var r=n*this.rowSize+(e>>5);return(this.bits[r]>>>(e&31)&1)!==0},t.prototype.set=function(e,n){var r=n*this.rowSize+(e>>5);this.bits[r]|=1<<(e&31)&4294967295},t.prototype.unset=function(e,n){var r=n*this.rowSize+(e>>5);this.bits[r]&=~(1<<(e&31)&4294967295)},t.prototype.flip=function(e,n){var r=n*this.rowSize+(e>>5);this.bits[r]^=1<<(e&31)&4294967295},t.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new Q("input matrix dimensions do not match");for(var n=new vt((this.width>>5)+1),r=this.rowSize,a=this.bits,o=0,i=this.height;o<i;o++)for(var s=o*r,c=e.getRow(o,n).getBitArray(),l=0;l<r;l++)a[s+l]^=c[l]},t.prototype.clear=function(){this.bits.fill(0)},t.prototype.setRegion=function(e,n,r,a){if(n<0||e<0)throw new Q("Left and top must be nonnegative");if(a<1||r<1)throw new Q("Height and width must be at least 1");var o=e+r,i=n+a;if(i>this.height||o>this.width)throw new Q("The region must fit inside the matrix");for(var s=this.rowSize,c=this.bits,l=n;l<i;l++)for(var u=l*s,d=e;d<o;d++)c[u+(d>>5)]|=1<<(d&31)&4294967295}
34,t.prototype.getRow=function(e,n){n==null||n.getSize()<this.width?n=new vt(this.width):n.clear();for(var r=this.rowSize,a=this.bits,o=e*r,i=0;i<r;i++)n.setBulk(i*32,a[o+i]);return n},t.prototype.setRow=function(e,n){Ne.arraycopy(n.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var e=this.getWidth(),n=this.getHeight(),r=new vt(e),a=new vt(e),o=0,i=Math.floor((n+1)/2);o<i;o++)r=this.getRow(o,r),a=this.getRow(n-1-o,a),r.reverse(),a.reverse(),this.setRow(o,a),this.setRow(n-1-o,r)},t.prototype.getEnclosingRectangle=function(){for(var e=this.width,n=this.height,r=this.rowSize,a=this.bits,o=e,i=n,s=-1,c=-1,l=0;l<n;l++)for(var u=0;u<r;u++){var d=a[l*r+u];if(d!==0){if(l<i&&(i=l),l>c&&(c=l),u*32<o){for(var f=0;(d<<31-f&4294967295)===0;)f++;u*32+f<o&&(o=u*32+f)}if(u*32+31>s){for(var f=31;!(d>>>f);)f--;u*32+f>s&&(s=u*32+f)}}}return s<o||c<i?null:Int32Array.from([o,i,s-o+1,c-i+1])},t.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,n=this.bits,r=0;r<n.length&&n[r]===0;)r++;if(r===n.length)return null;for(var a=r/e,o=r%e*32,i=n[r],s=0;(i<<31-s&4294967295)===0;)s++;return o+=s,Int32Array.from([o,a])},t.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,n=this.bits,r=n.length-1;r>=0&&n[r]===0;)r--;if(r<0)return null;for(var a=Math.floor(r/e),o=Math.floor(r%e)*32,i=n[r],s=31;!(i>>>s);)s--;return o+=s,Int32Array.from([o,a])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&ht.equals(this.bits,n.bits)},t.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+ht.hashCode(this.bits),e},t.prototype.toString=function(e,n,r){return e===void 0&&(e="X "),n===void 0&&(n=" "),r===void 0&&(r=` 35`),this.buildToString(e,n,r)},t.prototype.buildToString=function(e,n,r){for(var a=new se,o=0,i=this.height;o<i;o++){for(var s=0,c=this.width;s<c;s++)a.append(this.get(s,o)?e:n);a.append(r)}return a.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t})(),fv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),D=(function(t){fv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e})(zt),hv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),a0=(function(t){hv(e,t);function e(n){var r=t.call(this,n)||this;return r.luminances=e.EMPTY,r.buckets=new Int32Array(e.LUMINANCE_BUCKETS),r}return e.prototype.getBlackRow=function(n,r){var a=this.getLuminanceSource(),o=a.getWidth();r==null||r.getSize()<o?r=new vt(o):r.clear(),this.initArrays(o);for(var i=a.getRow(n,this.luminances),s=this.buckets,c=0;c<o;c++)s[(i[c]&255)>>e.LUMINANCE_SHIFT]++;var l=e.estimateBlackPoint(s);if(o<3)for(var c=0;c<o;c++)(i[c]&255)<l&&r.set(c);else for(var u=i[0]&255,d=i[1]&255,c=1;c<o-1;c++){var f=i[c+1]&255;(d*4-u-f)/2<l&&r.set(c),u=d,d=f}return r},e.prototype.getBlackMatrix=function(){var n=this.getLuminanceSource(),r=n.getWidth(),a=n.getHeight(),o=new on(r,a);this.initArrays(r);for(var i=this.buckets,s=1;s<5;s++)for(var c=Math.floor(a*s/5),l=n.getRow(c,this.luminances),u=Math.floor(r*4/5),d=Math.floor(r/5);d<u;d++){var f=l[d]&255;i[f>>e.LUMINANCE_SHIFT]++}for(var p=e.estimateBlackPoint(i),g=n.getMatrix(),s=0;s<a;s++)for(var m=s*r,d=0;d<r;d++){var f=g[m+d]&255;f<p&&o.set(d,s)}return o},e.prototype.createBinarizer=function(n){return new e(n)},e.prototype.initArrays=function(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n)),this.buckets.fill(0)},e.estimateBlackPoint=function(n){for(var r=n.length,a=0,o=0,i=0,s=0;s<r;s++)n[s]>i&&(o=s,i=n[s]),n[s]>a&&(a=n[s]);for(var c=0,l=0,s=0;s<r;s++){var u=s-o,d=n[s]*u*u;d>l&&(c=s,l=d)}if(o>c){var f=o;o=c,c=f}if(c-o<=r/16)throw new D;for(var p=c-1,g=-1,s=c-1;s>o;s--){var m=s-o,d=m*m*(c-s)*(a-n[s]);d>g&&(p=s,g=d)}return p<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e})(ov),pv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
35e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),o0=(function(t){pv(e,t);function e(n){var r=t.call(this,n)||this;return r.matrix=null,r}return e.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),a=n.getHeight();if(r>=e.MINIMUM_DIMENSION&&a>=e.MINIMUM_DIMENSION){var o=n.getMatrix(),i=r>>e.BLOCK_SIZE_POWER;(r&e.BLOCK_SIZE_MASK)!==0&&i++;var s=a>>e.BLOCK_SIZE_POWER;(a&e.BLOCK_SIZE_MASK)!==0&&s++;var c=e.calculateBlackPoints(o,i,s,r,a),l=new on(r,a);e.calculateThresholdForBlock(o,i,s,r,a,c,l),this.matrix=l}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(n){return new e(n)},e.calculateThresholdForBlock=function(n,r,a,o,i,s,c){for(var l=i-e.BLOCK_SIZE,u=o-e.BLOCK_SIZE,d=0;d<a;d++){var f=d<<e.BLOCK_SIZE_POWER;f>l&&(f=l);for(var p=e.cap(d,2,a-3),g=0;g<r;g++){var m=g<<e.BLOCK_SIZE_POWER;m>u&&(m=u);for(var y=e.cap(g,2,r-3),v=0,w=-2;w<=2;w++){var b=s[p+w];v+=b[y-2]+b[y-1]+b[y]+b[y+1]+b[y+2]}var _=v/25;e.thresholdBlock(n,m,f,_,o,c)}}},e.cap=function(n,r,a){return n<r?r:n>a?a:n},e.thresholdBlock=function(n,r,a,o,i,s){for(var c=0,l=a*i+r;c<e.BLOCK_SIZE;c++,l+=i)for(var u=0;u<e.BLOCK_SIZE;u++)(n[l+u]&255)<=o&&s.set(r+u,a+c)},e.calculateBlackPoints=function(n,r,a,o,i){for(var s=i-e.BLOCK_SIZE,c=o-e.BLOCK_SIZE,l=new Array(a),u=0;u<a;u++){l[u]=new Int32Array(r);var d=u<<e.BLOCK_SIZE_POWER;d>s&&(d=s);for(var f=0;f<r;f++){var p=f<<e.BLOCK_SIZE_POWER;p>c&&(p=c);for(var g=0,m=255,y=0,v=0,w=d*o+p;v<e.BLOCK_SIZE;v++,w+=o){for(var b=0;b<e.BLOCK_SIZE;b++){var _=n[w+b]&255;g+=_,_<m&&(m=_),_>y&&(y=_)}if(y-m>e.MIN_DYNAMIC_RANGE)for(v++,w+=o;v<e.BLOCK_SIZE;v++,w+=o)for(var b=0;b<e.BLOCK_SIZE;b++)g+=n[w+b]&255}var A=g>>e.BLOCK_SIZE_POWER*2;if(y-m<=e.MIN_DYNAMIC_RANGE&&(A=m/2,u>0&&f>0)){var T=(l[u-1][f]+2*l[u][f-1]+l[u-1][f-1])/4;m<T&&(A=T)}l[u][f]=A}}return l},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=e.BLOCK_SIZE*5,e.MIN_DYNAMIC_RANGE=24,e})(a0),so=(function(){function t(e,n){this.width=e,this.height=n}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(e,n,r,a){throw new ko("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new ko("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new ko("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),n=new se,r=0;r<this.height;r++){for(var a=this.getRow(r,e),o=0;o<this.width;o++){var i=a[o]&255,s=void 0;i<64?s="#":i<128?s="+":i<192?s=".":s=" ",n.append(s)}n.append(` 36`)}return n.toString()},t})(),gv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ii=(function(t){gv(e,t);function e(n){var r=t.call(this,n.getWidth(),n.getHeight())||this;return r.delegate=n,r}return e.prototype.getRow=function(n,r){for(var a=this.delegate.getRow(n,r),o=this.getWidth(),i=0;i<o;i++)a[i]=255-(a[i]&255);return a},e.prototype.getMatrix=function(){for(var n=this.delegate.getMatrix(),r=this.getWidth()*this.getHeight(),a=new Uint8ClampedArray(r),o=0;o<r;o++)a[o]=255-(n[o]&255);return a},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(n,r,a,o){return new e(this.delegate.crop(n,r,a,o))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e})(so),mv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
36e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Zl=(function(t){mv(e,t);function e(n,r,a){r===void 0&&(r=!1);var o=t.call(this,n.width,n.height)||this;return o.canvas=n,o.tempCanvasElement=null,o.buffer=e.makeBufferFromCanvasImageData(n,r,a),o}return e.makeBufferFromCanvasImageData=function(n,r,a){r===void 0&&(r=!1);var o=n.getContext("2d").getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(o.data,n.width,n.height,r,a)},e.toGrayscaleBuffer=function(n,r,a,o,i){o===void 0&&(o=!1);var s=r*a,c=i&&i.length>=s?i:new Uint8ClampedArray(s);e.FRAME_INDEX=!e.FRAME_INDEX;for(var l=!e.FRAME_INDEX&&o?255:0,u=0,d=0,f=n.length;u<f;u+=4,d++){var p=void 0,g=n[u+3];if(g===0)p=255;else{var m=n[u],y=n[u+1],v=n[u+2];p=306*m+601*y+117*v+512>>10}c[d]=p^l}return c},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Q("Requested row is outside the image: "+n);var a=this.getWidth(),o=n*a;return r===null?r=this.buffer.slice(o,o+a):(r.length<a&&(r=new Uint8ClampedArray(a)),r.set(this.buffer.subarray(o,o+a))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,a,o){return t.prototype.crop.call(this,n,r,a,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement(),a=r.getContext("2d"),o=n*e.DEGREE_TO_RADIANS,i=this.canvas.width,s=this.canvas.height,c=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*s),l=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*s);return r.width=c,r.height=l,a.translate(c/2,l/2),a.rotate(o),a.drawImage(this.canvas,i/-2,s/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new ii(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e.FRAME_INDEX=!0,e})(so),xv=(function(){function t(e,n,r){this.deviceId=e,this.label=n,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t})(),Dt=function(t,e,n,r){function a(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function s(u){try{l(r.next(u))}catch(d){i(d)}}function c(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?o(u.value):a(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},Mt=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,a&&(o=l[0]&2?a.return:l[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,l[1])).done)return o;switch(a=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],a=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},vv=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ra=(function(){function t(e,n,r){n===void 0&&(n=500),this.reader=e,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"}
vendor: 8,746 bytes, line 36
36,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return Dt(this,void 0,void 0,function(){var e,n,r,a,o,i,s,c,l,u,d,f;return Mt(this,function(p){switch(p.label){case 0: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.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=vv(e),a=r.next();!a.done;a=r.next())o=a.value,i=o.kind==="video"?"videoinput":o.kind,i==="videoinput"&&(s=o.deviceId||o.id,c=o.label||"Video device ".concat(n.length+1),l=o.groupId,u={deviceId:s,label:c,kind:i,groupId:l},n.push(u))}catch(g){d={error:g}}finally{try{a&&!a.done&&(f=r.return)&&f.call(r)}finally{if(d)throw d.error}}return[2,n]}})})},t.prototype.getVideoInputDevices=function(){return Dt(this,void 0,void 0,function(){var e;return Mt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),[2,e.map(function(r){return new xv(r.deviceId,r.label)})]}})})},t.prototype.findDeviceById=function(e){return Dt(this,void 0,void 0,function(){var n;return Mt(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return n=r.sent(),n?[2,n.find(function(a){return a.deviceId===e})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(e,n){return Dt(this,void 0,void 0,function(){return Mt(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return Dt(this,void 0,void 0,function(){var r,a;return Mt(this,function(o){switch(o.label){case 0:return this.reset(),e?r={deviceId:{exact:e}}:r={facingMode:"environment"},a={video:r},[4,this.decodeOnceFromConstraints(a,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return Dt(this,void 0,void 0,function(){var r;return Mt(this,function(a){switch(a.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=a.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,a.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return Dt(this,void 0,void 0,function(){var r,a;return Mt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return a=o.sent(),[2,a]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(e,n,r){return Dt(this,void 0,void 0,function(){return Mt(this,function(a){switch(a.label){case 0:return[4,this.decodeFromVideoDevice(e,n,r)];case 1:return[2,a.sent()]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return Dt(this,void 0,void 0,function(){var a,o;return Mt(this,function(i){switch(i.label){case 0:return e?a={deviceId:{exact:e}}:a={facingMode:"environment"},o={video:a},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return Dt(this,void 0,void 0,function(){var a;return Mt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return a=o.sent(),[4,this.decodeFromStream(a,n,r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromStream=function(e,n,r){return Dt(this,void 0,void 0,function(){var a;return Mt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return a=o.sent(),[4,this.decodeContinuously(a,r)];case 2:return[2,o.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(e,n){return Dt(this,void 0,void 0,function(){var r;return Mt(this,function(a){switch(a.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return a.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(e){var n=this;return new Promise(function(r,a){return n.playVideoOnLoad(e,function(){return r()})})},t.prototype.playVideoOnLoad=function(e,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",n),this.tryPlayVideo(e)},t.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},t.prototype.tryPlayVideo=function(e){return Dt(this,void 0,void 0,function(){return Mt(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new et("element with id '".concat(e,"' not found"));if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new et("element with id '".concat(e,"' must be an ").concat(n," element"));return r},t.prototype.decodeFromImage=function(e,n){if(!e&&!n)throw new et("either imageElement with a src set or an url must be provided");return n&&!e?this.decodeFromImageUrl(n):this.decodeFromImageElement(e)},t.prototype.decodeFromVideo=function(e,n){if(!e&&!n)throw new et("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(e)},t.prototype.decodeFromVideoContinuously=function(e,n,r){if(e===void 0&&n===void 0)throw new et("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(e,r)},t.prototype.decodeFromImageElement=function(e){if(!e)throw new et("An image element must be provided.");this.reset();var n=this.prepareImageElement(e);this.imageElement=n;var r;return this.isImageLoaded(n)?r=this.decodeOnce(n,!1,!0):r=this._decodeOnLoadImage(n),r},t.prototype.decodeFromVideoElement=function(e){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(n)},t.prototype.decodeFromVideoElementContinuously=function(e,n){var r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,n)},t.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new et("A video element must be provided.");this.reset();var n=this.prepareVideoElement(e);return this.videoElement=n,n},t.prototype.decodeFromImageUrl=function(e){if(!e)throw new et("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=e,r},t.prototype.decodeFromVideoUrl=function(e){if(!e)throw new et("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=e,r},t.prototype.decodeFromVideoUrlContinuously=function(e,n){if(!e)throw new et("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),a=this.decodeFromVideoElementContinuously(r,n);return r.src=e,a},t.prototype._decodeOnLoadImage=function(e){var n=this;return new Promise(function(r,a){n.imageLoadedListener=function(){return n.decodeOnce(e,!1,!0).then(r,a)},e.addEventListener("load",n.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(e){return Dt(this,void 0,void 0,function(){return Mt(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),[4,this.decodeOnce(e)];case 2:return[2,n.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(e,n){return Dt(this,void 0,void 0,function(){return Mt(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,n),[2]}})})},t.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWi
36dth===0)},t.prototype.prepareImageElement=function(e){var n;return typeof e>"u"&&(n=document.createElement("img"),n.width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(n=e),n},t.prototype.prepareVideoElement=function(e){var n;return!e&&typeof document<"u"&&(n=document.createElement("video"),n.width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(n=e),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.prototype.decodeOnce=function(e,n,r){var a=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var o=function(i,s){if(a._stopAsyncDecode){s(new D("Video stream has ended before any code could be detected.")),a._stopAsyncDecode=void 0;return}try{var c=a.decode(e);i(c)}catch(f){var l=n&&f instanceof D,u=f instanceof Ke||f instanceof P,d=u&&r;if(l||d)return setTimeout(o,a._timeBetweenDecodingAttempts,i,s);s(f)}};return new Promise(function(i,s){return o(i,s)})},t.prototype.decodeContinuously=function(e,n){var r=this;this._stopContinuousDecode=!1;var a=function(){if(r._stopContinuousDecode){r._stopContinuousDecode=void 0;return}try{var o=r.decode(e);n(o,null),setTimeout(a,r.timeBetweenScansMillis)}catch(c){n(null,c);var i=c instanceof Ke||c instanceof P,s=c instanceof D;i||s?setTimeout(a,r._timeBetweenDecodingAttempts):console.error("BrowserCodeReader: unexpected error during decode, stopping scan loop:",c)}};a()},t.prototype.decode=function(e){var n=this.createBinaryBitmap(e);try{return this.decodeBitmap(n)}catch(s){if(s instanceof D){var r=this.getCaptureCanvas(e),a=new Zl(r,!1),o=new a0(a),i=new Es(o);return this.decodeBitmap(i)}throw s}},t.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e);var n=!1;e instanceof HTMLVideoElement?(this.drawFrameOnCanvas(e),n=!0):this.drawImageOnCanvas(e);var r=this.getCaptureCanvas(e),a=new Zl(r,n,this._grayscaleBuffer);this._grayscaleBuffer=a.getMatrix();var o=new o0(a);return new Es(o)},t.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(e),r=void 0;try{r=n.getContext("2d",{willReadFrequently:!0})}catch{r=n.getContext("2d")}this.captureCanvasContext=r}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var n=this.createCaptureCanvas(e);this.captureCanvas=n}return this.captureCanvas},t.prototype.drawFrameOnCanvas=function(e,n,r){n===void 0&&(n={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),r===void 0&&(r=this.captureCanvasContext),r.drawImage(e,n.sx,n.sy,n.sWidth,n.sHeight,n.dx,n.dy,n.dWidth,n.dHeight)},t.prototype.drawImageOnCanvas=function(e,n,r){n===void 0&&(n={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),r===void 0&&(r=this.captureCanvasContext),r.drawImage(e,n.sx,n.sy,n.sWidth,n.sHeight,n.dx,n.dy,n.dWidth,n.dHeight)},t.prototype.decodeBitmap=function(e){try{return this.reader.decode(e,this._hints)}finally{this.reader.reset()}},t.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n=document.createElement("canvas"),r,a;return typeof e<"u"&&(e instanceof HTMLVideoElement?(r=e.videoWidth,a=e.videoHeight):e instanceof HTMLImageElement&&(r=e.naturalWidth||e.width,a=e.naturalHeight||e.height)),n.style.width=r+"px",n.style.height=a+"px",n.width=r,n.height=a,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){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)},t.prototype._destroyImageElement=function(){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)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},t})(),yt=(function(){function t(e,n,r,a,o,i){r===void 0&&(r=n==null?0:8*n.length),i===void 0&&(i=Ne.currentTimeMillis()),this.text=e,this.rawBytes=n,this.numBits=r,this.resultPoints=a,this.format=o,this.timestamp=i,this.text=e,this.rawBytes=n,r==null?this.numBits=n==null?0:8*n.length:this.numBits=r,this.resultPoints=a,this.format=o,this.resultMetadata=null,i==null?this.timestamp=Ne.currentTimeMillis():this.timestamp=i}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(e,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,n)},t.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},t.prototype.addResultPoints=function(e){var n=this.resultPoints;if(n===null)this.resultPoints=e;else if(e!==null&&e.length>0){var r=new Array(n.length+e.length);Ne.arraycopy(n,0,r,0,n.length),Ne.arraycopy(e,0,r,n.length,e.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t})(),Ss;
36(function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION",t[t.MICRO_QR_CODE=17]="MICRO_QR_CODE"})(Ss||(Ss={}));const X=Ss;var Is;(function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY",t[t.ERRORS_CORRECTED=11]="ERRORS_CORRECTED"})(Is||(Is={}));const tt=Is;var aa=(function(){function t(e,n,r,a,o,i){o===void 0&&(o=-1),i===void 0&&(i=-1),this.rawBytes=e,this.text=n,this.byteSegments=r,this.ecLevel=a,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=e==null?0:8*e.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(e){this.numBits=e},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(e){this.erasures=e},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(e){this.other=e},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t})(),Ba=(function(){function t(){}return t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new Q;return this.logTable[e]},t.addOrSubtract=function(e,n){return e^n},t})(),qn=(function(){function t(e,n){if(n.length===0)throw new Q;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var a=1;a<r&&n[a]===0;)a++;a===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-a),Ne.arraycopy(n,a,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var n=this.coefficients,r;if(e===1){r=0;for(var a=0,o=n.length;a!==o;a++){var i=n[a];r=Ba.addOrSubtract(r,i)}return r}r=n[0];for(var s=n.length,c=this.field,a=1;a<s;a++)r=Ba.addOrSubtract(c.multiply(e,r),n[a]);return r},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new Q("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var a=n;n=r,r=a}var o=new Int32Array(r.length),i=r.length-n.length;Ne.arraycopy(r,0,o,0,i);for(var s=i;s<r.length;s++)o[s]=Ba.addOrSubtract(n[s-i],r[s]);return new t(this.field,o)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new Q("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,a=e.coefficients,o=a.length,i=new Int32Array(r+o-1),s=this.field,c=0;c<r;c++)for(var l=n[c],u=0;u<o;u++)i[c+u]=Ba.addOrSubtract(i[c+u],s.multiply(l,a[u]));return new t(s,i)},t.prototype.multiplyScalar=function(e){if(e===0)return this.field.getZero();if(e===1)return this;for(var n=this.coefficients.length,r=this.field,a=new Int32Array(n),o=this.coefficients,i=0;i<n;i++)a[i]=r.multiply(o[i],e);return new t(r,a)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new Q;if(n===0)return this.field.getZero();for(var r=this.coefficients,a=r.length,o=new Int32Array(a+e),i=this.field,s=0;s<a;s++)o[s]=i.multiply(r[s],n);return new t(i,o)},t.prototype.divide=function(e){if(!this.field.equals(e.field))throw new Q("GenericGFPolys do n
36ot have same GenericGF field");if(e.isZero())throw new Q("Divide by 0");for(var n=this.field,r=n.getZero(),a=this,o=e.getCoefficient(e.getDegree()),i=n.inverse(o);a.getDegree()>=e.getDegree()&&!a.isZero();){var s=a.getDegree()-e.getDegree(),c=n.multiply(a.getCoefficient(a.getDegree()),i),l=e.multiplyByMonomial(s,c),u=n.buildMonomial(s,c);r=r.addOrSubtract(u),a=a.addOrSubtract(l)}return[r,a]},t.prototype.toString=function(){for(var e="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),n===0||r!==1){var a=this.field.log(r);a===0?e+="1":a===1?e+="a":(e+="a^",e+=a)}n!==0&&(n===1?e+="x":(e+="x^",e+=n))}}return e},t})(),yv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i0=(function(t){yv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ArithmeticException",e})(zt),wv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),St=(function(t){wv(e,t);function e(n,r,a){var o=t.call(this)||this;o.primitive=n,o.size=r,o.generatorBase=a;for(var i=new Int32Array(r),s=1,c=0;c<r;c++)i[c]=s,s*=2,s>=r&&(s^=n,s&=r-1);o.expTable=i;for(var l=new Int32Array(r),c=0;c<r-1;c++)l[i[c]]=c;return o.logTable=l,o.zero=new qn(o,Int32Array.from([0])),o.one=new qn(o,Int32Array.from([1])),o}return e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new Q;if(r===0)return this.zero;var a=new Int32Array(n+1);return a[0]=r,new qn(this,a)},e.prototype.inverse=function(n){if(n===0)throw new i0;return this.expTable[this.size-this.logTable[n]-1]},e.prototype.multiply=function(n,r){return n===0||r===0?0:this.expTable[(this.logTable[n]+this.logTable[r])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+ce.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(n){return n===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e})(Ba),bv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ja=(function(t){bv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ReedSolomonException",e})(zt),Cv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
36e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),co=(function(t){Cv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="IllegalStateException",e})(zt),oa=(function(){function t(e){this.field=e}return t.prototype.decode=function(e,n){this.decodeWithECCount(e,n)},t.prototype.decodeWithECCount=function(e,n){for(var r=this.field,a=new qn(r,e),o=new Int32Array(n),i=!0,s=0;s<n;s++){var c=a.evaluateAt(r.exp(s+r.getGeneratorBase()));o[o.length-1-s]=c,c!==0&&(i=!1)}if(i)return 0;for(var l=new qn(r,o),u=this.runEuclideanAlgorithm(r.buildMonomial(n,1),l,n),d=u[0],f=u[1],p=this.findErrorLocations(d),g=this.findErrorMagnitudes(f,p),s=0;s<p.length;s++){var m=e.length-1-r.log(p[s]);if(m<0)throw new ja("Bad error location");e[m]=St.addOrSubtract(e[m],g[s])}return p.length},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var a=e;e=n,n=a}for(var o=this.field,i=e,s=n,c=o.getZero(),l=o.getOne();s.getDegree()>=(r/2|0);){var u=i,d=c;if(i=s,c=l,i.isZero())throw new ja("r_{i-1} was zero");s=u;for(var f=o.getZero(),p=i.getCoefficient(i.getDegree()),g=o.inverse(p);s.getDegree()>=i.getDegree()&&!s.isZero();){var m=s.getDegree()-i.getDegree(),y=o.multiply(s.getCoefficient(s.getDegree()),g);f=f.addOrSubtract(o.buildMonomial(m,y)),s=s.addOrSubtract(i.multiplyByMonomial(m,y))}if(l=f.multiply(c).addOrSubtract(d),s.getDegree()>=i.getDegree())throw new co("Division algorithm failed to reduce polynomial?")}var v=l.getCoefficient(0);if(v===0)throw new ja("sigmaTilde(0) was zero");var w=o.inverse(v),b=l.multiplyScalar(w),_=s.multiplyScalar(w);return[b,_]},t.prototype.findErrorLocations=function(e){var n=e.getDegree();if(n===1)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(n),a=0,o=this.field,i=1;i<o.getSize()&&a<n;i++)e.evaluateAt(i)===0&&(r[a]=o.inverse(i),a++);if(a!==n)throw new ja("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(e,n){for(var r=n.length,a=new Int32Array(r),o=this.field,i=0;i<r;i++){for(var s=o.inverse(n[i]),c=1,l=0;l<r;l++)if(i!==l){var u=o.multiply(n[l],s),d=(u&1)===0?u|1:u&-2;c=o.multiply(c,d)}a[i]=o.multiply(e.evaluateAt(s),o.inverse(c)),o.getGeneratorBase()!==0&&(a[i]=o.multiply(a[i],s))}return a},t})(),bt;(function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"})(bt||(bt={}));var ql=(function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var n=e.getBits(),r=this.extractBits(n),a=this.correctBits(r),o=t.convertBoolArrayToByteArray(a),i=t.getEncodedData(a),s=new aa(o,i,null,null);return s.setNumBits(a.length),s},t.highLevelDecode=function(e){return this.getEncodedData(e)},t.getEncodedData=function(e){for(var n=e.length,r=bt.UPPER,a=bt.UPPER,o="",i=0;i<n;)if(a===bt.BINARY){if(n-i<5)break;var s=t.readCode(e,i,5);if(i+=5,s===0){if(n-i<11)break;s=t.readCode(e,i,11)+31,i+=11}for(var c=0;c<s;c++){if(n-i<8){i=n;break}var l=t.readCode(e,i,8);o+=de.castAsNonUtf8Char(l),i+=8}a=r}else{var u=a===bt.DIGIT?4:5;if(n-i<u)break;var l=t.readCode(e,i,u);i+=u;var d=t.getCharacter(a,l);d.startsWith("CTRL_")?(r=a,a=t.getTable(d.charAt(5)),d.charAt(6)==="L"&&(r=a)):(o+=d,a=r)}return o},t.getTable=function(e){switch(e){case"L":return bt.LOWER;case"P":return bt.PUNCT;case"M":return bt.MIXED;case"D":return bt.DIGIT;case"B":return bt.BINARY;case"U":default:return bt.UPPER}},t.getCharacter=function(e,n){switch(e){case bt.UPPER:return t.UPPER_TABLE[n];case bt.LOWER:return t.LOWER_TABLE[n];case bt.MIXED:return t.MIXED_TABLE[n];case bt.PUNCT:return t.PUNCT_TABLE[n];case bt.DIGIT:return t.DIGIT_TABLE[n];default:throw new co("Bad table")}},t.prototype.correctBits=function(e){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=St.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=St.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=St.AZTEC_DATA_10):(r=12,n=St.AZTEC_DATA_12);var a=this.ddata.getNbDatablocks(),o=e.length/r;if(o<a)throw new P;for(var i=e.length%r,s=new Int32Array(o),c=0;c<o;c++,i+=r)s[c]=t.readCode(e,i,r);try{var l=new oa(n);l.decode(s,o-a)}catch(y){throw new P(y)}for(var u=(1<<r)-1,d=0,c=0;c<a;c++){var f=s[c];if(f===0||f===u)throw new P;(f===1||f===u-1)&&d++}
36for(var p=new Array(a*r-d),g=0,c=0;c<a;c++){var f=s[c];if(f===1||f===u-1)p.fill(f>1,g,g+r-1),g+=r-1;else for(var m=r-1;m>=0;--m)p[g++]=(f&1<<m)!==0}return p},t.prototype.extractBits=function(e){var n=this.ddata.isCompact(),r=this.ddata.getNbLayers(),a=(n?11:14)+r*4,o=new Int32Array(a),i=new Array(this.totalBitsInLayer(r,n));if(n)for(var s=0;s<o.length;s++)o[s]=s;else for(var c=a+1+2*ce.truncDivision(ce.truncDivision(a,2)-1,15),l=a/2,u=ce.truncDivision(c,2),s=0;s<l;s++){var d=s+ce.truncDivision(s,15);o[l-s-1]=u-d-1,o[l+s]=u+d+1}for(var s=0,f=0;s<r;s++){for(var p=(r-s)*4+(n?9:12),g=s*2,m=a-1-g,y=0;y<p;y++)for(var v=y*2,w=0;w<2;w++)i[f+v+w]=e.get(o[g+w],o[g+y]),i[f+2*p+v+w]=e.get(o[g+y],o[m-w]),i[f+4*p+v+w]=e.get(o[m-w],o[m-y]),i[f+6*p+v+w]=e.get(o[m-y],o[g+w]);f+=p*8}return i},t.readCode=function(e,n,r){for(var a=0,o=n;o<n+r;o++)a<<=1,e[o]&&(a|=1);return a},t.readByte=function(e,n){var r=e.length-n;return r>=8?t.readCode(e,n,8):t.readCode(e,n,r)<<8-r},t.convertBoolArrayToByteArray=function(e){for(var n=new Uint8Array((e.length+7)/8),r=0;r<n.length;r++)n[r]=t.readByte(e,8*r);return n},t.prototype.totalBitsInLayer=function(e,n){return((n?88:112)+16*e)*e},t.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"],t.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"],t.MIXED_TABLE=["CTRL_PS"," ","�","�","�","�","�","�","\x07","\b"," ",` 37`,"\v","\f","\r","\x1B","�","�","�","�","@","\\","^","_","`","|","~","�","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],t.PUNCT_TABLE=["","\r",`\r 38`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t})(),xe=(function(){function t(){}return t.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},t.distance=function(e,n,r,a){var o=e-r,i=n-a;return Math.sqrt(o*o+i*i)},t.sum=function(e){for(var n=0,r=0,a=e.length;r!==a;r++){var o=e[r];n+=o}return n},t})(),Rs=(function(){function t(){}return t.floatToIntBits=function(e){return e},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t})(),$=(function(){function t(e,n){this.x=e,this.y=n}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var n=e;return this.x===n.x&&this.y===n.y}return!1},t.prototype.hashCode=function(){return 31*Rs.floatToIntBits(this.x)+Rs.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(e){var n=this.distance(e[0],e[1]),r=this.distance(e[1],e[2]),a=this.distance(e[0],e[2]),o,i,s;if(r>=n&&r>=a?(i=e[0],o=e[1],s=e[2]):a>=r&&a>=n?(i=e[1],o=e[0],s=e[2]):(i=e[2],o=e[0],s=e[1]),this.crossProductZ(o,i,s)<0){var c=o;o=s,s=c}e[0]=o,e[1]=i,e[2]=s},t.distance=function(e,n){return xe.distance(e.x,e.y,n.x,n.y)},t.crossProductZ=function(e,n,r){var a=n.x,o=n.y;return(r.x-a)*(e.y-o)-(r.y-o)*(e.x-a)},t})(),si=(function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t})(),_v=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Av=(function(t){_v(e,t);function e(n,r,a,o,i){var s=t.call(this,n,r)||this;return s.compact=a,s.nbDatablocks=o,s.nbLayers=i,s}return e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e})(si),Ts=(function(){function t(e,n,r,a){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),n==null&&(n=t.INIT_SIZE),r==null&&(r=e.getWidth()/2|0),a==null&&(a=e.getHeight()/2|0);var o=n/2|0;if(this.leftInit=r-o,this.rightInit=r+o,this.upInit=a-o,this.downInit=a+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new D}return t.prototype.detect=function(){for(var e=this.leftInit,n=this.rightInit,r=this.upInit,a=this.downInit,o=!1,i=!0,s=!1,c=!1,l=!1,u=!1,d=!1,f=this.width,p=this.height;i;){i=!1;for(var g=!0;(g||!c)&&n<f;)g=this.containsBlackPoint(r,a,n,!1),g?(n++,i=!0,c=!0):c||n++;if(n>=f){o=!0;break}for(var m=!0;(m||!l)&&a<p;)m=this.containsBlackPoint(e,n,a,!0),m?(a++,i=!0,l=!0):l||a++;if(a>=p){o=!0;break}for(var y=!0;(y||!u)&&e>=0;)y=this.containsBlackPoint(r,a,e,!1),y?(e--,i=!0,u=!0):u||e--;if(e<0){o=!0;break}for(var v=!0;(v||!d)&&r>=0;)v=this.containsBlackPoint(e,n,r,!0),v?(r--,i=!0,d=!0):d||r--;if(r<0){o=!0;break}i&&(s=!0)}if(!o&&s){for(var w=n-e,b=null,_=1;b===null&&_<w;_++)b=this.getBlackPointOnSegment(e,a-_,e+_,a);if(b==null)throw new D;for(var A=null,_=1;A===null&&_<w;_++)A=this.getBlackPointOnSegment(e,r+_,e+_,r);if(A==null)throw new D;for(var T=null,_=1;T===null&&_<w;_++)T=this.getBlackPointOnSegment(n,r+_,n-_,r);if(T==null)throw new D;for(var S=null,_=1;S===null&&_<w;_++)S=this.getBlackPointOnSegment(n,a-_,n-_,a);if(S==null)throw new D;return this.centerEdges(S,b,T,A)}else throw new D},t.prototype.getBlackPointOnSegment=function(e,n,r,a){for(var o=xe.round(xe.distance(e,n,r,a)),i=(r-e)/o,s=(a-n)/o,c=this.image,l=0;l<o;l++){var u=xe.round(e+l*i),d=xe.round(n+l*s);if(c.get(u,d))return new $(u,d)}return null},t.prototype.centerEdges=function(e,n,r,a){var o=e.getX(),i=e.getY(),s=n.getX(),c=n.getY(),l=r.getX(),u=r.getY(),d=a.getX(),f=a.getY(),p=t.CORR;return o<this.width/2?[new $(d-p,f+p),new $(s+p,c+p),new $(l-p,u-p),new $(o+p,i-p)]:[new $(d+p,f+p),new $(s+p,c-p),new $(l-p,u+p),new $(o-p,i-p)]},t.prototype.containsBlackPoint=function(e,n,r,a){var o=this.image;if(a){for(var i=e;i<=n;i++)if(o.get(i,r))return!0}else for(var s=e;s<=n;s++)if(o.get(r,s))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t})(),Ql=(function(){function t(){}return t.checkAndNudgePoints=function(e,n){for(var r=e.getWidth(),a=e.getHeight(),o=!0,i=0;i<n.length&&o;
38i+=2){var s=Math.floor(n[i]),c=Math.floor(n[i+1]);if(s<-1||s>r||c<-1||c>a)throw new D;o=!1,s===-1?(n[i]=0,o=!0):s===r&&(n[i]=r-1,o=!0),c===-1?(n[i+1]=0,o=!0):c===a&&(n[i+1]=a-1,o=!0)}o=!0;for(var i=n.length-2;i>=0&&o;i-=2){var s=Math.floor(n[i]),c=Math.floor(n[i+1]);if(s<-1||s>r||c<-1||c>a)throw new D;o=!1,s===-1?(n[i]=0,o=!0):s===r&&(n[i]=r-1,o=!0),c===-1?(n[i+1]=0,o=!0):c===a&&(n[i+1]=a-1,o=!0)}},t})(),fc=(function(){function t(e,n,r,a,o,i,s,c,l){this.a11=e,this.a21=n,this.a31=r,this.a12=a,this.a22=o,this.a32=i,this.a13=s,this.a23=c,this.a33=l}return t.quadrilateralToQuadrilateral=function(e,n,r,a,o,i,s,c,l,u,d,f,p,g,m,y){var v=t.quadrilateralToSquare(e,n,r,a,o,i,s,c),w=t.squareToQuadrilateral(l,u,d,f,p,g,m,y);return w.times(v)},t.prototype.transformPoints=function(e){for(var n=e.length,r=this.a11,a=this.a12,o=this.a13,i=this.a21,s=this.a22,c=this.a23,l=this.a31,u=this.a32,d=this.a33,f=0;f<n;f+=2){var p=e[f],g=e[f+1],m=o*p+c*g+d;e[f]=(r*p+i*g+l)/m,e[f+1]=(a*p+s*g+u)/m}},t.prototype.transformPointsWithValues=function(e,n){for(var r=this.a11,a=this.a12,o=this.a13,i=this.a21,s=this.a22,c=this.a23,l=this.a31,u=this.a32,d=this.a33,f=e.length,p=0;p<f;p++){var g=e[p],m=n[p],y=o*g+c*m+d;e[p]=(r*g+i*m+l)/y,n[p]=(a*g+s*m+u)/y}},t.squareToQuadrilateral=function(e,n,r,a,o,i,s,c){var l=e-r+o-s,u=n-a+i-c;if(l===0&&u===0)return new t(r-e,o-r,e,a-n,i-a,n,0,0,1);var d=r-o,f=s-o,p=a-i,g=c-i,m=d*g-f*p,y=(l*g-f*u)/m,v=(d*u-l*p)/m;return new t(r-e+y*r,s-e+v*s,e,a-n+y*a,c-n+v*c,n,y,v,1)},t.quadrilateralToSquare=function(e,n,r,a,o,i,s,c){return t.squareToQuadrilateral(e,n,r,a,o,i,s,c).buildAdjoint()},t.prototype.buildAdjoint=function(){return new t(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)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t})(),Ev=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Sv=(function(t){Ev(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.sampleGrid=function(n,r,a,o,i,s,c,l,u,d,f,p,g,m,y,v,w,b,_){var A=fc.quadrilateralToQuadrilateral(o,i,s,c,l,u,d,f,p,g,m,y,v,w,b,_);return this.sampleGridWithTransform(n,r,a,A)},e.prototype.sampleGridWithTransform=function(n,r,a,o){if(r<=0||a<=0)throw new D;for(var i=new on(r,a),s=new Float32Array(2*r),c=0;c<a;c++){for(var l=s.length,u=c+.5,d=0;d<l;d+=2)s[d]=d/2+.5,s[d+1]=u;o.transformPoints(s),Ql.checkAndNudgePoints(n,s);try{for(var d=0;d<l;d+=2)n.get(s[d]|0,s[d+1]|0)&&i.set(d/2,c)}catch{throw new D}}return i},e})(Ql),ci=(function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new Sv,t})(),jt=(function(){function t(e,n){this.x=e,this.y=n}return t.prototype.toResultPoint=function(){return new $(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t})(),Iv=(function(){function t(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(e){var n=this.getMatrixCenter(),r=this.getBullsEyeCorners(n);if(e){var a=r[0];r[0]=r[2],r[2]=a}this.extractParameters(r);var o=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),i=this.getMatrixCornerPoints(r);return new Av(o,i,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(e){if(!this.isValidPoint(e[0])||!this.isValidPoint(e[1])||!this.isValidPoint(e[2])||!this.isValidPoint(e[3]))throw new D;var n=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(e[0],e[1],n),this.sampleLine(e[1],e[2],n),this.sampleLine(e[2],e[3],n),this.sampleLine(e[3],e[0],n)]);this.shift=this.getRotation(r,n);for(var a=0,o=0;o<4;
38o++){var i=r[(this.shift+o)%4];this.compact?(a<<=7,a+=i>>1&127):(a<<=10,a+=(i>>2&992)+(i>>1&31))}var s=this.getCorrectedParameterData(a,this.compact);this.compact?(this.nbLayers=(s>>6)+1,this.nbDataBlocks=(s&63)+1):(this.nbLayers=(s>>11)+1,this.nbDataBlocks=(s&2047)+1)},t.prototype.getRotation=function(e,n){var r=0;e.forEach(function(o,i,s){var c=(o>>n-2<<1)+(o&1);r=(r<<3)+c}),r=((r&1)<<11)+(r>>1);for(var a=0;a<4;a++)if(ce.bitCount(r^this.EXPECTED_CORNER_BITS[a])<=2)return a;throw new D},t.prototype.getCorrectedParameterData=function(e,n){var r,a;n?(r=7,a=2):(r=10,a=4);for(var o=r-a,i=new Int32Array(r),s=r-1;s>=0;--s)i[s]=e&15,e>>=4;try{var c=new oa(St.AZTEC_PARAM);c.decode(i,o)}catch{throw new D}for(var l=0,s=0;s<a;s++)l=(l<<4)+i[s];return l},t.prototype.getBullsEyeCorners=function(e){var n=e,r=e,a=e,o=e,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var s=this.getFirstDifferent(n,i,1,-1),c=this.getFirstDifferent(r,i,1,1),l=this.getFirstDifferent(a,i,-1,1),u=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){var d=this.distancePoint(u,s)*this.nbCenterLayers/(this.distancePoint(o,n)*(this.nbCenterLayers+2));if(d<.75||d>1.25||!this.isWhiteOrBlackRectangle(s,c,l,u))break}n=s,r=c,a=l,o=u,i=!i}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new D;this.compact=this.nbCenterLayers===5;var f=new $(n.getX()+.5,n.getY()-.5),p=new $(r.getX()+.5,r.getY()+.5),g=new $(a.getX()-.5,a.getY()+.5),m=new $(o.getX()-.5,o.getY()-.5);return this.expandSquare([f,p,g,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var e,n,r,a;try{var o=new Ts(this.image).detect();e=o[0],n=o[1],r=o[2],a=o[3]}catch{var i=this.image.getWidth()/2,s=this.image.getHeight()/2;e=this.getFirstDifferent(new jt(i+7,s-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new jt(i+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new jt(i-7,s+7),!1,-1,1).toResultPoint(),a=this.getFirstDifferent(new jt(i-7,s-7),!1,-1,-1).toResultPoint()}var c=xe.round((e.getX()+a.getX()+n.getX()+r.getX())/4),l=xe.round((e.getY()+a.getY()+n.getY()+r.getY())/4);try{var o=new Ts(this.image,15,c,l).detect();e=o[0],n=o[1],r=o[2],a=o[3]}catch{e=this.getFirstDifferent(new jt(c+7,l-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new jt(c+7,l+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new jt(c-7,l+7),!1,-1,1).toResultPoint(),a=this.getFirstDifferent(new jt(c-7,l-7),!1,-1,-1).toResultPoint()}return c=xe.round((e.getX()+a.getX()+n.getX()+r.getX())/4),l=xe.round((e.getY()+a.getY()+n.getY()+r.getY())/4),new jt(c,l)},t.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(e,n,r,a,o){var i=ci.getInstance(),s=this.getDimension(),c=s/2-this.nbCenterLayers,l=s/2+this.nbCenterLayers;return i.sampleGrid(e,s,s,c,c,l,c,l,l,c,l,n.getX(),n.getY(),r.getX(),r.getY(),a.getX(),a.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(e,n,r){for(var a=0,o=this.distanceResultPoint(e,n),i=o/r,s=e.getX(),c=e.getY(),l=i*(n.getX()-e.getX())/o,u=i*(n.getY()-e.getY())/o,d=0;d<r;d++)this.image.get(xe.round(s+d*l),xe.round(c+d*u))&&(a|=1<<r-d-1);return a},t.prototype.isWhiteOrBlackRectangle=function(e,n,r,a){var o=3;e=new jt(e.getX()-o,e.getY()+o),n=new jt(n.getX()-o,n.getY()-o),r=new jt(r.getX()+o,r.getY()-o),a=new jt(a.getX()+o,a.getY()+o);var i=this.getColor(a,e);if(i===0)return!1;var s=this.getColor(e,n);return s!==i||(s=this.getColor(n,r),s!==i)?!1:(s=this.getColor(r,a),s===i)},t.prototype.getColor=function(e,n){for(var r=this.distancePoint(e,n),a=(n.getX()-e.getX())/r,o=(n.getY()-e.getY())/r,i=0,s=e.getX(),c=e.getY(),l=this.image.get(e.getX(),e.getY()),u=Math.ceil(r),d=0;d<u;d++)s+=a,c+=o,this.image.get(xe.round(s),xe.round(c))!==l&&i++;var f=i/r;return f>.1&&f<.9?0:f<=.1===l?1:-1},t.prototype.getFirstDifferent=function(e,n,r,a){for(var o=e.getX()+r,i=e.getY()+a;this.isValid(o,i)&&this.image.get(o,i)===n;)o+=r,i+=a;for(o-=r,i-=a;this.isValid(o,i)&&this.image.get(o,i)===n;)o+=r;for(o-=r;this.isValid(o,i)&&this.image.get(o,i)===n;)i+=a;return i-=a,new jt(o,i)},t.prototype.expandSquare=function(e,n,r){var a=r/(2*n),o=e[0].getX()-e[2].getX(),i=e[0].getY()-e[2].getY(),s=(e[0].getX()+e[2].getX())/2,c=(e[0].getY()+e[2].getY())/2,l=ne
38w $(s+a*o,c+a*i),u=new $(s-a*o,c-a*i);o=e[1].getX()-e[3].getX(),i=e[1].getY()-e[3].getY(),s=(e[1].getX()+e[3].getX())/2,c=(e[1].getY()+e[3].getY())/2;var d=new $(s+a*o,c+a*i),f=new $(s-a*o,c-a*i),p=[l,d,u,f];return p},t.prototype.isValid=function(e,n){return e>=0&&e<this.image.getWidth()&&n>0&&n<this.image.getHeight()},t.prototype.isValidPoint=function(e){var n=xe.round(e.getX()),r=xe.round(e.getY());return this.isValid(n,r)},t.prototype.distancePoint=function(e,n){return xe.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.distanceResultPoint=function(e,n){return xe.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(ce.truncDivision(this.nbLayers-4,8)+1)+15},t})(),$o=(function(){function t(){}return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=null,a=new Iv(e.getBlackMatrix()),o=null,i=null;try{var s=a.detectMirror(!1);o=s.getPoints(),this.reportFoundResultPoints(n,o),i=new ql().decode(s)}catch(d){r=d}if(i==null)try{var s=a.detectMirror(!0);o=s.getPoints(),this.reportFoundResultPoints(n,o),i=new ql().decode(s)}catch(d){throw r??d}var c=new yt(i.getText(),i.getRawBytes(),i.getNumBits(),o,X.AZTEC,Ne.currentTimeMillis()),l=i.getByteSegments();l!=null&&c.putMetadata(tt.BYTE_SEGMENTS,l);var u=i.getECLevel();return u!=null&&c.putMetadata(tt.ERROR_CORRECTION_LEVEL,u),c},t.prototype.reportFoundResultPoints=function(e,n){if(e!=null){var r=e.get(be.NEED_RESULT_POINT_CALLBACK);r!=null&&n.forEach(function(a,o,i){r.foundPossibleResultPoint(a)})}},t.prototype.reset=function(){},t})(),Rv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){Rv(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new $o,n)||this}return e})(ra);var pt=(function(){function t(){}return t.prototype.decode=function(e,n){try{return this.doDecode(e,n)}catch{var r=n&&n.get(be.TRY_HARDER)===!0;if(r&&e.isRotateSupported()){var a=e.rotateCounterClockwise(),o=this.doDecode(a,n),i=o.getResultMetadata(),s=270;i!==null&&i.get(tt.ORIENTATION)===!0&&(s=s+i.get(tt.ORIENTATION)%360),o.putMetadata(tt.ORIENTATION,s);var c=o.getResultPoints();if(c!==null)for(var l=a.getHeight(),u=0;u<c.length;u++)c[u]=new $(l-c[u].getY()-1,c[u].getX());return o}else throw new D}},t.prototype.reset=function(){},t.prototype.doDecode=function(e,n){var r=e.getWidth(),a=e.getHeight(),o=new vt(r),i=n&&n.get(be.TRY_HARDER)===!0,s=Math.max(1,a>>(i?8:5)),c;i?c=a:c=25;for(var l=Math.trunc(a/2),u=0;u<c;u++){var d=Math.trunc((u+1)/2),f=(u&1)===0,p=l+s*(f?d:-d);if(p<0||p>=a)break;try{o=e.getBlackRow(p,o)}catch{continue}for(var g=function(w){if(w===1&&(o.reverse(),n&&n.get(be.NEED_RESULT_POINT_CALLBACK)===!0)){var b=new Map;n.forEach(function(T,S){return b.set(S,T)}),b.delete(be.NEED_RESULT_POINT_CALLBACK),n=b}try{var _=m.decodeRow(p,o,n);if(w===1){_.putMetadata(tt.ORIENTATION,180);var A=_.getResultPoints();A!==null&&(A[0]=new $(r-A[0].getX()-1,A[0].getY()),A[1]=new $(r-A[1].getX()-1,A[1].getY()))}return{value:_}}catch{}},m=this,y=0;y<2;y++){var v=g(y);if(typeof v=="object")return v.value}}throw new D},t.recordPattern=function(e,n,r){for(var a=r.length,o=0;o<a;o++)r[o]=0;var i=e.getSize();if(n>=i)throw new D;for(var s=!e.get(n),c=0,l=n;l<i;){if(e.get(l)!==s)r[c]++;else{if(++c===a)break;r[c]=1,s=!s}l++}if(!(c===a||c===a-1&&l===i))throw new D},t.recordPatternInReverse=function(e,n,r){for(var a=r.length,o=e.get(n);n>0&&a>=0;)e.get(--n)!==o&&(a--,o=!o);if(a>=0)throw new D;t.recordPattern(e,n+1,r)},t.patternMatchVariance=function(e,n,r){for(var a=e.length,o=0,i=0,s=0;s<a;s++)o+=e[s],i+=n[s];if(o<i)return Number.POSITIVE_INFINITY;var c=o/i;r*=c;for(var l=0,u=0;u<a;u++){var d=e[u],f=n[u]*c,p=d>f?d-f:f-d;if(p>r)return Number.POSITIVE_INFINITY;l+=p}return l/o},t})(),Tv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Jl=(function(t){Tv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.findStartPattern=function(n){for(var r=n.getSize(),a=n.getNextSet(0),o=0,i=Int32Array.from([0,0,0,0,0,0]),s=a,c=!1,l=6,u=a;u<r;u++)if(n.get(u)!==c)i[o]++;else{if(o===l-1){for(var d=e.MAX_AVG_VARIANCE,f=-1,p=e.CODE_START_A;p<=e.CODE_START_C;p++){var g=pt.patternMatchVariance(i,e.CODE_PATTERNS[p],e.MAX_INDIVIDUAL_VARIANCE);g<d&&(d=g,f=p)}if(f>=0&&n.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,f]);s+=i[0]+i[1],i=i.slice(2,i.length),i[o-1]=0,i[o]=0,o--}else o++;i[o]=1,c=!c}throw new D},e.decodeCode=function(n,r,a){pt.recordPattern(n,a,r);for(var o=e.MAX_AVG_VARIANCE,i=-1,s=0;s<e.CODE_PATTERNS.length;s++){var c=e.CODE_PATTERNS[s],l=this.patternMatchVariance(r,c,e.MAX_INDIVIDUAL_VARIANCE);l<o&&(o=l,i=s)}if(i>=0)return i;throw new D},e.prototype.decodeRow=function(n,r,a){var o=a&&a.get(be.ASSUME_GS1)===!0,i=e.findStartPattern(r),s=i[2],c=0,l=new Uint8Array(20);l[c++]=s;var u;switch(s){case e.CODE_START_A:u=e.CODE_CODE_A;break;case e.CODE_START_B:u=e.CODE_CODE_B;break;case e.CODE_START_C:u=e.CODE_CODE_C;break;default:throw new P}for(var d=!1,f=!1,p="",g=i[0],m=i[1],y=Int32Array.from([0,0,0,0,0,0]),v=0,w=0,b=s,_=0,A=!0,T=!1,S=!1;!d;){var E=f;switch(f=!1,v=w,w=e.decodeCode(r,y,m),l[c++]=w,w!==e.CODE_STOP&&(A=!0),w!==e.CODE_STOP&&(_++,b+=_*w),g=m,m+=y.reduce(function(ne,oe){return ne+oe},0),w){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new P}switch(u){case e.CODE_CODE_A:if(w<64)S===T?p+=String.fromCharCode(32+w):p+=String.fromCharCode(32+w+128),S=!1;else if(w<96)S===T?p+=String.fromCharCode(w-64):p+=String.fromCharCode(w+64),S=!1;else switch(w!==e.CODE_STOP&&(A=!1),w){case e.CODE_FNC_1:o&&(p.length===0?p+="]C1":p+="�");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!T&&S?(T=!0,S=!1):T&&S?(T=!1,S=!1):S=!0;break;case e.CODE_SHIFT:f=!0,u=e.CODE_CODE_B;break;case e.CODE_CODE_B:u=e.CODE_CODE_B;break;case e.CODE_CODE_C:u=e.CODE_CODE_C;break;case e.CODE_STOP:d=!0;break}break;case e.CODE_CODE_B:if(w<96)S===T?p+=String.fromCharCode(32+w):p+=String.fromCharCode(32+w+128),S=!1;else switch(w!==e.CODE_STOP&&(A=!1),w){case e.CODE_FNC_1:o&&(p.length===0?p+="]C1":p+="�");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!T&&S?(T=!0,S=!1):T&&S?(T=!1,S=!1):S=!0;break;case e.CODE_SHIFT:f=!0,u=e.CODE_CODE_A;break;case e.CODE_CODE_A:u=e.CODE_CODE_A;break;case e.CODE_CODE_C:u=e.CODE_CODE_C;break;case e.CODE_STOP:d=!0;break}break;case e.CODE_CODE_C:if(w<100)w<10&&(p+="0"),p+=w;else switch(w!==e.CODE_STOP&&(A=!1),w){case e.CODE_FNC_1:o&&(p.length===0?p+="]C1":p+="�");break;case e.CODE_CODE_A:u=e.CODE_CODE_A;break;case e.CODE_CODE_B:u=e.CODE_CODE_B;break;case e.CODE_STOP:d=!0;break}break}E&&(u=u===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var F=m-g;if(m=r.getNextUnset(m),!r.isRange(m,Math.min(r.getSize(),m+(m-g)/2),!1))throw new D;if(b-=_*v,b%103!==v)throw new Ke;var k=p.length;if(k===0)throw new D;k>0&&A&&(u===e.CODE_CODE_C?p=p.substring(0,k-2):p=p.substring(0,k-1));for(var W=(i[1]+i[0])/2,z=g+F/2,L=l.length,le=new Uint8Array(L),fe=0;fe<L;fe++)le[fe]=l[fe];var Ve=[new $(W,n),new $(z,n)];return new yt(p,le,0,Ve,X.CODE_128,new Date().getTime())},e.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])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIA
38NCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e})(pt),Nv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ki=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},eu=(function(t){Nv(e,t);function e(n,r){n===void 0&&(n=!1),r===void 0&&(r=!1);var a=t.call(this)||this;return a.usingCheckDigit=n,a.extendedMode=r,a.decodeRowResult="",a.counters=new Int32Array(9),a}return e.prototype.decodeRow=function(n,r,a){var o,i,s,c,l=this.counters;l.fill(0),this.decodeRowResult="";var u=e.findAsteriskPattern(r,l),d=r.getNextSet(u[1]),f=r.getSize(),p,g;do{e.recordPattern(r,d,l);var m=e.toNarrowWidePattern(l);if(m<0)throw new D;p=e.patternToChar(m),this.decodeRowResult+=p,g=d;try{for(var y=(o=void 0,Ki(l)),v=y.next();!v.done;v=y.next()){var w=v.value;d+=w}}catch(L){o={error:L}}finally{try{v&&!v.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}d=r.getNextSet(d)}while(p!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var b=0;try{for(var _=Ki(l),A=_.next();!A.done;A=_.next()){var w=A.value;b+=w}}catch(L){s={error:L}}finally{try{A&&!A.done&&(c=_.return)&&c.call(_)}finally{if(s)throw s.error}}var T=d-g-b;if(d!==f&&T*2<b)throw new D;if(this.usingCheckDigit){for(var S=this.decodeRowResult.length-1,E=0,F=0;F<S;F++)E+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(F));if(this.decodeRowResult.charAt(S)!==e.ALPHABET_STRING.charAt(E%43))throw new Ke;this.decodeRowResult=this.decodeRowResult.substring(0,S)}if(this.decodeRowResult.length===0)throw new D;var k;this.extendedMode?k=e.decodeExtended(this.decodeRowResult):k=this.decodeRowResult;var W=(u[1]+u[0])/2,z=g+b/2;return new yt(k,null,0,[new $(W,n),new $(z,n)],X.CODE_39,new Date().getTime())},e.findAsteriskPattern=function(n,r){for(var a=n.getSize(),o=n.getNextSet(0),i=0,s=o,c=!1,l=r.length,u=o;u<a;u++)if(n.get(u)!==c)r[i]++;else{if(i===l-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&n.isRange(Math.max(0,s-Math.floor((u-s)/2)),s,!1))return[s,u];s+=r[0]+r[1],r.copyWithin(0,2,2+i-1),r[i-1]=0,r[i]=0,i--}else i++;r[i]=1,c=!c}throw new D},e.toNarrowWidePattern=function(n){var r,a,o=n.length,i=0,s;do{var c=2147483647;try{for(var l=(r=void 0,Ki(n)),u=l.next();!u.done;u=l.next()){var d=u.value;d<c&&d>i&&(c=d)}}catch(m){r={error:m}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}i=c,s=0;for(var f=0,p=0,g=0;g<o;g++){var d=n[g];d>i&&(p|=1<<o-1-g,s++,f+=d)}if(s===3){for(var g=0;g<o&&s>0;g++){var d=n[g];if(d>i&&(s--,d*2>=f))return-1}return p}}while(s>3);return-1},e.patternToChar=function(n){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===n)return e.ALPHABET_STRING.charAt(r);if(n===e.ASTERISK_ENCODING)return"*";throw new D},e.decodeExtended=function(n){for(var r=n.length,a="",o=0;o<r;o++){var i=n.charAt(o);if(i==="+"||i==="$"||i==="%"||i==="/"){var s=n.charAt(o+1),c="\0";switch(i){case"+":if(s>="A"&&s<="Z")c=String.fromCharCode(s.charCodeAt(0)+32);else throw new P;break;case"$":if(s>="A"&&s<="Z")c=String.fromCharCode(s.charCodeAt(0)-64);else throw new P;break;case"%":if(s>="A"&&s<="E")c=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")c=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")c=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")c="\0";else if(s==="V")c="@";else if(s==="W")c="`";else if(s==="X"||s==="Y"||s==="Z")c="�";else throw new P;break;case"/":if(s>="A"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")c=":";else throw new P;break}a+=c,o++}else a+=i}return a},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.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],e.ASTERISK_ENCODING=148,e})(pt),Ov=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Zi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},tu=(function(t){Ov(e,t);function e(){var n=t.call(this)||this;return n.decodeRowResult="",n.counters=new Int32Array(6),n}return e.prototype.decodeRow=function(n,r,a){var o,i,s,c,l=this.findAsteriskPattern(r),u=r.getNextSet(l[1]),d=r.getSize(),f=this.counters;f.fill(0),this.decodeRowResult="";var p,g;do{e.recordPattern(r,u,f);var m=this.toPattern(f);if(m<0)throw new D;p=this.patternToChar(m),this.decodeRowResult+=p,g=u;try{for(var y=(o=void 0,Zi(f)),v=y.next();!v.done;v=y.next()){var w=v.value;u+=w}}catch(F){o={error:F}}finally{try{v&&!v.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}u=r.getNextSet(u)}while(p!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var b=0;try{for(var _=Zi(f),A=_.next();!A.done;A=_.next()){var w=A.value;b+=w}}catch(F){s={error:F}}finally{try{A&&!A.done&&(c=_.return)&&c.call(_)}finally{if(s)throw s.error}}if(u===d||!r.get(u))throw new D;if(this.decodeRowResult.length<2)throw new D;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var T=this.decodeExtended(this.decodeRowResult),S=(l[1]+l[0])/2,E=g+b/2;return new yt(T,null,0,[new $(S,n),new $(E,n)],X.CODE_93,new Date().getTime())},e.prototype.findAsteriskPattern=function(n){var r=n.getSize(),a=n.getNextSet(0);this.counters.fill(0);for(var o=this.counters,i=a,s=!1,c=o.length,l=0,u=a;u<r;u++)if(n.get(u)!==s)o[l]++;else{if(l===c-1){if(this.toPattern(o)===e.ASTERISK_ENCODING)return new Int32Array([i,u]);i+=o[0]+o[1],o.copyWithin(0,2,2+l-1),o[l-1]=0,o[l]=0,l--}else l++;o[l]=1,s=!s}throw new D},e.prototype.toPattern=function(n){var r,a,o=0;try{for(var i=Zi(n),s=i.next();!s.done;s=i.next()){var c=s.value;o+=c}}catch(g){r={error:g}}finally{try{s&&!s.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}for(var l=0,u=n.length,d=0;d<u;d++){var f=Math.round(n[d]*9/o);if(f<1||f>4)return-1;if((d&1)===0)for(var p=0;p<f;p++)l=l<<1|1;else l<<=f}return l},e.prototype.patternToChar=function(n){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===n)return e.ALPHABET_STRING.charAt(r);throw new D},e.prototype.decodeExtended=function(n){for(var r=n.length,a="",o=0;o<r;o++){var i=n.charAt(o);if(i>="a"&&i<="d"){if(o>=r-1)throw new P;var s=n.charAt(o+1),c="\0";switch(i){case"d":if(s>="A"&&s<="Z")c=String.fromCharCode(s.charCodeAt(0)+32);else throw new P;break;case"a":if(s>="A"&&s<="Z")c=String.fromCharCode(s.charCodeAt(0)-64);else throw new P;break;case"b":if(s>="A"&&s<="E")c=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")c=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")c=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")c="\0";else if(s==="V")c="@";else if(s==="W")c="`";else if(s>="X"&&s<="Z")c="�";else throw new P;break;case"c":if(s>="A"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")c=":";else throw new P;break}a+=c,o++}else a+=i}return a},e.prototype.checkChecksums=function(n){var r=n.length;this.checkOneChecksum(n,r-2,20),this.checkOneChecksum(n,r-1,15)},e.prototype.checkOneChecksum=function(n,r,a){for(var o=1,i=0,s=r-1;s>=0;s--)i+=o*e.ALPHABET_STRING.indexOf(n.charAt(s)),++o>a&&(o=1);if(n.charAt(r)!==e.ALPHABET_STRING[i%47])throw new Ke},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",e.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],e.ASTERISK_ENCODING=e.CHARACTER_ENCODINGS[47],e})(pt),Dv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Mv=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},Fv=function(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,o;r<a;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Pv=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nu=(function(t){Dv(e,t);function e(){var n=t.apply(this,Fv([],Mv(arguments),!1))||this;return n.narrowLineWidth=-1,n}return e.prototype.decodeRow=function(n,r,a){var o,i,s=this.decodeStart(r),c=this.decodeEnd(r),l=new se;e.decodeMiddle(r,s[1],c[0],l);var u=l.toString(),d=null;a!=null&&(d=a.get(be.ALLOWED_LENGTHS)),d==null&&(d=e.DEFAULT_ALLOWED_LENGTHS);var f=u.length,p=!1,g=0;try{for(var m=Pv(d),y=m.next();!y.done;y=m.next()){var v=y.value;if(f===v){p=!0;break}v>g&&(g=v)}}catch(_){o={error:_}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}if(!p&&f>g&&(p=!0),!p)throw new P;var w=[new $(s[1],n),new $(c[0],n)],b=new yt(u,null,0,w,X.ITF,new Date().getTime());return b},e.decodeMiddle=function(n,r,a,o){var i=new Int32Array(10),s=new Int32Array(5),c=new Int32Array(5);for(i.fill(0),s.fill(0),c.fill(0);r<a;){pt.recordPattern(n,r,i);for(var l=0;l<5;l++){var u=2*l;s[l]=i[u],c[l]=i[u+1]}var d=e.decodeDigit(s);o.append(d.toString()),d=this.decodeDigit(c),o.append(d.toString()),i.forEach(function(f){r+=f})}},e.prototype.decodeStart=function(n){var r=e.skipWhiteSpace(n),a=e.findGuardPattern(n,r,e.START_PATTERN);return this.narrowLineWidth=(a[1]-a[0])/4,this.validateQuietZone(n,a[0]),a},e.prototype.validateQuietZone=function(n,r){var a=this.narrowLineWidth*10;a=a<r?a:r;for(var o=r-1;a>0&&o>=0&&!n.get(o);o--)a--;if(a!==0)throw new D},e.skipWhiteSpace=function(n){var r=n.getSize(),a=n.getNextSet(0);if(a===r)throw new D;return a},e.prototype.decodeEnd=function(n){n.reverse();try{var r=e.skipWhiteSpace(n),a=void 0;try{a=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[0])}catch(i){i instanceof D&&(a=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,a[0]);var o=a[0];return a[0]=n.getSize()-a[1],a[1]=n.getSize()-o,a}finally{n.reverse()}},e.findGuardPattern=function(n,r,a){var o=a.length,i=new Int32Array(o),s=n.getSize(),c=!1,l=0,u=r;i.fill(0);for(var d=r;d<s;d++)if(n.get(d)!==c)i[l]++;else{if(l===o-1){if(pt.patternMatchVariance(i,a,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[u,d];u+=i[0]+i[1],Ne.arraycopy(i,2,i,0,l-1),i[l-1]=0,i[l]=0,l--}else l++;i[l]=1,c=!c}throw new D},e.decodeDigit=function(n){for(var r=e.MAX_AVG_VARIANCE,a=-1,o=e.PATTERNS.length,i=0;i<o;i++){var s=e.PATTERNS[i],c=pt.patternMatchVariance(n,s,e.MAX_INDIVIDUAL_VARIANCE);c<r?(r=c,a=i):c===r&&(a=-1)}if(a>=0)return a%10;throw new D},e.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])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e})(pt),kv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Bv=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},jv=function(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,o;r<a;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},qr=(function(t){kv(e,t);function e(){var n=t.apply(this,jv([],Bv(arguments),!1))||this;return n.decodeRowStringBuffer="",n}return e.findStartGuardPattern=function(n){for(var r=!1,a,o=0,i=Int32Array.from([0,0,0]);!r;){i=Int32Array.from([0,0,0]),a=e.findGuardPattern(n,o,!1,this.START_END_PATTERN,i);var s=a[0];o=a[1];var c=s-(o-s);c>=0&&(r=n.isRange(c,s,!1))}return a},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var a=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===a},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,a=0,o=r-1;o>=0;o-=2){var i=n.charAt(o).charCodeAt(0)-48;if(i<0||i>9)throw new P;a+=i}a*=3;for(var o=r-2;o>=0;o-=2){var i=n.charAt(o).charCodeAt(0)-48;if(i<0||i>9)throw new P;a+=i}return(1e3-a)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(n,r,a,o){return this.findGuardPattern(n,r,a,o,new Int32Array(o.length))},e.findGuardPattern=function(n,r,a,o,i){var s=n.getSize();r=a?n.getNextUnset(r):n.getNextSet(r);for(var c=0,l=r,u=o.length,d=a,f=r;f<s;f++)if(n.get(f)!==d)i[c]++;else{if(c===u-1){if(pt.patternMatchVariance(i,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([l,f]);l+=i[0]+i[1];for(var p=i.slice(2,i.length),g=0;g<c-1;g++)i[g]=p[g];i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,d=!d}throw new D},e.decodeDigit=function(n,r,a,o){this.recordPattern(n,a,r);for(var i=this.MAX_AVG_VARIANCE,s=-1,c=o.length,l=0;l<c;l++){var u=o[l],d=pt.patternMatchVariance(r,u,e.MAX_INDIVIDUAL_VARIANCE);d<i&&(i=d,s=l)}if(s>=0)return s;throw new D},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.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])],e})(pt),Lv=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vv=(function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var a=this.decodeRowStringBuffer,o=this.decodeMiddle(n,r,a),i=a.toString(),s=t.parseExtensionString(i),c=[new $((r[0]+r[1])/2,e),new $(o,e)],l=new yt(i,null,0,c,X.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(e,n,r){var a,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var s=e.getSize(),c=n[1],l=0,u=0;u<5&&c<s;u++){var d=qr.decodeDigit(e,i,c,qr.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(a=void 0,Lv(i)),p=f.next();!p.done;p=f.next()){var g=p.value;c+=g}}catch(y){a={error:y}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}d>=10&&(l|=1<<4-u),u!==4&&(c=e.getNextSet(c),c=e.getNextUnset(c))}if(r.length!==5)throw new D;var m=this.determineCheckDigit(l);if(t.extensionChecksum(r.toString())!==m)throw new D;return c},t.extensionChecksum=function(e){for(var n=e.length,r=0,a=n-2;a>=0;
38a-=2)r+=e.charAt(a).charCodeAt(0)-48;r*=3;for(var a=n-1;a>=0;a-=2)r+=e.charAt(a).charCodeAt(0)-48;return r*=3,r%10},t.prototype.determineCheckDigit=function(e){for(var n=0;n<10;n++)if(e===this.CHECK_DIGIT_ENCODINGS[n])return n;throw new D},t.parseExtensionString=function(e){if(e.length!==5)return null;var n=t.parseExtension5String(e);return n==null?null:new Map([[tt.SUGGESTED_PRICE,n]])},t.parseExtension5String=function(e){var n;switch(e.charAt(0)){case"0":n="£";break;case"5":n="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}n="";break;default:n="";break}var r=parseInt(e.substring(1)),a=(r/100).toString(),o=r%100,i=o<10?"0"+o:o.toString();return n+a+"."+i},t})(),Uv=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zv=(function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var a=this.decodeRowStringBuffer,o=this.decodeMiddle(n,r,a),i=a.toString(),s=t.parseExtensionString(i),c=[new $((r[0]+r[1])/2,e),new $(o,e)],l=new yt(i,null,0,c,X.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&l.putAllMetadata(s),l},t.prototype.decodeMiddle=function(e,n,r){var a,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var s=e.getSize(),c=n[1],l=0,u=0;u<2&&c<s;u++){var d=qr.decodeDigit(e,i,c,qr.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(a=void 0,Uv(i)),p=f.next();!p.done;p=f.next()){var g=p.value;c+=g}}catch(m){a={error:m}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}d>=10&&(l|=1<<1-u),u!==1&&(c=e.getNextSet(c),c=e.getNextUnset(c))}if(r.length!==2)throw new D;if(parseInt(r.toString())%4!==l)throw new D;return c},t.parseExtensionString=function(e){return e.length!==2?null:new Map([[tt.ISSUE_NUMBER,parseInt(e)]])},t})(),Wv=(function(){function t(){}return t.decodeRow=function(e,n,r){var a=qr.findGuardPattern(n,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var o=new Vv;return o.decodeRow(e,n,a)}catch{var i=new zv;return i.decodeRow(e,n,a)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t})(),Hv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),dt=(function(t){Hv(e,t);function e(){var n=t.call(this)||this;n.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var r=10;r<20;r++){for(var a=e.L_PATTERNS[r-10],o=new Int32Array(a.length),i=0;i<a.length;i++)o[i]=a[a.length-i-1];e.L_AND_G_PATTERNS[r]=o}return n}return e.prototype.decodeRow=function(n,r,a){var o=e.findStartGuardPattern(r),i=a==null?null:a.get(be.NEED_RESULT_POINT_CALLBACK);if(i!=null){var s=new $((o[0]+o[1])/2,n);i.foundPossibleResultPoint(s)}var c=this.decodeMiddle(r,o,this.decodeRowStringBuffer),l=c.rowOffset,u=c.resultString;if(i!=null){var d=new $(l,n);i.foundPossibleResultPoint(d)}var f=e.decodeEnd(r,l);if(i!=null){var p=new $((f[0]+f[1])/2,n);i.foundPossibleResultPoint(p)}var g=f[1],m=g+(g-f[0]);if(m>=r.getSize()||!r.isRange(g,m,!1))throw new D;var y=u.toString();if(y.length<8)throw new P;if(!e.checkChecksum(y))throw new Ke;var v=(o[1]+o[0])/2,w=(f[1]+f[0])/2,b=this.getBarcodeFormat(),_=[new $(v,n),new $(w,n)],A=new yt(y,null,0,_,b,new Date().getTime()),T=0;try{var S=Wv.decodeRow(n,r,f[1]);A.putMetadata(tt.UPC_EAN_EXTENSION,S.getText()),A.putAllMetadata(S.getResultMetadata()),A.addResultPoints(S.getResultPoints()),T=S.getText().length}catch{}var E=a==null?null:a.get(be.ALLOWED_EAN_EXTENSIONS);if(E!=null){var F=!1;for(var k in E)if(T.toString()===k){F=!0;break}if(!F)throw new D}return b===X.EAN_13||X.UPC_A,A},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var a=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===a},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,a=0,o=r-1;o>=0;
38o-=2){var i=n.charAt(o).charCodeAt(0)-48;if(i<0||i>9)throw new P;a+=i}a*=3;for(var o=r-2;o>=0;o-=2){var i=n.charAt(o).charCodeAt(0)-48;if(i<0||i>9)throw new P;a+=i}return(1e3-a)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e})(qr),$v=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ru=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ns=(function(t){$v(e,t);function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return e.prototype.decodeMiddle=function(n,r,a){var o,i,s,c,l=this.decodeMiddleCounters;l[0]=0,l[1]=0,l[2]=0,l[3]=0;for(var u=n.getSize(),d=r[1],f=0,p=0;p<6&&d<u;p++){var g=dt.decodeDigit(n,l,d,dt.L_AND_G_PATTERNS);a+=String.fromCharCode(48+g%10);try{for(var m=(o=void 0,ru(l)),y=m.next();!y.done;y=m.next()){var v=y.value;d+=v}}catch(A){o={error:A}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}g>=10&&(f|=1<<5-p)}a=e.determineFirstDigit(a,f);var w=dt.findGuardPattern(n,d,!0,dt.MIDDLE_PATTERN,new Int32Array(dt.MIDDLE_PATTERN.length).fill(0));d=w[1];for(var p=0;p<6&&d<u;p++){var g=dt.decodeDigit(n,l,d,dt.L_PATTERNS);a+=String.fromCharCode(48+g);try{for(var b=(s=void 0,ru(l)),_=b.next();!_.done;_=b.next()){var v=_.value;d+=v}}catch(S){s={error:S}}finally{try{_&&!_.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}}return{rowOffset:d,resultString:a}},e.prototype.getBarcodeFormat=function(){return X.EAN_13},e.determineFirstDigit=function(n,r){for(var a=0;a<10;a++)if(r===this.FIRST_DIGIT_ENCODINGS[a])return n=String.fromCharCode(48+a)+n,n;throw new D},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e})(dt),Gv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),au=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ou=(function(t){Gv(e,t);function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return e.prototype.decodeMiddle=function(n,r,a){var o,i,s,c,l=this.decodeMiddleCounters;l[0]=0,l[1]=0,l[2]=0,l[3]=0;for(var u=n.getSize(),d=r[1],f=0;f<4&&d<u;f++){var p=dt.decodeDigit(n,l,d,dt.L_PATTERNS);a+=String.fromCharCode(48+p);try{for(var g=(o=void 0,au(l)),m=g.next();!m.done;m=g.next()){var y=m.value;d+=y}}catch(_){o={error:_}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}}var v=dt.findGuardPattern(n,d,!0,dt.MIDDLE_PATTERN,new Int32Array(dt.MIDDLE_PATTERN.length).fill(0));d=v[1];for(var f=0;f<4&&d<u;f++){var p=dt.decodeDigit(n,l,d,dt.L_PATTERNS);a+=String.fromCharCode(48+p);try{for(var w=(s=void 0,au(l)),b=w.next();!b.done;b=w.next()){var y=b.value;d+=y}}catch(T){s={error:T}}finally{try{b&&!b.done&&(c=w.return)&&c.call(w)}finally{if(s)throw s.error}}}return{rowOffset:d,resultString:a}},e.prototype.getBarcodeFormat=function(){return X.EAN_8},e})(dt),Yv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Xv=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},Kv=function(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,o;r<a;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},iu=(function(t){Yv(e,t);function e(){var n=t.apply(this,Kv([],Xv(arguments),!1))||this;return n.ean13Reader=new Ns,n}return e.prototype.getBarcodeFormat=function(){return X.UPC_A},e.prototype.decode=function(n,r){return this.maybeReturnResult(this.ean13Reader.decode(n))},e.prototype.decodeRow=function(n,r,a){return this.maybeReturnResult(this.ean13Reader.decodeRow(n,r,a))},e.prototype.decodeMiddle=function(n,r,a){return this.ean13Reader.decodeMiddle(n,r,a)},e.prototype.maybeReturnResult=function(n){var r=n.getText();if(r.charAt(0)==="0"){var a=new yt(r.substring(1),null,null,n.getResultPoints(),X.UPC_A);return n.getResultMetadata()!=null&&a.putAllMetadata(n.getResultMetadata()),a}else throw new D},e.prototype.reset=function(){this.ean13Reader.reset()},e})(dt),Zv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),qv=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},su=(function(t){Zv(e,t);function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=new Int32Array(4),n}return e.prototype.decodeMiddle=function(n,r,a){var o,i,s=this.decodeMiddleCounters.map(function(y){return y});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var c=n.getSize(),l=r[1],u=0,d=0;d<6&&l<c;d++){var f=e.decodeDigit(n,s,l,e.L_AND_G_PATTERNS);a+=String.fromCharCode(48+f%10);try{for(var p=(o=void 0,qv(s)),g=p.next();!g.done;g=p.next()){var m=g.value;l+=m}}catch(y){o={error:y}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}f>=10&&(u|=1<<5-d)}return e.determineNumSysAndCheckDigit(new se(a),u),l},e.prototype.decodeEnd=function(n,r){return e.findGuardPatternWithoutCounters(n,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(n){return dt.checkChecksum(e.convertUPCEtoUPCA(n))},e.determineNumSysAndCheckDigit=function(n,r){for(var a=0;a<=1;a++)for(var o=0;o<10;o++)if(r===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[a][o]){n.insert(0,"0"+a),n.append("0"+o);return}throw D.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return X.UPC_E},e.convertUPCEtoUPCA=function(n){var r=n.slice(1,7).split("").map(function(i){return i.charCodeAt(0)}),a=new se;a.append(n.charAt(0));var o=r[5];switch(o){case 0:case 1:case 2:a.appendChars(r,0,2),a.append(o),a.append("0000"),a.appendChars(r,2,3);break;case 3:a.appendChars(r,0,3),a.append("00000"),a.appendChars(r,3,2);break;case 4:a.appendChars(r,0,4),a.append("00000"),a.append(r[4]);break;default:a.appendChars(r,0,5),a.append("0000"),a.append(o);break}return n.length>=8&&a.append(n.charAt(7)),a.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.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,1])],e})(dt),Qv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),cu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},qi=(function(t){Qv(e,t);function e(n){var r=t.call(this)||this,a=n==null?null:n.get(be.POSSIBLE_FORMATS),o=[];return a!=null&&(a.indexOf(X.EAN_13)>-1&&o.push(new Ns),a.indexOf(X.UPC_A)>-1&&o.push(new iu),a.indexOf(X.EAN_8)>-1&&o.push(new ou),a.indexOf(X.UPC_E)>-1&&o.push(new su)),o.length===0&&(o.push(new Ns),o.push(new iu),o.push(new ou),o.push(new su)),r.readers=o,r}return e.prototype.decodeRow=function(n,r,a){var o,i;try{for(var s=cu(this.readers),c=s.next();!c.done;c=s.next()){var l=c.value;try{var u=l.decodeRow(n,r,a),d=u.getBarcodeFormat()===X.EAN_13&&u.getText().charAt(0)==="0",f=a==null?null:a.get(be.POSSIBLE_FORMATS),p=f==null||f.includes(X.UPC_A);if(d&&p){var g=u.getRawBytes(),m=new yt(u.getText().substring(1),g,g?g.length:null,u.getResultPoints(),X.UPC_A);return m.putAllMetadata(u.getResultMetadata()),m}return u}catch{}}}catch(y){o={error:y}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}throw new D},e.prototype.reset=function(){var n,r;try{for(var a=cu(this.readers),o=a.next();!o.done;o=a.next()){var i=o.value;i.reset()}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},e})(pt),Jv=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),e2=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},t2=function(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,o;r<a;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},n2=(function(t){Jv(e,t);function e(){var n=t.apply(this,t2([],e2(arguments),!1))||this;return n.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},n}return e.prototype.decodeRow=function(n,r,a){var o=this.getValidRowData(r);if(!o)throw new D;var i=this.codaBarDecodeRow(o.row);if(!i)throw new D;return new yt(i,null,0,[new $(o.left,n),new $(o.right,n)],X.CODABAR,new Date().getTime())},e.prototype.getValidRowData=function(n){var r=n.toArray(),a=r.indexOf(!0);if(a===-1)return null;var o=r.lastIndexOf(!0);if(o<=a)return null;r=r.slice(a,o+1);for(var i=[],s=r[0],c=1,l=1;l<r.length;l++)r[l]===s?c++:(s=r[l],i.push(c),c=1);return i.push(c),i.length<23&&(i.length+1)%8!==0?null:{row:i,left:a,right:o}},e.prototype.codaBarDecodeRow=function(n){for(var r=[],a=Math.ceil(n.reduce(function(c,l){return(c+l)/2},0));n.length>0;){var o=n.splice(0,8).splice(0,7),i=o.map(function(c){return c<a?"n":"w"}).join("");if(this.CODA_BAR_CHAR_SET[i]===void 0)return null;r.push(this.CODA_BAR_CHAR_SET[i])}var s=r.join("");return this.validCodaBarString(s)?s:null},e.prototype.validCodaBarString=function(n){var r=/^[A-D].{1,}[A-D]$/;return r.test(n)},e})(pt),r2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),a2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},wr=(function(t){r2(e,t);function e(){var n=t.call(this)||this;return n.decodeFinderCounters=new Int32Array(4),n.dataCharacterCounters=new Int32Array(8),n.oddRoundingErrors=new Array(4),n.evenRoundingErrors=new Array(4),n.oddCounts=new Array(Math.trunc(n.dataCharacterCounters.length/2)),n.evenCounts=new Array(Math.trunc(n.dataCharacterCounters.length/2)),n}return e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(n,r){for(var a=0;a<r.length;a++)if(pt.patternMatchVariance(n,r[a],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return a;throw new D},e.count=function(n){return xe.sum(new Int32Array(n))},e.increment=function(n,r){for(var a=0,o=r[0],i=1;i<n.length;i++)r[i]>o&&(o=r[i],a=i);n[a]++},e.decrement=function(n,r){for(var a=0,o=r[0],i=1;i<n.length;i++)r[i]<o&&(o=r[i],a=i);n[a]--},e.isFinderPattern=function(n){var r,a,o=n[0]+n[1],i=o+n[2]+n[3],s=o/i;if(s>=e.MIN_FINDER_PATTERN_RATIO&&s<=e.MAX_FINDER_PATTERN_RATIO){var c=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;try{for(var u=a2(n),d=u.next();!d.done;d=u.next()){var f=d.value;f>l&&(l=f),f<c&&(c=f)}}catch(p){r={error:p}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}return l<10*c}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e})(pt),Go=(function(){function t(e,n){this.value=e,this.checksumPortion=n}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value&&this.checksumPortion===n.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t})(),s0=(function(){function t(e,n,r,a,o){this.value=e,this.startEnd=n,this.resultPoints=new Array,this.resultPoints.push(new $(r,o)),this.resultPoints.push(new $(a,o))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.hashCode=function(){return this.value},t})(),o2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vr=(function(){function t(){}return t.getRSSvalue=function(e,n,r){var a,o,i=0;try{for(var s=o2(e),c=s.next();!c.done;c=s.next()){var l=c.value;i+=l}}catch(w){a={error:w}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}for(var u=0,d=0,f=e.length,p=0;p<f-1;p++){var g=void 0;for(g=1,d|=1<<p;g<e[p];g++,d&=~(1<<p)){var m=t.combins(i-g-1,f-p-2);if(r&&d===0&&i-g-(f-p-1)>=f-p-1&&(m-=t.combins(i-g-(f-p),f-p-2)),f-p-1>1){for(var y=0,v=i-g-(f-p-2);v>n;v--)y+=t.combins(i-g-v-1,f-p-3);m-=y*(f-1-p)}else i-g>n&&m--;u+=m}i-=g}return u},t.combins=function(e,n){var r=0,a=0;e-n>n?(a=n,r=e-n):(a=e-n,r=n);for(var o=1,i=1,s=e;s>r;s--)o*=s,i<=a&&(o=Math.trunc(o/i),i++);for(;i<=a;)o=Math.trunc(o/i),i++;return o},t})(),i2=(function(){function t(){}return t.buildBitArray=function(e){var n=e.length*2-1;e[e.length-1].getRightChar()===null&&(n-=1);for(var r=12*n,a=new vt(r),o=0,i=e[0],s=i.getRightChar().getValue(),c=11;c>=0;--c)(s&1<<c)!==0&&a.set(o),o++;for(var c=1;c<e.length;++c){for(var l=e[c],u=l.getLeftChar().getValue(),d=11;d>=0;--d)(u&1<<d)!==0&&a.set(o),o++;if(l.getRightChar()!==null)for(var f=l.getRightChar().getValue(),d=11;d>=0;--d)(f&1<<d)!==0&&a.set(o),o++}return a},t})(),gr=(function(){function t(e,n){this.decodedInformation=e||null,this.finished=!!n}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t})(),In;(function(t){t[t.NUMERIC=0]="NUMERIC",t[t.ALPHA=1]="ALPHA",t[t.ISO_IEC_646=2]="ISO_IEC_646"})(In||(In={}));var s2=(function(){function t(){this.position=0,this.encoding=In.NUMERIC}return t.prototype.getPosition=function(){return this.position},t.prototype.setPosition=function(e){this.position=e},t.prototype.incrementPosition=function(e){this.position+=e},t.prototype.isAlpha=function(){return this.encoding===In.ALPHA},t.prototype.isNumeric=function(){return this.encoding===In.NUMERIC},t.prototype.isIsoIec646=function(){return this.encoding===In.ISO_IEC_646},t.prototype.setNumeric=function(){this.encoding=In.NUMERIC},t.prototype.setAlpha=function(){this.encoding=In.ALPHA},t.prototype.setIsoIec646=function(){this.encoding=In.ISO_IEC_646},t})(),hc=(function(){function t(e){this.newPosition=e}return t.prototype.getNewPosition=function(){return this.newPosition},t})(),c2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ln=(function(t){c2(e,t);function e(n,r){var a=t.call(this,n)||this;return a.value=r,a}return e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e})(hc),l2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),mr=(function(t){l2(e,t);function e(n,r,a){var o=t.call(this,n)||this;return o.newString=r,a===void 0?(o.remaining=!1,o.remainingValue=0):(o.remaining=!0,o.remainingValue=a),o}return e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e})(hc),u2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),jr=(function(t){u2(e,t);function e(n,r,a){var o=t.call(this,n)||this;if(r<0||r>10||a<0||a>10)throw new P;return o.firstDigit=r,o.secondDigit=a,o}return e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.FNC1=10,e})(hc),d2=(function(){function t(){}return t.fixed=function(e,n){return function(r){return t.processFixedAI(e,n,r)}},t.variable=function(e,n){return function(r){return t.processVariableAI(e,n,r)}},t.parseFieldsInGeneralPurpose=function(e){if(!e)return null;if(e.length<2)throw new D;var n=e.substring(0,2),r=this.TWO_DIGIT_DATA_LENGTH.get(n);if(r)return r(e);if(e.length<3)throw new D;var a=e.substring(0,3),o=this.THREE_DIGIT_DATA_LENGTH.get(a);if(o)return o(e);var i=this.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH.get(a);if(i)return i(e);if(e.length<4)throw new D;var s=e.substring(0,4),c=this.FOUR_DIGIT_DATA_LENGTH.get(s);if(c)return c(e);throw new D},t.processFixedAI=function(e,n,r){if(r.length<e)throw new D;var a=r.substring(0,e);if(r.length<e+n)throw new D;var o=r.substring(e,e+n),i=r.substring(e+n),s="("+a+")"+o,c=t.parseFieldsInGeneralPurpose(i);return c===null?s:s+c},t.processVariableAI=function(e,n,r){var a=r.substring(0,e),o;r.length<e+n?o=r.length:o=e+n;var i=r.substring(e,o),s=r.substring(o),c="("+a+")"+i,l=t.parseFieldsInGeneralPurpose(s);return l===null?c:c+l},t.TWO_DIGIT_DATA_LENGTH=(function(){var e=new Map;e.set("00",t.fixed(2,18)),e.set("01",t.fixed(2,14)),e.set("02",t.fixed(2,14)),e.set("10",t.variable(2,20)),e.set("11",t.fixed(2,6)),e.set("12",t.fixed(2,6)),e.set("13",t.fixed(2,6)),e.set("15",t.fixed(2,6)),e.set("16",t.fixed(2,6)),e.set("17",t.fixed(2,6)),e.set("20",t.fixed(2,2)),e.set("21",t.variable(2,20)),e.set("22",t.variable(2,29)),e.set("30",t.variable(2,8)),e.set("37",t.variable(2,8));for(var n=90;n<=99;n++)e.set(String(n),t.variable(2,30));return e})(),t.THREE_DIGIT_DATA_LENGTH=new Map([["235",t.variable(3,28)],["240",t.variable(3,30)],["241",t.variable(3,30)],["242",t.variable(3,6)],["243",t.variable(3,20)],["250",t.variable(3,30)],["251",t.variable(3,30)],["253",t.variable(3,30)],["254",t.variable(3,20)],["255",t.variable(3,25)],["400",t.variable(3,30)],["401",t.variable(3,30)],["402",t.fixed(3,17)],["403",t.variable(3,30)],["410",t.f
38ixed(3,13)],["411",t.fixed(3,13)],["412",t.fixed(3,13)],["413",t.fixed(3,13)],["414",t.fixed(3,13)],["415",t.fixed(3,13)],["416",t.fixed(3,13)],["417",t.fixed(3,13)],["420",t.variable(3,20)],["421",t.variable(3,15)],["422",t.fixed(3,3)],["423",t.variable(3,15)],["424",t.fixed(3,3)],["425",t.variable(3,15)],["426",t.fixed(3,3)],["427",t.variable(3,3)],["710",t.variable(3,20)],["711",t.variable(3,20)],["712",t.variable(3,20)],["713",t.variable(3,20)],["714",t.variable(3,20)],["715",t.variable(3,20)]]),t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=(function(){for(var e=new Map,n=310;n<=316;n++)e.set(String(n),t.fixed(4,6));for(var n=320;n<=337;n++)e.set(String(n),t.fixed(4,6));for(var n=340;n<=357;n++)e.set(String(n),t.fixed(4,6));for(var n=360;n<=369;n++)e.set(String(n),t.fixed(4,6));return e.set("390",t.variable(4,15)),e.set("391",t.variable(4,18)),e.set("392",t.variable(4,15)),e.set("393",t.variable(4,18)),e.set("394",t.fixed(4,4)),e.set("395",t.fixed(4,6)),e.set("703",t.variable(4,30)),e.set("723",t.variable(4,30)),e})(),t.FOUR_DIGIT_DATA_LENGTH=(function(){var e=new Map;return e.set("4300",t.variable(4,35)),e.set("4301",t.variable(4,35)),e.set("4302",t.variable(4,70)),e.set("4303",t.variable(4,70)),e.set("4304",t.variable(4,70)),e.set("4305",t.variable(4,70)),e.set("4306",t.variable(4,70)),e.set("4307",t.fixed(4,2)),e.set("4308",t.variable(4,30)),e.set("4309",t.fixed(4,20)),e.set("4310",t.variable(4,35)),e.set("4311",t.variable(4,35)),e.set("4312",t.variable(4,70)),e.set("4313",t.variable(4,70)),e.set("4314",t.variable(4,70)),e.set("4315",t.variable(4,70)),e.set("4316",t.variable(4,70)),e.set("4317",t.fixed(4,2)),e.set("4318",t.variable(4,20)),e.set("4319",t.variable(4,30)),e.set("4320",t.variable(4,35)),e.set("4321",t.fixed(4,1)),e.set("4322",t.fixed(4,1)),e.set("4323",t.fixed(4,1)),e.set("4324",t.fixed(4,10)),e.set("4325",t.fixed(4,10)),e.set("4326",t.fixed(4,6)),e.set("7001",t.fixed(4,13)),e.set("7002",t.variable(4,30)),e.set("7003",t.fixed(4,10)),e.set("7004",t.variable(4,4)),e.set("7005",t.variable(4,12)),e.set("7006",t.fixed(4,6)),e.set("7007",t.variable(4,12)),e.set("7008",t.variable(4,3)),e.set("7009",t.variable(4,10)),e.set("7010",t.variable(4,2)),e.set("7011",t.variable(4,10)),e.set("7020",t.variable(4,20)),e.set("7021",t.variable(4,20)),e.set("7022",t.variable(4,20)),e.set("7023",t.variable(4,30)),e.set("7040",t.fixed(4,4)),e.set("7240",t.variable(4,20)),e.set("8001",t.fixed(4,14)),e.set("8002",t.variable(4,20)),e.set("8003",t.variable(4,30)),e.set("8004",t.variable(4,30)),e.set("8005",t.fixed(4,6)),e.set("8006",t.fixed(4,18)),e.set("8007",t.variable(4,34)),e.set("8008",t.variable(4,12)),e.set("8009",t.variable(4,50)),e.set("8010",t.variable(4,30)),e.set("8011",t.variable(4,12)),e.set("8012",t.variable(4,20)),e.set("8013",t.variable(4,25)),e.set("8017",t.fixed(4,18)),e.set("8018",t.fixed(4,18)),e.set("8019",t.variable(4,10)),e.set("8020",t.variable(4,25)),e.set("8026",t.fixed(4,18)),e.set("8100",t.fixed(4,6)),e.set("8101",t.fixed(4,10)),e.set("8102",t.fixed(4,2)),e.set("8110",t.variable(4,70)),e.set("8111",t.fixed(4,4)),e.set("8112",t.variable(4,70)),e.set("8200",t.variable(4,70)),e})(),t})(),Bo=(function(){function t(e){this.current=new s2,this.buffer=new se,this.information=e}return t.prototype.decodeAllCodes=function(e,n){var r=n,a=null;do{var o=this.decodeGeneralPurposeField(r,a),i=d2.parseFieldsInGeneralPurpose(o.getNewString());if(i!==null&&e.append(i),o.isRemaining()?a=""+o.getRemainingValue():a=null,r===o.getNewPosition())break;r=o.getNewPosition()}while(!0);return e.toString()},t.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var n=e;n<e+3;++n)if(this.information.get(n))return!0;return this.information.get(e+3)},t.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var n=this.extractNumericValueFromBitArray(e,4);return n===0?new jr(this.information.getSize(),jr.FNC1,jr.FNC1):new jr(this.information.getSize(),n-1,jr.FNC1)}var r=this.extractNumericValueFromBitArray(e,7),a=Math.trunc((r-8)/11),o=(r-8)%11;return new jr(e+7,a,o)},t.prototype.extractNumericValueFromBitArray=function(e,n){return t.extractNumericValueFromBitArray(this.information,e,n)},t.extractNumericValueFromBitArray=function(e,n,r){for(var a=0,o=0;o<r;++o)e.get(n+o)&&(a|=1<<r-o-1);return a},t.prototype.decodeGeneralPurposeField=function(e,n){this.buffer.setLengthToZero(),n!==null&&this.buffer.append(n),this.current.setPosition(e);var r=this.parseBlocks();return r!==null&&r.isRemaining()?new mr(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new mr(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var e=!1,n;do{var r=this.current.getPosition();this.current.isAlpha()?(n=this.parseAlphaBlock(),e=n.isFinished()):this.current.isIsoIec646()?(n=this.parseIsoIec646Block(),e=n.isFinished()):(n=this.parseNumericBlock(),e=n.isFinished());var a=r!==this.current.getPosition();if(!a&&!e)break}while(!e);return n.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var n=void 0;return e.isSecondDigitFNC1()?n=new mr(this.current.getPosition(),this.buffer.toString()):n=new mr(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new gr(n,!0)}if(this.buffer.append(""+e.getFirstDigit()),e.isSecondDigitFNC1()){var n=new mr(this.current.getPosition(),this.buffer.toString());return new gr(n,!0)}this.buffer.append(""+e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new gr},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new mr(this.current.getPosition(),this.buffer.toString());return new gr(n,!0)}this.buffer.append(e.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 gr},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new mr(this.current.getPosition(),this.buffer.toString());return new gr(n,!0)}this.buffer.append(e.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 gr},t.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;
38if(e+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<116)return!0;if(e+8>this.information.getSize())return!1;var a=this.extractNumericValueFromBitArray(e,8);return a>=232&&a<253},t.prototype.decodeIsoIec646=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new ln(e+5,ln.FNC1);if(n>=5&&n<15)return new ln(e+5,String.fromCharCode(48+n-5));var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<90)return new ln(e+7,String.fromCharCode(r+1));if(r>=90&&r<116)return new ln(e+7,String.fromCharCode(r+7));var a=this.extractNumericValueFromBitArray(e,8),o;switch(a){case 232:o="!";break;case 233:o='"';break;case 234:o="%";break;case 235:o="&";break;case 236:o="'";break;case 237:o="(";break;case 238:o=")";break;case 239:o="*";break;case 240:o="+";break;case 241:o=",";break;case 242:o="-";break;case 243:o=".";break;case 244:o="/";break;case 245:o=":";break;case 246:o=";";break;case 247:o="<";break;case 248:o="=";break;case 249:o=">";break;case 250:o="?";break;case 251:o="_";break;case 252:o=" ";break;default:throw new P}return new ln(e+8,o)},t.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;if(e+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new ln(e+5,ln.FNC1);if(n>=5&&n<15)return new ln(e+5,String.fromCharCode(48+n-5));var r=this.extractNumericValueFromBitArray(e,6);if(r>=32&&r<58)return new ln(e+6,String.fromCharCode(r+33));var a;switch(r){case 58:a="*";break;case 59:a=",";break;case 60:a="-";break;case 61:a=".";break;case 62:a="/";break;default:throw new co("Decoding invalid alphanumeric value: "+r)}return new ln(e+6,a)},t.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<5&&n+e<this.information.getSize();++n)if(n===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+n))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var n=e;n<e+3;++n)if(this.information.get(n))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<4&&n+e<this.information.getSize();++n)if(this.information.get(e+n))return!1;return!0},t})(),c0=(function(){function t(e){this.information=e,this.generalDecoder=new Bo(e)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t})(),f2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),dn=(function(t){f2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.encodeCompressedGtin=function(n,r){n.append("(01)");var a=n.length();n.append("9"),this.encodeCompressedGtinWithoutAI(n,r,a)},e.prototype.encodeCompressedGtinWithoutAI=function(n,r,a){for(var o=0;o<4;++o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*o,10);i<100&&n.append("0"),i<10&&n.append("0"),n.append(""+i)}e.appendCheckDigit(n,a)},e.appendCheckDigit=function(n,r){for(var a=0,o=0;o<13;o++){var i=n.charAt(o+r).charCodeAt(0)-48;a+=(o&1)===0?3*i:i}a=10-a%10,a===10&&(a=0),n.append(""+a)},e.GTIN_SIZE=40,e})(c0),h2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),p2=(function(t){h2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){var n=new se;n.append("(01)");var r=n.length(),a=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return n.append(""+a),this.encodeCompressedGtinWithoutAI(n,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e})(dn),g2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),m2=(function(t){g2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){var n=new se;return this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE)},e.HEADER_SIZE=5,e})(c0),x2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),jo=(function(t){x2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.encodeCompressedWeight=function(n,r,a){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(r,a);this.addWeightCode(n,o);for(var i=this.checkWeight(o),s=1e5,c=0;c<5;++c)i<s&&n.append("0"),s=Math.trunc(s/10);n.append(""+i)},e})(dn),v2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),l0=(function(t){v2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()!==e.HEADER_SIZE+jo.GTIN_SIZE+e.WEIGHT_SIZE)throw new D;var n=new se;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+jo.GTIN_SIZE,e.WEIGHT_SIZE),n.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e})(jo),y2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),w2=(function(t){y2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.addWeightCode=function(n,r){n.append("(3103)")},e.prototype.checkWeight=function(n){return n},e})(l0),b2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),C2=(function(t){b2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.addWeightCode=function(n,r){r<1e4?n.append("(3202)"):n.append("(3203)")},e.prototype.checkWeight=function(n){return n<1e4?n:n-1e4},e})(l0),_2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),A2=(function(t){_2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+dn.GTIN_SIZE)throw new D;var n=new se;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+dn.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(392"),n.append(""+r),n.append(")");var a=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+dn.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return n.append(a.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e})(dn),E2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),S2=(function(t){E2(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+dn.GTIN_SIZE)throw new D;var n=new se;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+dn.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(393"),n.append(""+r),n.append(")");var a=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+dn.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);a<100&&n.append("0"),a<10&&n.append("0"),n.append(""+a);var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+dn.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return n.append(o.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e})(dn),I2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Yn=(function(t){I2(e,t);function e(n,r,a){var o=t.call(this,n)||this;
38return o.dateCode=a,o.firstAIdigits=r,o}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()!==e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new D;var n=new se;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(n,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),n.toString()},e.prototype.encodeCompressedDate=function(n,r){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(a!==38400){n.append("("),n.append(this.dateCode),n.append(")");var o=a%32;a=Math.trunc(a/32);var i=a%12+1;a=Math.trunc(a/12);var s=a;s<10&&n.append("0"),n.append(""+s),i<10&&n.append("0"),n.append(""+i),o<10&&n.append("0"),n.append(""+o)}},e.prototype.addWeightCode=function(n,r){n.append("("),n.append(this.firstAIdigits),n.append(""+Math.trunc(r/1e5)),n.append(")")},e.prototype.checkWeight=function(n){return n%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e})(jo);function R2(t){if(t.get(1))return new p2(t);if(!t.get(2))return new m2(t);var e=Bo.extractNumericValueFromBitArray(t,1,4);switch(e){case 4:return new w2(t);case 5:return new C2(t)}var n=Bo.extractNumericValueFromBitArray(t,1,5);switch(n){case 12:return new A2(t);case 13:return new S2(t)}var r=Bo.extractNumericValueFromBitArray(t,1,7);switch(r){case 56:return new Yn(t,"310","11");case 57:return new Yn(t,"320","11");case 58:return new Yn(t,"310","13");case 59:return new Yn(t,"320","13");case 60:return new Yn(t,"310","15");case 61:return new Yn(t,"320","15");case 62:return new Yn(t,"310","17");case 63:return new Yn(t,"320","17")}throw new co("unknown decoder: "+t)}var Lo=(function(){function t(e,n,r){this.leftChar=e,this.rightChar=n,this.finderPattern=r}return t.prototype.getLeftChar=function(){return this.leftChar},t.prototype.getRightChar=function(){return this.rightChar},t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.mustBeLast=function(){return this.rightChar===null},t.prototype.toString=function(){return"[ "+this.leftChar+", "+this.rightChar+" : "+(this.finderPattern===null?"null":this.finderPattern.getValue())+" ]"},t.equals=function(e,n){return n===null?e===null:n instanceof t?(e.leftChar===null?n.leftChar===null:e.leftChar.equals(n.leftChar))&&(e.rightChar===null?n.rightChar===null:e.rightChar.equals(n.rightChar))&&(e.finderPattern===null?n.finderPattern===null:e.finderPattern.equals(n.finderPattern)):!1},t.prototype.hashCode=function(){return t.hashNotNull(this.leftChar)^t.hashNotNull(this.rightChar)^t.hashNotNull(this.finderPattern)},t.hashNotNull=function(e){return e===null?0:e.hashCode()},t})(),T2=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},N2=function(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,o;r<a;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},O2=(function(){function t(e,n){this.pairs=N2([],T2(e),!1),this.rowNumber=n}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isEquivalent=function(e){return t.listEquals(this.getPairs(),e)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.equals=function(e,n){return e===null?n===null:n instanceof t?t.listEquals(e.pairs,n.getPairs()):!1},t.listEquals=function(e,n){return e.length!==n.length?!1:e.every(function(r,a){var o=n[a];return Lo.equals(r,o)})},t})(),D2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),lu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},uu=function(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,o;r<a;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Lr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},du=(function(t){D2(e,t);function e(){var n=t.apply(this,uu([],lu(arguments),!1))||this;return n.pairs=new Array(e.MAX_PAIRS),n.rows=new Array,n.startEnd=[0,0],n.startFromEven=!1,n}return e.prototype.decodeRow=function(n,r,a){this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(n,r))}catch(o){if(!(o instanceof D))throw o}return this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(n,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(n,r){this.pairs.length=0;for(var a=!1;!a;)try{this.pairs.push(this.retrieveNextPair(r,this.pairs,n))}catch(s){if(s instanceof D){if(this.pairs.length===0)throw s;a=!0}else throw s}if(this.checkChecksum()&&e.isValidSequence(this.pairs,!0))return this.pairs;var o=this.rows.length>0;if(this.storeRow(n),o){var i=this.checkRowsBoolean(!1);if(i!==null||(i=this.checkRowsBoolean(!0),i!==null))return i}throw new D},e.prototype.checkRowsBoolean=function(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&this.rows.reverse();var r=null;try{r=this.checkRows(new Array,0)}catch(a){if(!(a instanceof D))throw a}return n&&this.rows.reverse(),r},e.prototype.checkRows=function(n,r){for(var a,o=r;o<this.rows.length;o++){var i=this.rows[o];(a=this.pairs).push.apply(a,uu([],lu(i.getPairs()),!1));var s=i.getPairs().length;if(e.isValidSequence(this.pairs,!1)){if(this.checkChecksum())return this.pairs;n.push(i);try{return this.checkRows(n,o+1)}catch(c){if(c instanceof D)n.pop(),this.pairs.splice(this.pairs.length-s,s);else throw c}}else this.pairs.splice(this.pairs.length-s,s)}throw new D},e.isValidSequence=function(n,r){var a,o;try{for(var i=Lr(e.FINDER_PATTERN_SEQUENCES),s=i.next();!s.done;s=i.next()){var c=s.value,l=r?n.length===c.length:n.length<=c.length;if(l){for(var u=!0,d=0;d<n.length;d++)if(n[d].getFinderPattern().getValue()!==c[d]){u=!1;break}if(u)return!0}}}catch(f){a={error:f}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(a)throw a.error}}return!1},e.mayFollow=function(n,r){var a,o;if(n.length===0)return!0;try{for(var i=Lr(this.FINDER_PATTERN_SEQUENCES),s=i.next();!s.done;s=i.next()){var c=s.value;if(n.length+1<=c.length){for(var l=n.length;l<c.length;l++)if(c[l]===r){for(var u=!0,d=0;d<n.length;d++){var f=c[l-d-1],p=n[n.length-d-1].getFinderPattern().getValue();if(f!==p){u=!1;break}}if(u)return!0}}}}catch(g){a={error:g}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(a)throw a.error}}return!1},e.prototype.storeRow=function(n){for(var r=0,a=!1,o=!1;r<this.rows.length;){var i=this.rows[r];if(i.getRowNumber()>n){o=i.isEquivalent(this.pairs);break}a=i.isEquivalent(this.pairs),r++}o||a||e.isPartialRow(this.pairs,this.rows)||(this.rows.splice(r,0,new O2(this.pairs,n)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(n,r){for(var a,o,i=r.length-1;i>=0;i--){var s=r[i];if(s.getPairs().length!==n.length){var c=!0,l=function(g){if(!n.some(function(m){return Lo.equals(g,m)}))return c=!1,"break"};try{for(var u=(a=void 0,Lr(s.getPairs())),d=u.next();!d.done;d=u.next()){var f=d.value,p=l(f);if(p==="break")break}}catch(g){a={error:g}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}c&&r.splice(i,1)}}},e.isPartialRow=function(n,r){var a,o,i,s,c,l;try{for(var u=Lr(r),d=u.next();!d.done;d=u.next()){var f=d.value,p=!0;try{for(var g=(i=void 0,Lr(n)),m=g.next();!m.done;m=g.next()){var y=m.value,v=!1;try{for(var w=(c=void 0,Lr(f.getPairs())),b=w.next();!b.done;b=w.next()){var _=b.value;if(Lo.equals(y,_)){v=!0;break}}}catch(A){c={error:A}}finally{try{b&&!b.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}if(!v){p=!1;break}}}catch(A){i={error:A}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(i)throw i.error}}if(p)return!0}}catch(A){a={error:A}}
38finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(n){var r=i2.buildBitArray(n),a=R2(r),o=a.parseInformation(),i=n[0].getFinderPattern().getResultPoints(),s=n[n.length-1].getFinderPattern().getResultPoints(),c=[i[0],i[1],s[0],s[1]];return new yt(o,null,null,c,X.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var n=this.pairs[0],r=n.getLeftChar(),a=n.getRightChar();if(a===null)return!1;for(var o=a.getChecksumPortion(),i=2,s=1;s<this.pairs.length;++s){var c=this.pairs[s];o+=c.getLeftChar().getChecksumPortion(),i++;var l=c.getRightChar();l!==null&&(o+=l.getChecksumPortion(),i++)}o%=211;var u=211*(i-4)+o;return u===r.getValue()},e.getNextSecondBar=function(n,r){var a=0;return n.get(r)?(a=n.getNextUnset(r),a=n.getNextSet(a)):(a=n.getNextSet(r),a=n.getNextUnset(a)),a},e.prototype.retrieveNextPair=function(n,r,a){var o=r.length%2===0;this.startFromEven&&(o=!o);var i=null,s=null,c=!0,l=-1;do if(this.findNextPair(n,r,l),i=this.parseFoundFinderPattern(n,a,o,r),i===null)l=e.getNextSecondBar(n,this.startEnd[0]);else try{s=this.decodeDataCharacter(n,i,o,!0),c=!1}catch(d){if(d instanceof D)l=e.getNextSecondBar(n,this.startEnd[0]);else throw d}while(c);if(r.length>0&&r[r.length-1].mustBeLast())throw new D;var u=null;try{u=this.decodeDataCharacter(n,i,o,!1)}catch(d){if(d instanceof D)u=null;else throw d}return new Lo(s,u,i)},e.prototype.findNextPair=function(n,r,a){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var i=n.getSize(),s=0;if(a>=0)s=a;else if(r.length===0)s=0;else{var c=r[r.length-1];s=c.getFinderPattern().getStartEnd()[1]}var l=r.length%2!==0;this.startFromEven&&(l=!l);for(var u=!1;s<i&&(u=!n.get(s),!!u);)s++;for(var d=0,f=s,p=s;p<i;p++)if(n.get(p)!==u)o[d]++;else{if(d===3){if(l&&e.reverseCounters(o),e.isFinderPattern(o)){this.startEnd[0]=f,this.startEnd[1]=p;return}l&&e.reverseCounters(o),f+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,d--}else d++;o[d]=1,u=!u}throw new D},e.reverseCounters=function(n){for(var r=n.length,a=0;a<Math.trunc(r/2);++a){var o=n[a];n[a]=n[r-a-1],n[r-a-1]=o}},e.prototype.parseFoundFinderPattern=function(n,r,a,o){var i=0,s=0,c=0;if(a){for(var l=this.startEnd[0]-1;l>=0&&!n.get(l);)l--;l++,i=this.startEnd[0]-l,s=l,c=this.startEnd[1]}else s=this.startEnd[0],c=n.getNextUnset(this.startEnd[1]+1),i=c-this.startEnd[1];var u=this.getDecodeFinderCounters();Ne.arraycopy(u,0,u,1,u.length-1),u[0]=i;var d=0;try{d=this.parseFinderValue(u,e.FINDER_PATTERNS)}catch(b){if(b instanceof D)return null;throw b}if(!e.mayFollow(o,d))return null;if(o.length>0){var f=o[o.length-1],p=f.getFinderPattern().getStartEnd()[0],g=f.getFinderPattern().getStartEnd()[1],m=g-p,y=m/e.FINDER_PATTERN_MODULES*e.DATA_CHARACTER_MODULES,v=g+2*y*(1-e.MAX_FINDER_PATTERN_DISTANCE_VARIANCE),w=g+2*y*(1+e.MAX_FINDER_PATTERN_DISTANCE_VARIANCE);if(s<v||s>w)return null}return new s0(d,[s,c],s,c,r)},e.prototype.decodeDataCharacter=function(n,r,a,o){for(var i=this.getDataCharacterCounters(),s=0;s<i.length;s++)i[s]=0;if(o)e.recordPatternInReverse(n,r.getStartEnd()[0],i);else{e.recordPattern(n,r.getStartEnd()[1],i);for(var c=0,l=i.length-1;c<l;c++,l--){var u=i[c];i[c]=i[l],i[l]=u}}var d=17,f=xe.sum(new Int32Array(i))/d,p=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(f-p)/p>.3)throw new D;for(var g=this.getOddCounts(),m=this.getEvenCounts(),y=this.getOddRoundingErrors(),v=this.getEvenRoundingErrors(),c=0;c<i.length;c++){var w=1*i[c]/f,b=Math.trunc(w+.5);if(b<1){if(w<.3)throw new D;b=1}else if(b>8){if(w>8.7)throw new D;b=8}var _=Math.trunc(c/2);(c&1)===0?(g[_]=b,y[_]=w-b):(m[_]=b,v[_]=w-b)}this.adjustOddEvenCounts(d);for(var A=4*r.getValue()+(a?0:2)+(o?0:1)-1,T=0,S=0,c=g.length-1;c>=0;c--){if(e.isNotA1left(r,a,o)){var E=e.WEIGHTS[A][2*c];S+=g[c]*E}T+=g[c]}for(var F=0,c=m.length-1;c>=0;c--)if(e.isNotA1left(r,a,o)){var E=e.WEIGHTS[A][2*c+1];F+=m[c]*E}var k=S+F;if((T&1)!==0||T>13||T<4)throw new D;var W=Math.trunc((13-T)/2),z=e.SYMBOL_WIDEST[W],L=9-z,le=Vr.getRSSvalue(g,z,!0),fe=Vr.getRSSvalue(m,L,!1),Ve=e.EVEN_TOTAL_SUBSET[W],ne=e.GSUM[W],oe=le*Ve+fe+ne;return new Go(oe,k)},e.isNotA1left=function(n,r,a){return!(n.getValue()===0&&r&&a)},e.prototype.adjustOddEvenCounts=function(n){var r=xe.sum(new Int32Array(this.getOddCounts())),a=xe.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1;r>13?i=!0:r<4&&(o=!0);var s=!1,c=!1;a>13?c=!0:a<4&&(s=!0);var l=r+a-n,u=(r&1)===1,d=(a&1)===0;if(l===1)if(u){if(d)throw new D;i=!0}else{if(!d)throw new D;c=!0}else if(l===-1)if(u){if(d)throw new D;o=!0}else{if(!d)throw new D;s=!0}else if(l===0){if(u){if(!d)throw new D;r<a?(o=!0,c=!0):(i=!0,s=!0)}else if(d)throw new D}else throw new D;if(o){if(i)throw new D;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}
38if(i&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(c)throw new D;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}c&&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,e.FINDER_PATTERN_MODULES=15,e.DATA_CHARACTER_MODULES=17,e.MAX_FINDER_PATTERN_DISTANCE_VARIANCE=.1,e})(wr),M2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),F2=(function(t){M2(e,t);function e(n,r,a){var o=t.call(this,n,r)||this;return o.count=0,o.finderPattern=a,o}return e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e})(Go),P2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),k2=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},B2=function(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,o;r<a;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Qi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fu=(function(t){P2(e,t);function e(){var n=t.apply(this,B2([],k2(arguments),!1))||this;return n.possibleLeftPairs=[],n.possibleRightPairs=[],n}return e.prototype.decodeRow=function(n,r,a){var o,i,s,c,l=this.decodePair(r,!1,n,a);e.addOrTally(this.possibleLeftPairs,l),r.reverse();var u=this.decodePair(r,!0,n,a);e.addOrTally(this.possibleRightPairs,u),r.reverse();try{for(var d=Qi(this.possibleLeftPairs),f=d.next();!f.done;f=d.next()){var p=f.value;if(p.getCount()>1)try{for(var g=(s=void 0,Qi(this.possibleRightPairs)),m=g.next();!m.done;m=g.next()){var y=m.value;if(y.getCount()>1&&e.checkChecksum(p,y))return e.constructResult(p,y)}}catch(v){s={error:v}}finally{try{m&&!m.done&&(c=g.return)&&c.call(g)}finally{if(s)throw s.error}}}}catch(v){o={error:v}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}throw new D},e.addOrTally=function(n,r){var a,o;if(r!==null){var i=!1;try{for(var s=Qi(n),c=s.next();!c.done;c=s.next()){var l=c.value;if(l.getValue()===r.getValue()){l.incrementCount(),i=!0;break}}}catch(u){a={error:u}}
38finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}i||n.push(r)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(n,r){for(var a=4537077*n.getValue()+r.getValue(),o=String(a),i=new se,s=13-o.length;s>0;s--)i.append("0");i.append(o);for(var c=0,s=0;s<13;s++){var l=i.charAt(s).charCodeAt(0)-48;c+=(s&1)===0?3*l:l}c=10-c%10,c===10&&(c=0),i.append(c.toString());var u=n.getFinderPattern().getResultPoints(),d=r.getFinderPattern().getResultPoints();return new yt(i.toString(),null,0,[u[0],u[1],d[0],d[1]],X.RSS_14,new Date().getTime())},e.checkChecksum=function(n,r){var a=(n.getChecksumPortion()+16*r.getChecksumPortion())%79,o=9*n.getFinderPattern().getValue()+r.getFinderPattern().getValue();return o>72&&o--,o>8&&o--,a===o},e.prototype.decodePair=function(n,r,a,o){try{var i=this.findFinderPattern(n,r),s=this.parseFoundFinderPattern(n,a,r,i),c=o==null?null:o.get(be.NEED_RESULT_POINT_CALLBACK);if(c!=null){var l=(i[0]+i[1]-1)/2;r&&(l=n.getSize()-1-l),c.foundPossibleResultPoint(new $(l,a))}var u=this.decodeDataCharacter(n,s,!0),d=this.decodeDataCharacter(n,s,!1);return new F2(1597*u.getValue()+d.getValue(),u.getChecksumPortion()+4*d.getChecksumPortion(),s)}catch(f){if(f instanceof D)return null;throw f}},e.prototype.decodeDataCharacter=function(n,r,a){for(var o=this.getDataCharacterCounters(),i=0;i<o.length;i++)o[i]=0;if(a)pt.recordPatternInReverse(n,r.getStartEnd()[0],o);else{pt.recordPattern(n,r.getStartEnd()[1],o);for(var s=0,c=o.length-1;s<c;s++,c--){var l=o[s];o[s]=o[c],o[c]=l}}for(var u=a?16:15,d=xe.sum(new Int32Array(o))/u,f=this.getOddCounts(),p=this.getEvenCounts(),g=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors(),s=0;s<o.length;s++){var y=o[s]/d,v=Math.floor(y+.5);v<1?v=1:v>8&&(v=8);var w=Math.floor(s/2);(s&1)===0?(f[w]=v,g[w]=y-v):(p[w]=v,m[w]=y-v)}this.adjustOddEvenCounts(a,u);for(var b=0,_=0,s=f.length-1;s>=0;s--)_*=9,_+=f[s],b+=f[s];for(var A=0,T=0,s=p.length-1;s>=0;s--)A*=9,A+=p[s],T+=p[s];var S=_+3*A;if(a){if((b&1)!==0||b>12||b<4)throw new D;var E=(12-b)/2,F=e.OUTSIDE_ODD_WIDEST[E],k=9-F,W=Vr.getRSSvalue(f,F,!1),z=Vr.getRSSvalue(p,k,!0),L=e.OUTSIDE_EVEN_TOTAL_SUBSET[E],le=e.OUTSIDE_GSUM[E];return new Go(W*L+z+le,S)}else{if((T&1)!==0||T>10||T<4)throw new D;var E=(10-T)/2,F=e.INSIDE_ODD_WIDEST[E],k=9-F,W=Vr.getRSSvalue(f,F,!0),z=Vr.getRSSvalue(p,k,!1),fe=e.INSIDE_ODD_TOTAL_SUBSET[E],le=e.INSIDE_GSUM[E];return new Go(z*fe+W+le,S)}},e.prototype.findFinderPattern=function(n,r){var a=this.getDecodeFinderCounters();a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var o=n.getSize(),i=!1,s=0;s<o&&(i=!n.get(s),r!==i);)s++;for(var c=0,l=s,u=s;u<o;u++)if(n.get(u)!==i)a[c]++;else{if(c===3){if(wr.isFinderPattern(a))return[l,u];l+=a[0]+a[1],a[0]=a[2],a[1]=a[3],a[2]=0,a[3]=0,c--}else c++;a[c]=1,i=!i}throw new D},e.prototype.parseFoundFinderPattern=function(n,r,a,o){for(var i=n.get(o[0]),s=o[0]-1;s>=0&&i!==n.get(s);)s--;s++;var c=o[0]-s,l=this.getDecodeFinderCounters(),u=new Int32Array(l.length);Ne.arraycopy(l,0,u,1,l.length-1),u[0]=c;var d=this.parseFinderValue(u,e.FINDER_PATTERNS),f=s,p=o[1];return a&&(f=n.getSize()-1-f,p=n.getSize()-1-p),new s0(d,[s,o[1]],f,p,r)},e.prototype.adjustOddEvenCounts=function(n,r){var a=xe.sum(new Int32Array(this.getOddCounts())),o=xe.sum(new Int32Array(this.getEvenCounts())),i=!1,s=!1,c=!1,l=!1;n?(a>12?s=!0:a<4&&(i=!0),o>12?l=!0:o<4&&(c=!0)):(a>11?s=!0:a<5&&(i=!0),o>10?l=!0:o<4&&(c=!0));var u=a+o-r,d=(a&1)===(n?1:0),f=(o&1)===1;if(u===1)if(d){if(f)throw new D;s=!0}else{if(!f)throw new D;l=!0}else if(u===-1)if(d){if(f)throw new D;i=!0}else{if(!f)throw new D;c=!0}else if(u===0){if(d){if(!f)throw new D;a<o?(i=!0,l=!0):(s=!0,c=!0)}else if(f)throw new D}else throw new D;if(i){if(s)throw new D;wr.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&wr.decrement(this.getOddCounts(),this.getOddRoundingErrors()),c){if(l)throw new D;wr.increment(this.getEvenCounts(),this.getOddRoundingErrors())}l&&wr.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.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])],e})(wr),j2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ur=(function(t){j2(e,t);function e(n){var r=t.call(this)||this;r.readers=[];var a=n?n.get(be.POSSIBLE_FORMATS):null,o=n&&n.get(be.ASSUME_CODE_39_CHECK_DIGIT)!==void 0,i=n&&n.get(be.ENABLE_CODE_39_EXTENDED_MODE)!==void 0;return a&&((a.includes(X.EAN_13)||a.includes(X.UPC_A)||a.includes(X.EAN_8)||a.includes(X.UPC_E))&&r.readers.push(new qi(n)),a.includes(X.CODE_39)&&r.readers.push(new eu(o,i)),a.includes(X.CODE_93)&&r.readers.push(new tu),a.includes(X.CODE_128)&&r.readers.push(new Jl),a.includes(X.ITF)&&r.readers.push(new nu),a.includes(X.CODABAR)&&r.readers.push(new n2),a.includes(X.RSS_14)&&r.readers.push(new fu),a.includes(X.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new du))),r.readers.length===0&&(r.readers.push(new qi(n)),r.readers.push(new eu),r.readers.push(new tu),r.readers.push(new qi(n)),r.readers.push(new Jl),r.readers.push(new nu),r.readers.push(new fu),r.readers.push(new du)),r}return e.prototype.decodeRow=function(n,r,a){for(var o=0;o<this.readers.length;o++)try{return this.readers[o].decodeRow(n,r,a)}catch{}throw new D},e.prototype.reset=function(){this.readers.forEach(function(n){return n.reset()})},e})(pt),L2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){L2(e,t);function e(n,r){return n===void 0&&(n=500),t.call(this,new Ur(r),n,r)||this}return e})(ra);var hu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ae=(function(){function t(e,n,r){this.ecCodewords=e,this.ecBlocks=[n],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t})(),ve=(function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t})(),V2=(function(){function t(e,n,r,a,o,i){var s,c;this.versionNumber=e,this.symbolSizeRows=n,this.symbolSizeColumns=r,this.dataRegionSizeRows=a,this.dataRegionSizeColumns=o,this.ecBlocks=i;var l=0,u=i.getECCodewords(),d=i.getECBlocks();try{for(var f=hu(d),p=f.next();!p.done;p=f.next()){var g=p.value;l+=g.getCount()*(g.getDataCodewords()+u)}}catch(m){s={error:m}}finally{try{p&&!p.done&&(c=f.return)&&c.call(f)}finally{if(s)throw s.error}}this.totalCodewords=l}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,n){var r,a;if((e&1)!==0||(n&1)!==0)throw new P;try{for(var o=hu(t.VERSIONS),i=o.next();!i.done;i=o.next()){var s=i.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===n)return s}}catch(c){r={error:c}}finally{try{i&&!i.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}throw new P},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new Ae(5,new ve(1,3))),new t(2,12,12,10,10,new Ae(7,new ve(1,5))),new t(3,14,14,12,12,new Ae(10,new ve(1,8))),new t(4,16,16,14,14,new Ae(12,new ve(1,12))),new t(5,18,18,16,16,new Ae(14,new ve(1,18))),new t(6,20,20,18,18,new Ae(18,new ve(1,22))),new t(7,22,22,20,20,new Ae(20,new ve(1,30))),new t(8,24,24,22,22,new Ae(24,new ve(1,36))),new t(9,26,26,24,24,new Ae(28,new ve(1,44))),new t(10,32,32,14,14,new Ae(36,new ve(1,62))),new t(11,36,36,16,16,new Ae(42,new ve(1,86))),new t(12,40,40,18,18,new Ae(48,new ve(1,114))),new t(13,44,44,20,20,new Ae(56,new ve(1,144))),new t(14,48,48,22,22,new Ae(68,new ve(1,174))),new t(15,52,52,24,24,new Ae(42,new ve(2,102))),new t(16,64,64,14,14,new Ae(56,new ve(2,140))),new t(17,72,72,16,16,new Ae(36,new ve(4,92))),new t(18,80,80,18,18,new Ae(48,new ve(4,114))),new t(19,88,88,20,20,new Ae(56,new ve(4,144))),new t(20,96,96,22,22,new Ae(68,new ve(4,174))),new t(21,104,104,24,24,new Ae(56,new ve(6,136))),new t(22,120,120,18,18,new Ae(68,new ve(6,175))),new t(23,132,132,20,20,new Ae(62,
38new ve(8,163))),new t(24,144,144,22,22,new Ae(62,new ve(8,156),new ve(2,155))),new t(25,8,18,6,16,new Ae(7,new ve(1,5))),new t(26,8,32,6,14,new Ae(11,new ve(1,10))),new t(27,12,26,10,24,new Ae(14,new ve(1,16))),new t(28,12,36,10,16,new Ae(18,new ve(1,22))),new t(29,16,36,14,16,new Ae(24,new ve(1,32))),new t(30,16,48,14,22,new Ae(28,new ve(1,49)))]},t.VERSIONS=t.buildVersions(),t})(),U2=(function(){function t(e){var n=e.getHeight();if(n<8||n>144||(n&1)!==0)throw new P;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new on(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(e){var n=e.getHeight(),r=e.getWidth();return V2.getVersionForDimensions(n,r)},t.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),n=0,r=4,a=0,o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth(),s=!1,c=!1,l=!1,u=!1;do if(r===o&&a===0&&!s)e[n++]=this.readCorner1(o,i)&255,r-=2,a+=2,s=!0;else if(r===o-2&&a===0&&(i&3)!==0&&!c)e[n++]=this.readCorner2(o,i)&255,r-=2,a+=2,c=!0;else if(r===o+4&&a===2&&(i&7)===0&&!l)e[n++]=this.readCorner3(o,i)&255,r-=2,a+=2,l=!0;else if(r===o-2&&a===0&&(i&7)===4&&!u)e[n++]=this.readCorner4(o,i)&255,r-=2,a+=2,u=!0;else{do r<o&&a>=0&&!this.readMappingMatrix.get(a,r)&&(e[n++]=this.readUtah(r,a,o,i)&255),r-=2,a+=2;while(r>=0&&a<i);r+=1,a+=3;do r>=0&&a<i&&!this.readMappingMatrix.get(a,r)&&(e[n++]=this.readUtah(r,a,o,i)&255),r+=2,a-=2;while(r<o&&a>=0);r+=3,a+=1}while(r<o||a<i);if(n!==this.version.getTotalCodewords())throw new P;return e},t.prototype.readModule=function(e,n,r,a){return e<0&&(e+=r,n+=4-(r+4&7)),n<0&&(n+=a,e+=4-(a+4&7)),this.readMappingMatrix.set(n,e),this.mappingBitMatrix.get(n,e)},t.prototype.readUtah=function(e,n,r,a){var o=0;return this.readModule(e-2,n-2,r,a)&&(o|=1),o<<=1,this.readModule(e-2,n-1,r,a)&&(o|=1),o<<=1,this.readModule(e-1,n-2,r,a)&&(o|=1),o<<=1,this.readModule(e-1,n-1,r,a)&&(o|=1),o<<=1,this.readModule(e-1,n,r,a)&&(o|=1),o<<=1,this.readModule(e,n-2,r,a)&&(o|=1),o<<=1,this.readModule(e,n-1,r,a)&&(o|=1),o<<=1,this.readModule(e,n,r,a)&&(o|=1),o},t.prototype.readCorner1=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,1,e,n)&&(r|=1),r<<=1,this.readModule(e-1,2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.readCorner2=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-4,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner3=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-3,e,n)&&(r|=1),r<<=1,this.readModule(1,n-2,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner4=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.extractDataRegion=function(e){var n=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(e.getHeight()!==n)throw new Q("Dimension of bitMatrix must match the version size");for(var a=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=n/a|0,s=r/o|0,c=i*a,l=s*o,u=new on(l,c),d=0;d<i;++d)for(var f=d*a,p=0;p<s;++p)for(var g=p*o,m=0;m<a;++m)for(var y=d*(a+2)+1+m,v=f+m,w=0;w<o;++w){var b=p*(o+2)+1+w;if(e.get(b,y)){var _=g+w;u.set(_,v)}}return u},t})(),pu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
38,z2=(function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n){var r,a,o,i,s=n.getECBlocks(),c=0,l=s.getECBlocks();try{for(var u=pu(l),d=u.next();!d.done;d=u.next()){var f=d.value;c+=f.getCount()}}catch(le){r={error:le}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}var p=new Array(c),g=0;try{for(var m=pu(l),y=m.next();!y.done;y=m.next())for(var f=y.value,v=0;v<f.getCount();v++){var w=f.getDataCodewords(),b=s.getECCodewords()+w;p[g++]=new t(w,new Uint8Array(b))}}catch(le){o={error:le}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}for(var _=p[0].codewords.length,A=_-s.getECCodewords(),T=A-1,S=0,v=0;v<T;v++)for(var E=0;E<g;E++)p[E].codewords[v]=e[S++];for(var F=n.getVersionNumber()===24,k=F?8:g,E=0;E<k;E++)p[E].codewords[A-1]=e[S++];for(var W=p[0].codewords.length,v=A;v<W;v++)for(var E=0;E<g;E++){var z=F?(E+8)%g:E,L=F&&z>7?v-1:v;p[z].codewords[L]=e[S++]}if(S!==e.length)throw new Q;return p},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t})(),pc=(function(){function t(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Q(""+e);var n=0,r=this.bitOffset,a=this.byteOffset,o=this.bytes;if(r>0){var i=8-r,s=e<i?e:i,c=i-s,l=255>>8-s<<c;n=(o[a]&l)>>c,e-=s,r+=s,r===8&&(r=0,a++)}if(e>0){for(;e>=8;)n=n<<8|o[a]&255,a++,e-=8;if(e>0){var c=8-e,l=255>>c<<c;n=n<<e|(o[a]&l)>>c,r+=e}}return this.bitOffset=r,this.byteOffset=a,n},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t})(),ct;(function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"})(ct||(ct={}));var W2=(function(){function t(){}return t.decode=function(e){var n=new pc(e),r=new se,a=new se,o=new Array,i=ct.ASCII_ENCODE;do if(i===ct.ASCII_ENCODE)i=this.decodeAsciiSegment(n,r,a);else{switch(i){case ct.C40_ENCODE:this.decodeC40Segment(n,r);break;case ct.TEXT_ENCODE:this.decodeTextSegment(n,r);break;case ct.ANSIX12_ENCODE:this.decodeAnsiX12Segment(n,r);break;case ct.EDIFACT_ENCODE:this.decodeEdifactSegment(n,r);break;case ct.BASE256_ENCODE:this.decodeBase256Segment(n,r,o);break;default:throw new P}i=ct.ASCII_ENCODE}while(i!==ct.PAD_ENCODE&&n.available()>0);return a.length()>0&&r.append(a.toString()),new aa(e,r.toString(),o.length===0?null:o,null)},t.decodeAsciiSegment=function(e,n,r){var a=!1;do{var o=e.readBits(8);if(o===0)throw new P;if(o<=128)return a&&(o+=128),n.append(String.fromCharCode(o-1)),ct.ASCII_ENCODE;if(o===129)return ct.PAD_ENCODE;if(o<=229){var i=o-130;i<10&&n.append("0"),n.append(""+i)}else switch(o){case 230:return ct.C40_ENCODE;case 231:return ct.BASE256_ENCODE;case 232:n.append("�");break;case 233:case 234:break;case 235:a=!0;break;case 236:n.append("[)>�05�"),r.insert(0,"��");break;case 237:n.append("[)>�06�"),r.insert(0,"��");break;case 238:return ct.ANSIX12_ENCODE;case 239:return ct.TEXT_ENCODE;case 240:return ct.EDIFACT_ENCODE;case 241:break;default:if(o!==254||e.available()!==0)throw new P;break}}while(e.available()>0);return ct.ASCII_ENCODE},t.decodeC40Segment=function(e,n){var r=!1,a=[],o=0;do{if(e.available()===8)return;var i=e.readBits(8);if(i===254)return;this.parseTwoBytes(i,e.readBits(8),a);for(var s=0;s<3;s++){var c=a[s];switch(o){case 0:if(c<3)o=c+1;else if(c<this.C40_BASIC_SET_CHARS.length){var l=this.C40_BASIC_SET_CHARS[c];r?(n.append(String.fromCharCode(l.charCodeAt(0)+128)),r=!1):n.append(l)}else throw new P;break;case 1:r?(n.append(String.fromCharCode(c+128)),r=!1):n.append(String.fromCharCode(c)),o=0;break;case 2:if(c<this.C40_SHIFT2_SET_CHARS.length){var l=this.C40_SHIFT2_SET_CHARS[c];r?(n.append(String.fromCharCode(l.charCodeAt(0)+128)),r=!1):n.append(l)}else switch(c){case 27:n.append("�");break;case 30:r=!0;break;default:throw new P}o=0;break;case 3:r?(n.append(String.fromCharCode(c+224)),r=!1):n.append(String.fromCharCode(c+96)),o=0;break;default:throw new P}}}while(e.available()>0)},t.decodeTextSegment=function(e,n){var r=!1,a=[],o=0;do{if(e.available()===8)return;var i=e.readBits(8);if(i===254)return;this.parseTwoBytes(i,e.readBits(8),a);for(var s=0;s<3;s++){var c=a[s];switch(o){case 0:if(c<3)o=c+1;else if(c<this.TEXT_BASIC_SET_CHARS.length){var l=this.TEXT_BASIC_SET_CHARS[c];r?(n.append(String.fromCharCode(l.charCodeAt(0)+128)),r=!1):n.append(l)}else throw new P;break;case 1:r?(n.append(String.fromCharCode(c+128)),r=!1):n.append(String.fromCharCode(c)),o=0;break;case 2:if(c<this.TEXT_SHIFT2_SET_CHARS.length){var l=this.TEXT_SHIFT2_SET_CHARS[c];r?(n.append(String.fromCharCode(l.charCodeAt(0)+128)),r=!1):n.append(l)}else switch(c){case 27:n.append("�");break;case 30:r=!0;break;default:throw new P}o=0;break;case 3:if(c<this.TEXT_SHIFT3_SET_CHARS.length){var l=this.TEXT_SHIFT3_SET_CHARS[c];r?(n.append(String.fromCharCode(l.charCodeAt(0)+128)),r=!1):n.append(l),o=0}else throw new P;break;default:throw new P}}}while(e.available()>0)},t.decodeAnsiX12Segment=function(e,n){var r=[];do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),r);for(var o=0;o<3;o++){var i=r[o];switch(i){case 0:n.append("\r");break;case 1:n.append("*");break;case 2:n.append(">");break;case 3:n.append(" ");break;default:if(i<14)n.append(String.fromCharCode(i+44));else if(i<40)n.append(String.fromCharCode(i+51));else throw new P;break}}}while(e.available()>0)},t.parseTwoBytes=function(e,n,r){var a=(e<<8)+n-1,o=Math.floor(a/1600);r[0]=o,a-=o*1600,o=Math.floor(a/40),r[1]=o,r[2]=a-o*40},t.decodeEdifactSegment=function(e,n){do{if(e.available()<=16)return;for(var r=0;r<4;r++){var a=e.readBits(6);if(a===31){var o=8-e.getBitOffset();o!==8&&e.readBits(o);return}(a&32)===0&&(a|=64),n.append(String.fromCharCode(a))}}while(e.available()>0)},t.decodeBase256Segment=function(e,n,r){var a=1+e.getByteOffset(),o=this.unrandomize255State(e.readBits(8),a++),i;if(o===0?i=e.available()/8|0:o<250?i=o:i=250*(o-249)+this.unrandomize255State(e.readBits(8),a++),i<0)throw new P;for(var s=new Uint8Array(i),c=0;c<i;c++){if(e.available()<8)throw new P;s[c]=this.unrandomize255State(e.readBits(8),a++)}r.push(s);try{n.append(Ut.decode(s,de.ISO88591))}catch(l){throw new co("Platform does not support required encoding: "+l.message)}},t.unrandomize255State=function(e,n){var r=149*n%255+1,a=e-r;return a>=0?a:a+256},t.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"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.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"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.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","{","|","}","~","�"],t})(),H2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
38,$2=(function(){function t(){this.rsDecoder=new oa(St.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(e){var n,r,a=new U2(e),o=a.getVersion(),i=a.readCodewords(),s=z2.getDataBlocks(i,o),c=0;try{for(var l=H2(s),u=l.next();!u.done;u=l.next()){var d=u.value;c+=d.getNumDataCodewords()}}catch(b){n={error:b}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}for(var f=new Uint8Array(c),p=s.length,g=0;g<p;g++){var m=s[g],y=m.getCodewords(),v=m.getNumDataCodewords();this.correctErrors(y,v);for(var w=0;w<v;w++)f[w*p+g]=y[w]}return W2.decode(f)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new Ke}for(var a=0;a<n;a++)e[a]=r[a]},t})(),G2=(function(){function t(e){this.image=e,this.rectangleDetector=new Ts(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),n=this.detectSolid1(e);if(n=this.detectSolid2(n),n[3]=this.correctTopRight(n),!n[3])throw new D;n=this.shiftToModuleCenter(n);var r=n[0],a=n[1],o=n[2],i=n[3],s=this.transitionsBetween(r,i)+1,c=this.transitionsBetween(o,i)+1;(s&1)===1&&(s+=1),(c&1)===1&&(c+=1),4*s<7*c&&4*c<7*s&&(s=c=Math.max(s,c));var l=t.sampleGrid(this.image,r,a,o,i,s,c);return new si(l,[r,a,o,i])},t.shiftPoint=function(e,n,r){var a=(n.getX()-e.getX())/(r+1),o=(n.getY()-e.getY())/(r+1);return new $(e.getX()+a,e.getY()+o)},t.moveAway=function(e,n,r){var a=e.getX(),o=e.getY();return a<n?a-=1:a+=1,o<r?o-=1:o+=1,new $(a,o)},t.prototype.detectSolid1=function(e){var n=e[0],r=e[1],a=e[3],o=e[2],i=this.transitionsBetween(n,r),s=this.transitionsBetween(r,a),c=this.transitionsBetween(a,o),l=this.transitionsBetween(o,n),u=i,d=[o,n,r,a];return u>s&&(u=s,d[0]=n,d[1]=r,d[2]=a,d[3]=o),u>c&&(u=c,d[0]=r,d[1]=a,d[2]=o,d[3]=n),u>l&&(d[0]=a,d[1]=o,d[2]=n,d[3]=r),d},t.prototype.detectSolid2=function(e){var n=e[0],r=e[1],a=e[2],o=e[3],i=this.transitionsBetween(n,o),s=t.shiftPoint(r,a,(i+1)*4),c=t.shiftPoint(a,r,(i+1)*4),l=this.transitionsBetween(s,n),u=this.transitionsBetween(c,o);return l<u?(e[0]=n,e[1]=r,e[2]=a,e[3]=o):(e[0]=r,e[1]=a,e[2]=o,e[3]=n),e},t.prototype.correctTopRight=function(e){var n=e[0],r=e[1],a=e[2],o=e[3],i=this.transitionsBetween(n,o),s=this.transitionsBetween(r,o),c=t.shiftPoint(n,r,(s+1)*4),l=t.shiftPoint(a,r,(i+1)*4);i=this.transitionsBetween(c,o),s=this.transitionsBetween(l,o);var u=new $(o.getX()+(a.getX()-r.getX())/(i+1),o.getY()+(a.getY()-r.getY())/(i+1)),d=new $(o.getX()+(n.getX()-r.getX())/(s+1),o.getY()+(n.getY()-r.getY())/(s+1));if(!this.isValid(u))return this.isValid(d)?d:null;if(!this.isValid(d))return u;var f=this.transitionsBetween(c,u)+this.transitionsBetween(l,u),p=this.transitionsBetween(c,d)+this.transitionsBetween(l,d);return f>p?u:d},t.prototype.shiftToModuleCenter=function(e){var n=e[0],r=e[1],a=e[2],o=e[3],i=this.transitionsBetween(n,o)+1,s=this.transitionsBetween(a,o)+1,c=t.shiftPoint(n,r,s*4),l=t.shiftPoint(a,r,i*4);i=this.transitionsBetween(c,o)+1,s=this.transitionsBetween(l,o)+1,(i&1)===1&&(i+=1),(s&1)===1&&(s+=1);var u=(n.getX()+r.getX()+a.getX()+o.getX())/4,d=(n.getY()+r.getY()+a.getY()+o.getY())/4;n=t.moveAway(n,u,d),r=t.moveAway(r,u,d),a=t.moveAway(a,u,d),o=t.moveAway(o,u,d);var f,p;return c=t.shiftPoint(n,r,s*4),c=t.shiftPoint(c,o,i*4),f=t.shiftPoint(r,n,s*4),f=t.shiftPoint(f,a,i*4),l=t.shiftPoint(a,o,s*4),l=t.shiftPoint(l,r,i*4),p=t.shiftPoint(o,a,s*4),p=t.shiftPoint(p,n,i*4),[c,f,l,p]},t.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},t.sampleGrid=function(e,n,r,a,o,i,s){var c=ci.getInstance();return c.sampleGrid(e,i,s,.5,.5,i-.5,.5,i-.5,s-.5,.5,s-.5,n.getX(),n.getY(),o.getX(),o.getY(),a.getX(),a.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(e,n){var r=Math.trunc(e.getX()),a=Math.trunc(e.getY()),o=Math.trunc(n.getX()),i=Math.trunc(n.getY()),s=Math.abs(i-a)>Math.abs(o-r);if(s){var c=r;r=a,a=c,c=o,o=i,i=c}for(var l=Math.abs(o-r),u=Math.abs(i-a),d=-l/2,f=a<i?1:-1,p=r<o?1:-1,g=0,m=this.image.get(s?a:r,s?r:a),y=r,v=a;y!==o;y+=p){var w=this.image.get(s?v:y,s?y:v);if(w!==m&&(g++,m=w),d+=u,d>0){if(v===i)break;v+=f,d-=l}}return g},t})(),Yo=(function(){function t(){this.decoder=new $2}
38return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r,a;if(n!=null&&n.has(be.PURE_BARCODE)){var o=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decode(o),a=t.NO_POINTS}else{var i=new G2(e.getBlackMatrix()).detect();r=this.decoder.decode(i.getBits()),a=i.getPoints()}var s=r.getRawBytes(),c=new yt(r.getText(),s,8*s.length,a,X.DATA_MATRIX,Ne.currentTimeMillis()),l=r.getByteSegments();l!=null&&c.putMetadata(tt.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!=null&&c.putMetadata(tt.ERROR_CORRECTION_LEVEL,u),c},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n==null||r==null)throw new D;var a=this.moduleSize(n,e),o=n[1],i=r[1],s=n[0],c=r[0],l=(c-s+1)/a,u=(i-o+1)/a;if(l<=0||u<=0)throw new D;var d=a/2;o+=d,s+=d;for(var f=new on(l,u),p=0;p<u;p++)for(var g=o+p*a,m=0;m<l;m++)e.get(s+m*a,g)&&f.set(m,p);return f},t.moduleSize=function(e,n){for(var r=n.getWidth(),a=e[0],o=e[1];a<r&&n.get(a,o);)a++;if(a===r)throw new D;var i=a-e[0];if(i===0)throw new D;return i},t.NO_POINTS=[],t})(),Y2=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){Y2(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new Yo,n)||this}return e})(ra);var zr;(function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"})(zr||(zr={}));var X2=(function(){function t(e,n,r){this.value=e,this.stringValue=n,this.bits=r,t.FOR_BITS.set(r,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new et(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new Q;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(zr.L,"L",1),t.M=new t(zr.M,"M",0),t.Q=new t(zr.Q,"Q",3),t.H=new t(zr.H,"H",2),t})(),K2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u0=(function(){function t(e){this.errorCorrectionLevel=X2.forBits(e>>3&3),this.dataMask=e&7}return t.numBitsDiffering=function(e,n){return ce.bitCount(e^n)},t.decodeFormatInformation=function(e,n){var r=t.doDecodeFormatInformation(e,n);return r!==null?r:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,n^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,n){var r,a,o=Number.MAX_SAFE_INTEGER,i=0;try{for(var s=K2(t.FORMAT_INFO_DECODE_LOOKUP),c=s.next();!c.done;c=s.next()){var l=c.value,u=l[0];if(u===e||u===n)return new t(l[1]);var d=t.numBitsDiffering(e,u);d<o&&(i=l[1],o=d),e!==n&&(d=t.numBitsDiffering(n,u),d<o&&(i=l[1],o=d))}}catch(f){r={error:f}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return o<=3?new t(i):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.errorCorrectionLevel===n.errorCorrectionLevel&&this.dataMask===n.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.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])],t})(),Z2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},N=(function(){function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.ecCodewordsPerBlock=e,this.ecBlocks=n}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var e,n,r=0,a=this.ecBlocks;try{for(var o=Z2(a),i=o.next();!i.done;i=o.next()){var s=i.value;r+=s.getCount()}}catch(c){e={error:c}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t})(),C=(function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t})(),q2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sr=(function(){function t(e,n){for(var r,a,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];this.versionNumber=e,this.alignmentPatternCenters=n,this.ecBlocks=o;var s=0,c=o[0].getECCodewordsPerBlock(),l=o[0].getECBlocks();try{for(var u=q2(l),d=u.next();!d.done;d=u.next()){var f=d.value;s+=f.getCount()*(f.getDataCodewords()+c)}}catch(p){r={error:p}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}this.totalCodewords=s}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},t.getProvisionalVersionForDimension=function(e){if(e%4!==1)throw new P;try{return this.getVersionForNumber((e-17)/4)}catch{throw new P}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new Q;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var n=Number.MAX_SAFE_INTEGER,r=0,a=0;a<t.VERSION_DECODE_INFO.length;a++){var o=t.VERSION_DECODE_INFO[a];if(o===e)return t.getVersionForNumber(a+7);var i=u0.numBitsDiffering(e,o);i<n&&(r=a+7,n=i)}return n<=3?t.getVersionForNumber(r):null},t.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),n=new on(e);n.setRegion(0,0,9,9),n.setRegion(e-8,0,8,9),n.setRegion(0,e-8,9,8);for(var r=this.alignmentPatternCenters.length,a=0;a<r;a++)for(var o=this.alignmentPatternCenters[a]-2,i=0;i<r;i++)a===0&&(i===0||i===r-1)||a===r-1&&i===0||n.setRegion(this.alignmentPatternCenters[i]-2,o,5,5);return n.setRegion(6,9,1,e-17),n.setRegion(9,6,e-17,1),this.versionNumber>6&&(n.setRegion(e-11,0,3,6),n.setRegion(0,e-11,6,3)),n},t.prototype.toString=function(){return""+this.versionNumber},t.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]),t.VERSIONS=[new t(1,new Int32Array(0),new N(7,new C(1,19)),new N(10,new C(1,16)),new N(13,new C(1,13)),new N(17,new C(1,9))),new t(2,Int32Array.from([6,18]),new N(10,new C(1,34)),new N(16,new C(1,28)),new N(22,new C(1,22)),new N(28,new C(1,16))),new t(3,Int32Array.from([6,22]),new N(15,new C(1,55)),new N(26,new C(1,44)),new N(18,new C(2,17)),new N(22,new C(2,13))),new t(4,Int32Array.from([6,26]),new N(20,new C(1,80)),new N(18,new C(2,32)),new N(26,new C(2,24)),new N(16,new C(4,9))),new t(5,Int32Array.from([6,30]),new N(26,new C(1,108)),new N(24,new C(2,43)),new N(18,new C(2,15),new C(2,16)),new N(22,new C(2,11),new C(2,12))),new t(6,Int32Array.from([6,34]),new N(18,new C(2,68)),new N(16,new C(4,27)),new N(24,new C(4,19)),new N(28,new C(4,15))),new t(7,Int32Array.from([6,22,38]),new N(20,new C(2,78)),new N(18,new C(4,31)),new N(18,new C(2,14),new C(4,15)),new N(26,new C(4,13),new C(1,14))),new t(8,Int32Array.from([6,24,42]),new N(24,new C(2,97)),new N(22,new C(2,38),new C(2,39)),new N(22,new C(4,18),new C(2,19)),new N(26,new C(4,14),new C(2,15))),new t(9,Int32Array.from([6,26,46]),new N(30,new C(2,116)),new N(22,new C(3,36),new C(2,37)),new N(20,new C(4,16),new C(4,17)),new N(24,new C(4,12),new C(4,13))),new t(10,Int32Array.from([6,28,50]),new N(18,new C(2,68),new C(2,69)),new N(26,new C(4,43),new C(1,44)),new N(24,new C(6,19),new C(2,20)),new N(28,new C(6,15),new C(2,16))),new t(11,Int32Array.from([6,30,54]),new N(20,new C(4,81)),new N(30,new C(1,50),new C(4,51)),new N(28,new C(4,22),new C(4,23)),new N(24,new C(3,12),new C(8,13))),new t(12,Int32Array.from([6,32,58]),new N(24,new C(2,92),new C(2,93)),new N(22,new C(6,36),new C(2,37)),new N(26,new C(4,20),new C(6,21)),new N(28,new C(7,14),new C(4,15))),new t(13,Int32Array.from([6,34,62]),new N(26,new C(4,107)),new N(22,new C(8,37),new C(1,38)),new N(24,new C(8,20),new C(4,21)),new N(22,new C(12,11),new C(4,12))),new t(14,Int32Array.from([6,26,46,66]),new N(30,new C(3,115),new C(1,116)),new N(24,new C(4,40),new C(5,41)
38),new N(20,new C(11,16),new C(5,17)),new N(24,new C(11,12),new C(5,13))),new t(15,Int32Array.from([6,26,48,70]),new N(22,new C(5,87),new C(1,88)),new N(24,new C(5,41),new C(5,42)),new N(30,new C(5,24),new C(7,25)),new N(24,new C(11,12),new C(7,13))),new t(16,Int32Array.from([6,26,50,74]),new N(24,new C(5,98),new C(1,99)),new N(28,new C(7,45),new C(3,46)),new N(24,new C(15,19),new C(2,20)),new N(30,new C(3,15),new C(13,16))),new t(17,Int32Array.from([6,30,54,78]),new N(28,new C(1,107),new C(5,108)),new N(28,new C(10,46),new C(1,47)),new N(28,new C(1,22),new C(15,23)),new N(28,new C(2,14),new C(17,15))),new t(18,Int32Array.from([6,30,56,82]),new N(30,new C(5,120),new C(1,121)),new N(26,new C(9,43),new C(4,44)),new N(28,new C(17,22),new C(1,23)),new N(28,new C(2,14),new C(19,15))),new t(19,Int32Array.from([6,30,58,86]),new N(28,new C(3,113),new C(4,114)),new N(26,new C(3,44),new C(11,45)),new N(26,new C(17,21),new C(4,22)),new N(26,new C(9,13),new C(16,14))),new t(20,Int32Array.from([6,34,62,90]),new N(28,new C(3,107),new C(5,108)),new N(26,new C(3,41),new C(13,42)),new N(30,new C(15,24),new C(5,25)),new N(28,new C(15,15),new C(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new N(28,new C(4,116),new C(4,117)),new N(26,new C(17,42)),new N(28,new C(17,22),new C(6,23)),new N(30,new C(19,16),new C(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new N(28,new C(2,111),new C(7,112)),new N(28,new C(17,46)),new N(30,new C(7,24),new C(16,25)),new N(24,new C(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new N(30,new C(4,121),new C(5,122)),new N(28,new C(4,47),new C(14,48)),new N(30,new C(11,24),new C(14,25)),new N(30,new C(16,15),new C(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new N(30,new C(6,117),new C(4,118)),new N(28,new C(6,45),new C(14,46)),new N(30,new C(11,24),new C(16,25)),new N(30,new C(30,16),new C(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new N(26,new C(8,106),new C(4,107)),new N(28,new C(8,47),new C(13,48)),new N(30,new C(7,24),new C(22,25)),new N(30,new C(22,15),new C(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new N(28,new C(10,114),new C(2,115)),new N(28,new C(19,46),new C(4,47)),new N(28,new C(28,22),new C(6,23)),new N(30,new C(33,16),new C(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new N(30,new C(8,122),new C(4,123)),new N(28,new C(22,45),new C(3,46)),new N(30,new C(8,23),new C(26,24)),new N(30,new C(12,15),new C(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new N(30,new C(3,117),new C(10,118)),new N(28,new C(3,45),new C(23,46)),new N(30,new C(4,24),new C(31,25)),new N(30,new C(11,15),new C(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new N(30,new C(7,116),new C(7,117)),new N(28,new C(21,45),new C(7,46)),new N(30,new C(1,23),new C(37,24)),new N(30,new C(19,15),new C(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new N(30,new C(5,115),new C(10,116)),new N(28,new C(19,47),new C(10,48)),new N(30,new C(15,24),new C(25,25)),new N(30,new C(23,15),new C(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new N(30,new C(13,115),new C(3,116)),new N(28,new C(2,46),new C(29,47)),new N(30,new C(42,24),new C(1,25)),new N(30,new C(23,15),new C(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new N(30,new C(17,115)),new N(28,new C(10,46),new C(23,47)),new N(30,new C(10,24),new C(35,25)),new N(30,new C(19,15),new C(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new N(30,new C(17,115),new C(1,116)),new N(28,new C(14,46),new C(21,47)),new N(30,new C(29,24),new C(19,25)),new N(30,new C(11,15),new C(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new N(30,new C(13,115),new C(6,116)),new N(28,new C(14,46),new C(23,47)),new N(30,new C(44,24),new C(7,25)),new N(30,new C(59,16),new C(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new N(30,new C(12,121),new C(7,122)),new N(28,new C(12,47),new C(26,48)),new N(30,new C(39,24),new C(14,25)),new N(30,new C(22,15),new C(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new N(30,new C(6,121),new C(14,122)),new N(28,new C(6,47),new C(34,48)),new N(30,new C(46,24),new C(10,25)),new N(30,new C(2,15),new C(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new N(30,new C(17,122),new C(4,123)),new N(28,new C(29,46),new C(14,47)),new N(30,new C(49,24),new C(10,25)),new N(30,new C(24,15),new C(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new N(30,new C(4,122),new C(18,123)),new N(28,new C(13,46),new C(32,47)),new N(30,new C(48,24),new C(14,25)),new N(30,new C(42,15),new C(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new N(30,new C(20,117),new C(4,118)),new N(28,new C(40,47),new C(7,48)),new N(30,new C(43,24),new C(22,25)),new N(30,new C(10,15),new C(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new N(30,new C(19,118),new C(6,119)),new N(28,new C(18,47),new C(31,48)),new N(30,new C(34,24),new C(34,25)),new N(30,new C(20,15),new C(61,16)))],t})(),mt;(function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"})(mt||(mt={}));var gu=(function(){function t(e,n){this.value=e,this.isMasked=n}return t.prototype.unmaskBitMatrix=function(e,n){for(var r=0;r<n;r++)for(var a=0;a<n;a++)this.isMasked(r,a)&&e.flip(a,r)},t.values=new Map([[mt.DATA_MASK_000,new t(mt.DATA_MASK_000,function(e,n){return(e+n&1)===0})],[mt.DATA_MASK_001,new t(mt.DATA_MASK_001,function(e,n){return(e&1)===0})],[mt.DATA_MASK_010,new t(mt.DATA_MASK_010,function(e,n){return n%3===0})],[mt.DATA_MASK_011,new t(mt.DATA_MASK_011,function(e,n){return(e+n)%3===0})],[mt.DATA_MASK_100,new t(mt.DATA_MASK_100,function(e,n){return(Math.floor(e/2)+Math.floor(n/3)&1)===0})],[mt.DATA_MASK_101,new t(mt.DATA_MASK_101,function(e,n){return e*n%6===0})],[mt.DATA_MASK_110,new t(mt.DATA_MASK_110,function(e,n){return e*n%6<3})],[mt.DATA_MASK_111,new t(mt.DATA_MASK_111,function(e,n){return(e+n+e*n%3&1)===0})]]),t})(),Q2=(function(){function t(e){var n=e.getHeight();if(n<21||(n&3)!==1)throw new P;this.bitMatrix=e}return t.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,n=0;n<6;n++)e=this.copyBit(n,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var r=5;r>=0;r--)e=this.copyBit(8,r,e);for(var a=this.bitMatrix.getHeight(),o=0,i=a-7,r=a-1;r>=i;r--)o=this.copyBit(8,r,o);for(var n=a-8;n<a;n++)o=this.copyBit(n,8,o);if(this.parsedFormatInfo=u0.decodeFormatInformation(e,o),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new P},t.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),n=Math.floor((e-17)/4);if(n<=6)return Sr.getVersionForNumber(n);for(var r=0,a=e-11,o=5;o>=0;o--)for(var i=e-9;i>=a;i--)r=this.copyBit(i,o,r);var s=Sr.decodeVersionInformation(r);if(s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;r=0;for(var i=5;i>=0;i--)for(var o=e-9;o>=a;o--)r=this.copyBit(i,o,r);if(s=Sr.decodeVersionInformation(r),s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;throw new P},t.prototype.copyBit=function(e,n,r){var a=this.isMirror?this.bitMatrix.get(n,e):this.bitMatrix.get(e,n);return a?r<<1|1:r<<1},t.prototype.readCodewords=function(){var e=this.readFormatInformation(),n=this.readVersion(),r=gu.values.get(e.getDataMask()),a=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,a);for(var o=n.buildFunctionPattern(),i=!0,s=new Uint8Array(n.getTotalCodewords()),c=0,l=0,u=0,d=a-1;d>0;d-=2){d===6&&d--;for(var f=0;f<a;f++)for(var p=i?a-1-f:f,g=0;g<2;g++)o.get(d-g,p)||(u++,l<<=1,this.bitMatrix.get(d-g,p)&&(l|=1),u===8&&(s[c++]=l,u=0,l=0));i=!i}if(c!==n.getTotalCodewords())throw new P;return s},t.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=gu.values.get(this.parsedFormatInfo.getDataMask()),n=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,n)}},t.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},t.prototype.mirror=function(){for(var e=this.bitMatrix,n=0,r=e.getWidth();n<r;n++)for(var a=n+1,o=e.getHeight();a<o;a++)e.get(n,a)!==e.get(a,n)&&(e.flip(a,n),e.flip(n,a))},t})(),mu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
38,J2=(function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n,r){var a,o,i,s;if(e.length!==n.getTotalCodewords())throw new Q;var c=n.getECBlocksForLevel(r),l=0,u=c.getECBlocks();try{for(var d=mu(u),f=d.next();!f.done;f=d.next()){var p=f.value;l+=p.getCount()}}catch(L){a={error:L}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(a)throw a.error}}var g=new Array(l),m=0;try{for(var y=mu(u),v=y.next();!v.done;v=y.next())for(var p=v.value,w=0;w<p.getCount();w++){var b=p.getDataCodewords(),_=c.getECCodewordsPerBlock()+b;g[m++]=new t(b,new Uint8Array(_))}}catch(L){i={error:L}}finally{try{v&&!v.done&&(s=y.return)&&s.call(y)}finally{if(i)throw i.error}}for(var A=g[0].codewords.length,T=g.length-1;T>=0;){var S=g[T].codewords.length;if(S===A)break;T--}T++;for(var E=A-c.getECCodewordsPerBlock(),F=0,w=0;w<E;w++)for(var k=0;k<m;k++)g[k].codewords[w]=e[F++];for(var k=T;k<m;k++)g[k].codewords[E]=e[F++];for(var W=g[0].codewords.length,w=E;w<W;w++)for(var k=0;k<m;k++){var z=k<T?w:w+1;g[k].codewords[z]=e[F++]}return g},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t})(),en;(function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"})(en||(en={}));var Le=(function(){function t(e,n,r,a){this.value=e,this.stringValue=n,this.characterCountBitsForVersions=r,this.bits=a,t.FOR_BITS.set(a,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var n=t.FOR_BITS.get(e);if(n===void 0)throw new Q;return n},t.prototype.getCharacterCountBits=function(e){var n=e.getVersionNumber(),r;return n<=9?r=0:n<=26?r=1:r=2,this.characterCountBitsForVersions[r]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(en.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(en.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(en.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(en.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(en.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(en.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(en.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(en.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(en.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(en.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t})(),ey=(function(){function t(){}return t.decode=function(e,n,r,a){var o=new pc(e),i=new se,s=new Array,c=-1,l=-1;try{var u=null,d=!1,f=void 0;do{if(o.available()<4)f=Le.TERMINATOR;else{var p=o.readBits(4);f=Le.forBits(p)}switch(f){case Le.TERMINATOR:break;case Le.FNC1_FIRST_POSITION:case Le.FNC1_SECOND_POSITION:d=!0;break;case Le.STRUCTURED_APPEND:if(o.available()<16)throw new P;c=o.readBits(8),l=o.readBits(8);break;case Le.ECI:var g=t.parseECIValue(o);if(u=ft.getCharacterSetECIByValue(g),u===null)throw new P;break;case Le.HANZI:var m=o.readBits(4),y=o.readBits(f.getCharacterCountBits(n));m===t.GB2312_SUBSET&&t.decodeHanziSegment(o,i,y);break;default:var v=o.readBits(f.getCharacterCountBits(n));switch(f){case Le.NUMERIC:t.decodeNumericSegment(o,i,v);break;case Le.ALPHANUMERIC:t.decodeAlphanumericSegment(o,i,v,d);break;case Le.BYTE:t.decodeByteSegment(o,i,v,u,s,a);break;case Le.KANJI:t.decodeKanjiSegment(o,i,v);break;default:throw new P}break}}while(f!==Le.TERMINATOR)}catch{throw new P}return new aa(e,i.toString(),s.length===0?null:s,r===null?null:r.toString(),c,l)},t.decodeHanziSegment=function(e,n,r){if(r*13>e.available())throw new P;for(var a=new Uint8Array(2*r),o=0;r>0;){var i=e.readBits(13),s=i/96<<8&4294967295|i%96;s<959?s+=41377:s+=42657,a[o]=s>>8&255,a[o+1]=s&255,o+=2,r--}try{n.append(Ut.decode(a,de.GB2312))}catch(c){throw new P(c)}},t.decodeKanjiSegment=function(e,n,r){if(r*13>e.available())throw new P;for(var a=new Uint8Array(2*r),o=0;r>0;){var i=e.readBits(13),s=i/192<<8&4294967295|i%192;s<7936?s+=33088:s+=49472,a[o]=s>>8,a[o+1]=s,o+=2,r--}try{n.append(Ut.decode(a,de.SHIFT_JIS))}catch(c){throw new P(c)}},t.decodeByteSegment=function(e,n,r,a,o,i){if(8*r>e.available())throw new P;for(var s=new Uint8Array(r),c=0;c<r;c++)s[c]=e.readBits(8);var l;a===null?l=de.guessEncoding(s,i):l=a.getName();try{n.append(Ut.decode(s,l))}catch(u){throw new P(u)}o.push(s)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new P;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,n,r,a){for(var o=n.length();r>1;){if(e.available()<11)throw new P;var i=e.readBits(11);n.append(t.toAlphaNumericChar(Math.floor(i/45))),n.append(t.toAlphaNumericChar(i%45)),r-=2}if(r===1){if(e.available()<6)throw new P;n.append(t.toAlphaNumericChar(e.readBits(6)))}if(a)for(var s=o;s<n.length();s++)n.charAt(s)==="%"&&(s<n.length()-1&&n.charAt(s+1)==="%"?n.deleteCharAt(s+1):n.setCharAt(s,"�"))},t.decodeNumericSegment=function(e,n,r){for(;r>=3;){if(e.available()<10)throw new P;var a=e.readBits(10);if(a>=1e3)throw new P;n.append(t.toAlphaNumericChar(Math.floor(a/100))),n.append(t.toAlphaNumericChar(Math.floor(a/10)%10)),n.append(t.toAlphaNumericChar(a%10)),r-=3}if(r===2){if(e.available()<7)throw new P;var o=e.readBits(7);if(o>=100)throw new P;n.append(t.toAlphaNumericChar(Math.floor(o/10))),n.append(t.toAlphaNumericChar(o%10))}else if(r===1){if(e.available()<4)throw new P;var i=e.readBits(4);if(i>=10)throw new P;n.append(t.toAlphaNumericChar(i))}},t.parseECIValue=function(e){var n=e.readBits(8);if((n&128)===0)return n&127;if((n&192)===128){var r=e.readBits(8);return(n&63)<<8&4294967295|r}if((n&224)===192){var a=e.readBits(16);return(n&31)<<16&4294967295|a}throw new P},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t})(),d0=(function(){function t(e){this.mirrored=e}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(e){if(!(!this.mirrored||e===null||e.length<3)){var n=e[0];e[0]=e[2],e[2]=n}},t})(),xu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ty=(function(){function t(){this.rsDecoder=new oa(St.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(e,n){return this.decodeBitMatrix(on.parseFromBooleanArray(e),n)},t.prototype.decodeBitMatrix=function(e,n){var r=new Q2(e),a=null;try{return this.decodeBitMatrixParser(r,n)}catch(i){a=i}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,n);return o.setOther(new d0(!0)),o}catch(i){throw a!==null?a:i}},t.prototype.decodeBitMatrixParser=function(e,n){var r,a,o,i,s=e.readVersion(),c=e.readFormatInformation().getErrorCorrectionLevel(),l=e.readCodewords(),u=J2.getDataBlocks(l,s,c),d=0;try{for(var f=xu(u),p=f.next();!p.done;p=f.next()){var g=p.value;d+=g.getNumDataCodewords()}}catch(T){r={error:T}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}var m=new Uint8Array(d),y=0;try{for(var v=xu(u),w=v.next();!w.done;w=v.next()){var g=w.value,b=g.getCodewords(),_=g.getNumDataCodewords();this.correctErrors(b,_);for(var A=0;A<_;A++)m[y++]=b[A]}}catch(T){o={error:T}}finally{try{w&&!w.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return ey.decode(m,s,c,n)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new Ke}for(var a=0;a<n;a++)e[a]=r[a]},t})(),ny=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ry=(function(t){ny(e,t);function e(n,r,a){var o=t.call(this,n,r)||this;return o.estimatedModuleSize=a,o}return e.prototype.aboutEquals=function(n,r,a){if(Math.abs(r-this.getY())<=n&&Math.abs(a-this.getX())<=n){var o=Math.abs(n-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,a){var o=(this.getX()+r)/2,i=(this.getY()+n)/2,s=(this.estimatedModuleSize+a)/2;return new e(o,i,s)},e})($),ay=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oy=(function(){function t(e,n,r,a,o,i,s){this.image=e,this.startX=n,this.startY=r,this.width=a,this.height=o,this.moduleSize=i,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var e=this.startX,n=this.height,r=this.width,a=e+r,o=this.startY+n/2,i=new Int32Array(3),s=this.image,c=0;c<n;c++){var l=o+((c&1)===0?Math.floor((c+1)/2):-Math.floor((c+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var u=e;u<a&&!s.get(u,l);)u++;for(var d=0;u<a;){if(s.get(u,l))if(d===1)i[1]++;else if(d===2){if(this.foundPatternCross(i)){var f=this.handlePossibleCenter(i,l,u);if(f!==null)return f}i[0]=i[2],i[1]=1,i[2]=0,d=1}else i[++d]++;else d===1&&d++,i[d]++;u++}if(this.foundPatternCross(i)){var f=this.handlePossibleCenter(i,l,a);if(f!==null)return f}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new D},t.centerFromEnd=function(e,n){return n-e[2]-e[1]/2},t.prototype.foundPatternCross=function(e){for(var n=this.moduleSize,r=n/2,a=0;a<3;a++)if(Math.abs(n-e[a])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,n,r,a){var o=this.image,i=o.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var c=e;c>=0&&o.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&!o.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<i&&o.get(n,c)&&s[1]<=r;)s[1]++,c++;if(c===i||s[1]>r)return NaN;for(;c<i&&!o.get(n,c)&&s[2]<=r;)s[2]++,c++;if(s[2]>r)return NaN;var l=s[0]+s[1]+s[2];return 5*Math.abs(l-a)>=2*a?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,n,r){var a,o,i=e[0]+e[1]+e[2],s=t.centerFromEnd(e,r),c=this.crossCheckVertical(n,s,2*e[1],i);if(!isNaN(c)){var l=(e[0]+e[1]+e[2])/3;try{for(var u=ay(this.possibleCenters),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.aboutEquals(l,c,s))return f.combineEstimate(c,s,l)}}catch(g){a={error:g}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}var p=new ry(s,c,l);this.possibleCenters.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return null},t})(),iy=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),sy=(function(t){iy(e,t);function e(n,r,a,o){var i=t.call(this,n,r)||this;return i.estimatedModuleSize=a,i.count=o,o===void 0&&(i.count=1),i}return e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(n,r,a){if(Math.abs(r-this.getY())<=n&&Math.abs(a-this.getX())<=n){var o=Math.abs(n-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,a){var o=this.count+1,i=(this.count*this.getX()+r)/o,s=(this.count*this.getY()+n)/o,c=(this.count*this.estimatedModuleSize+a)/o;return new e(i,s,c,o)},e})($),cy=(function(){function t(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t})(),Oa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ly=(function(){function t(e,n){this.image=e,this.resultPointCallback=n,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=n}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var n=e!=null&&e.get(be.TRY_HARDER)!==void 0,r=e!=null&&e.get(be.PURE_BARCODE)!==void 0,a=this.image,o=a.getHeight(),i=a.getWidth(),s=Math.floor(3*o/(4*t.MAX_MODULES));(s<t.MIN_SKIP||n)&&(s=t.MIN_SKIP);for(var c=!1,l=new Int32Array(5),u=s-1;u<o&&!c;u+=s){l.fill(0);for(var d=0,f=0;f<i;f++)if(a.get(f,u))(d&1)===1&&d++,l[d]++;
vendor: 5,735 bytes, line 38
38else if((d&1)===0)if(d===4)if(t.foundPatternCross(l)){var p=this.handlePossibleCenter(l,u,f,r);if(p===!0)if(s=2,this.hasSkipped===!0)c=this.haveMultiplyConfirmedCenters();else{var g=this.findRowSkip();g>l[2]&&(u+=g-l[2]-s,f=i-1)}else{l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;continue}d=0,l.fill(0)}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;else l[++d]++;else l[d]++;if(t.foundPatternCross(l)){var p=this.handlePossibleCenter(l,u,i,r);p===!0&&(s=l[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}}var m=this.selectBestPatterns();return $.orderBestPatterns(m),new cy(m)},t.centerFromEnd=function(e,n){return n-e[4]-e[3]-e[2]/2},t.foundPatternCross=function(e){for(var n=0,r=0;r<5;r++){var a=e[r];if(a===0)return!1;n+=a}if(n<7)return!1;var o=n/7,i=o/2;return Math.abs(o-e[0])<i&&Math.abs(o-e[1])<i&&Math.abs(3*o-e[2])<3*i&&Math.abs(o-e[3])<i&&Math.abs(o-e[4])<i},t.prototype.getCrossCheckStateCount=function(){return this.crossCheckStateCount.fill(0),this.crossCheckStateCount},t.prototype.crossCheckDiagonal=function(e,n,r,a){for(var o=this.getCrossCheckStateCount(),i=0,s=this.image;e>=i&&n>=i&&s.get(n-i,e-i);)o[2]++,i++;if(e<i||n<i)return!1;for(;e>=i&&n>=i&&!s.get(n-i,e-i)&&o[1]<=r;)o[1]++,i++;if(e<i||n<i||o[1]>r)return!1;for(;e>=i&&n>=i&&s.get(n-i,e-i)&&o[0]<=r;)o[0]++,i++;if(o[0]>r)return!1;var c=s.getHeight(),l=s.getWidth();for(i=1;e+i<c&&n+i<l&&s.get(n+i,e+i);)o[2]++,i++;if(e+i>=c||n+i>=l)return!1;for(;e+i<c&&n+i<l&&!s.get(n+i,e+i)&&o[3]<r;)o[3]++,i++;if(e+i>=c||n+i>=l||o[3]>=r)return!1;for(;e+i<c&&n+i<l&&s.get(n+i,e+i)&&o[4]<r;)o[4]++,i++;if(o[4]>=r)return!1;var u=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(u-a)<2*a&&t.foundPatternCross(o)},t.prototype.crossCheckVertical=function(e,n,r,a){for(var o=this.image,i=o.getHeight(),s=this.getCrossCheckStateCount(),c=e;c>=0&&o.get(n,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!o.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&o.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<i&&o.get(n,c);)s[2]++,c++;if(c===i)return NaN;for(;c<i&&!o.get(n,c)&&s[3]<r;)s[3]++,c++;if(c===i||s[3]>=r)return NaN;for(;c<i&&o.get(n,c)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-a)>=2*a?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.crossCheckHorizontal=function(e,n,r,a){for(var o=this.image,i=o.getWidth(),s=this.getCrossCheckStateCount(),c=e;c>=0&&o.get(c,n);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!o.get(c,n)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&o.get(c,n)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<i&&o.get(c,n);)s[2]++,c++;if(c===i)return NaN;for(;c<i&&!o.get(c,n)&&s[3]<r;)s[3]++,c++;if(c===i||s[3]>=r)return NaN;for(;c<i&&o.get(c,n)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-a)>=a?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,n,r,a){var o=e[0]+e[1]+e[2]+e[3]+e[4],i=t.centerFromEnd(e,r),s=this.crossCheckVertical(n,Math.floor(i),e[2],o);if(!isNaN(s)&&(i=this.crossCheckHorizontal(Math.floor(i),Math.floor(s),e[2],o),!isNaN(i)&&(!a||this.crossCheckDiagonal(Math.floor(s),Math.floor(i),e[2],o)))){for(var c=o/7,l=!1,u=this.possibleCenters,d=0,f=u.length;d<f;d++){var p=u[d];if(p.aboutEquals(c,s,i)){u[d]=p.combineEstimate(s,i,c),l=!0;break}}if(!l){var g=new sy(i,s,c);u.push(g),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(g)}return!0}return!1},t.prototype.findRowSkip=function(){var e,n,r=this.possibleCenters.length;if(r<=1)return 0;var a=null;try{for(var o=Oa(this.possibleCenters),i=o.next();!i.done;i=o.next()){var s=i.value;if(s.getCount()>=t.CENTER_QUORUM)if(a==null)a=s;else return this.hasSkipped=!0,Math.floor((Math.abs(a.getX()-s.getX())-Math.abs(a.getY()-s.getY()))/2)}}catch(c){e={error:c}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,n,r,a,o=0,i=0,s=this.possibleCenters.length;try{for(var c=Oa(this.possibleCenters),l=c.next();!l.done;l=c.next()){var u=l.value;u.getCount()>=t.CENTER_QUORUM&&(o++,i+=u.getEstimatedModuleSize())}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(o<3)return!1;var d=i/s,f=0;try{for(var p=Oa(this.possibleCenters),g=p.next();!g.done;g=p.next()){var u=g.value;f+=Math.abs(u.getEstimatedModuleSize()-d)}}catch(m){r={error:m}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}return f<=.05*i},t.prototype.selectBestPatterns=function(){var e,n,r,a,o=this.possibleCenters.length;if(o<3)throw new D;var i=this.possibleCenters,s;if(o>3){var c=0,l=0;try{for(var u=Oa(this.possibleCenters),d=u.next();!d.done;d=u.next()){var f=d.value,p=f.getEstimatedModuleSize();c+=p,l+=p*p}}catch(A){e={error:A}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}s=c/o;var g=Math.sqrt(l/o-s*s);i.sort(function(A,T){var S=Math.abs(T.getEstimatedModuleSize()-s),E=Math.abs(A.getEstimatedModuleSize()-s);return S<E?-1:S>E?1:0});for(var m=Math.max(.2*s,g),y=0;y<i.length&&i.length>3;y++){var v=i[y];Math.abs(v.getEstimatedModuleSize()-s)>m&&(i.splice(y,1),y--)}}if(i.length>3){var c=0;try{for(var w=Oa(i),b=w.next();!b.done;b=w.next()){var _=b.value;c+=_.getEstimatedModuleSize()}}catch(T){r={error:T}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(r)throw r.error}}s=c/i.length,i.sort(function(T,S){if(S.getCount()===T.getCount()){var E=Math.abs(S.getEstimatedModuleSize()-s),F=Math.abs(T.getEstimatedModuleSize()-s);return E<F?1:E>F?-1:0}else return S.getCount()-T.getCount()}),i.splice(3)}return[i[0],i[1],i[2]]}
38,t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t})(),uy=(function(){function t(e){this.image=e}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(be.NEED_RESULT_POINT_CALLBACK);var n=new ly(this.image,this.resultPointCallback),r=n.find(e);return this.processFinderPatternInfo(r)},t.prototype.processFinderPatternInfo=function(e){var n=e.getTopLeft(),r=e.getTopRight(),a=e.getBottomLeft(),o=this.calculateModuleSize(n,r,a);if(o<1)throw new D("No pattern found in proccess finder.");var i=t.computeDimension(n,r,a,o),s=Sr.getProvisionalVersionForDimension(i),c=s.getDimensionForVersion()-7,l=null;if(s.getAlignmentPatternCenters().length>0)for(var u=r.getX()-n.getX()+a.getX(),d=r.getY()-n.getY()+a.getY(),f=1-3/c,p=Math.floor(n.getX()+f*(u-n.getX())),g=Math.floor(n.getY()+f*(d-n.getY())),m=4;m<=16;m<<=1)try{l=this.findAlignmentInRegion(o,p,g,m);break}catch(b){if(!(b instanceof D))throw b}var y=t.createTransform(n,r,a,l,i),v=t.sampleGrid(this.image,y,i),w;return l===null?w=[a,n,r]:w=[a,n,r,l],new si(v,w)},t.createTransform=function(e,n,r,a,o){var i=o-3.5,s,c,l,u;return a!==null?(s=a.getX(),c=a.getY(),l=i-3,u=l):(s=n.getX()-e.getX()+r.getX(),c=n.getY()-e.getY()+r.getY(),l=i,u=i),fc.quadrilateralToQuadrilateral(3.5,3.5,i,3.5,l,u,3.5,i,e.getX(),e.getY(),n.getX(),n.getY(),s,c,r.getX(),r.getY())},t.sampleGrid=function(e,n,r){var a=ci.getInstance();return a.sampleGridWithTransform(e,r,r,n)},t.computeDimension=function(e,n,r,a){var o=xe.round($.distance(e,n)/a),i=xe.round($.distance(e,r)/a),s=Math.floor((o+i)/2)+7;switch(s&3){case 0:s++;break;case 2:s--;break;case 3:throw new D("Dimensions could be not found.")}return s},t.prototype.calculateModuleSize=function(e,n,r){return(this.calculateModuleSizeOneWay(e,n)+this.calculateModuleSizeOneWay(e,r))/2},t.prototype.calculateModuleSizeOneWay=function(e,n){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(n.getX()),Math.floor(n.getY())),a=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(r)?a/7:isNaN(a)?r/7:(r+a)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,n,r,a){var o=this.sizeOfBlackWhiteBlackRun(e,n,r,a),i=1,s=e-(r-e);s<0?(i=e/(e-s),s=0):s>=this.image.getWidth()&&(i=(this.image.getWidth()-1-e)/(s-e),s=this.image.getWidth()-1);var c=Math.floor(n-(a-n)*i);return i=1,c<0?(i=n/(n-c),c=0):c>=this.image.getHeight()&&(i=(this.image.getHeight()-1-n)/(c-n),c=this.image.getHeight()-1),s=Math.floor(e+(s-e)*i),o+=this.sizeOfBlackWhiteBlackRun(e,n,s,c),o-1},t.prototype.sizeOfBlackWhiteBlackRun=function(e,n,r,a){var o=Math.abs(a-n)>Math.abs(r-e);if(o){var i=e;e=n,n=i,i=r,r=a,a=i}for(var s=Math.abs(r-e),c=Math.abs(a-n),l=-s/2,u=e<r?1:-1,d=n<a?1:-1,f=0,p=r+u,g=e,m=n;g!==p;g+=u){var y=o?m:g,v=o?g:m;if(f===1===this.image.get(y,v)){if(f===2)return xe.distance(g,m,e,n);f++}if(l+=c,l>0){if(m===a)break;m+=d,l-=s}}return f===2?xe.distance(r+u,a,e,n):NaN},t.prototype.findAlignmentInRegion=function(e,n,r,a){var o=Math.floor(a*e),i=Math.max(0,n-o),s=Math.min(this.image.getWidth()-1,n+o);if(s-i<e*3)throw new D("Alignment top exceeds estimated module size.");var c=Math.max(0,r-o),l=Math.min(this.image.getHeight()-1,r+o);if(l-c<e*3)throw new D("Alignment bottom exceeds estimated module size.");var u=new oy(this.image,i,c,s-i,l-c,e,this.resultPointCallback);return u.find()},t})(),Xo=(function(){function t(){this.decoder=new ty}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,n){var r,a;if(n!=null&&n.get(be.PURE_BARCODE)!==void 0){var o=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decodeBitMatrix(o,n),a=t.NO_POINTS}else{var i=new uy(e.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(i.getBits(),n),a=i.getPoints()}r.getOther()instanceof d0&&r.getOther().applyMirroredCorrection(a);var s=new yt(r.getText(),r.getRawBytes(),void 0,a,X.QR_CODE,void 0),c=r.getByteSegments();c!==null&&s.putMetadata(tt.BYTE_SEGMENTS,c);var l=r.getECLevel();return l!==null&&s.putMetadata(tt.ERROR_CORRECTION_LEVEL,l),r.hasStru
38cturedAppend()&&(s.putMetadata(tt.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(tt.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n===null||r===null)throw new D;var a=this.moduleSize(n,e),o=n[1],i=r[1],s=n[0],c=r[0];if(s>=c||o>=i)throw new D;if(i-o!==c-s&&(c=s+(i-o),c>=e.getWidth()))throw new D;var l=Math.round((c-s+1)/a),u=Math.round((i-o+1)/a);if(l<=0||u<=0)throw new D;if(u!==l)throw new D;var d=Math.floor(a/2);o+=d,s+=d;var f=s+Math.floor((l-1)*a)-c;if(f>0){if(f>d)throw new D;s-=f}var p=o+Math.floor((u-1)*a)-i;if(p>0){if(p>d)throw new D;o-=p}for(var g=new on(l,u),m=0;m<u;m++)for(var y=o+Math.floor(m*a),v=0;v<l;v++)e.get(s+Math.floor(v*a),y)&&g.set(v,m);return g},t.moduleSize=function(e,n){for(var r=n.getHeight(),a=n.getWidth(),o=e[0],i=e[1],s=!0,c=0;o<a&&i<r;){if(s!==n.get(o,i)){if(++c===5)break;s=!s}o++,i++}if(o===a||i===r)throw new D;return(o-e[0])/7},t.NO_POINTS=new Array,t})(),vu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},yu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},dy=(function(){function t(e){this.versionIndicator=e>>2&7,this.dataMask=e&3}return t.computeBCHFormatWord=function(e){for(var n=e<<10,r=4;r>=0;r--)n>>r+10&1&&(n^=t.BCH_GENERATOR<<r);return e<<10|n&1023},t.buildLookupTable=function(){for(var e=[],n=0;n<32;n++){var r=t.computeBCHFormatWord(n),a=r^t.FORMAT_INFO_MASK_MICRO_QR;e.push([a,n])}return e},t.numBitsDiffering=function(e,n){return ce.bitCount(e^n)},t.decodeFormatInformation=function(e){var n,r,a,o;try{for(var i=vu(t.FORMAT_INFO_DECODE_LOOKUP),s=i.next();!s.done;s=i.next()){var c=yu(s.value,2),l=c[0],u=c[1];if(l===e)return new t(u)}}catch(v){n={error:v}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}var d=Number.MAX_SAFE_INTEGER,f=0;try{for(var p=vu(t.FORMAT_INFO_DECODE_LOOKUP),g=p.next();!g.done;g=p.next()){var m=yu(g.value,2),l=m[0],u=m[1],y=t.numBitsDiffering(e,l);y<d&&(d=y,f=u)}}catch(v){a={error:v}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}return d<=3?new t(f):null},t.prototype.getVersionIndicator=function(){return this.versionIndicator},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.getMicroQRVersionNumber=function(){return this.versionIndicator===0?1:this.versionIndicator<=2?2:this.versionIndicator<=4?3:4},t.prototype.getECLevelLabel=function(){switch(this.versionIndicator){case 0:return null;case 1:case 3:case 5:return"L";case 2:case 4:case 6:return"M";case 7:return"Q";default:return null}},t.FORMAT_INFO_MASK_MICRO_QR=17477,t.BCH_GENERATOR=1335,t.FORMAT_INFO_DECODE_LOOKUP=t.buildLookupTable(),t})(),fy=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},f0=(function(){function t(e,n,r){this.versionNumber=e,this.versionIndicator=n,this.ecBlocks=r;var a=r,o=a.getECBlocks()[0];this.totalCodewords=o.getCount()*(o.getDataCodewords()+a.getECCodewordsPerBlock())}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getVersionIndicator=function(){return this.versionIndicator},t.prototype.getDimensionForVersion=function(){return 9+2*this.versionNumber},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getNumDataCodewords=function(){return this.ecBlocks.getECBlocks()[0].getDataCodewords()},t.prototype.getNumECCodewords=function(){return this.totalCodewords-this.getNumDataCodewords()},t.prototype.getECBlocks=function(){return this.ecBlocks},t.prototype.getECLevelLabel=function(){return t.VERSION_INFO[this.versionIndicator][1]},t.prototype.getModeIndicatorBits=function(){return t.MODE_INDICATOR_BITS[this.versionNumber-1]},t.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),n=new on(e);return n.setRegion(0,0,9,9),e>9&&(n.setRegion(9,0,e-9,1),n.setRegion(0,9,1,e-9)),n},t.getVersionForIndicator=function(e){if(e<0||e>7)throw new P;var n=fy(t.VERSION_INFO[e],1),r=n[0];return new t(r,e,t.EC_BLOCKS[e])},t.getVersionForDimension=function(e){switch(e){case 11:return t.getVersionForIndicator(0);case 13:return t.getVersionForIndicator(1);case 15:return t.getVersionForIndicator(3);case 17:return t.getVersionForIndicator(5);default:throw new P}},t.prototype.toString=function(){return"M"+this.versionNumber},t.VERSION_INFO=[[1,null],[2,"L"],[2,"M"],[3,"L"],[3,"M"],[4,"L"],[4,"M"],[4,"Q"]],t.EC_BLOCKS=[new N(2,new C(1,3)),new N(5,new C(1,5)),new N(6,new C(1,4)),new N(6,new C(1,11)),new N(8,new C(1,9)),new N(8,new C(1,16)),new N(10,new C(1,14)),new N(14,new C(1,10))],t.MODE_INDICATOR_BITS=[0,1,2,3],t})(),hy=(function(){function t(e,n){this.maskIndex=e,this.isMasked=n}return t.forIndex=function(e){if(e<0||e>=t.MASKS.length)throw new Error("Invalid Micro QR mask index: "+e);return t.MASKS[e]},t.prototype.unmaskBitMatrix=function(e,n){for(var r=0;r<n;r++)for(var a=0;a<n;a++)this.isMasked(r,a)&&e.flip(a,r)},t.MASKS=[new t(0,function(e,n){return(e&1)===0}),new t(1,function(e,n){return(Math.floor(e/2)+Math.floor(n/3))%2===0}),new t(2,function(e,n){var r=e*n;
38return((r&1)+r%3)%2===0}),new t(3,function(e,n){return((e+n&1)+e*n%3)%2===0})],t})(),py=(function(){function t(e){this.bitMatrix=e,this.parsedFormatInfo=null,this.parsedVersion=null;var n=e.getHeight();if(n<11||n>17||n%2!==1)throw new P}return t.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null)return this.parsedFormatInfo;for(var e=0,n=1;n<=8;n++)e=this.copyBit(n,8,e);for(var r=7;r>=1;r--)e=this.copyBit(8,r,e);var a=dy.decodeFormatInformation(e);if(a!==null)return this.parsedFormatInfo=a,this.parsedVersion=f0.getVersionForIndicator(a.getVersionIndicator()),a;throw new P},t.prototype.copyBit=function(e,n,r){return this.bitMatrix.get(e,n)?r<<1|1:r<<1},t.prototype.readCodewords=function(){var e=this.readFormatInformation(),n=this.parsedVersion,r=hy.forIndex(e.getDataMask()),a=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,a);for(var o=n.buildFunctionPattern(),i=n.getNumDataCodewords(),s=n.getVersionNumber()===1||n.getVersionNumber()===3,c=!0,l=new Uint8Array(n.getTotalCodewords()),u=0,d=0,f=0,p=a-1;p>0;p-=2){for(var g=0;g<a;g++)for(var m=c?a-1-g:g,y=0;y<2;y++){var v=p-y;if(!o.get(v,m)){f++,d<<=1,this.bitMatrix.get(v,m)&&(d|=1);var w=s&&u===i-1,b=w?4:8;f===b&&(l[u++]=w?d<<4&255:d&255,f=0,d=0)}}c=!c}if(u!==n.getTotalCodewords())throw new P;return l},t})(),wu=(function(){function t(){}return t.decode=function(e,n,r){var a=new pc(e),o=new se,i=[],s=n.getVersionNumber(),c=n.getModeIndicatorBits();try{for(;;){var l=void 0;if(c===0)l=t.MODE_NUMERIC;else{if(a.available()<c)break;var u=a.readBits(c);l=t.decodeMode(u,s)}var d=t.charCountBits(l,s);if(a.available()<d)break;var f=a.readBits(d);if(f===0)break;switch(l){case t.MODE_NUMERIC:t.decodeNumeric(a,o,f);break;case t.MODE_ALPHA:t.decodeAlphanumeric(a,o,f);break;case t.MODE_BYTE:t.decodeByte(a,o,i,f,r);break;case t.MODE_KANJI:t.decodeKanji(a,o,f);break;default:throw new P}}}catch(p){throw p instanceof P?p:new P}return new aa(e,o.toString(),i.length===0?null:i,n.getECLevelLabel(),-1,-1)},t.decodeMode=function(e,n){switch(n){case 2:return e===0?t.MODE_NUMERIC:t.MODE_ALPHA;case 3:switch(e){case 0:return t.MODE_NUMERIC;case 1:return t.MODE_ALPHA;case 2:return t.MODE_BYTE;case 3:return t.MODE_KANJI}break;case 4:switch(e){case 0:return t.MODE_NUMERIC;case 1:return t.MODE_ALPHA;case 2:return t.MODE_BYTE;case 4:return t.MODE_KANJI}break}throw new P},t.charCountBits=function(e,n){switch(e){case t.MODE_NUMERIC:return n+2;case t.MODE_ALPHA:return n+1;case t.MODE_BYTE:return n+1;case t.MODE_KANJI:return n;default:throw new P}},t.decodeNumeric=function(e,n,r){for(var a=r;a>=3;){if(e.available()<10)throw new P;var o=e.readBits(10);if(o>=1e3)throw new P;n.append(t.toChar(Math.floor(o/100))),n.append(t.toChar(Math.floor(o/10)%10)),n.append(t.toChar(o%10)),a-=3}if(a===2){if(e.available()<7)throw new P;var i=e.readBits(7);if(i>=100)throw new P;n.append(t.toChar(Math.floor(i/10))),n.append(t.toChar(i%10))}else if(a===1){if(e.available()<4)throw new P;var s=e.readBits(4);if(s>=10)throw new P;n.append(t.toChar(s))}},t.decodeAlphanumeric=function(e,n,r){for(var a=r;a>1;){if(e.available()<11)throw new P;var o=e.readBits(11);n.append(t.toAlphaNum(Math.floor(o/45))),n.append(t.toAlphaNum(o%45)),a-=2}if(a===1){if(e.available()<6)throw new P;n.append(t.toAlphaNum(e.readBits(6)))}},t.decodeByte=function(e,n,r,a,o){if(8*a>e.available())throw new P;for(var i=new Uint8Array(a),s=0;s<a;s++)i[s]=e.readBits(8)&255;var c=de.guessEncoding(i,o);try{n.append(Ut.decode(i,c))}catch{throw new P}r.push(i)},t.decodeKanji=function(e,n,r){if(13*r>e.available())throw new P;for(var a=new Uint8Array(2*r),o=0,i=0;i<r;i++){var s=e.readBits(13),c=Math.floor(s/192)<<8|s%192;c+=c<7936?33088:49472,a[o++]=c>>8&255,a[o++]=c&255}try{n.append(Ut.decode(a,de.SHIFT_JIS))}catch{throw new P}},t.toChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new P;return t.ALPHANUMERIC_CHARS[e]},t.toAlphaNum=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new P;return t.ALPHANUMERIC_CHARS[e]},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.MODE_NUMERIC=0,t.MODE_ALPHA=1,t.MODE_BYTE=2,t.MODE_KANJI=3,t})(),gy=(function(){function t(){this.rsDecoder=new oa(St.QR_CODE_FIELD_256)}return t.prototype.decodeBitMatrix=function(e,n){var r=new py(e),a=r.readFormatInformation(),o=f0.getVersionForIndicator(a.getVersionIndicator()),i=r.readCodewords(),s=o.getNumDataCodewords();return o.getNumECCodewords(),o.getVersionNumber()===1||this.correctErrors(i,s),wu.decode(i.subarray(0,s),o,n??null)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new Ke}for(var a=0;a<n;a++)e[a]=r[a]&255},t})(),my=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
38e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),xy=(function(t){my(e,t);function e(n,r,a,o){o===void 0&&(o=1);var i=t.call(this,n,r)||this;return i.estimatedModuleSize=a,i.count=o,i}return e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(n,r,a){if(Math.abs(r-this.getY())<=n&&Math.abs(a-this.getX())<=n){var o=Math.abs(n-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,a){var o=this.count+1,i=(this.count*this.getX()+r)/o,s=(this.count*this.getY()+n)/o,c=(this.count*this.estimatedModuleSize+a)/o;return new e(i,s,c,o)},e})($),vy=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},yy=(function(){function t(e){this.image=e}return t.prototype.detect=function(e){var n;this.resultPointCallback=e!=null&&(n=e.get(be.NEED_RESULT_POINT_CALLBACK))!==null&&n!==void 0?n:null;var r=this.findFinderPattern(e);return this.processFinderPattern(r)},t.prototype.findFinderPattern=function(e){for(var n=this.image,r=n.getHeight(),a=n.getWidth(),o=e!=null&&e.get(be.TRY_HARDER)!==void 0,i=o?1:Math.max(1,Math.floor(r/64)),s=new Int32Array(5),c=[],l=i-1;l<r;l+=i){s.fill(0);for(var u=0,d=0;d<a;d++)if(n.get(d,l))(u&1)===1&&u++,s[u]++;else if((u&1)===0)if(u===4){if(this.foundPatternCross(s)){var f=this.handlePossibleCenter(s,l,d,c);if(f){s.fill(0),u=0;continue}}s[0]=s[2],s[1]=s[3],s[2]=s[4],s[3]=1,s[4]=0,u=3;continue}else s[++u]++;else s[u]++;this.foundPatternCross(s)&&this.handlePossibleCenter(s,l,a,c)}if(c.length===0)throw new D("No Micro QR finder pattern found.");return c.sort(function(p,g){return g.getCount()-p.getCount()}),c[0]},t.prototype.foundPatternCross=function(e){for(var n=0,r=0;r<5;r++){var a=e[r];if(a===0)return!1;n+=a}if(n<7)return!1;var o=n/7,i=o/2;return Math.abs(o-e[0])<i&&Math.abs(o-e[1])<i&&Math.abs(3*o-e[2])<3*i&&Math.abs(o-e[3])<i&&Math.abs(o-e[4])<i},t.prototype.handlePossibleCenter=function(e,n,r,a){var o=e[0]+e[1]+e[2]+e[3]+e[4],i=this.centerFromEnd(e,r),s=this.crossCheckVertical(n,Math.floor(i),e[2],o);if(isNaN(s))return!1;for(var c=(e[0]+e[1]+e[2]+e[3]+e[4])/7,l=0;l<a.length;l++){var u=a[l];if(u.aboutEquals(c,s,i))return a[l]=u.combineEstimate(s,i,c),!0}return a.push(new xy(i,s,c)),this.resultPointCallback!==null&&this.resultPointCallback.foundPossibleResultPoint(a[a.length-1]),!1},t.prototype.centerFromEnd=function(e,n){return n-e[4]-e[3]-e[2]/2},t.prototype.crossCheckVertical=function(e,n,r,a){for(var o=this.image,i=o.getHeight(),s=new Int32Array(5),c=e;c>=0&&o.get(n,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!o.get(n,c)&&s[1]<=a;)s[1]++,c--;if(c<0||s[1]>a)return NaN;for(;c>=0&&o.get(n,c)&&s[0]<=a;)s[0]++,c--;if(s[0]>a)return NaN;for(c=e+1;c<i&&o.get(n,c);)s[2]++,c++;if(c===i)return NaN;for(;c<i&&!o.get(n,c)&&s[3]<a;)s[3]++,c++;if(c===i||s[3]>=a)return NaN;for(;c<i&&o.get(n,c)&&s[4]<a;)s[4]++,c++;if(s[4]>=a)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-a)>=2*a?NaN:this.foundPatternCross(s)?this.centerFromEnd(s,c):NaN},t.prototype.processFinderPattern=function(e){var n=e.getX(),r=e.getY(),a=e.getEstimatedModuleSize();if(a<1)throw new D("Module size too small.");var o=this.determineDimension(n,r,a);if(o===null)throw new D("Cannot determine Micro QR symbol dimension.");var i=o.dim,s=o.orientation,c=(i-7)*a,l=[c,0,-c,0][s],u=[0,c,0,-c][s],d=[0,-c,0,c][s],f=[c,0,-c,0][s],p=n+l,g=r+u,m=n+d,y=r+f,v=t.createTransform(n,r,p,g,m,y,i),w=t.sampleGrid(this.image,v,i),b=[new $(n,r),new $(p,g),new $(m,y)];return new si(w,b)},t.prototype.determineDimension=function(e,n,r){for(var a=[[5,-3,1,0,-3,5,0,1],[3,5,0,1,-5,-3,-1,0],[-5,3,-1,0,3,-5,0,-1],[-3,-5,0,-1,5,3,1,0]],o=null,i=0;i<4;i++){var s=vy(a[i],8),c=s[0],l=s[1],u=s[2],d=s[3],f=s[4],p=s[5],g=s[6],m=s[7],y=this.probeTimingLine(e+c*r,n+l*r,u,d,r),v=this.probeTimingLine(e+f*r,n+p*r,g,m,r);
38if(y!==null&&v!==null){var w=this.snapDimension(y,v);if(w!==null)return{dim:w,orientation:i}}else if(o===null&&(y!==null||v!==null)){var w=this.snapDimension(y,v);w!==null&&(o={dim:w,orientation:i})}}return o},t.prototype.snapDimension=function(e,n){if(e===null)return n;if(n===null||e===n)return e;var r=Math.round((e+n)/2),a=[11,13,15,17].reduce(function(o,i){return Math.abs(i-r)<Math.abs(o-r)?i:o});return a},t.prototype.probeTimingLine=function(e,n,r,a,o){for(var i=0,s=0;s<10;s++){var c=8+s,l=Math.round(e+r*s*o),u=Math.round(n+a*s*o);if(l<0||l>=this.image.getWidth()||u<0||u>=this.image.getHeight())break;var d=this.image.get(l,u),f=c%2===0;if(d!==f)break;f&&i++}if(i<2)return null;var p=8+2*i-1;if(p===11||p===13||p===15||p===17)return p;var g=[11,13,15,17].reduce(function(m,y){return Math.abs(y-p)<Math.abs(m-p)?y:m});return Math.abs(g-p)<=2?g:null},t.createTransform=function(e,n,r,a,o,i,s){var c=s-3.5;return fc.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,3.5,c,c,c,e,n,r,a,o,i,r+(o-e),a+(i-n))},t.sampleGrid=function(e,n,r){var a=ci.getInstance();return a.sampleGridWithTransform(e,r,r,n)},t})(),bu=(function(){function t(){this.decoder=new gy}return t.prototype.decode=function(e,n){var r,a;if(n!=null&&n.get(be.PURE_BARCODE)!==void 0){var o=e.getBlackMatrix();r=this.decoder.decodeBitMatrix(o,n??void 0),a=[]}else{var i=new yy(e.getBlackMatrix()),s=i.detect(n??void 0);a=s.getPoints(),r=this.decoder.decodeBitMatrix(s.getBits(),n??void 0)}var c=new yt(r.getText(),r.getRawBytes(),r.getNumBits(),a,X.MICRO_QR_CODE,Ne.currentTimeMillis()),l=r.getByteSegments();l!==null&&c.putMetadata(tt.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!==null&&c.putMetadata(tt.ERROR_CORRECTION_LEVEL,u),c},t.prototype.reset=function(){},t})(),wy=(function(){function t(e){this.bitMatrix=e}return t.prototype.readCodewords=function(){for(var e=new Uint8Array(144),n=this.bitMatrix.getHeight(),r=this.bitMatrix.getWidth(),a=0;a<n;a++)for(var o=t.BITNR[a],i=0;i<r;i++){var s=o[i];s>=0&&this.bitMatrix.get(i,a)&&(e[Math.floor(s/6)]|=1<<5-s%6)}return e},t.BITNR=[[121,120,127,126,133,132,139,138,145,144,151,150,157,156,163,162,169,168,175,174,181,180,187,186,193,192,199,198,-2,-2],[123,122,129,128,135,134,141,140,147,146,153,152,159,158,165,164,171,170,177,176,183,182,189,188,195,194,201,200,816,-3],[125,124,131,130,137,136,143,142,149,148,155,154,161,160,167,166,173,172,179,178,185,184,191,190,197,196,203,202,818,817],[283,282,277,276,271,270,265,264,259,258,253,252,247,246,241,240,235,234,229,228,223,222,217,216,211,210,205,204,819,-3],[285,284,279,278,273,272,267,266,261,260,255,254,249,248,243,242,237,236,231,230,225,224,219,218,213,212,207,206,821,820],[287,286,281,280,275,274,269,268,263,262,257,256,251,250,245,244,239,238,233,232,227,226,221,220,215,214,209,208,822,
38-3],[289,288,295,294,301,300,307,306,313,312,319,318,325,324,331,330,337,336,343,342,349,348,355,354,361,360,367,366,824,823],[291,290,297,296,303,302,309,308,315,314,321,320,327,326,333,332,339,338,345,344,351,350,357,356,363,362,369,368,825,-3],[293,292,299,298,305,304,311,310,317,316,323,322,329,328,335,334,341,340,347,346,353,352,359,358,365,364,371,370,827,826],[409,408,403,402,397,396,391,390,79,78,-2,-2,13,12,37,36,2,-1,44,43,109,108,385,384,379,378,373,372,828,-3],[411,410,405,404,399,398,393,392,81,80,40,-2,15,14,39,38,3,-1,-1,45,111,110,387,386,381,380,375,374,830,829],[413,412,407,406,401,400,395,394,83,82,41,-3,-3,-3,-3,-3,5,4,47,46,113,112,389,388,383,382,377,376,831,-3],[415,414,421,420,427,426,103,102,55,54,16,-3,-3,-3,-3,-3,-3,-3,20,19,85,84,433,432,439,438,445,444,833,832],[417,416,423,422,429,428,105,104,57,56,-3,-3,-3,-3,-3,-3,-3,-3,22,21,87,86,435,434,441,440,447,446,834,-3],[419,418,425,424,431,430,107,106,59,58,-3,-3,-3,-3,-3,-3,-3,-3,-3,23,89,88,437,436,443,442,449,448,836,835],[481,480,475,474,469,468,48,-2,30,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,0,53,52,463,462,457,456,451,450,837,-3],[483,482,477,476,471,470,49,-1,-2,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-1,465,464,459,458,453,452,839,838],[485,484,479,478,473,472,51,50,31,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,1,-2,42,467,466,461,460,455,454,840,-3],[487,486,493,492,499,498,97,96,61,60,-3,-3,-3,-3,-3,-3,-3,-3,-3,26,91,90,505,504,511,510,517,516,842,841],[489,488,495,494,501,500,99,98,63,62,-3,-3,-3,-3,-3,-3,-3,-3,28,27,93,92,507,506,513,512,519,518,843,-3],[491,490,497,496,503,502,101,100,65,64,17,-3,-3,-3,-3,-3,-3,-3,18,29,95,94,509,508,515,514,521,520,845,844],[559,558,553,552,547,546,541,540,73,72,32,-3,-3,-3,-3,-3,-3,10,67,66,115,114,535,534,529,528,523,522,846,-3],[561,560,555,554,549,548,543,542,75,74,-2,-1,7,6,35,34,11,-2,69,68,117,116,537,536,531,530,525,524,848,847],[563,562,557,556,551,550,545,544,77,76,-2,33,9,8,25,24,-1,-2,71,70,119,118,539,538,533,532,527,526,849,-3],[565,564,571,570,577,576,583,582,589,588,595,594,601,600,607,606,613,612,619,618,625,624,631,630,637,636,643,642,851,850],[567,566,573,572,579,578,585,584,591,590,597,596,603,602,609,608,615,614,621,620,627,626,633,632,639,638,645,644,852,-3],[569,568,575,574,581,580,587,586,593,592,599,598,605,604,611,610,617,616,623,622,629,628,635,634,641,640,647,646,854,853],[727,726,721,720,715,714,709,708,703,702,697,696,691,690,685,684,679,678,673,672,667,666,661,660,655,654,649,648,855,-3],[729,728,723,722,717,716,711,710,705,704,699,698,693,692,687,686,681,680,675,674,669,668,663,662,657,656,651,650,857,856],[731,730,725,724,719,718,713,712,707,706,701,700,695,694,689,688,683,682,677,676,671,670,665,664,659,658,653,652,858,-3],[733,732,739,738,745,744,751,750,757,756,763,762,769,768,775,774,781,780,787,786,793,792,799,798,805,804,811,810,860,859],[735,734,741,740,747,746,753,752,759,758,765,764,771,770,777,776,783,782,789,788,795,794,801,800,807,806,813,812,861,-3],[737,736,743,742,749,748,755,754,761,760,767,766,773,772,779,778,785,784,791,790,797,796,803,802,809,808,815,814,863,862]],t})(),by=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Cy=(function(){function t(){}return t.decode=function(e,n){var r=[];switch(n){case 2:case 3:{var a=void 0;if(n===2){var o=t.getPostCode2(e),i=t.getPostCode2Length(e);if(i>10)throw P.getFormatInstance();a=String(o).padStart(i,"0")}else a=t.getPostCode3(e);var s=String(t.getCountry(e)).padStart(3,"0"),c=String(t.getServiceClass(e)).padStart(3,"0"),l=t.getMessage(e,10,84);r.push(l),r.join("").startsWith("[)>"+t.RS+"01"+t.GS)?(r.splice(0,r.length),r.push(l.substring(0,9)),r.push(a+t.GS+s+t.GS+c+t.GS),r.push(l.substring(9))):(r.splice(0,r.length),r.push(a+t.GS+s+t.GS+c+t.GS),r.push(l));break}case 4:r.push(t.getMessage(e,1,93));break;case 5:r.push(t.getMessage(e,1,77));break}return new aa(e,r.join(""),null,String(n))},t.getBit=function(e,n){return e--,(n[Math.floor(e/6)]&1<<5-e%6)===0?0:1},t.getInt=function(e,n){for(var r=0,a=0;a<n.length;a++)r+=t.getBit(n[a],e)<<n.length-a-1;return r},t.getCountry=function(e){return t.getInt(e,t.COUNTRY_BYTES)},t.getServiceClass=function(e){return t.getInt(e,t.SERVICE_CLASS_BYTES)},t.getPostCode2Length=function(e){return t.getInt(e,t.POSTCODE_2_LENGTH_BYTES)},t.getPostCode2=function(e){return t.getInt(e,t.POSTCODE_2_BYTES)},t.getPostCode3=function(e){var n,r,a=[];try{for(var o=by(t.POSTCODE_3_BYTES),i=o.next();!i.done;i=o.next()){var s=i.value;a.push(t.SETS[0].charAt(t.getInt(e,s)))}}catch(c){n={error:c}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a.join("")},t.getMessage=function(e,n,r){for(var a=[],o=-1,i=0,s=0,c=n;c<n+r;c++){var l=t.SETS[i].charAt(e[c]);switch(l){case t.LATCHA:i=0,o=-1;break;case t.LATCHB:i=1,o=-1;break;case t.SHIFTA:case t.SHIFTB:case t.SHIFTC:case t.SHIFTD:case t.SHIFTE:s=i,i=l.charCodeAt(0)-t.SHIFTA.charCodeAt(0),o=1;break;case t.TWOSHIFTA:s=i,i=0,o=2;break;case t.THREESHIFTA:s=i,i=0,o=3;break;case t.NS:{var u=(e[++c]<<24)+(e[++c]<<18)+(e[++c]<<12)+(e[++c]<<6)+e[++c];a.push(String(u).padStart(9,"0"));break}
38case t.LOCK:o=-1;break;default:a.push(l)}o--===0&&(i=s)}for(;a.length>0&&a[a.length-1]===t.PAD;)a.pop();return a.join("")},t.SHIFTA="ï¿°",t.SHIFTB="￱",t.SHIFTC="￲",t.SHIFTD="￳",t.SHIFTE="ï¿´",t.TWOSHIFTA="￵",t.THREESHIFTA="ï¿¶",t.LATCHA="ï¿·",t.LATCHB="￸",t.LOCK="",t.ECI="",t.NS="ï¿»",t.PAD="",t.FS="�",t.GS="�",t.RS="�",t.COUNTRY_BYTES=[53,54,43,44,45,46,47,48,37,38],t.SERVICE_CLASS_BYTES=[55,56,57,58,59,60,49,50,51,52],t.POSTCODE_2_LENGTH_BYTES=[39,40,41,42,31,32],t.POSTCODE_2_BYTES=[33,34,35,36,25,26,27,28,29,30,19,20,21,22,23,24,13,14,15,16,17,18,7,8,9,10,11,12,1,2],t.POSTCODE_3_BYTES=[[39,40,41,42,31,32],[33,34,35,36,25,26],[27,28,29,30,19,20],[21,22,23,24,13,14],[15,16,17,18,7,8],[9,10,11,12,1,2]],t.SETS=["\rABCDEFGHIJKLMNOPQRSTUVWXYZ"+t.ECI+t.FS+t.GS+t.RS+t.NS+" "+t.PAD+`"#$%&'()*+,-./0123456789:`+t.SHIFTB+t.SHIFTC+t.SHIFTD+t.SHIFTE+t.LATCHB,"`abcdefghijklmnopqrstuvwxyz"+t.ECI+t.FS+t.GS+t.RS+t.NS+"{"+t.PAD+"}~�;<=>?[\\]^_ ,./:@!|"+t.PAD+t.TWOSHIFTA+t.THREESHIFTA+t.PAD+t.SHIFTA+t.SHIFTC+t.SHIFTD+t.SHIFTE+t.LATCHA,"ÃÃÃÃÃà ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ"+t.ECI+t.FS+t.GS+t.RS+t.NS+"ÃÃÃÃꬱ²³µ¹º¼½¾Â ÂÂÂÂ"+t.LATCHA+" "+t.LOCK+t.SHIFTD+t.SHIFTE+t.LATCHB,"à áâãäåæçèéêëìÃîïðñòóôõö÷øùú"+t.ECI+t.FS+t.GS+t.RS+t.NS+"ûüýþÿ¡¨«¯°´·¸»¿ÂÂÂÂÂÂÂÂÂÂÂ"+t.LATCHA+" "+t.SHIFTC+t.LOCK+t.SHIFTE+t.LATCHB,`\0������\x07\b 39\v\f\r�������������`+t.ECI+t.PAD+t.PAD+"\x1B"+t.NS+t.FS+t.GS+t.RS+"� ¢£¤¥¦§©Â®¶ÂÂÂÂÂÂÂÂÂÂ"+t.LATCHA+" "+t.SHIFTC+t.SHIFTD+t.LOCK+t.LATCHB],t})(),_y=(function(){function t(){this.rsDecoder=new oa(St.MAXICODE_FIELD_64)}return t.prototype.decode=function(e,n){var r=new wy(e),a=r.readCodewords(),o=this.correctErrors(a,0,10,10,t.ALL),i=a[0]&15,s;switch(i){case 2:case 3:case 4:o+=this.correctErrors(a,20,84,40,t.EVEN),o+=this.correctErrors(a,20,84,40,t.ODD),s=new Uint8Array(94);break;case 5:o+=this.correctErrors(a,20,68,56,t.EVEN),o+=this.correctErrors(a,20,68,56,t.ODD),s=new Uint8Array(78);break;default:throw P.getFormatInstance()}for(var c=0;c<10;c++)s[c]=a[c];for(var c=0;c<s.length-10;c++)s[c+10]=a[c+20];var l=Cy.decode(s,i);return l.setErrorsCorrected(o),l},t.prototype.correctErrors=function(e,n,r,a,o){for(var i=r+a,s=o===t.ALL?1:2,c=new Int32Array(Math.floor(i/s)),l=0;l<i;l++)(o===t.ALL||l%2===o-1)&&(c[Math.floor(l/s)]=e[l+n]&255);var u=0;try{u=this.rsDecoder.decodeWithECCount(c,Math.floor(a/s))}catch(d){throw d instanceof ja?Ke.getChecksumInstance():d}for(var l=0;l<r;l++)(o===t.ALL||l%2===o-1)&&(e[l+n]=c[Math.floor(l/s)]);return u},t.ALL=0,t.EVEN=1,t.ODD=2,t})(),Cu=(function(){function t(){this.decoder=new _y}
39return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=t.extractPureBits(e.getBlackMatrix()),a=this.decoder.decode(r,n),o=new yt(a.getText(),a.getRawBytes(),8*a.getRawBytes().length,t.NO_POINTS,X.MAXICODE,Ne.currentTimeMillis());o.putMetadata(tt.ERRORS_CORRECTED,a.getErrorsCorrected());var i=a.getECLevel();return i!=null&&o.putMetadata(tt.ERROR_CORRECTION_LEVEL,i),o},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getEnclosingRectangle();if(n==null)throw new D;for(var r=n[0],a=n[1],o=n[2],i=n[3],s=new on(t.MATRIX_WIDTH,t.MATRIX_HEIGHT),c=0;c<t.MATRIX_HEIGHT;c++)for(var l=a+Math.min(Math.floor((c*i+i/2)/t.MATRIX_HEIGHT),i-1),u=0;u<t.MATRIX_WIDTH;u++){var d=r+Math.min(Math.floor((u*o+o/2+(c&1)*Math.floor(o/2))/t.MATRIX_WIDTH),o-1);e.get(d,l)&&s.set(u,c)}return s},t.NO_POINTS=[],t.MATRIX_WIDTH=30,t.MATRIX_HEIGHT=33,t})(),Ay=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pe=(function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(e){return xe.sum(e)},t.toIntArray=function(e){var n,r;if(e==null||!e.length)return t.EMPTY_INT_ARRAY;var a=new Int32Array(e.length),o=0;try{for(var i=Ay(e),s=i.next();!s.done;s=i.next()){var c=s.value;a[o++]=c}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},t.getCodeword=function(e){var n=ht.binarySearch(t.SYMBOL_TABLE,e&262143);return n<0?-1:(t.CODEWORD_TABLE[n
vendor: 31,401 bytes, line 39
39]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.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]),t.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]),t}
39)(),Ey=(function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t})(),Sy=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Iy=(function(){function t(){}return t.detectMultiple=function(e,n,r){var a=e.getBlackMatrix(),o=t.detect(r,a);return o.length||(a=a.clone(),a.rotate180(),o=t.detect(r,a)),new Ey(a,o)},t.detect=function(e,n){for(var r,a,o=new Array,i=0,s=0,c=!1;i<n.getHeight();){var l=t.findVertices(n,i,s);if(l[0]==null&&l[3]==null){if(!c)break;c=!1,s=0;try{for(var u=(r=void 0,Sy(o)),d=u.next();!d.done;d=u.next()){var f=d.value;f[1]!=null&&(i=Math.trunc(Math.max(i,f[1].getY()))),f[3]!=null&&(i=Math.max(i,Math.trunc(f[3].getY())))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}i+=t.ROW_STEP;continue}if(c=!0,o.push(l),!e)break;l[2]!=null?(s=Math.trunc(l[2].getX()),i=Math.trunc(l[2].getY())):(s=Math.trunc(l[4].getX()),i=Math.trunc(l[4].getY()))}return o},t.findVertices=function(e,n,r){var a=e.getHeight(),o=e.getWidth(),i=new Array(8);return t.copyToResult(i,t.findRowsWithPattern(e,a,o,n,r,t.START_PATTERN),t.INDEXES_START_PATTERN),i[4]!=null&&(r=Math.trunc(i[4].getX()),n=Math.trunc(i[4].getY())),t.copyToResult(i,t.findRowsWithPattern(e,a,o,n,r,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),i},t.copyToResult=function(e,n,r){for(var a=0;a<r.length;a++)e[r[a]]=n[a]},t.findRowsWithPattern=function(e,n,r,a,o,i){for(var s=new Array(4),c=!1,l=new Int32Array(i.length);a<n;a+=t.ROW_STEP){var u=t.findGuardPattern(e,o,a,r,!1,i,l);if(u!=null){for(;a>0;){var d=t.findGuardPattern(e,o,--a,r,!1,i,l);if(d!=null)u=d;else{a++;break}}s[0]=new $(u[0],a),s[1]=new $(u[1],a),c=!0;break}}var f=a+1;if(c){for(var p=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);f<n;f++){var u=t.findGuardPattern(e,d[0],f,r,!1,i,l);if(u!=null&&Math.abs(d[0]-u[0])<t.MAX_PATTERN_DRIFT&&Math.abs(d[1]-u[1])<t.MAX_PATTERN_DRIFT)d=u,p=0;else{if(p>t.SKIPPED_ROW_COUNT_MAX)break;p++}}f-=p+1,s[2]=new $(d[0],f),s[3]=new $(d[1],f)}return f-a<t.BARCODE_MIN_HEIGHT&&ht.fill(s,null),s},t.findGuardPattern=function(e,n,r,a,o,i,s){ht.fillWithin(s,0,s.length,0);for(var c=n,l=0;e.get(c,r)&&c>0&&l++<t.MAX_PIXEL_DRIFT;)c--;for(var u=c,d=0,f=i.length,p=o;u<a;u++){var g=e.get(u,r);if(g!==p)s[d]++;else{if(d===f-1){if(t.patternMatchVariance(s,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([c,u]);c+=s[0]+s[1],Ne.arraycopy(s,2,s,0,d-1),s[d-1]=0,s[d]=0,d--}else d++;s[d]=1,p=!p}}return d===f-1&&t.patternMatchVariance(s,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([c,u-1]):null},t.patternMatchVariance=function(e,n,r){for(var a=e.length,o=0,i=0,s=0;s<a;s++)o+=e[s],i+=n[s];if(o<i)return 1/0;var c=o/i;r*=c;for(var l=0,u=0;u<a;u++){var d=e[u],f=n[u]*c,p=d>f?d-f:f-d;if(p>r)return 1/0;l+=p}return l/o},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t})(),Ry=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_r=(function(){function t(e,n){if(n.length===0)throw new Q;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var a=1;a<r&&n[a]===0;)a++;a===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-a),Ne.arraycopy(n,a,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){var n,r;if(e===0)return this.getCoefficient(0);if(e===1){var a=0;try{for(var o=Ry(this.coefficients),i=o.next();!i.done;i=o.next()){var s=i.value;a=this.field.add(a,s)}}catch(d){n={error:d}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}for(var c=this.coefficients[0],l=this.coefficients.length,u=1;u<l;u++)c=this.field.add(this.field.multiply(e,c),this.coefficients[u]);return c},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new Q("ModulusPolys do n
39ot have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var a=n;n=r,r=a}var o=new Int32Array(r.length),i=r.length-n.length;Ne.arraycopy(r,0,o,0,i);for(var s=i;s<r.length;s++)o[s]=this.field.add(n[s-i],r[s]);return new t(this.field,o)},t.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new Q("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new Q("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var n=this.coefficients,r=n.length,a=e.coefficients,o=a.length,i=new Int32Array(r+o-1),s=0;s<r;s++)for(var c=n[s],l=0;l<o;l++)i[s+l]=this.field.add(i[s+l],this.field.multiply(c,a[l]));return new t(this.field,i)},t.prototype.negative=function(){for(var e=this.coefficients.length,n=new Int32Array(e),r=0;r<e;r++)n[r]=this.field.subtract(0,this.coefficients[r]);return new t(this.field,n)},t.prototype.multiplyScalar=function(e){if(e===0)return new t(this.field,new Int32Array([0]));if(e===1)return this;for(var n=this.coefficients.length,r=new Int32Array(n),a=0;a<n;a++)r[a]=this.field.multiply(this.coefficients[a],e);return new t(this.field,r)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new Q;if(n===0)return new t(this.field,new Int32Array([0]));for(var r=this.coefficients.length,a=new Int32Array(r+e),o=0;o<r;o++)a[o]=this.field.multiply(this.coefficients[o],n);return new t(this.field,a)},t.prototype.toString=function(){for(var e=new se,n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);r!==0&&(r<0?(e.append(" - "),r=-r):e.length()>0&&e.append(" + "),(n===0||r!==1)&&e.append(r),n!==0&&(n===1?e.append("x"):(e.append("x^"),e.append(n))))}return e.toString()},t})(),Ty=(function(){function t(){}return t.prototype.add=function(e,n){return(e+n)%this.modulus},t.prototype.subtract=function(e,n){return(this.modulus+e-n)%this.modulus},t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new Q;return this.logTable[e]},t.prototype.inverse=function(e){if(e===0)throw new i0;return this.expTable[this.modulus-this.logTable[e]-1]},t.prototype.multiply=function(e,n){return e===0||n===0?0:this.expTable[(this.logTable[e]+this.logTable[n])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(e){return e===this},t})(),Ny=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Oy=(function(t){Ny(e,t);function e(n,r){var a=t.call(this)||this;a.modulus=n,a.expTable=new Int32Array(n),a.logTable=new Int32Array(n);for(var o=1,i=0;i<n;i++)a.expTable[i]=o,o=o*r%n;for(var i=0;i<n-1;i++)a.logTable[a.expTable[i]]=i;return a.zero=new _r(a,new Int32Array([0])),a.one=new _r(a,new Int32Array([1])),a}return e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new Q;if(r===0)return this.zero;var a=new Int32Array(n+1);return a[0]=r,new _r(this,a)},e.PDF417_GF=new e(pe.NUMBER_OF_CODEWORDS,3),e})(Ty),Dy=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},My=(function(){function t(){this.field=Oy.PDF417_GF}return t.prototype.decode=function(e,n,r){for(var a,o,i=new _r(this.field,e),s=new Int32Array(n),c=!1,l=n;l>0;l--){var u=i.evaluateAt(this.field.exp(l));s[n-l]=u,u!==0&&(c=!0)}if(!c)return 0;var d=this.field.getOne();if(r!=null)try{for(var f=Dy(r),p=f.next();!p.done;p=f.next()){var g=p.value,m=this.field.exp(e.length-1-g),y=new _r(this.field,new Int32Array([this.field.subtract(0,m),1]));d=d.multiply(y)}}catch(E){a={error:E}}
39finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}for(var v=new _r(this.field,s),w=this.runEuclideanAlgorithm(this.field.buildMonomial(n,1),v,n),b=w[0],_=w[1],A=this.findErrorLocations(b),T=this.findErrorMagnitudes(_,b,A),l=0;l<A.length;l++){var S=e.length-1-this.field.log(A[l]);if(S<0)throw Ke.getChecksumInstance();e[S]=this.field.subtract(e[S],T[l])}return A.length},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var a=e;e=n,n=a}for(var o=e,i=n,s=this.field.getZero(),c=this.field.getOne();i.getDegree()>=Math.round(r/2);){var l=o,u=s;if(o=i,s=c,o.isZero())throw Ke.getChecksumInstance();i=l;for(var d=this.field.getZero(),f=o.getCoefficient(o.getDegree()),p=this.field.inverse(f);i.getDegree()>=o.getDegree()&&!i.isZero();){var g=i.getDegree()-o.getDegree(),m=this.field.multiply(i.getCoefficient(i.getDegree()),p);d=d.add(this.field.buildMonomial(g,m)),i=i.subtract(o.multiplyByMonomial(g,m))}c=d.multiply(s).subtract(u).negative()}var y=c.getCoefficient(0);if(y===0)throw Ke.getChecksumInstance();var v=this.field.inverse(y),w=c.multiply(v),b=i.multiply(v);return[w,b]},t.prototype.findErrorLocations=function(e){for(var n=e.getDegree(),r=new Int32Array(n),a=0,o=1;o<this.field.getSize()&&a<n;o++)e.evaluateAt(o)===0&&(r[a]=this.field.inverse(o),a++);if(a!==n)throw Ke.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(e,n,r){for(var a=n.getDegree(),o=new Int32Array(a),i=1;i<=a;i++)o[a-i]=this.field.multiply(i,n.getCoefficient(i));for(var s=new _r(this.field,o),c=r.length,l=new Int32Array(c),i=0;i<c;i++){var u=this.field.inverse(r[i]),d=this.field.subtract(0,e.evaluateAt(u)),f=this.field.inverse(s.evaluateAt(u));l[i]=this.field.multiply(d,f)}return l},t})(),Os=(function(){function t(e,n,r,a,o){e instanceof t?this.constructor_2(e):this.constructor_1(e,n,r,a,o)}return t.prototype.constructor_1=function(e,n,r,a,o){var i=n==null||r==null,s=a==null||o==null;if(i&&s)throw new D;i?(n=new $(0,a.getY()),r=new $(0,o.getY())):s&&(a=new $(e.getWidth()-1,n.getY()),o=new $(e.getWidth()-1,r.getY())),this.image=e,this.topLeft=n,this.bottomLeft=r,this.topRight=a,this.bottomRight=o,this.minX=Math.trunc(Math.min(n.getX(),r.getX())),this.maxX=Math.trunc(Math.max(a.getX(),o.getX())),this.minY=Math.trunc(Math.min(n.getY(),a.getY())),this.maxY=Math.trunc(Math.max(r.getY(),o.getY()))},t.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},t.merge=function(e,n){return e==null?n:n==null?e:new t(e.image,e.topLeft,e.bottomLeft,n.topRight,n.bottomRight)},t.prototype.addMissingRows=function(e,n,r){var a=this.topLeft,o=this.bottomLeft,i=this.topRight,s=this.bottomRight;if(e>0){var c=r?this.topLeft:this.topRight,l=Math.trunc(c.getY()-e);l<0&&(l=0);var u=new $(c.getX(),l);r?a=u:i=u}if(n>0){var d=r?this.bottomLeft:this.bottomRight,f=Math.trunc(d.getY()+n);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var p=new $(d.getX(),f);r?o=p:s=p}return new t(this.image,a,o,i,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t})(),Fy=(function(){function t(e,n,r,a){this.columnCount=e,this.errorCorrectionLevel=a,this.rowCountUpperPart=n,this.rowCountLowerPart=r,this.rowCount=n+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t})(),gc=(function(){function t(){this.buffer=""}return t.form=function(e,n){var r=-1;function a(i,s,c,l,u,d){if(i==="%%")return"%";if(n[++r]!==void 0){i=l?parseInt(l.substr(1)):void 0;var f=u?parseInt(u.substr(1)):void 0,p;switch(d){case"s":p=n[r];break;case"c":p=n[r][0];break;case"f":p=parseFloat(n[r]).toFixed(i);break;case"p":p=parseFloat(n[r]).toPrecision(i);break;case"e":p=parseFloat(n[r]).toExponential(i);break;case"x":p=parseInt(n[r]).toString(f||16);break;case"d":p=parseFloat(parseInt(n[r],f||10).toPrecision(i)).toFixed(0);break}p=typeof p=="object"?JSON.stringify(p):(+p).toString(f);for(var g=parseInt(c),m=c&&c[0]+""=="0"?"0":" ";p.length<g;)p=s!==void 0?p+m:m+p;return p}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(o,a)},t.prototype.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.buffer+=t.form(e,n)},t.prototype.toString=function(){return this.buffer},t})(),Py=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},h0=(function(){function t(e){this.boundingBox=new Os(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var n=this.getCodeword(e);if(n!=null)return n;for(var r=1;r<t.MAX_NEARBY_DISTANCE;r++){var a=this.imageRowToCodewordIndex(e)-r;if(a>=0&&(n=this.codewords[a],n!=null)||(a=this.imageRowToCodewordIndex(e)+r,a<this.codewords.length&&(n=this.codewords[a],n!=null)))return n}return null},t.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()}
39,t.prototype.setCodeword=function(e,n){this.codewords[this.imageRowToCodewordIndex(e)]=n},t.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var e,n,r=new gc,a=0;try{for(var o=Py(this.codewords),i=o.next();!i.done;i=o.next()){var s=i.value;if(s==null){r.format("%3d: | %n",a++);continue}r.format("%3d: %3d|%3d%n",a++,s.getRowNumber(),s.getValue())}}catch(c){e={error:c}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t})(),ky=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},By=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),a,o=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},La=(function(){function t(){this.values=new Map}return t.prototype.setValue=function(e){e=Math.trunc(e);var n=this.values.get(e);n==null&&(n=0),n++,this.values.set(e,n)},t.prototype.getValue=function(){var e,n,r=-1,a=new Array,o=function(d,f){var p={getKey:function(){return d},getValue:function(){return f}};p.getValue()>r?(r=p.getValue(),a=[],a.push(p.getKey())):p.getValue()===r&&a.push(p.getKey())};try{for(var i=ky(this.values.entries()),s=i.next();!s.done;s=i.next()){var c=By(s.value,2),l=c[0],u=c[1];o(l,u)}}catch(d){e={error:d}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return pe.toIntArray(a)},t.prototype.getConfidence=function(e){return this.values.get(e)},t})(),jy=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ji=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_u=(function(t){jy(e,t);function e(n,r){var a=t.call(this,n)||this;return a._isLeft=r,a}return e.prototype.setRowNumbers=function(){var n,r;try{for(var a=Ji(this.getCodewords()),o=a.next();!o.done;o=a.next()){var i=o.value;i?.setRowNumberAsRowIndicatorColumn()}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(n){var r=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(r,n);for(var a=this.getBoundingBox(),o=this._isLeft?a.getTopLeft():a.getTopRight(),i=this._isLeft?a.getBottomLeft():a.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(o.getY())),c=this.imageRowToCodewordIndex(Math.trunc(i.getY())),l=-1,u=1,d=0,f=s;f<c;f++)if(r[f]!=null){var p=r[f],g=p.getRowNumber()-l;if(g===0)d++;else if(g===1)u=Math.max(u,d),d=1,l=p.getRowNumber();else if(g<0||p.getRowNumber()>=n.getRowCount()||g>f)r[f]=null;else{var m=void 0;u>2?m=(u-2)*g:m=g;for(var y=m>=f,v=1;v<=m&&!y;v++)y=r[f-v]!=null;y?r[f]=null:(l=p.getRowNumber(),d=1)}}},e.prototype.getRowHeights=function(){var n,r,a=this.getBarcodeMetadata();if(a==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(a);var o=new Int32Array(a.getRowCount());try{for(var i=Ji(this.getCodewords()),s=i.next();!s.done;s=i.next()){var c=s.value;if(c!=null){var l=c.getRowNumber();if(l>=o.length)continue;o[l]++}}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(n){for(var r=this.getBoundingBox(),a=this._isLeft?r.getTopLeft():r.getTopRight(),o=this._isLeft?r.getBottomLeft():r.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(a.getY())),s=this.imageRowToCodewordIndex(Math.trunc(o.getY())),c=this.getCodewords(),l=-1,u=i;u<s;u++)if(c[u]!=null){var d=c[u];d.setRowNumberAsRowIndicatorColumn();var f=d.getRowNumber()-l;f===0||(f===1?l=d.getRowNumber():d.getRowNumber()>=n.getRowCount()?c[u]=null:l=d.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var n,r,a=this.getCodewords(),o=new La,i=new La,s=new La,c=new La;try{for(var l=Ji(a),u=l.next();!u.done;u=l.next()){var d=u.value;if(d!=null){d.setRowNumberAsRowIndicatorColumn();var f=d.getValue()%30,p=d.getRowNumber();switch(this._isLeft||(p+=2),p%3){case 0:i.setValue(f*3+1);break;case 1:c.setValue(f/3),s.setValue(f%3);break;case 2:o.setValue(f+1);break}}}}catch(m){n={error:m}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}if(o.getValue().length===0||i.getValue().length===0||s.getValue().length===0||c.getValue().length===0||o.getValue()[0]<1||i.getValue()[0]+s.getValue()[0]<pe.MIN_ROWS_IN_BARCODE||i.getValue()[0]+s.getValue()[0]>pe.MAX_ROWS_IN_BARCODE)return null;var g=new Fy(o.getValue()[0],i.getValue()[0],s.getValue()[0],c.getValue()[0]);return this.removeIncorrectCodewords(a,g),g},e.prototype.removeIncorrectCodewords=function(n,r){for(var a=0;a<n.length;a++){var o=n[a];if(n[a]!=null){var i=o.getValue()%30,s=o.getRowNumber();if(s>r.getRowCount()){n[a]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:i*3+1!==r.getRowCountUpperPart()&&(n[a]=null);break;case 1:(Math.trunc(i/3)!==r.getErrorCorrectionLevel()||i%3!==r.getRowCountLowerPart())&&(n[a]=null);break;case 2:i+1!==r.getColumnCount()&&(n[a]=null);break}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+` 40`+t.prototype.toString.call(this)},e})(h0),Ly=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vy=(function(){function t(e,n){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=n,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e=pe.MAX_CODEWORDS_IN_BARCODE,n;do n=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e<n);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(e){e?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var n=1;n<this.barcodeColumnCount+1;n++)for(var r=this.detectionResultColumns[n].getCodewords(),a=0;a<r.length;a++)r[a]!=null&&(r[a].hasValidRowNumber()||this.adjustRowNumbers(n,a,r));return e},t.prototype.adjustRowNumbersByRow=function(){this.adjustRowNumbersFromBothRI();var e=this.adjustRowNumbersFromLRI();return e+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(!(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)){for(var e=this.detectionResultColumns[0].getCodewords(),n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<e.length;r++)if(e[r]!=null&&n[r]!=null&&e[r].getRowNumber()===n[r].getRowNumber())for(var a=1;a<=this.barcodeColumnCount;a++){var o=this.detectionResultColumns[a].getCodewords()[r];o!=null&&(o.setRowNumber(e[r].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[a].getCodewords()[r]=null))}}},t.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var e=0,n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var a=n[r].getRowNumber(),o=0,i=this.barcodeColumnCount+1;i>0&&o<this.ADJUST_ROW_NUMBER_SKIP;i--){var s=this.detectionResultColumns[i].getCodewords()[r];s!=null&&(o=t.adjustRowNumberIfValid(a,o,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var e=0,n=this.detectionResultColumns[0].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var a=n[r].getRowNumber(),o=0,i=1;i<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;i++){var s=this.detectionResultColumns[i].getCodewords()[r];s!=null&&(o=t.adjustRowNumberIfValid(a,o,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(e,n,r){return r==null||r.hasValidRowNumber()||(r.isValidRowNumber(e)?(r.setRowNumber(e),n=0):++n),n},t.prototype.adjustRowNumbers=function(e,n,r){var a,o;if(this.detectionResultColumns[e-1]!=null){var i=r[n],s=this.detectionResultColumns[e-1].getCodewords(),c=s;this.detectionResultColumns[e+1]!=null&&(c=this.detectionResultColumns[e+1].getCodewords());var l=new Array(14);l[2]=s[n],l[3]=c[n],n>0&&(l[0]=r[n-1],l[4]=s[n-1],l[5]=c[n-1]),n>1&&(l[8]=r[n-2],l[10]=s[n-2],l[11]=c[n-2]),n<r.length-1&&(l[1]=r[n+1],l[6]=s[n+1],l[7]=c[n+1]),n<r.length-2&&(l[9]=r[n+2],l[12]=s[n+2],l[13]=c[n+2]);try{for(var u=Ly(l),d=u.next();!d.done;d=u.next()){var f=d.value;if(t.adjustRowNumber(i,f))return}}catch(p){a={error:p}}
40finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}}},t.adjustRowNumber=function(e,n){return n==null?!1:n.hasValidRowNumber()&&n.getBucket()===e.getBucket()?(e.setRowNumber(n.getRowNumber()),!0):!1},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(e){this.boundingBox=e},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(e,n){this.detectionResultColumns[e]=n},t.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},t.prototype.toString=function(){var e=this.detectionResultColumns[0];e==null&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var n=new gc,r=0;r<e.getCodewords().length;r++){n.format("CW %3d:",r);for(var a=0;a<this.barcodeColumnCount+2;a++){if(this.detectionResultColumns[a]==null){n.format(" | ");continue}var o=this.detectionResultColumns[a].getCodewords()[r];if(o==null){n.format(" | ");continue}n.format(" %3d|%3d",o.getRowNumber(),o.getValue())}n.format("%n")}return n.toString()},t})(),Uy=(function(){function t(e,n,r,a){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(n),this.bucket=Math.trunc(r),this.value=Math.trunc(a)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(e){this.rowNumber=e},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t})(),zy=(function(){function t(){}return t.initialize=function(){for(var e=0;e<pe.SYMBOL_TABLE.length;e++)for(var n=pe.SYMBOL_TABLE[e],r=n&1,a=0;a<pe.BARS_IN_MODULE;a++){for(var o=0;(n&1)===r;)o+=1,n>>=1;r=n&1,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(pe.BARS_IN_MODULE)),t.RATIOS_TABLE[e][pe.BARS_IN_MODULE-a-1]=Math.fround(o/pe.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var n=t.getDecodedCodewordValue(t.sampleBitCounts(e));return n!==-1?n:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(e){for(var n=xe.sum(e),r=new Int32Array(pe.BARS_IN_MODULE),a=0,o=0,i=0;i<pe.MODULES_IN_CODEWORD;i++){var s=n/(2*pe.MODULES_IN_CODEWORD)+i*n/pe.MODULES_IN_CODEWORD;o+e[a]<=s&&(o+=e[a],a++),r[a]++}return r},t.getDecodedCodewordValue=function(e){var n=t.getBitValue(e);return pe.getCodeword(n)===-1?-1:n},t.getBitValue=function(e){for(var n=0,r=0;r<e.length;r++)for(var a=0;a<e[r];a++)n=n<<1|(r%2===0?1:0);return Math.trunc(n)},t.getClosestDecodedValue=function(e){var n=xe.sum(e),r=new Array(pe.BARS_IN_MODULE);if(n>1)for(var a=0;a<r.length;a++)r[a]=Math.fround(e[a]/n);var o=Rs.MAX_VALUE,i=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var c=0,l=t.RATIOS_TABLE[s],u=0;u<pe.BARS_IN_MODULE;u++){var d=Math.fround(l[u]-r[u]);if(c+=Math.fround(d*d),c>=o)break}c<o&&(o=c,i=pe.SYMBOL_TABLE[s])}return i},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(pe.SYMBOL_TABLE.length).map(function(e){return new Array(pe.BARS_IN_MODULE)}),t})(),Wy=(function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(e){this.segmentIndex=e},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(e){this.fileId=e},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(e){this.optionalData=e},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(e){this.lastSegment=e},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(e){this.segmentCount=e},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(e){this.sender=e},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(e){this.addressee=e},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(e){this.fileName=e},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(e){this.fileSize=e},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(e){this.checksum=e},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(e){this.timestamp=e},t})(),Au=(function(){function t(){}return t.parseLong=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t})(),Hy=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
40e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$y=(function(t){Hy(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="NullPointerException",e})(zt),Gy=(function(){function t(){}return t.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},t.prototype.writeBytesOffset=function(e,n,r){if(e==null)throw new $y;if(n<0||n>e.length||r<0||n+r>e.length||n+r<0)throw new dc;if(r===0)return;for(var a=0;a<r;a++)this.write(e[n+a])},t.prototype.flush=function(){},t.prototype.close=function(){},t})(),Yy=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Xy=(function(t){Yy(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(zt),Ky=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Zy=(function(t){Ky(e,t);function e(n){n===void 0&&(n=32);var r=t.call(this)||this;if(r.count=0,n<0)throw new Q("Negative initial size: "+n);return r.buf=new Uint8Array(n),r}return e.prototype.ensureCapacity=function(n){n-this.buf.length>0&&this.grow(n)},e.prototype.grow=function(n){var r=this.buf.length,a=r<<1;if(a-n<0&&(a=n),a<0){if(n<0)throw new Xy;a=ce.MAX_VALUE}this.buf=ht.copyOfUint8Array(this.buf,a)},e.prototype.write=function(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1},e.prototype.writeBytesOffset=function(n,r,a){if(r<0||r>n.length||a<0||r+a-n.length>0)throw new dc;this.ensureCapacity(this.count+a),Ne.arraycopy(n,r,this.buf,this.count,a),this.count+=a},e.prototype.writeTo=function(n){n.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return ht.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(n){return new String(this.buf).toString()},e.prototype.toString_number=function(n){return new String(this.buf).toString()},e.prototype.close=function(){},e})(Gy),Te;(function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Te||(Te={}));function p0(){if(typeof window<"u")return window.BigInt||null;if(typeof globalThis<"u")return globalThis.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var Ro;function Zn(t){if(typeof Ro>"u"&&(Ro=p0()),Ro===null)throw new Error("BigInt is not supported!");return Ro(t)}function qy(){var t=[];t[0]=Zn(1);var e=Zn(900);t[1]=e;for(var n=2;n<16;n++)t[n]=t[n-1]*e;return t}var Qy=(function(){function t(){}return t.decode=function(e,n){var r=new se(""),a=ft.ISO8859_1;r.enableDecoding(a);for(var o=1,i=e[o++],s=new Wy;o<e[0];){switch(i){case t.TEXT_COMPACTION_MODE_LATCH:o=t.textCompaction(e,o,r);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:o=t.byteCompaction(i,e,a,o,r);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[o++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:o=t.numericCompaction(e,o,r);break;case t.ECI_CHARSET:ft.getCharacterSetECIByValue(e[o++]);break;case t.ECI_GENERAL_PURPOSE:o+=2;break;case t.ECI_USER_DEFINED:o++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=t.decodeMacroBlock(e,o,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new P;default:o--,o=t.textCompaction(e,o,r);break}if(o<e.length)i=e[o++];else throw P.getFormatInstance()}if(r.length()===0)throw P.getFormatInstance();var c=new aa(null,r.toString(),null,n);return c.setOther(s),c},t.decodeMacroBlock=function(e,n,r){if(n+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw P.getFormatInstance();for(var a=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o<t.NUMBER_OF_SEQUENCE_CODEWORDS;o++,n++)a[o]=e[n];r.setSegmentIndex(ce.parseInt(t.decodeBase900toBase10(a,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var i=new se;n=t.textCompaction(e,n,i),r.setFileId(i.toString());var s=-1;for(e[n]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=n+1);n<e[0];)switch(e[n]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(n++,e[n]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var c=new se;
vendor: 4,107 bytes, line 40
40n=t.textCompaction(e,n+1,c),r.setFileName(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var l=new se;n=t.textCompaction(e,n+1,l),r.setSender(l.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var u=new se;n=t.textCompaction(e,n+1,u),r.setAddressee(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var d=new se;n=t.numericCompaction(e,n+1,d),r.setSegmentCount(ce.parseInt(d.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new se;n=t.numericCompaction(e,n+1,f),r.setTimestamp(Au.parseLong(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var p=new se;n=t.numericCompaction(e,n+1,p),r.setChecksum(ce.parseInt(p.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var g=new se;n=t.numericCompaction(e,n+1,g),r.setFileSize(Au.parseLong(g.toString()));break;default:throw P.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:n++,r.setLastSegment(!0);break;default:throw P.getFormatInstance()}if(s!==-1){var m=n-s;r.isLastSegment()&&m--,r.setOptionalData(ht.copyOfRange(e,s,s+m))}return n},t.textCompaction=function(e,n,r){for(var a=new Int32Array((e[0]-n)*2),o=new Int32Array((e[0]-n)*2),i=0,s=!1;n<e[0]&&!s;){var c=e[n++];if(c<t.TEXT_COMPACTION_MODE_LATCH)a[i]=c/30,a[i+1]=c%30,i+=2;else switch(c){case t.TEXT_COMPACTION_MODE_LATCH:a[i++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a[i]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=e[n++],o[i]=c,i++;break}}return t.decodeTextCompaction(a,o,i,r),n},t.decodeTextCompaction=function(e,n,r,a){for(var o=Te.ALPHA,i=Te.ALPHA,s=0;s<r;){var c=e[s],l="";switch(o){case Te.ALPHA:if(c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=" ";break;case t.LL:o=Te.LOWER;break;case t.ML:o=Te.MIXED;break;case t.PS:i=o,o=Te.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=Te.ALPHA;break}break;case Te.LOWER:if(c<26)l=String.fromCharCode(97+c);else switch(c){case 26:l=" ";break;case t.AS:i=o,o=Te.ALPHA_SHIFT;break;case t.ML:o=Te.MIXED;break;case t.PS:i=o,o=Te.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=Te.ALPHA;break}break;case Te.MIXED:if(c<t.PL)l=t.MIXED_CHARS[c];else switch(c){case t.PL:o=Te.PUNCT;break;case 26:l=" ";break;case t.LL:o=Te.LOWER;break;case t.AL:o=Te.ALPHA;break;case t.PS:i=o,o=Te.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=Te.ALPHA;break}break;case Te.PUNCT:if(c<t.PAL)l=t.PUNCT_CHARS[c];else switch(c){case t.PAL:o=Te.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=Te.ALPHA;break}break;case Te.ALPHA_SHIFT:if(o=i,c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:o=Te.ALPHA;break}break;case Te.PUNCT_SHIFT:if(o=i,c<t.PAL)l=t.PUNCT_CHARS[c];else switch(c){case t.PAL:o=Te.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=Te.ALPHA;break}break}l!==""&&a.append(l),s++}},t.byteCompaction=function(e,n,r,a,o){var i=new Zy,s=0,c=0,l=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var u=new Int32Array(6),d=n[a++];a<n[0]&&!l;)switch(u[s++]=d,c=900*c+d,d=n[a++],d){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:a--,l=!0;break;default:if(s%5===0&&s>0){for(var f=0;f<6;++f)i.write(Number(Zn(c)>>Zn(8*(5-f))));c=0,s=0}break}a===n[0]&&d<t.TEXT_COMPACTION_MODE_LATCH&&(u[s++]=d);for(var p=0;p<s;p++)i.write(u[p]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;a<n[0]&&!l;){var g=n[a++];
40if(g<t.TEXT_COMPACTION_MODE_LATCH)s++,c=900*c+g;else switch(g){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:a--,l=!0;break}if(s%5===0&&s>0){for(var f=0;f<6;++f)i.write(Number(Zn(c)>>Zn(8*(5-f))));c=0,s=0}}break}return o.append(Ut.decode(i.toByteArray(),r)),a},t.numericCompaction=function(e,n,r){for(var a=0,o=!1,i=new Int32Array(t.MAX_NUMERIC_CODEWORDS);n<e[0]&&!o;){var s=e[n++];if(n===e[0]&&(o=!0),s<t.TEXT_COMPACTION_MODE_LATCH)i[a]=s,a++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,o=!0;break}(a%t.MAX_NUMERIC_CODEWORDS===0||s===t.NUMERIC_COMPACTION_MODE_LATCH||o)&&a>0&&(r.append(t.decodeBase900toBase10(i,a)),a=0)}return n},t.decodeBase900toBase10=function(e,n){for(var r=Zn(0),a=0;a<n;a++)r+=t.EXP900[n-a-1]*Zn(e[a]);var o=r.toString();if(o.charAt(0)!=="1")throw new P;return o.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,: 41-.$/"|*()?{}'`,t.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",t.EXP900=p0()?qy():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t})(),Da=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jy=(function(){function t(){}return t.decode=function(e,n,r,a,o,i,s){for(var c=new Os(e,n,r,a,o),l=null,u=null,d,f=!0;;f=!1){if(n!=null&&(l=t.getRowIndicatorColumn(e,c,n,!0,i,s)),a!=null&&(u=t.getRowIndicatorColumn(e,c,a,!1,i,s)),d=t.merge(l,u),d==null)throw D.getNotFoundInstance();var p=d.getBoundingBox();if(f&&p!=null&&(p.getMinY()<c.getMinY()||p.getMaxY()>c.getMaxY()))c=p;else break}d.setBoundingBox(c);var g=d.getBarcodeColumnCount()+1;d.setDetectionResultColumn(0,l),d.setDetectionResultColumn(g,u);for(var m=l!=null,y=1;y<=g;y++){var v=m?y:g-y;if(d.getDetectionResultColumn(v)===void 0){var w=void 0;v===0||v===g?w=new _u(c,v===0):w=new h0(c),d.setDetectionResultColumn(v,w);for(var b=-1,_=b,A=c.getMinY();A<=c.getMaxY();A++){if(b=t.getStartColumn(d,v,A,m),b<0||b>c.getMaxX()){if(_===-1)continue;b=_}var T=t.detectCodeword(e,c.getMinX(),c.getMaxX(),m,b,A,i,s);T!=null&&(w.setCodeword(A,T),_=b,i=Math.min(i,T.getWidth()),s=Math.max(s,T.getWidth()))}}}return t.createDecoderResult(d)},t.merge=function(e,n){if(e==null&&n==null)return null;var r=t.getBarcodeMetadata(e,n);if(r==null)return null;var a=Os.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(n));return new Vy(r,a)},t.adjustBoundingBox=function(e){var n,r;if(e==null)return null;var a=e.getRowHeights();if(a==null)return null;var o=t.getMax(a),i=0;try{for(var s=Da(a),c=s.next();!c.done;c=s.next()){var l=c.value;if(i+=o-l,l>0)break}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var u=e.getCodewords(),d=0;i>0&&u[d]==null;d++)i--;for(var f=0,d=a.length-1;d>=0&&(f+=o-a[d],!(a[d]>0));d--);for(var d=u.length-1;f>0&&u[d]==null;d--)f--;return e.getBoundingBox().addMissingRows(i,f,e.isLeft())},t.getMax=function(e){var n,r,a=-1;try{for(var o=Da(e),i=o.next();!i.done;i=o.next()){var s=i.value;a=Math.max(a,s)}}catch(c){n={error:c}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a},t.getBarcodeMetadata=function(e,n){var r;if(e==null||(r=e.getBarcodeMetadata())==null)return n==null?null:n.getBarcodeMetadata();var a;return n==null||(a=n.getBarcodeMetadata())==null?r:r.getColumnCount()!==a.getColumnCount()&&r.getErrorCorrectionLevel()!==a.getErrorCorrectionLevel()&&r.getRowCount()!==a.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,n,r,a,o,i){for(var s=new _u(n,a),c=0;c<2;c++)for(var l=c===0?1:-1,u=Math.trunc(Math.trunc(r.getX())),d=Math.trunc(Math.trunc(r.getY()));d<=n.getMaxY()&&d>=n.getMinY();d+=l){var f=t.detectCodeword(e,0,e.getWidth(),a,u,d,o,i);f!=null&&(s.setCodeword(d,f),a?u=f.getStartX():u=f.getEndX())}return s},t.adjustCodewordCount=function(e,n){var r=n[0][1],a=r.getValue(),o=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(a.length===0){if(o<1||o>pe.MAX_CODEWORDS_IN_BARCODE)throw D.getNotFoundInstance();r.setValue(o)}else a[0]!==o&&r.setValue(o)},t.createDecoderResult=function(e){var n=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,n);for(var r=new Array,a=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),o=[],i=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var c=0;c<e.getBarcodeColumnCount();c++){var l=n[s][c+1].getValue(),u=s*e.getBarcodeColumnCount()+c;l.length===0?r.push(u):l.length===1?a[u]=l[0]:(i.push(u),o.push(l))}for(var d=new Array(o.length),f=0;f<d.length;f++)d[f]=o[f];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),a,pe.toIntArray(r),pe.toIntArray(i),d)},t.createDecoderResultFromAmbiguousValues=function(e,n,r,a,o){for(var i=new Int32Array(a.length),s=100;s-- >0;){for(var c=0;c<i.length;c++)n[a[c]]=o[c][i[c]];try{return t.decodeCodewords(n,e,r)}catch(u){var l=u instanceof Ke;if(!l)throw u}if(i.length===0)throw Ke.getChecksumInstance();for(var c=0;c<i.length;c++)if(i[c]<o[c].length-1){i[c]++;break}else if(i[c]=0,c===i.length-1)throw Ke.getChecksumInstance()}throw Ke.getChecksumInstance()},t.createBarcodeMatrix=function(e){for(var n,r,a,o,i=Array.from({length:e.getBarcodeRowCount()},function(){return new Array(e.getBarcodeColumnCount()+2)}),s=0;s<i.length;s++)for(var c=0;c<i[s].length;c++)i[s][c]=new La;var l=0;try{for(var u=Da(e.getDetectionResultColumns()),d=u.next();!d.done;d=u.next()){var f=d.value;if(f!=null)try{for(var p=(a=void 0,Da(f.getCodewords())),g=p.next();!g.done;g=p.next()){var m=g.value;if(m!=null){var y=m.getRowNumber();if(y>=0){if(y>=i.length)continue;i[y][l].setValue(m.getValue())}}}}catch(v){a={error:v}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}l++}}catch(v){n={error:v}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return i},t.isValidBarcodeColumn=function(e,n){return n>=0&&n<=e.getBarcodeColumnCount()+1},t.getStartColumn=function(e,n,r,a){var o,i,s=a?1:-1,c=null;if(t.isValidBarcodeColumn(e,n-s)&&(c=e.getDetectionResultColumn(n-s).getCodeword(r)),c!=null)return a?c.getEndX():c.getStartX();if(c=e.getDetectionResultColumn(n).getCodewordNearby(r),c!=null)return a?c.getStartX():c.getEndX();if(t.isValidBarcodeColumn(e,n-s)&&(c=e.getDetectionResultColumn(n-s).getCodewordNearby(r)),c!=null)return a?c.getEndX():c.getStartX();for(var l=0;t.isValidBarcodeColumn(e,n-s);){n-=s;try{for(var u=(o=void 0,Da(e.getDetectionResultColumn(n).getCodewords())),d=u.next();!d.done;d=u.next()){var f=d.value;if(f!=null)return(a?f.getEndX():f.getStartX())+s*l*(f.getEndX()-f.getStartX())}}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}l++}return a?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,n,r,a,o,i,s,c){o=t.adjustCodewordStartColumn(e,n,r,a,o,i);var l=t.getModuleBitCount(e,n,r,a,o,i);if(l==null)return null;var u,d=xe.sum(l);
41if(a)u=o+d;else{for(var f=0;f<l.length/2;f++){var p=l[f];l[f]=l[l.length-1-f],l[l.length-1-f]=p}u=o,o=u-d}if(!t.checkCodewordSkew(d,s,c))return null;var g=zy.getDecodedValue(l),m=pe.getCodeword(g);return m===-1?null:new Uy(o,u,t.getCodewordBucketNumber(g),m)},t.getModuleBitCount=function(e,n,r,a,o,i){for(var s=o,c=new Int32Array(8),l=0,u=a?1:-1,d=a;(a?s<r:s>=n)&&l<c.length;)e.get(s,i)===d?(c[l]++,s+=u):(l++,d=!d);return l===c.length||s===(a?r:n)&&l===c.length-1?c:null},t.getNumberOfECCodeWords=function(e){return 2<<e},t.adjustCodewordStartColumn=function(e,n,r,a,o,i){for(var s=o,c=a?-1:1,l=0;l<2;l++){for(;(a?s>=n:s<r)&&a===e.get(s,i);){if(Math.abs(o-s)>t.CODEWORD_SKEW_SIZE)return o;s+=c}c=-c,a=!a}return s},t.checkCodewordSkew=function(e,n,r){return n-t.CODEWORD_SKEW_SIZE<=e&&e<=r+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,n,r){if(e.length===0)throw P.getFormatInstance();var a=1<<n+1,o=t.correctErrors(e,r,a);t.verifyCodewordCount(e,a);var i=Qy.decode(e,""+n);return i.setErrorsCorrected(o),i.setErasures(r.length),i},t.correctErrors=function(e,n,r){if(n!=null&&n.length>r/2+t.MAX_ERRORS||r<0||r>t.MAX_EC_CODEWORDS)throw Ke.getChecksumInstance();return t.errorCorrection.decode(e,r,n)},t.verifyCodewordCount=function(e,n){if(e.length<4)throw P.getFormatInstance();var r=e[0];if(r>e.length)throw P.getFormatInstance();if(r===0)if(n<e.length)e[0]=e.length-n;else throw P.getFormatInstance()},t.getBitCountForCodeword=function(e){for(var n=new Int32Array(8),r=0,a=n.length-1;!((e&1)!==r&&(r=e&1,a--,a<0));)n[a]++,e>>=1;return n},t.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},t.toString=function(e){for(var n=new gc,r=0;r<e.length;r++){n.format("Row %2d: ",r);for(var a=0;a<e[r].length;a++){var o=e[r][a];o.getValue().length===0?n.format(" ",null):n.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}n.format("%n")}return n.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new My,t})(),ew=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ko=(function(){function t(){}
41return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=t.decode(e,n,!1);if(r==null||r.length===0||r[0]==null)throw D.getNotFoundInstance();return r[0]},t.prototype.decodeMultiple=function(e,n){n===void 0&&(n=null);try{return t.decode(e,n,!0)}catch(r){throw r instanceof P||r instanceof Ke?D.getNotFoundInstance():r}},t.decode=function(e,n,r){var a,o,i=new Array,s=Iy.detectMultiple(e,n,r);try{for(var c=ew(s.getPoints()),l=c.next();!l.done;l=c.next()){var u=l.value,d=Jy.decode(s.getBits(),u[4],u[5],u[6],u[7],t.getMinCodewordWidth(u),t.getMaxCodewordWidth(u)),f=new yt(d.getText(),d.getRawBytes(),void 0,u,X.PDF_417);f.putMetadata(tt.ERROR_CORRECTION_LEVEL,d.getECLevel());var p=d.getOther();p!=null&&f.putMetadata(tt.PDF417_EXTRA_METADATA,p),i.push(f)}}catch(g){a={error:g}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}return i.map(function(g){return g})},t.getMaxWidth=function(e,n){return e==null||n==null?0:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMinWidth=function(e,n){return e==null||n==null?ce.MAX_VALUE:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*pe.MODULES_IN_CODEWORD/pe.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*pe.MODULES_IN_CODEWORD/pe.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*pe.MODULES_IN_CODEWORD/pe.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*pe.MODULES_IN_CODEWORD/pe.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t})(),tw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Eu=(function(t){tw(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ReaderException",e})(zt),Su=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},g0=(function(){function t(){}return t.prototype.decode=function(e,n){return this.hints!==n&&this.setHints(n),this.decodeInternal(e)},t.prototype.decodeWithState=function(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)},t.prototype.setHints=function(e){this.hints=e;var n=e!=null&&e.get(be.TRY_HARDER)!==void 0,r=e==null?null:e.get(be.POSSIBLE_FORMATS),a=new Array;if(r!=null){var o=r.some(function(i){return i===X.UPC_A||i===X.UPC_E||i===X.EAN_13||i===X.EAN_8||i===X.CODABAR||i===X.CODE_39||i===X.CODE_93||i===X.CODE_128||i===X.ITF||i===X.RSS_14||i===X.RSS_EXPANDED});o&&!n&&a.push(new Ur(e)),r.includes(X.QR_CODE)&&a.push(new Xo),r.includes(X.MICRO_QR_CODE)&&a.push(new bu),r.includes(X.DATA_MATRIX)&&a.push(new Yo),r.includes(X.AZTEC)&&a.push(new $o),r.includes(X.PDF_417)&&a.push(new Ko),r.includes(X.MAXICODE)&&a.push(new Cu),o&&n&&a.push(new Ur(e))}a.length===0&&(n||a.push(new Ur(e)),a.push(new Xo),a.push(new bu),a.push(new Yo),a.push(new $o),a.push(new Ko),a.push(new Cu),n&&a.push(new Ur(e))),this.readers=a},t.prototype.reset=function(){var e,n;if(this.readers!==null)try{for(var r=Su(this.readers),a=r.next();!a.done;a=r.next()){var o=a.value;o.reset()}}catch(i){e={error:i}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.decodeInternal=function(e){var n,r;if(this.readers===null)throw new Eu("No readers where selected, nothing can be read.");try{for(var a=Su(this.readers),o=a.next();!o.done;o=a.next()){var i=o.value;try{return i.decode(e,this.hints)}catch(s){if(s instanceof Eu)continue;console.warn("MultiFormatReader: non-ReaderException from reader:",s);continue}}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}throw new D("No MultiFormat Readers were able to detect the code.")},t})(),nw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
41e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){nw(e,t);function e(n,r){n===void 0&&(n=null),r===void 0&&(r=500);var a=new g0;return a.setHints(n),t.call(this,a,r)||this}return Object.defineProperty(e.prototype,"hints",{set:function(n){this._hints=n||null,this.reader.setHints(n)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(n){try{return this.reader.decodeWithState(n)}finally{this.reader.reset()}},e})(ra);var rw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){rw(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new Ko,n)||this}return e})(ra);var aw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){aw(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new Xo,n)||this}return e})(ra);var Ds;(function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",t[t.MIN_SIZE=4]="MIN_SIZE",t[t.MAX_SIZE=5]="MAX_SIZE",t[t.MARGIN=6]="MARGIN",t[t.PDF417_COMPACT=7]="PDF417_COMPACT",t[t.PDF417_COMPACTION=8]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=10]="AZTEC_LAYERS",t[t.QR_VERSION=11]="QR_VERSION",t[t.GS1_FORMAT=12]="GS1_FORMAT",t[t.FORCE_C40=13]="FORCE_C40"})(Ds||(Ds={}));const To=Ds;var m0=(function(){function t(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new qn(e,Int32Array.from([1])))}return t.prototype.buildGenerator=function(e){var n=this.cachedGenerators;if(e>=n.length)for(var r=n[n.length-1],a=this.field,o=n.length;o<=e;o++){var i=r.multiply(new qn(a,Int32Array.from([1,a.exp(o-1+a.getGeneratorBase())])));n.push(i),r=i}return n[e]},t.prototype.encode=function(e,n){if(n===0)throw new Q("No error correction bytes");var r=e.length-n;if(r<=0)throw new Q("No data bytes provided");var a=this.buildGenerator(n),o=new Int32Array(r);Ne.arraycopy(e,0,o,0,r);var i=new qn(this.field,o);i=i.multiplyByMonomial(n,1);for(var s=i.divide(a)[1],c=s.getCoefficients(),l=n-c.length,u=0;u<l;u++)e[r+u]=0;Ne.arraycopy(c,0,e,r+l,c.length)},t})(),Va=(function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var n=0,r=e.getArray(),a=e.getWidth(),o=e.getHeight(),i=0;i<o-1;i++)for(var s=r[i],c=0;c<a-1;c++){var l=s[c];l===s[c+1]&&l===r[i+1][c]&&l===r[i+1][c+1]&&n++}return t.N2*n},t.applyMaskPenaltyRule3=function(e){for(var n=0,r=e.getArray(),a=e.getWidth(),o=e.getHeight(),i=0;i<o;i++)for(var s=0;s<a;s++){var c=r[i];s+6<a&&c[s]===1&&c[s+1]===0&&c[s+2]===1&&c[s+3]===1&&c[s+4]===1&&c[s+5]===0&&c[s+6]===1&&(t.isWhiteHorizontal(c,s-4,s)||t.isWhiteHorizontal(c,s+7,s+11))&&n++,i+6<o&&r[i][s]===1&&r[i+1][s]===0&&r[i+2][s]===1&&r[i+3][s]===1&&r[i+4][s]===1&&r[i+5][s]===0&&r[i+6][s]===1&&(t.isWhiteVertical(r,s,i-4,i)||t.isWhiteVertical(r,s,i+7,i+11))&&n++}return n*t.N3},t.isWhiteHorizontal=function(e,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(var a=n;a<r;a++)if(e[a]===1)return!1;return!0},t.isWhiteVertical=function(e,n,r,a){r=Math.max(r,0),a=Math.min(a,e.length);for(var o=r;o<a;o++)if(e[o][n]===1)return!1;return!0}
41,t.applyMaskPenaltyRule4=function(e){for(var n=0,r=e.getArray(),a=e.getWidth(),o=e.getHeight(),i=0;i<o;i++)for(var s=r[i],c=0;c<a;c++)s[c]===1&&n++;var l=e.getHeight()*e.getWidth(),u=Math.floor(Math.abs(n*2-l)*10/l);return u*t.N4},t.getDataMaskBit=function(e,n,r){var a,o;switch(e){case 0:a=r+n&1;break;case 1:a=r&1;break;case 2:a=n%3;break;case 3:a=(r+n)%3;break;case 4:a=Math.floor(r/2)+Math.floor(n/3)&1;break;case 5:o=r*n,a=(o&1)+o%3;break;case 6:o=r*n,a=(o&1)+o%3&1;break;case 7:o=r*n,a=o%3+(r+n&1)&1;break;default:throw new Q("Invalid mask pattern: "+e)}return a===0},t.applyMaskPenaltyRule1Internal=function(e,n){for(var r=0,a=n?e.getHeight():e.getWidth(),o=n?e.getWidth():e.getHeight(),i=e.getArray(),s=0;s<a;s++){for(var c=0,l=-1,u=0;u<o;u++){var d=n?i[s][u]:i[u][s];d===l?c++:(c>=5&&(r+=t.N1+(c-5)),c=1,l=d)}c>=5&&(r+=t.N1+(c-5))}return r},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t})(),ow=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},iw=(function(){function t(e,n){this.width=e,this.height=n;for(var r=new Array(n),a=0;a!==n;a++)r[a]=new Uint8Array(e);this.bytes=r}return t.prototype.getHeight=function(){return this.height},t.prototype.getWidth=function(){return this.width},t.prototype.get=function(e,n){return this.bytes[n][e]},t.prototype.getArray=function(){return this.bytes},t.prototype.setNumber=function(e,n,r){this.bytes[n][e]=r},t.prototype.setBoolean=function(e,n,r){this.bytes[n][e]=r?1:0},t.prototype.clear=function(e){var n,r;try{for(var a=ow(this.bytes),o=a.next();!o.done;o=a.next()){var i=o.value;ht.fill(i,e)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;if(this.width!==n.width||this.height!==n.height)return!1;for(var r=0,a=this.height;r<a;++r)for(var o=this.bytes[r],i=n.bytes[r],s=0,c=this.width;s<c;++s)if(o[s]!==i[s])return!1;return!0},t.prototype.toString=function(){for(var e=new se,n=0,r=this.height;n<r;++n){for(var a=this.bytes[n],o=0,i=this.width;o<i;++o)switch(a[o]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append(" ");break}e.append(` 42`)}return e.toString()},t})(),Ms=(function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var e=new se;return e.append(`<< 43`),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append(` 44 ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append(` 45 version: `),e.append(this.version?this.version.toString():"null"),e.append(` 46 maskPattern: `),e.append(this.maskPattern.toString()),this.matrix?(e.append(` 47 matrix: 48`),e.append(this.matrix.toString())):e.append(` 49 matrix: null 50`),e.append(`>> 51`),e.toString()},t.prototype.setMode=function(e){this.mode=e},t.prototype.setECLevel=function(e){this.ecLevel=e},t.prototype.setVersion=function(e){this.version=e},t.prototype.setMaskPattern=function(e){this.maskPattern=e}
51,t.prototype.setMatrix=function(e){this.matrix=e},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t})(),sw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),je=(function(t){sw(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="WriterException",e})(zt),Iu=(function(){function t(){}return t.clearMatrix=function(e){e.clear(255)},t.buildMatrix=function(e,n,r,a,o){t.clearMatrix(o),t.embedBasicPatterns(r,o),t.embedTypeInfo(n,a,o),t.maybeEmbedVersionInfo(r,o),t.embedDataBits(e,a,o)},t.embedBasicPatterns=function(e,n){t.embedPositionDetectionPatternsAndSeparators(n),t.embedDarkDotAtLeftBottomCorner(n),t.maybeEmbedPositionAdjustmentPatterns(e,n),t.embedTimingPatterns(n)},t.embedTypeInfo=function(e,n,r){var a=new vt;t.makeTypeInfoBits(e,n,a);for(var o=0,i=a.getSize();o<i;++o){var s=a.get(a.getSize()-1-o),c=t.TYPE_INFO_COORDINATES[o],l=c[0],u=c[1];if(r.setBoolean(l,u,s),o<8){var d=r.getWidth()-o-1,f=8;r.setBoolean(d,f,s)}else{var d=8,f=r.getHeight()-7+(o-8);r.setBoolean(d,f,s)}}},t.maybeEmbedVersionInfo=function(e,n){if(!(e.getVersionNumber()<7)){var r=new vt;t.makeVersionInfoBits(e,r);for(var a=17,o=0;o<6;++o)for(var i=0;i<3;++i){var s=r.get(a);a--,n.setBoolean(o,n.getHeight()-11+i,s),n.setBoolean(n.getHeight()-11+i,o,s)}}}
51,t.embedDataBits=function(e,n,r){for(var a=0,o=-1,i=r.getWidth()-1,s=r.getHeight()-1;i>0;){for(i===6&&(i-=1);s>=0&&s<r.getHeight();){for(var c=0;c<2;++c){var l=i-c;if(t.isEmpty(r.get(l,s))){var u=void 0;a<e.getSize()?(u=e.get(a),++a):u=!1,n!==255&&Va.getDataMaskBit(n,l,s)&&(u=!u),r.setBoolean(l,s,u)}}s+=o}o=-o,s+=o,i-=2}if(a!==e.getSize())throw new je("Not all bits consumed: "+a+"/"+e.getSize())},t.findMSBSet=function(e){return 32-ce.numberOfLeadingZeros(e)},t.calculateBCHCode=function(e,n){if(n===0)throw new Q("0 polynomial");var r=t.findMSBSet(n);for(e<<=r-1;t.findMSBSet(e)>=r;)e^=n<<t.findMSBSet(e)-r;return e},t.makeTypeInfoBits=function(e,n,r){if(!Ms.isValidMaskPattern(n))throw new je("Invalid mask pattern");var a=e.getBits()<<3|n;r.appendBits(a,5);var o=t.calculateBCHCode(a,t.TYPE_INFO_POLY);r.appendBits(o,10);var i=new vt;if(i.appendBits(t.TYPE_INFO_MASK_PATTERN,15),r.xor(i),r.getSize()!==15)throw new je("should not happen but we got: "+r.getSize())},t.makeVersionInfoBits=function(e,n){n.appendBits(e.getVersionNumber(),6);var r=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new je("should not happen but we got: "+n.getSize())},t.isEmpty=function(e){return e===255},t.embedTimingPatterns=function(e){for(var n=8;n<e.getWidth()-8;++n){var r=(n+1)%2;t.isEmpty(e.get(n,6))&&e.setNumber(n,6,r),t.isEmpty(e.get(6,n))&&e.setNumber(6,n,r)}},t.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new je;e.setNumber(8,e.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,n,r){for(var a=0;a<8;++a){if(!t.isEmpty(r.get(e+a,n)))throw new je;r.setNumber(e+a,n,0)}},t.embedVerticalSeparationPattern=function(e,n,r){for(var a=0;a<7;++a){if(!t.isEmpty(r.get(e,n+a)))throw new je;r.setNumber(e,n+a,0)}},t.embedPositionAdjustmentPattern=function(e,n,r){for(var a=0;a<5;++a)for(var o=t.POSITION_ADJUSTMENT_PATTERN[a],i=0;i<5;++i)r.setNumber(e+i,n+a,o[i])},t.embedPositionDetectionPattern=function(e,n,r){for(var a=0;a<7;++a)for(var o=t.POSITION_DETECTION_PATTERN[a],i=0;i<7;++i)r.setNumber(e+i,n+a,o[i])},t.embedPositionDetectionPatternsAndSeparators=function(e){var n=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-n,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-n,e);var r=8;t.embedHorizontalSeparationPattern(0,r-1,e),t.embedHorizontalSeparationPattern(e.getWidth()-r,r-1,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-r,e);var a=7;t.embedVerticalSeparationPattern(a,0,e),t.embedVerticalSeparationPattern(e.getHeight()-a-1,0,e),t.embedVerticalSeparationPattern(a,e.getHeight()-a,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,n){if(!(e.getVersionNumber()<2))for(var r=e.getVersionNumber()-1,a=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],o=0,i=a.length;o!==i;o++){var s=a[o];if(s>=0)for(var c=0;c!==i;c++){var l=a[c];l>=0&&t.isEmpty(n.get(l,s))&&t.embedPositionAdjustmentPattern(l-2,s-2,n)}}},t.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])]),t.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])]),t.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])]),t.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])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522,t})(),cw=(function(){function t(e,n){this.dataBytes=e,this.errorCorrectionBytes=n}return t.prototype.getDataBytes=function(){return this.dataBytes},t.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},t})(),Ru=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function t(){}return t.calculateMaskPenalty=function(e){return Va.applyMaskPenaltyRule1(e)+Va.applyMaskPenaltyRule2(e)+Va.applyMaskPenaltyRule3(e)+Va.applyMaskPenaltyRule4(e)},t.encode=function(e,n,r){r===void 0&&(r=null);var a=t.DEFAULT_BYTE_MODE_ENCODING,o=r!==null&&r.get(To.CHARACTER_SET)!==void 0;o&&(a=r.get(To.CHARACTER_SET).toString());var i=this.chooseMode(e,a),s=new vt;if(i===Le.BYTE&&(o||t.DEFAULT_BYTE_MODE_ENCODING!==a)){var c=ft.getCharacterSetECIByName(a);c!==void 0&&this.appendECI(c,s)}this.appendModeInfo(i,s);var l=new vt;this.appendBytes(e,i,l,a);var u;if(r!==null&&r.get(To.QR_VERSION)!==void 0){var d=Number.parseInt(r.get(To.QR_VERSION).toString(),10);u=Sr.getVersionForNumber(d);var f=this.calculateBitsNeeded(i,s,l,u);if(!this.willFit(f,u,n))throw new je("Data too big for requested version")}else u=this.recommendVersion(n,i,s,l);var p=new vt;p.appendBitArray(s);var g=i===Le.BYTE?l.getSizeInBytes():e.length;this.appendLengthInfo(g,u,i,p),p.appendBitArray(l);var m=u.getECBlocksForLevel(n),y=u.getTotalCodewords()-m.getTotalECCodewords();this.terminateBits(y,p);var v=this.interleaveWithECBytes(p,u.getTotalCodewords(),y,m.getNumBlocks()),w=new Ms;w.setECLevel(n),w.setMode(i),w.setVersion(u);var b=u.getDimensionForVersion(),_=new iw(b,b),A=this.chooseMaskPattern(v,n,u,_);return w.setMaskPattern(A),Iu.buildMatrix(v,n,u,A,_),w.setMatrix(_),w},t.recommendVersion=function(e,n,r,a){var o=this.calculateBitsNeeded(n,r,a,Sr.getVersionForNumber(1)),i=this.chooseVersion(o,e),s=this.calculateBitsNeeded(n,r,a,i);return this.chooseVersion(s,e)},t.calculateBitsNeeded=function(e,n,r,a){return n.getSize()+e.getCharacterCountBits(a)+r.getSize()},t.getAlphanumericCode=function(e){return e<t.ALPHANUMERIC_TABLE.length?t.ALPHANUMERIC_TABLE[e]:-1},t.chooseMode=function(e,n){if(n===void 0&&(n=null),ft.SJIS.getName()===n&&this.isOnlyDoubleByteKanji(e))return Le.KANJI;for(var r=!1,a=!1,o=0,i=e.length;o<i;++o){var s=e.charAt(o);if(t.isDigit(s))r=!0;else if(this.getAlphanumericCode(s.charCodeAt(0))!==-1)a=!0;else return Le.BYTE}return a?Le.ALPHANUMERIC:r?Le.NUMERIC:Le.BYTE},t.isOnlyDoubleByteKanji=function(e){var n;try{n=Ut.encode(e,ft.SJIS)}catch{return!1}var r=n.length;if(r%2!==0)return!1;for(var a=0;a<r;a+=2){var o=n[a]&255;if((o<129||o>159)&&(o<224||o>235))return!1}return!0},t.chooseMaskPattern=function(e,n,r,a){for(var o=Number.MAX_SAFE_INTEGER,i=-1,s=0;s<Ms.NUM_MASK_PATTERNS;s++){Iu.buildMatrix(e,n,r,s,a);var c=this.calculateMaskPenalty(a);c<o&&(o=c,i=s)}return i},t.chooseVersion=function(e,n){for(var r=1;r<=40;r++){var a=Sr.getVersionForNumber(r);
51if(t.willFit(e,a,n))return a}throw new je("Data too big")},t.willFit=function(e,n,r){var a=n.getTotalCodewords(),o=n.getECBlocksForLevel(r),i=o.getTotalECCodewords(),s=a-i,c=(e+7)/8;return s>=c},t.terminateBits=function(e,n){var r=e*8;if(n.getSize()>r)throw new je("data bits cannot fit in the QR Code"+n.getSize()+" > "+r);for(var a=0;a<4&&n.getSize()<r;++a)n.appendBit(!1);var o=n.getSize()&7;if(o>0)for(var a=o;a<8;a++)n.appendBit(!1);for(var i=e-n.getSizeInBytes(),a=0;a<i;++a)n.appendBits((a&1)===0?236:17,8);if(n.getSize()!==r)throw new je("Bits size does not equal capacity")},t.getNumDataBytesAndNumECBytesForBlockID=function(e,n,r,a,o,i){if(a>=r)throw new je("Block ID too large");var s=e%r,c=r-s,l=Math.floor(e/r),u=l+1,d=Math.floor(n/r),f=d+1,p=l-d,g=u-f;if(p!==g)throw new je("EC bytes mismatch");if(r!==c+s)throw new je("RS blocks mismatch");if(e!==(d+p)*c+(f+g)*s)throw new je("Total bytes mismatch");a<c?(o[0]=d,i[0]=p):(o[0]=f,i[0]=g)},t.interleaveWithECBytes=function(e,n,r,a){var o,i,s,c;if(e.getSizeInBytes()!==r)throw new je("Number of bits and data bytes does not match");for(var l=0,u=0,d=0,f=new Array,p=0;p<a;++p){var g=new Int32Array(1),m=new Int32Array(1);t.getNumDataBytesAndNumECBytesForBlockID(n,r,a,p,g,m);var y=g[0],v=new Uint8Array(y);e.toBytes(8*l,v,0,y);var w=t.generateECBytes(v,m[0]);f.push(new cw(v,w)),u=Math.max(u,y),d=Math.max(d,w.length),l+=g[0]}if(r!==l)throw new je("Data bytes does not match offset");for(var b=new vt,p=0;p<u;++p)try{for(var _=(o=void 0,Ru(f)),A=_.next();!A.done;A=_.next()){var T=A.value,v=T.getDataBytes();p<v.length&&b.appendBits(v[p],8)}}catch(k){o={error:k}}finally{try{A&&!A.done&&(i=_.return)&&i.call(_)}finally{if(o)throw o.error}}for(var p=0;p<d;++p)try{for(var S=(s=void 0,Ru(f)),E=S.next();!E.done;E=S.next()){var T=E.value,w=T.getErrorCorrectionBytes();p<w.length&&b.appendBits(w[p],8)}}catch(k){s={error:k}}finally{try{E&&!E.done&&(c=S.return)&&c.call(S)}finally{if(s)throw s.error}}if(n!==b.getSizeInBytes())throw new je("Interleaving error: "+n+" and "+b.getSizeInBytes()+" differ.");return b},t.generateECBytes=function(e,n){for(var r=e.length,a=new Int32Array(r+n),o=0;o<r;o++)a[o]=e[o]&255;new m0(St.QR_CODE_FIELD_256).encode(a,n);for(var i=new Uint8Array(n),o=0;o<n;o++)i[o]=a[r+o];return i}
51,t.appendModeInfo=function(e,n){n.appendBits(e.getBits(),4)},t.appendLengthInfo=function(e,n,r,a){var o=r.getCharacterCountBits(n);if(e>=1<<o)throw new je(e+" is bigger than "+((1<<o)-1));a.appendBits(e,o)},t.appendBytes=function(e,n,r,a){switch(n){case Le.NUMERIC:t.appendNumericBytes(e,r);break;case Le.ALPHANUMERIC:t.appendAlphanumericBytes(e,r);break;case Le.BYTE:t.append8BitBytes(e,r,a);break;case Le.KANJI:t.appendKanjiBytes(e,r);break;default:throw new je("Invalid mode: "+n)}},t.getDigit=function(e){return e.charCodeAt(0)-48},t.isDigit=function(e){var n=t.getDigit(e);return n>=0&&n<=9},t.appendNumericBytes=function(e,n){for(var r=e.length,a=0;a<r;){var o=t.getDigit(e.charAt(a));if(a+2<r){var i=t.getDigit(e.charAt(a+1)),s=t.getDigit(e.charAt(a+2));n.appendBits(o*100+i*10+s,10),a+=3}else if(a+1<r){var i=t.getDigit(e.charAt(a+1));n.appendBits(o*10+i,7),a+=2}else n.appendBits(o,4),a++}},t.appendAlphanumericBytes=function(e,n){for(var r=e.length,a=0;a<r;){var o=t.getAlphanumericCode(e.charCodeAt(a));if(o===-1)throw new je;if(a+1<r){var i=t.getAlphanumericCode(e.charCodeAt(a+1));if(i===-1)throw new je;n.appendBits(o*45+i,11),a+=2}else n.appendBits(o,6),a++}},t.append8BitBytes=function(e,n,r){var a;try{a=Ut.encode(e,r)}catch(c){throw new je(c)}for(var o=0,i=a.length;o!==i;o++){var s=a[o];n.appendBits(s,8)}},t.appendKanjiBytes=function(e,n){var r;try{r=Ut.encode(e,ft.SJIS)}catch(d){throw new je(d)}for(var a=r.length,o=0;o<a;o+=2){var i=r[o]&255,s=r[o+1]&255,c=i<<8&4294967295|s,l=-1;if(c>=33088&&c<=40956?l=c-33088:c>=57408&&c<=60351&&(l=c-49472),l===-1)throw new je("Invalid byte sequence");var u=(l>>8)*192+(l&255);n.appendBits(u,13)}}
51,t.appendECI=function(e,n){n.appendBits(Le.ECI.getBits(),4),n.appendBits(e.getValue(),8)},t.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]),t.DEFAULT_BYTE_MODE_ENCODING=ft.UTF8.getName(),t})();var lw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){lw(e,t);function e(n,r,a,o,i,s,c,l){var u=t.call(this,s,c)||this;if(u.yuvData=n,u.dataWidth=r,u.dataHeight=a,u.left=o,u.top=i,o+s>r||i+c>a)throw new Q("Crop rectangle does not fit within image data.");return l&&u.reverseHorizontal(s,c),u}return e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Q("Requested row is outside the image: "+n);var a=this.getWidth();(r==null||r.length<a)&&(r=new Uint8ClampedArray(a));var o=(n+this.top)*this.dataWidth+this.left;return Ne.arraycopy(this.yuvData,o,r,0,a),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.yuvData;var a=n*r,o=new Uint8ClampedArray(a),i=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Ne.arraycopy(this.yuvData,i,o,0,a),o;for(var s=0;s<r;s++){var c=s*n;Ne.arraycopy(this.yuvData,i,o,c,n),i+=this.dataWidth}return o},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,a,o){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+r,a,o,!1)},e.prototype.renderThumbnail=function(){for(var n=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,a=new Int32Array(n*r),o=this.yuvData,i=this.top*this.dataWidth+this.left,s=0;s<r;s++){for(var c=s*n,l=0;l<n;l++){var u=o[i+l*e.THUMBNAIL_SCALE_FACTOR]&255;a[c+l]=4278190080|u*65793}i+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return a},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(n,r){for(var a=this.yuvData,o=0,i=this.top*this.dataWidth+this.left;o<r;o++,i+=this.dataWidth)for(var s=i+n/2,c=i,l=i+n-1;c<s;c++,l--){var u=a[c];a[c]=a[l],a[l]=u}},e.prototype.invert=function(){return new ii(this)},e.THUMBNAIL_SCALE_FACTOR=2,e})(so);var uw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){uw(e,t);function e(n,r,a,o,i,s,c){var l=t.call(this,r,a)||this;if(l.dataWidth=o,l.dataHeight=i,l.left=s,l.top=c,n.BYTES_PER_ELEMENT===4){for(var u=r*a,d=new Uint8ClampedArray(u),f=0;f<u;f++){var p=n[f],g=p>>16&255,m=p>>7&510,y=p&255;d[f]=(g+m+y)/4&255}l.luminances=d}else l.luminances=n;if(o===void 0&&(l.dataWidth=r),i===void 0&&(l.dataHeight=a),s===void 0&&(l.left=0),c===void 0&&(l.top=0),l.left+r>l.dataWidth||l.top+a>l.dataHeight)throw new Q("Crop rectangle does not fit within image data.");return l}return e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Q("Requested row is outside the image: "+n);var a=this.getWidth();(r==null||r.length<a)&&(r=new Uint8ClampedArray(a));var o=(n+this.top)*this.dataWidth+this.left;return Ne.arraycopy(this.luminances,o,r,0,a),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.luminances;var a=n*r,o=new Uint8ClampedArray(a),i=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Ne.arraycopy(this.luminances,i,o,0,a),o;for(var s=0;s<r;s++){var c=s*n;Ne.arraycopy(this.luminances,i,o,c,n),i+=this.dataWidth}return o},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,a,o){return new e(this.luminances,a,o,this.dataWidth,this.dataHeight,this.left+n,this.top+r)},e.prototype.invert=function(){return new ii(this)},e})(so);var dw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
51e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),fw=(function(t){dw(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.forName=function(n){return this.getCharacterSetECIByName(n)},e})(ft),hw=(function(){function t(){}return t.ISO_8859_1=ft.ISO8859_1,t})(),Fs,pw=301,gw=function(t,e){for(var n=1,r=0;r<255;r++)e[r]=n,t[n]=r,n*=2,n>=256&&(n^=pw);return{LOG:t,ALOG:e}};Fs=gw([],[]),Fs.LOG;Fs.ALOG;var Tu;(function(t){t[t.FORCE_NONE=0]="FORCE_NONE",t[t.FORCE_SQUARE=1]="FORCE_SQUARE",t[t.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(Tu||(Tu={}));var Nu=129,x0=230,mw=231,xw=235,vw=236,yw=237,ww=238,bw=239,Cw=240,es=254,_w=254,Ou="[)>�05�",Du="[)>�06�",Mu="��",Ie=0,Ct=1,Ft=2,lt=3,xt=4,At=5,Aw=(function(){function t(){}return t.prototype.getEncodingMode=function(){return Ie},t.prototype.encode=function(e){var n=fn.determineConsecutiveDigitCount(e.getMessage(),e.pos);if(n>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var r=e.getCurrentChar(),a=fn.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode())switch(a){case At:e.writeCodeword(mw),e.signalEncoderChange(At);return;case Ct:e.writeCodeword(x0),e.signalEncoderChange(Ct);return;case lt:e.writeCodeword(ww),e.signalEncoderChange(lt);break;case Ft:e.writeCodeword(bw),e.signalEncoderChange(Ft);break;case xt:e.writeCodeword(Cw),e.signalEncoderChange(xt);break;default:throw new Error("Illegal mode: "+a)}else fn.isExtendedASCII(r)?(e.writeCodeword(xw),e.writeCodeword(r-128+1),e.pos++):(e.writeCodeword(r+1),e.pos++)}},t.prototype.encodeASCIIDigits=function(e,n){if(fn.isDigit(e)&&fn.isDigit(n)){var r=(e-48)*10+(n-48);return r+130}throw new Error("not digits: "+e+n)},t})(),Ew=(function(){function t(){}return t.prototype.getEncodingMode=function(){return At},t.prototype.encode=function(e){var n=new se;for(n.append(0);e.hasMoreCharacters();){var r=e.getCurrentChar();n.append(r),e.pos++;var a=fn.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){e.signalEncoderChange(Ie);break}}var o=n.length()-1,i=1,s=e.getCodewordCount()+o+i;e.updateSymbolInfo(s);var c=e.getSymbolInfo().getDataCapacity()-s>0;if(e.hasMoreCharacters()||c)if(o<=249)n.setCharAt(0,de.getCharAt(o));else if(o<=1555)n.setCharAt(0,de.getCharAt(Math.floor(o/250)+249)),n.insert(1,de.getCharAt(o%250));else throw new Error("Message length not in valid ranges: "+o);for(var l=0,r=n.length();l<r;l++)e.writeCodeword(this.randomize255State(n.charAt(l).charCodeAt(0),e.getCodewordCount()+1))},t.prototype.randomize255State=function(e,n){var r=149*n%255+1,a=e+r;return a<=255?a:a-256},t})(),mc=(function(){function t(){}return t.prototype.getEncodingMode=function(){return Ct},t.prototype.encodeMaximal=function(e){for(var n=new se,r=0,a=e.pos,o=0;e.hasMoreCharacters();){var i=e.getCurrentChar();e.pos++,r=this.encodeChar(i,n),n.length()%3===0&&(a=e.pos,o=n.length())}if(o!==n.length()){var s=Math.floor(n.length()/3*2),c=Math.floor(e.getCodewordCount()+s+1);e.updateSymbolInfo(c);var l=e.getSymbolInfo().getDataCapacity()-c,u=Math.floor(n.length()%3);(u===2&&l!==2||u===1&&(r>3||l!==1))&&(e.pos=a)}n.length()>0&&e.writeCodeword(x0),this.handleEOD(e,n)},t.prototype.encode=function(e){for(var n=new se;e.hasMoreCharacters();){var r=e.getCurrentChar();e.pos++;var a=this.encodeChar(r,n),o=Math.floor(n.length()/3)*2,i=e.getCodewordCount()+o;e.updateSymbolInfo(i);var s=e.getSymbolInfo().getDataCapacity()-i;if(!e.hasMoreCharacters()){var c=new se;for(n.length()%3===2&&s!==2&&(a=this.backtrackOneCharacter(e,n,c,a));n.length()%3===1&&(a>3||s!==1);)a=this.backtrackOneCharacter(e,n,c,a);break}var l=n.length();if(l%3===0){var u=fn.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(u!==this.getEncodingMode()){e.signalEncoderChange(Ie);break}}}this.handleEOD(e,n)},t.prototype.backtrackOneCharacter=function(e,n,r,a){var o=n.length(),i=n.toString().substring(0,o-a);n.setLengthToZero(),n.append(i),e.pos--;var s=e.getCurrentChar();return a=this.encodeChar(s,r),e.resetSymbolInfo(),a},t.prototype.writeNextTriplet=function(e,n){e.writeCodewords(this.encodeToCodewords(n.toString()));var r=n.toString().substring(3);n.setLengthToZero(),n.append(r)},t.prototype.handleEOD=function(e,n){var r=Math.floor(n.length()/3*2),a=n.length()%3,o=e.getCodewordCount()+r;e.updateSymbolInfo(o);var i=e.getSymbolInfo().getDataCapacity()-o;if(a===2){for(n.append("\0");n.length()>=3;)this.writeNextTriplet(e,n);e.hasMoreCharacters()&&e.writeCodeword(es)}else if(i===1&&a===1){for(;n.length()>=3;)this.writeNextTriplet(e,n);e.hasMoreCharacters()&&e.writeCodeword(es),e.pos--}else if(a===0){for(;n.length()>=3;)this.writeNextTriplet(e,n);(i>0||e.hasMoreCharacters())&&e.writeCodeword(es)}else throw new Error("Unexpected case. Please report!");e.signalEncoderChange(Ie)},t.prototype.encodeChar=function(e,n){if(e===32)return n.append(3),1;if(e>=48&&e<=57)return n.append(e-48+4),1;if(e>=65&&e<=90)return n.append(e-65+14),1;if(e<32)return n.append(0),n.append(e),2;if(e<=47)return n.append(1),n.append(e-33),2;if(e<=64)return n.append(1),n.append(e-58+15),2;if(e<=95)return n.append(1),n.append(e-91+22),2;if(e<=127)return n.append(2),n.append(e-96),2;n.append("".concat(1,"�"));var r=2;return r+=this.encodeChar(e-128,n),r},t.prototype.encodeToCodewords=function(e){var n=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,r=n/256,a=n%256,o=new se;return o.append(r),o.append(a),o.toString()},t})(),Sw=(function(){function t(){}return t.prototype.getEncodingMode=function(){return xt},t.prototype.encode=function(e){for(var n=new se;e.hasMoreCharacters();){var r=e.getCurrentChar();this.encodeChar(r,n),e.pos++;var a=n.length();if(a>=4){e.writeCodewords(this.encodeToCodewords(n.toString()));var o=n.toString().substring(4);n.setLengthToZero(),n.append(o);var i=fn.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){e.signalEncoderChange(Ie);break}}}n.append(de.getCharAt(31)),this.handleEOD(e,n)},t.prototype.handleEOD=function(e,n){try{var r=n.length();if(r===0)return;if(r===1){e.updateSymbolInfo();var a=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),o=e.getRemainingCharacters();if(o>a&&(e.updateSymbolInfo(e.getCodewordCount()+1),a=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),o<=a&&a<=2)return}if(r>4)throw new Error("Count must not exceed 4");var i=r-1,s=this.encodeToCodewords(n.toString()),c=!e.hasMoreCharacters(),l=c&&i<=2;if(i<=2){e.updateSymbolInfo(e.getCodewordCount()+i);var a=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount();a>=3&&(l=!1,e.updateSymbolInfo(e.getCodewordCount()+s.length))}l?(e.resetSymbolInfo(),e.pos-=i):e.writeCodewords(s)}
51finally{e.signalEncoderChange(Ie)}},t.prototype.encodeChar=function(e,n){e>=32&&e<=63?n.append(e):e>=64&&e<=94?n.append(de.getCharAt(e-64)):fn.illegalCharacter(de.getCharAt(e))},t.prototype.encodeToCodewords=function(e){var n=e.length;if(n===0)throw new Error("StringBuilder must not be empty");var r=e.charAt(0).charCodeAt(0),a=n>=2?e.charAt(1).charCodeAt(0):0,o=n>=3?e.charAt(2).charCodeAt(0):0,i=n>=4?e.charAt(3).charCodeAt(0):0,s=(r<<18)+(a<<12)+(o<<6)+i,c=s>>16&255,l=s>>8&255,u=s&255,d=new se;return d.append(c),n>=2&&d.append(l),n>=3&&d.append(u),d.toString()},t})(),Iw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rw=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},we=(function(){function t(e,n,r,a,o,i,s,c){s===void 0&&(s=0),c===void 0&&(c=0),this.rectangular=e,this.dataCapacity=n,this.errorCodewords=r,this.matrixWidth=a,this.matrixHeight=o,this.dataRegions=i,this.rsBlockData=s,this.rsBlockError=c}return t.lookup=function(e,n,r,a,o){var i,s;n===void 0&&(n=0),r===void 0&&(r=null),a===void 0&&(a=null),o===void 0&&(o=!0);try{for(var c=Rw(Nw),l=c.next();!l.done;l=c.next()){var u=l.value;if(!(n===1&&u.rectangular)&&!(n===2&&!u.rectangular)&&!(r!=null&&(u.getSymbolWidth()<r.getWidth()||u.getSymbolHeight()<r.getHeight()))&&!(a!=null&&(u.getSymbolWidth()>a.getWidth()||u.getSymbolHeight()>a.getHeight()))&&e<=u.dataCapacity)return u}}catch(d){i={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}if(o)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+e);return null},t.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},t.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},t.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},t.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},t.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+this.getHorizontalDataRegions()*2},t.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},t.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},t.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},t.prototype.getDataCapacity=function(){return this.dataCapacity},t.prototype.getErrorCodewords=function(){return this.errorCodewords},t.prototype.getDataLengthForInterleavedBlock=function(e){return this.rsBlockData},t.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},t})(),Tw=(function(t){Iw(e,t);function e(){return t.call(this,!1,1558,620,22,22,36,-1,62)||this}return e.prototype.getInterleavedBlockCount=function(){return 10},e.prototype.getDataLengthForInterleavedBlock=function(n){return n<=8?156:155},e})(we),Nw=[new we(!1,3,5,8,8,1),new we(!1,5,7,10,10,1),new we(!0,5,7,16,6,1),new we(!1,8,10,12,12,1),new we(!0,10,11,14,6,2),new we(!1,12,12,14,14,1),new we(!0,16,14,24,10,1),new we(!1,18,14,16,16,1),new we(!1,22,18,18,18,1),new we(!0,22,18,16,10,2),new we(!1,30,20,20,20,1),new we(!0,32,24,16,14,2),new we(!1,36,24,22,22,1),new we(!1,44,28,24,24,1),new we(!0,49,28,22,14,2),new we(!1,62,36,14,14,4),new we(!1,86,42,16,16,4),new we(!1,114,48,18,18,4),new we(!1,144,56,20,20,4),new we(!1,174,68,22,22,4),new we(!1,204,84,24,24,4,102,42),new we(!1,280,112,14,14,16,140,56),new we(!1,368,144,16,16,16,92,36),new we(!1,456,192,18,18,16,114,48),new we(!1,576,224,20,20,16,144,56),new we(!1,696,272,22,22,16,174,68),new we(!1,816,336,24,24,16,136,56),new we(!1,1050,408,18,18,36,175,68),new we(!1,1304,496,20,20,36,163,62),new Tw],Ow=(function(){function t(e){this.msg=e,this.pos=0,this.skipAtEnd=0;
51for(var n=e.split("").map(function(s){return s.charCodeAt(0)}),r=new se,a=0,o=n.length;a<o;a++){var i=String.fromCharCode(n[a]&255);if(i==="?"&&e.charAt(a)!=="?")throw new Error("Message contains characters outside ISO-8859-1 encoding.");r.append(i)}this.msg=r.toString(),this.shape=0,this.codewords=new se,this.newEncoding=-1}return t.prototype.setSymbolShape=function(e){this.shape=e},t.prototype.setSizeConstraints=function(e,n){this.minSize=e,this.maxSize=n},t.prototype.getMessage=function(){return this.msg},t.prototype.setSkipAtEnd=function(e){this.skipAtEnd=e},t.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},t.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},t.prototype.getCodewords=function(){return this.codewords},t.prototype.writeCodewords=function(e){this.codewords.append(e)},t.prototype.writeCodeword=function(e){this.codewords.append(e)},t.prototype.getCodewordCount=function(){return this.codewords.length()},t.prototype.getNewEncoding=function(){return this.newEncoding},t.prototype.signalEncoderChange=function(e){this.newEncoding=e},t.prototype.resetEncoderSignal=function(){this.newEncoding=-1},t.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},t.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},t.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},t.prototype.getSymbolInfo=function(){return this.symbolInfo},t.prototype.updateSymbolInfo=function(e){e===void 0&&(e=this.getCodewordCount()),(this.symbolInfo==null||e>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=we.lookup(e,this.shape,this.minSize,this.maxSize,!0))},t.prototype.resetSymbolInfo=function(){this.symbolInfo=null},t})(),Dw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Mw=(function(t){Dw(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return lt},e.prototype.encode=function(n){for(var r=new se;n.hasMoreCharacters();){var a=n.getCurrentChar();n.pos++,this.encodeChar(a,r);var o=r.length();if(o%3===0){this.writeNextTriplet(n,r);var i=fn.lookAheadTest(n.getMessage(),n.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){n.signalEncoderChange(Ie);break}}}this.handleEOD(n,r)},e.prototype.encodeChar=function(n,r){switch(n){case 13:r.append(0);break;case 42:r.append(1);break;case 62:r.append(2);break;case 32:r.append(3);break;default:n>=48&&n<=57?r.append(n-48+4):n>=65&&n<=90?r.append(n-65+14):fn.illegalCharacter(de.getCharAt(n));break}return 1},e.prototype.handleEOD=function(n,r){n.updateSymbolInfo();var a=n.getSymbolInfo().getDataCapacity()-n.getCodewordCount(),o=r.length();n.pos-=o,(n.getRemainingCharacters()>1||a>1||n.getRemainingCharacters()!==a)&&n.writeCodeword(_w),n.getNewEncoding()<0&&n.signalEncoderChange(Ie)},e})(mc),Fw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Pw=(function(t){Fw(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return Ft},e.prototype.encodeChar=function(n,r){if(n===32)return r.append(3),1;if(n>=48&&n<=57)return r.append(n-48+4),1;if(n>=97&&n<=122)return r.append(n-97+14),1;if(n<32)return r.append(0),r.append(n),2;if(n<=47)return r.append(1),r.append(n-33),2;if(n<=64)return r.append(1),r.append(n-58+15),2;if(n>=91&&n<=95)return r.append(1),r.append(n-91+22),2;if(n===96)return r.append(2),r.append(0),2;if(n<=90)return r.append(2),r.append(n-65+1),2;if(n<=127)return r.append(2),r.append(n-123+27),2;r.append("".concat(1,"�"));var a=2;return a+=this.encodeChar(n-128,r),a},e})(mc),fn=(function(){function t(){}return t.randomize253State=function(e){var n=149*e%253+1,r=Nu+n;return r<=254?r:r-254},t.encodeHighLevel=function(e,n,r,a,o){n===void 0&&(n=0),r===void 0&&(r=null),a===void 0&&(a=null),o===void 0&&(o=!1);var i=new mc,s=[new Aw,i,new Pw,new Mw,new Sw,new Ew],c=new Ow(e);c.setSymbolShape(n),c.setSizeConstraints(r,a),e.startsWith(Ou)&&e.endsWith(Mu)?(c.writeCodeword(vw),c.setSkipAtEnd(2),c.pos+=Ou.length):e.startsWith(Du)&&e.endsWith(Mu)&&(c.writeCodeword(yw),c.setSkipAtEnd(2),c.pos+=Du.length);var l=Ie;for(o&&(i.encodeMaximal(c),l=c.getNewEncoding(),c.resetEncoderSignal());c.hasMoreCharacters();)s[l].encode(c),c.getNewEncoding()>=0&&(l=c.getNewEncoding(),c.resetEncoderSignal());var u=c.getCodewordCount();c.updateSymbolInfo();var d=c.getSymbolInfo().getDataCapacity();u<d&&l!==Ie&&l!==At&&l!==xt&&c.writeCodeword("þ");var f=c.getCodewords();for(f.length()<d&&f.append(Nu);f.length()<d;)f.append(this.randomize253State(f.length()+1));return c.getCodewords().toString()},t.lookAheadTest=function(e,n,r){var a=this.lookAheadTestIntern(e,n,r);if(r===lt&&a===lt){for(var o=Math.min(n+3,e.length),i=n;i<o;i++)if(!this.isNativeX12(e.charCodeAt(i)))return Ie}else if(r===xt&&a===xt){for(var o=Math.min(n+4,e.length),i=n;i<o;i++)if(!this.isNativeEDIFACT(e.charCodeAt(i)))return Ie}return a},t.lookAheadTestIntern=function(e,n,r){if(n>=e.length)return r;var a;r===Ie?a=[0,1,1,1,1,1.25]:(a=[1,2,2,2,2,2.25],a[r]=0);for(var o=0,i=new Uint8Array(6),s=[];;){if(n+o===e.length){ht.fill(i,0),ht.fill(s,0);var c=this.findMinimums(a,s,ce.MAX_VALUE,i),l=this.getMinimumCount(i);if(s[Ie]===c)return Ie;if(l===1){if(i[At]>0)return At;if(i[xt]>0)return xt;if(i[Ft]>0)return Ft;if(i[lt]>0)return lt}return Ct}var u=e.charCodeAt(n+o);if(o++,this.isDigit(u)?a[Ie]+=.5:this.isExtendedASCII(u)?(a[Ie]=Math.ceil(a[Ie]),a[Ie]+=2):(a[Ie]=Math.ceil(a[Ie]),a[Ie]++),this.isNativeC40(u)?a[Ct]+=2/3:this.isExtendedASCII(u)?a[Ct]+=8/3:a[Ct]+=4/3,this.isNativeText(u)?a[Ft]+=2/3:this.isExtendedASCII(u)?a[Ft]+=8/3:a[Ft]+=4/3,this.isNativeX12(u)?a[lt]+=2/3:this.isExtendedASCII(u)?a[lt]+=13/3:a[lt]+=10/3,this.isNativeEDIFACT(u)?a[xt]+=3/4:this.isExtendedASCII(u)?a[xt]+=17/4:a[xt]+=13/4,this.isSpecialB256(u)?a[At]+=4:a[At]++,o>=4){if(ht.fill(i,0),ht.fill(s,0),this.findMinimums(a,s,ce.MAX_VALUE,i),s[Ie]<this.min(s[At],s[Ct],s[Ft],s[lt],s[xt]))return Ie;if(s[At]<s[Ie]||s[At]+1<this.min(s[Ct],s[Ft],s[lt],s[xt]))return At;if(s[xt]+1<this.min(s[At],s[Ct],s[Ft],s[lt],s[Ie]))return xt;if(s[Ft]+1<this.min(s[At],s[Ct],s[xt],s[lt],s[Ie]))return Ft;if(s[lt]+1<this.min(s[At],s[Ct],s[xt],s[Ft],s[Ie]))return lt;if(s[Ct]+1<this.min(s[Ie],s[At],s[xt],s[Ft])){if(s[Ct]<s[lt])return Ct;if(s[Ct]===s[lt]){for(var d=n+o+1;d<e.length;){var f=e.charCodeAt(d);if(this.isX12TermSep(f))return lt;if(!this.isNativeX12(f))break;d++}return Ct}}}}},t.min=function(e,n,r,a,o){var i=Math.min(e,Math.min(n,Math.min(r,a)));return o===void 0?i:Math.min(i,o)},t.findMinimums=function(e,n,r,a){for(var o=0;o<6;o++){var i=n[o]=Math.ceil(e[o]);r>i&&(r=i,ht.fill(a,0)),r===i&&(a[o]=a[o]+1)}return r},t.getMinimumCount=function(e){for(var n=0,r=0;r<6;r++)n+=e[r];return n||0},t.isDigit=function(e){return e>=48&&e<=57},t.isExtendedASCII=function(e){return e>=128&&e<=255},t.isNativeC40=function(e){return e===32||e>=48&&e<=57||e>=65&&e<=90},t.isNativeText=function(e){return e===32||e>=48&&e<=57||e>=97&&e<=122},t.isNativeX12=function(e){return this.isX12TermSep(e)||e===32||e>=48&&e<=57||e>=65&&e<=90},t.isX12TermSep=function(e){return e===13||e===42||e===62},t.isNativeEDIFACT=function(e){return e>=32&&e<=94},t.isSpecialB256=function(e){return!1}
51,t.determineConsecutiveDigitCount=function(e,n){n===void 0&&(n=0);for(var r=e.length,a=n;a<r&&this.isDigit(e.charCodeAt(a));)a++;return a-n},t.illegalCharacter=function(e){var n=ce.toHexString(e.charCodeAt(0));throw n="0000".substring(0,4-n.length)+n,new Error("Illegal character: "+e+" (0x"+n+")")},t})(),ts=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fu=(function(){function t(e){this.charset=e,this.name=e.name}return t.prototype.canEncode=function(e){try{return Ut.encode(e,this.charset)!=null}catch{return!1}},t})(),kw=(function(){function t(e,n,r){var a,o,i,s,c,l;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(F){return new Fu(fw.forName(F))}),this.encoders=[];var u=[];u.push(new Fu(hw.ISO_8859_1));for(var d=n!=null&&n.name.startsWith("UTF"),f=0;f<e.length;f++){var p=!1;try{for(var g=(a=void 0,ts(u)),m=g.next();!m.done;m=g.next()){var y=m.value,v=e.charAt(f),w=v.charCodeAt(0);if(w===r||y.canEncode(v)){p=!0;break}}}catch(F){a={error:F}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(a)throw a.error}}if(!p)try{for(var b=(i=void 0,ts(this.ENCODERS)),_=b.next();!_.done;_=b.next()){var y=_.value;if(y.canEncode(e.charAt(f))){u.push(y),p=!0;break}}}catch(F){i={error:F}}finally{try{_&&!_.done&&(s=b.return)&&s.call(b)}finally{if(i)throw i.error}}p||(d=!0)}if(u.length===1&&!d)this.encoders=[u[0]];else{this.encoders=[];var A=0;try{for(var T=ts(u),S=T.next();!S.done;S=T.next()){var y=S.value;this.encoders[A++]=y}}catch(F){c={error:F}}finally{try{S&&!S.done&&(l=T.return)&&l.call(T)}finally{if(c)throw c.error}}}var E=-1;if(n!=null){for(var f=0;f<this.encoders.length;f++)if(this.encoders[f]!=null&&n.name===this.encoders[f].name){E=f;break}}this.priorityEncoderIndex=E}return t.prototype.length=function(){return this.encoders.length},t.prototype.getCharsetName=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].name},t.prototype.getCharset=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].charset},t.prototype.getECIValue=function(e){return this.encoders[e].charset.getValueIdentifier()},t.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},t.prototype.canEncode=function(e,n){if(!(n<this.length()))throw new Error("index must be less than length");return!0},t.prototype.encode=function(e,n){if(!(n<this.length()))throw new Error("index must be less than length");return Ut.encode(de.getCharAt(e),this.encoders[n].name)},t})(),Bw=3,jw=(function(){function t(e,n,r){this.fnc1=r;var a=new kw(e,n,r);if(a.length()===1)for(var o=0;o<this.bytes.length;o++){var i=e.charAt(o).charCodeAt(0);this.bytes[o]=i===r?1e3:i}else this.bytes=this.encodeMinimally(e,a,r)}return t.prototype.getFNC1Character=function(){return this.fnc1},t.prototype.length=function(){return this.bytes.length},t.prototype.haveNCharacters=function(e,n){if(e+n-1>=this.bytes.length)return!1;for(var r=0;r<n;r++)if(this.isECI(e+r))return!1;return!0},t.prototype.charAt=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(this.isECI(e))throw new Error("value at "+e+" is not a character but an ECI");return this.isFNC1(e)?this.fnc1:this.bytes[e]},t.prototype.subSequence=function(e,n){if(e<0||e>n||n>this.length())throw new Error(""+e);for(var r=new se,a=e;a<n;a++){if(this.isECI(a))throw new Error("value at "+a+" is not a character but an ECI");r.append(this.charAt(a))}return r.toString()},t.prototype.isECI=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]>255&&this.bytes[e]<=999},t.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]===1e3},t.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(!this.isECI(e))throw new Error("value at "+e+" is not an ECI but a character");return this.bytes[e]-256},t.prototype.addEdge=function(e,n,r){(e[n][r.encoderIndex]==null||e[n][r.encoderIndex].c
51achedTotalSize>r.cachedTotalSize)&&(e[n][r.encoderIndex]=r)},t.prototype.addEdges=function(e,n,r,a,o,i){var s=e.charAt(a).charCodeAt(0),c=0,l=n.length();n.getPriorityEncoderIndex()>=0&&(s===i||n.canEncode(s,n.getPriorityEncoderIndex()))&&(c=n.getPriorityEncoderIndex(),l=c+1);for(var u=c;u<l;u++)(s===i||n.canEncode(s,u))&&this.addEdge(r,a+1,new Pu(s,n,u,o,i))},t.prototype.encodeMinimally=function(e,n,r){var a=e.length,o=new Pu[a+1][n.length()];this.addEdges(e,n,o,0,null,r);for(var i=1;i<=a;i++){for(var s=0;s<n.length();s++)o[i][s]!=null&&i<a&&this.addEdges(e,n,o,i,o[i][s],r);for(var s=0;s<n.length();s++)o[i-1][s]=null}for(var c=-1,l=ce.MAX_VALUE,s=0;s<n.length();s++)if(o[a][s]!=null){var u=o[a][s];u.cachedTotalSize<l&&(l=u.cachedTotalSize,c=s)}if(c<0)throw new Error('Failed to encode "'+e+'"');for(var d=[],f=o[a][c];f!=null;){if(f.isFNC1())d.unshift(1e3);else for(var p=n.encode(f.c,f.encoderIndex),i=p.length-1;i>=0;i--)d.unshift(p[i]&255);var g=f.previous===null?0:f.previous.encoderIndex;g!==f.encoderIndex&&d.unshift(256+n.getECIValue(f.encoderIndex)),f=f.previous}for(var m=[],i=0;i<m.length;i++)m[i]=d[i];return m},t})(),Pu=(function(){function t(e,n,r,a,o){this.c=e,this.encoderSet=n,this.encoderIndex=r,this.previous=a,this.fnc1=o,this.c=e===o?1e3:e;var i=this.isFNC1()?1:n.encode(e,r).length,s=a===null?0:a.encoderIndex;s!==r&&(i+=Bw),a!=null&&(i+=a.cachedTotalSize),this.cachedTotalSize=i}return t.prototype.isFNC1=function(){return this.c===1e3},t})(),Lw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ku;(function(t){t[t.ASCII=0]="ASCII",t[t.C40=1]="C40",t[t.TEXT=2]="TEXT",t[t.X12=3]="X12",t[t.EDF=4]="EDF",t[t.B256=5]="B256"})(ku||(ku={}));(function(t){Lw(e,t);function e(n,r,a,o,i){var s=t.call(this,n,r,a)||this;return s.shape=o,s.macroId=i,s}return e.prototype.getMacroId=function(){return this.macroId},e.prototype.getShapeHint=function(){return this.shape},e})(jw);var Vw=(function(){function t(){}return t.prototype.isCompact=function(){return this.compact},t.prototype.setCompact=function(e){this.compact=e},t.prototype.getSize=function(){return this.size},t.prototype.setSize=function(e){this.size=e},t.prototype.getLayers=function(){return this.layers},t.prototype.setLayers=function(e){this.layers=e},t.prototype.getCodeWords=function(){return this.codeWords},t.prototype.setCodeWords=function(e){this.codeWords=e},t.prototype.getMatrix=function(){return this.matrix}
51,t.prototype.setMatrix=function(e){this.matrix=e},t})(),Bu=(function(){function t(){}return t.singletonList=function(e){return[e]},t.min=function(e,n){return e.sort(n)[0]},t})(),Uw=(function(){function t(e){this.previous=e}return t.prototype.getPrevious=function(){return this.previous},t})(),zw=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),xc=(function(t){zw(e,t);function e(n,r,a){var o=t.call(this,n)||this;return o.value=r,o.bitCount=a,o}return e.prototype.appendTo=function(n,r){n.appendBits(this.value,this.bitCount)},e.prototype.add=function(n,r){return new e(this,n,r)},e.prototype.addBinaryShift=function(n,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,n,r)},e.prototype.toString=function(){var n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+ce.toBinaryString(n|1<<this.bitCount).substring(1)+">"},e})(Uw),Ww=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Hw=(function(t){Ww(e,t);function e(n,r,a){var o=t.call(this,n,0,0)||this;return o.binaryShiftStart=r,o.binaryShiftByteCount=a,o}return e.prototype.appendTo=function(n,r){for(var a=0;a<this.binaryShiftByteCount;a++)(a===0||a===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):a===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+a],8)},e.prototype.addBinaryShift=function(n,r){return new e(this,n,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},e})(xc);function $w(t,e,n){return new Hw(t,e,n)}function Ma(t,e,n){return new xc(t,e,n)}var Gw=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Qn=0,Zo=1,nn=2,v0=3,wn=4,Yw=new xc(null,0,0),ns=[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])],Xw=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Kw(t){var e,n;try{for(var r=Xw(t),a=r.next();!a.done;a=r.next()){var o=a.value;ht.fill(o,-1)}}catch(i){e={error:i}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return t[Qn][wn]=0,t[Zo][wn]=0,t[Zo][Qn]=28,t[v0][wn]=0,t[nn][wn]=0,t[nn][Qn]=15,t}var y0=Kw(ht.createInt32Array(6,6)),Zw=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},qw=(function(){function t(e,n,r,a){this.token=e,this.mode=n,this.binaryShiftByteCount=r,this.bitCount=a}return t.prototype.getMode=function(){return this.mode},t.prototype.getToken=function(){return this.token},t.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},t.prototype.getBitCount=function(){return this.bitCount},t.prototype.latchAndAppend=function(e,n){var r=this.bitCount,a=this.token;if(e!==this.mode){var o=ns[this.mode][e];a=Ma(a,o&65535,o>>16),r+=o>>16}var i=e===nn?4:5;return a=Ma(a,n,i),new t(a,e,0,r+i)},t.prototype.shiftAndAppend=function(e,n){var r=this.token,a=this.mode===nn?4:5;return r=Ma(r,y0[this.mode][e],a),r=Ma(r,n,5),new t(r,this.mode,0,this.bitCount+a+5)},t.prototype.addBinaryShiftChar=function(e){var n=this.token,r=this.mode,a=this.bitCount;if(this.mode===wn||this.mode===nn){var o=ns[r][Qn];n=Ma(n,o&65535,o>>16),a+=o>>16,r=Qn}var i=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new t(n,r,this.binaryShiftByteCount+1,a+i);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(e+1)),s},t.prototype.endBinaryShift=function(e){if(this.binaryShiftByteCount===0)return this;var n=this.token;return n=$w(n,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new t(n,this.mode,0,this.bitCount)}
51,t.prototype.isBetterThanOrEqualTo=function(e){var n=this.bitCount+(ns[this.mode][e.mode]>>16);return this.binaryShiftByteCount<e.binaryShiftByteCount?n+=t.calculateBinaryShiftCost(e)-t.calculateBinaryShiftCost(this):this.binaryShiftByteCount>e.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(n+=10),n<=e.bitCount},t.prototype.toBitArray=function(e){for(var n,r,a=[],o=this.endBinaryShift(e.length).token;o!==null;o=o.getPrevious())a.unshift(o);var i=new vt;try{for(var s=Zw(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.appendTo(i,e)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},t.prototype.toString=function(){return de.format("%s bits=%d bytes=%d",Gw[this.mode],this.bitCount,this.binaryShiftByteCount)},t.calculateBinaryShiftCost=function(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0},t.INITIAL_STATE=new t(Yw,Qn,0,0),t})();function Qw(t){var e=de.getCharCode(" "),n=de.getCharCode("."),r=de.getCharCode(",");t[Qn][e]=1;for(var a=de.getCharCode("Z"),o=de.getCharCode("A"),i=o;i<=a;i++)t[Qn][i]=i-o+2;t[Zo][e]=1;for(var s=de.getCharCode("z"),c=de.getCharCode("a"),i=c;i<=s;i++)t[Zo][i]=i-c+2;t[nn][e]=1;for(var l=de.getCharCode("9"),u=de.getCharCode("0"),i=u;i<=l;i++)t[nn][i]=i-u+2;t[nn][r]=12,t[nn][n]=13;for(var d=["\0"," ","�","�","�","�","�","�","\x07","\b"," ",` 52`,"\v","\f","\r","\x1B","�","�","�","�","@","\\","^","_","`","|","~","�"],f=0;f<d.length;f++)t[v0][de.getCharCode(d[f])]=f;for(var p=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"],f=0;f<p.length;f++)de.getCharCode(p[f])>0&&(t[wn][de.getCharCode(p[f])]=f);return t}var rs=Qw(ht.createInt32Array(5,256)),No=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jw=(function(){function t(e){this.text=e}return t.prototype.encode=function(){for(var e=de.getCharCode(" "),n=de.getCharCode(` 53`),r=Bu.singletonList(qw.INITIAL_STATE),a=0;a<this.text.length;a++){var o=void 0,i=a+1<this.text.length?this.text[a+1]:0;switch(this.text[a]){case de.getCharCode("\r"):o=i===n?2:0;break;case de.getCharCode("."):o=i===e?3:0;break;case de.getCharCode(","):o=i===e?4:0;break;case de.getCharCode(":"):o=i===e?5:0;break;default:o=0}o>0?(r=t.updateStateListForPair(r,a,o),a++):r=this.updateStateListForChar(r,a)}var s=Bu.min(r,function(c,l){return c.getBitCount()-l.getBitCount()});return s.toBitArray(this.text)},t.prototype.updateStateListForChar=function(e,n){var r,a,o=[];try{for(var i=No(e),s=i.next();!s.done;s=i.next()){var c=s.value;this.updateStateForChar(c,n,o)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return t.simplifyStates(o)},t.prototype.updateStateForChar=function(e,n,r){for(var a=this.text[n]&255,o=rs[e.getMode()][a]>0,i=null,s=0;s<=wn;s++){var c=rs[s][a];if(c>0){if(i==null&&(i=e.endBinaryShift(n)),!o||s===e.getMode()||s===nn){var l=i.latchAndAppend(s,c);r.push(l)}if(!o&&y0[e.getMode()][s]>=0){var u=i.shiftAndAppend(s,c);r.push(u)}}}if(e.getBinaryShiftByteCount()>0||rs[e.getMode()][a]===0){var d=e.addBinaryShiftChar(n);r.push(d)}},t.updateStateListForPair=function(e,n,r){var a,o,i=[];try{for(var s=No(e),c=s.next();!c.done;c=s.next()){var l=c.value;this.updateStateForPair(l,n,r,i)}}catch(u){a={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}return this.simplifyStates(i)},t.updateStateForPair=function(e,n,r,a){var o=e.endBinaryShift(n);if(a.push(o.latchAndAppend(wn,r)),e.getMode()!==wn&&a.push(o.shiftAndAppend(wn,r)),r===3||r===4){var i=o.latchAndAppend(nn,16-r).latchAndAppend(nn,1);a.push(i)}if(e.getBinaryShiftByteCount()>0){var s=e.addBinaryShiftChar(n).addBinaryShiftChar(n+1);a.push(s)}},t.simplifyStates=function(e){var n,r,a,o,i=[];try{for(var s=No(e),c=s.next();!c.done;c=s.next()){var l=c.value,u=!0,d=function(y){if(y.isBetterThanOrEqualTo(l))return u=!1,"break";l.isBetterThanOrEqualTo(y)&&(i=i.filter(function(v){return v!==y}))};try{for(var f=(a=void 0,No(i)),p=f.next();!p.done;p=f.next()){var g=p.value,m=d(g);if(m==="break")break}}catch(y){a={error:y}}
53finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}u&&i.push(l)}}catch(y){n={error:y}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},t})(),e3=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function t(){}return t.encodeBytes=function(e){return t.encode(e,t.DEFAULT_EC_PERCENT,t.DEFAULT_AZTEC_LAYERS)},t.encode=function(e,n,r){var a=new Jw(e).encode(),o=ce.truncDivision(a.getSize()*n,100)+11,i=a.getSize()+o,s,c,l,u,d;if(r!==t.DEFAULT_AZTEC_LAYERS){if(s=r<0,c=Math.abs(r),c>(s?t.MAX_NB_BITS_COMPACT:t.MAX_NB_BITS))throw new Q(de.format("Illegal value %s for layers",r));l=t.totalBitsInLayer(c,s),u=t.WORD_SIZE[c];var f=l-l%u;if(d=t.stuffBits(a,u),d.getSize()+o>f)throw new Q("Data to large for user specified layer");if(s&&d.getSize()>u*64)throw new Q("Data to large for user specified layer")}else{u=0,d=null;for(var p=0;;p++){if(p>t.MAX_NB_BITS)throw new Q("Data too large for an Aztec code");if(s=p<=3,c=s?p+1:p,l=t.totalBitsInLayer(c,s),!(i>l)){(d==null||u!==t.WORD_SIZE[c])&&(u=t.WORD_SIZE[c],d=t.stuffBits(a,u));var f=l-l%u;if(!(s&&d.getSize()>u*64)&&d.getSize()+o<=f)break}}}var g=t.generateCheckWords(d,l,u),m=d.getSize()/u,y=t.generateModeMessage(s,c,m),v=(s?11:14)+c*4,w=new Int32Array(v),b;if(s){b=v;for(var p=0;p<w.length;p++)w[p]=p}else{b=v+1+2*ce.truncDivision(ce.truncDivision(v,2)-1,15);for(var _=ce.truncDivision(v,2),A=ce.truncDivision(b,2),p=0;p<_;p++){var T=p+ce.truncDivision(p,15);w[_-p-1]=A-T-1,w[_+p]=A+T+1}}for(var S=new on(b),p=0,E=0;p<c;p++){for(var F=(c-p)*4+(s?9:12),k=0;k<F;k++)for(var W=k*2,z=0;z<2;z++)g.get(E+W+z)&&S.set(w[p*2+z],w[p*2+k]),g.get(E+F*2+W+z)&&S.set(w[p*2+k],w[v-1-p*2-z]),g.get(E+F*4+W+z)&&S.set(w[v-1-p*2-z],w[v-1-p*2-k]),g.get(E+F*6+W+z)&&S.set(w[v-1-p*2-k],w[p*2+z]);E+=F*8}if(t.drawModeMessage(S,s,b,y),s)t.drawBullsEye(S,ce.truncDivision(b,2),5);else{t.drawBullsEye(S,ce.truncDivision(b,2),7);for(var p=0,k=0;p<ce.truncDivision(v,2)-1;p+=15,k+=16)for(var z=ce.truncDivision(b,2)&1;z<b;z+=2)S.set(ce.truncDivision(b,2)-k,z),S.set(ce.truncDivision(b,2)+k,z),S.set(z,ce.truncDivision(b,2)-k),S.set(z,ce.truncDivision(b,2)+k)}var L=new Vw;return L.setCompact(s),L.setSize(b),L.setLayers(c),L.setCodeWords(m),L.setMatrix(S),L},t.drawBullsEye=function(e,n,r){for(var a=0;a<r;a+=2)for(var o=n-a;o<=n+a;o++)e.set(o,n-a),e.set(o,n+a),e.set(n-a,o),e.set(n+a,o);e.set(n-r,n-r),e.set(n-r+1,n-r),e.set(n-r,n-r+1),e.set(n+r,n-r),e.set(n+r,n-r+1),e.set(n+r,n+r-1)},t.generateModeMessage=function(e,n,r){var a=new vt;return e?(a.appendBits(n-1,2),a.appendBits(r-1,6),a=t.generateCheckWords(a,28,4)):(a.appendBits(n-1,5),a.appendBits(r-1,11),a=t.generateCheckWords(a,40,4)),a},t.drawModeMessage=function(e,n,r,a){var o=ce.truncDivision(r,2);if(n)for(var i=0;i<7;i++){var s=o-3+i;a.get(i)&&e.set(s,o-5),a.get(i+7)&&e.set(o+5,s),a.get(20-i)&&e.set(s,o+5),a.get(27-i)&&e.set(o-5,s)}else for(var i=0;i<10;i++){var s=o-5+i+ce.truncDivision(i,5);a.get(i)&&e.set(s,o-7),a.get(i+10)&&e.set(o+7,s),a.get(29-i)&&e.set(s,o+7),a.get(39-i)&&e.set(o-7,s)}},t.generateCheckWords=function(e,n,r){var a,o,i=e.getSize()/r,s=new m0(t.getGF(r)),c=ce.truncDivision(n,r),l=t.bitsToWords(e,r,c);s.encode(l,c-i);var u=n%r,d=new vt;d.appendBits(0,u);try{for(var f=e3(Array.from(l)),p=f.next();!p.done;p=f.next()){var g=p.value;d.appendBits(g,r)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}return d},t.bitsToWords=function(e,n,r){var a=new Int32Array(r),o,i;for(o=0,i=e.getSize()/n;o<i;o++){for(var s=0,c=0;c<n;c++)s|=e.get(o*n+c)?1<<n-c-1:0;a[o]=s}return a},t.getGF=function(e){switch(e){case 4:return St.AZTEC_PARAM;case 6:return St.AZTEC_DATA_6;case 8:return St.AZTEC_DATA_8;case 10:return St.AZTEC_DATA_10;case 12:return St.AZTEC_DATA_12;default:throw new Q("Unsupported word size "+e)}},t.stuffBits=function(e,n){for(var r=new vt,a=e.getSize(),o=(1<<n)-2,i=0;i<a;i+=n){for(var s=0,c=0;c<n;c++)(i+c>=a||e.get(i+c))&&(s|=1<<n-1-c);(s&o)===o?(r.appendBits(s&o,n),i--):(s&o)===0?(r.appendBits(s|1,n),i--):r.appendBits(s,n)}return r},t.totalBitsInLayer=function(e,n){return((n?88:112)+16*e)*e},t.DEFAULT_EC_PERCENT=33,t.DEFAULT_AZTEC_LAYERS=0,t.MAX_NB_BITS=32,t.MAX_NB_BITS_COMPACT=4,t.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]),t})();var t3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
53e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n3=(function(t){t3(e,t);function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=e.makeBufferFromCanvasImageData(n),r}return e.makeBufferFromCanvasImageData=function(n){var r;try{r=n.getContext("2d",{willReadFrequently:!0})}catch{r=n.getContext("2d")}if(!r)throw new Error("Couldn't get canvas context.");var a=r.getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(a.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,a){for(var o=new Uint8ClampedArray(r*a),i=0,s=0,c=n.length;i<c;i+=4,s++){var l=void 0,u=n[i+3];if(u===0)l=255;else{var d=n[i],f=n[i+1],p=n[i+2];l=306*d+601*f+117*p+512>>10}o[s]=l}return o},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Q("Requested row is outside the image: "+n);var a=this.getWidth(),o=n*a;return r===null?r=this.buffer.slice(o,o+a):(r.length<a&&(r=new Uint8ClampedArray(a)),r.set(this.buffer.slice(o,o+a))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,a,o){return t.prototype.crop.call(this,n,r,a,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new ii(this)},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var a=n*e.DEGREE_TO_RADIANS,o=this.canvas.width,i=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(a))*o+Math.abs(Math.sin(a))*i),c=Math.ceil(Math.abs(Math.sin(a))*o+Math.abs(Math.cos(a))*i);r.width=s,r.height=c;var l=r.getContext("2d");if(!l)throw new Error("Could not create a Canvas Context element.");return l.translate(s/2,c/2),l.rotate(a),l.drawImage(this.canvas,o/-2,i/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e})(so);function w0(){return typeof navigator<"u"}function r3(){return w0()&&!!navigator.mediaDevices}function a3(){return!!(r3()&&navigator.mediaDevices.enumerateDevices)}var Wr=function(){return Wr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},Wr.apply(this,arguments)},ze=function(t,e,n,r){function a(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function s(u){try{l(r.next(u))}catch(d){i(d)}}function c(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?o(u.value):a(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},We=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,a&&(o=l[0]&2?a.return:l[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,l[1])).done)return o;switch(a=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],a=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},as=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},o3={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ia=(function(){function t(e,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=e,this.hints=n,this.options=Wr(Wr({},o3),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(be.POSSIBLE_FORMATS,e)}
53,enumerable:!1,configurable:!0}),t.addVideoSource=function(e,n){try{e.srcObject=n}catch{console.error("got interrupted by new loading request")}},t.mediaStreamSetTorch=function(e,n){return ze(this,void 0,void 0,function(){return We(this,function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:n}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var n,r,a=e.getVideoTracks();try{for(var o=as(a),i=o.next();!i.done;i=o.next()){var s=i.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(c){n={error:c}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(e){try{var n=e.getCapabilities();return"torch"in n}catch(r){return console.error(r),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},t.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new et("element with id '".concat(e,"' not found"));if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new et("element with id '".concat(e,"' must be an ").concat(n," element"));return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if(typeof e=="string")return t.getMediaElement(e,"video");if(!e&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if(typeof e=="string")return t.getMediaElement(e,"img");if(typeof e>"u"){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var n=t.createVideoElement(e);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},t.createBinaryBitmapFromCanvas=function(e){var n=new n3(e),r=new o0(n);return new Es(r)},t.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimensions!")},t.createCaptureCanvas=function(e){if(!e)throw new et("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=t.getMediaElementDimensions(e),a=r.width,o=r.height;return n.style.width=a+"px",n.style.height=o+"px",n.width=a,n.height=o,n},t.tryPlayVideo=function(e){return ze(this,void 0,void 0,function(){var n;return We(this,function(r){switch(r.label){case 0:if(e?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var n=t.createCaptureCanvas(e),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(r,e),n},t.createBinaryBitmapFromMediaElem=function(e){var n=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(n)},t.destroyImageElement=function(e){e.src="",e.removeAttribute("src")},t.listVideoInputDevices=function(){return ze(this,void 0,void 0,function(){var e,n,r,a,o,i,s,c,l,u,d,f;return We(this,function(p){switch(p.label){case 0:if(!w0())throw new Error("Can't enumerate devices, navigator is not present.");if(!a3())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=as(e),a=r.next();!a.done;a=r.next())o=a.value,i=o.kind==="video"?"videoinput":o.kind,i==="videoinput"&&(s=o.deviceId||o.id,c=o.label||"Video device ".concat(n.length+1),l=o.groupId,u={deviceId:s,label:c,kind:i,groupId:l},n.push(u))}catch(g){d={error:g}}finally{try{a&&!a.done&&(f=r.return)&&f.call(r)}finally{if(d)throw d.error}}return[2,n]}})})},t.findDeviceById=function(e){return ze(this,void 0,void 0,function(){var n;return We(this,function(r){switch(r.label){case 0:return[4,t.listVideoInputDevices()];case 1:return n=r.sent(),n?[2,n.find(function(a){return a.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=""}e&&e.removeAttribute("src")}},t.releaseAllStreams=function(){t.streamTracker.length!==0&&t.streamTracker.forEach(function(e){e.getTracks().forEac
53h(function(n){return n.stop()})}),t.streamTracker=[]},t.playVideoOnLoadAsync=function(e,n){return ze(this,void 0,void 0,function(){var r;return We(this,function(a){switch(a.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return r=a.sent(),r?[2,!0]:[2,new Promise(function(o,i){var s=setTimeout(function(){t.isVideoPlaying(e)||(i(!1),e.removeEventListener("canplay",c))},n),c=function(){t.tryPlayVideo(e).then(function(l){clearTimeout(s),e.removeEventListener("canplay",c),o(l)})};e.addEventListener("canplay",c)})]}})})},t.attachStreamToVideo=function(e,n){return ze(this,arguments,void 0,function(r,a,o){var i;return o===void 0&&(o=5e3),We(this,function(s){switch(s.label){case 0:return i=t.prepareVideoElement(a),t.addVideoSource(i,r),[4,t.playVideoOnLoadAsync(i,o)];case 1:return s.sent(),[2,i]}})})},t._waitImageLoad=function(e){return new Promise(function(n,r){var a=1e4,o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),r())},a),i=function(){clearTimeout(o),e.removeEventListener("load",i),n()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(e){if(!e)throw new et("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(n){return n.stop()})},t.prototype.decode=function(e){var n=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(n)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},t.prototype.decodeFromCanvas=function(e){var n=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(n)},t.prototype.decodeFromImageElement=function(e){return ze(this,void 0,void 0,function(){var n;return We(this,function(r){switch(r.label){case 0:if(!e)throw new et("An image element must be provided.");return n=t.prepareImageElement(e),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return ze(this,void 0,void 0,function(){var n;return We(this,function(r){switch(r.label){case 0:if(!e)throw new et("An URL must be provided.");n=t.prepareImageElement(),n.src=e,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return t.destroyImageElement(n),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return ze(this,void 0,void 0,function(){var a,o;return We(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(r),[4,this.getUserMedia(e)];case 1:a=i.sent(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.decodeFromStream(a,n,r)];case 3:return[2,i.sent()];case 4:throw o=i.sent(),t.disposeMediaStream(a),o;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,n,r){return ze(this,void 0,void 0,function(){var a,o,i,s,c,l,u,d,f,p=this;return We(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(r),a=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,n,a)];case 1:return o=g.sent(),i=function(){t.disposeMediaStream(e),t.cleanVideoSource(o)},s=this.scan(o,r,i),c=e.getVideoTracks(),l=Wr(Wr({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(m,y){return ze(this,void 0,void 0,function(){var v,w,b,_,A,T,S;return We(this,function(E){switch(E.label){case 0:v=y?c.filter(y):c,E.label=1;case 1:E.trys.push([1,6,7,8]),w=as(v),b=w.next(),E.label=2;case 2:return b.done?[3,5]:(_=b.value,[4,_.applyConstraints(m)]);case 3:E.sent(),E.label=4;case 4:return b=w.next(),[3,2];case 5:return[3,8];case 6:return A=E.sent(),T={error:A},[3,8];case 7:try{b&&!b.done&&(S=w.return)&&S.call(w)}finally{if(T)throw T.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(m){return c.find(m).getConstraints()},streamVideoSettingsGet:function(m){return c.find(m).getSettings()},streamVideoCapabilitiesGet:function(m){return c.find(m).getCapabilities()}}),u=t.mediaStreamIsTorchCompatible(e),u&&(d=c?.find(function(m){return t.mediaStreamIsTorchCompatibleTrack(m)}),f=function(m){return ze(p,void 0,void 0,function(){return We(this,function(y){switch(y.label){case 0:return[4,t.mediaStreamSetTorch(d,m)];case 1:return y.sent(),[2]}})})},l.switchTorch=f,l.stop=function(){return ze(p,void 0,void 0,function(){return We(this,function(m){switch(m.label){case 0:return s.stop(),[4,f(!1)];case 1:return m.sent(),[2]}})})}),[2,l]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return ze(this,void 0,void 0,function(){var a,o;return We(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(r),e?a={deviceId:{exact:e}}:a={facingMode:"environment"},o={video:a},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,n){return ze(this,void 0,void 0,function(){var r,a;return We(this,function(o){switch(o.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new et("A video element must be provided.");return r=t.prepareVideoElement(e),a=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,a)];case 1:return o.sent(),[2,this.scan(r,n)]}})})},t.prototype.decodeFromVideoUrl=function(e,n){return ze(this,void 0,void 0,function(){var r,a,o,i;return We(this,function(s){switch(s.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new et("An URL must be provided.");return r=t.prepareVideoElement(),r.src=e,a=function(){t.cleanVideoSource(r)},o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,o)];case 1:return s.sent(),i=this.scan(r,n,a),[2,i]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return ze(this,void 0,void 0,function(){var r;return We(this,function(a){switch(a.label){case 0:return[4,this.getUserMedia(e)];case 1:return r=a.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,a.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return ze(this,void 0,void 0,function(){var r,a,o;return We(this,function(i){switch(i.label){case 0:return r=!!n,[4,t.attachStreamToVideo(e,n)];case 1:a=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(a)];case 3:return o=i.sent(),[2,o];case 4:return r||t.cleanVideoSource(a),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return ze(this,void 0,void 0,function(){var r,a;return We(this,function(o){switch(o.label){case 0:return e?r={deviceId:{exact:e}}:r={facingMode:"environment"},a={video:r},[4,this.decodeOnceFromConstraints(a,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return ze(this,void 0,void 0,function(){var n,r;return We(this,function(a){switch(a.label){case 0:if(!e)throw new et("A video element must be provided.");return n=t.prepareVideoElement(e),r=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,r)];case 1:return a.sent(),[4,this.scanOneResult(n)];case 2:return[2,a.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return ze(this,void 0,void 0,function(){var n,r;return We(this,function(a){switch(a.label){case 0:if(!e)throw new et("An URL must be provided.");n=t.prepareVideoElement(),n.src=e,r=this.decodeOnceFromVideoElement(n),a.label=1;case 1:return a.trys.push([1,,3,4]),[4,r];case 2:return[2,a.sent()];case 3:return t.cleanVideoSource(n),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(e,n,r,a){var o=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),a===void 0&&(a=!0),new Promise(function(i,s){o.scan(e,function(c,l,u){if(c){i(c),u.stop();return}if(l){if(l instanceof D&&n||l instanceof Ke&&r||l instanceof P&&a)return;u.stop(),s(l)}})})},t.prototype.scan=function(e,n,r){var a=this;t.checkCallbackFnOrThrow(n);var o=t.createCaptureCanvas(e),i;try{i=o.getContext("2d",{willReadFrequently:!0})}catch{i=o.getContext("2d")}if(!i)throw new Error("Couldn't create canvas for visual element scan.");var s=function(){i=void 0,o=void 0},c=!1,l,u=function(){c=!0,clearTimeout(l),s(),r&&r()},d={stop:u},f=function(){if(!c)try{t.drawImageOnCanvas(i,e);var p=a.decodeFromCanvas(o);n(p,void 0,d),l=setTimeout(f,a.options.delayBetweenScanSuccess)}catch(v){n(void 0,v,d);var g=v instanceof Ke,m=v instanceof P,y=v instanceof D;if(g||m||y){l=setTimeout(f,a.options.delayBetweenScanAttempts);return}s(),r&&r(v)}};return f(),d},t.prototype._decodeOnLoadImage=function(e){return ze(this,void 0,void 0,function(){var n;return We(this,function(r){switch(r.label){case 0:return n=t.isImageLoaded(e),n?[3,2]:[4,t._waitImageLoad(e)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(e)]}})})},t.prototype.getUserMedia=function(e){return ze(this,void 0,void 0,function(){var n;return We(this,function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=r.sent(),t.streamTracker.push(n),[2,n]}})})},t.streamTracker=[],t})(),i3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}
53e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){i3(e,t);function e(n,r){return t.call(this,new $o,n,r)||this}return e})(ia);var s3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){s3(e,t);function e(n,r){return t.call(this,new Ur(n),n,r)||this}return e})(ia);var c3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){c3(e,t);function e(n,r){return t.call(this,new Yo,n,r)||this}return e})(ia);var l3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),u3=(function(t){l3(e,t);function e(n,r){var a=this,o=new g0;return o.setHints(n),a=t.call(this,o,n,r)||this,a.reader=o,a}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(n){this.hints.set(be.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},e.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)},e})(ia),d3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){d3(e,t);function e(n,r){return t.call(this,new Ko,n,r)||this}return e})(ia);var f3=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){f3(e,t);function e(n,r){return t.call(this,new Xo,n,r)||this}return e})(ia);function h3({open:t,onOpenChange:e,onDetected:n}){const r=R.useRef(null),a=R.useRef(null),o=R.useRef(!1),[i,s]=R.useState("starting"),[c,l]=R.useState(""),u=()=>{a.current?.stop(),a.current=null};R.useEffect(()=>{if(!t){u();return}let f=!1;o.current=!1,s("starting"),l("");const p=new u3;return(async()=>{try{if(!r.current)return;const m=await p.decodeFromConstraints({video:{facingMode:{ideal:"environment"},width:{ideal:1280},height:{ideal:720}},audio:!1},r.current,y=>{y&&!o.current&&(o.current=!0,a.current?.stop(),n(y.getText().replace(/\s/g,"")))});if(f){m.stop();return}a.current=m,s("ready")}catch(m){if(f)return;const y=m instanceof DOMException?m.name:"";l(y==="NotAllowedError"?"æªè½éåç¸æ©ãè«åºç覽å¨è¨å®å
è¨±ç¸æ©å¾å試ã":"æ«æéåå°ç¸æ©ãä½ å¯ä»¥æå輸å
¥å
è£ä¸å
æ¢ç¢¼ã"),s("error")}})(),()=>{f=!0,u()}},[t,n]);const d=()=>{u(),e(!1)};return h.jsx(Xf,{"data-loc":"client/src/components/BarcodeScanner.tsx:89",open:t,onOpenChange:f=>f?e(!0):d(),children:h.jsxs(Kf,{"data-loc":"client/src/components/BarcodeScanner.tsx:90",className:"border-white/10 bg-zinc-950/95 text-zinc-100 backdrop-blur-xl",children:[h.jsx(Zf,{"data-loc":"client/src/components/BarcodeScanner.tsx:91",className:"text-left",children:h.jsxs("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:92",className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:93",children:[h.jsxs(qf,{"data-loc":"client/src/components/BarcodeScanner.tsx:94",className:"flex items-center gap-2 text-lg text-zinc-100",children:[h.jsx(Pa,{"data-loc":"client/src/components/BarcodeScanner.tsx:95",className:"h-5 w-5 text-violet-300"}),"ææå
è£é£åæ¢ç¢¼"]}),h.jsx(Qf,{"data-loc":"client/src/components/BarcodeScanner.tsx:98",className:"mt-1 text-zinc-400",children:"å°æ¢ç¢¼æ¾å
¥æ¡å
§ï¼ç³»çµ±æèªåè®åã"})]}),h.jsx(ye,{"data-loc":"client/src/components/BarcodeScanner.tsx:100",variant:"ghost",size:"icon",onClick:d,className:"shrink-0 text-zinc-300 hover:bg-white/10 hover:text-white","aria-label":"ééææ
53å¨",children:h.jsx(za,{"data-loc":"client/src/components/BarcodeScanner.tsx:101",className:"h-5 w-5"})})]})}),h.jsxs("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:106",className:"px-4 pb-7",children:[h.jsxs("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:107",className:"relative overflow-hidden rounded-2xl border border-violet-400/35 bg-black aspect-[4/3]",children:[h.jsx("video",{"data-loc":"client/src/components/BarcodeScanner.tsx:108",ref:r,className:"h-full w-full object-cover",muted:!0,playsInline:!0}),i!=="error"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:111",className:"pointer-events-none absolute inset-5 rounded-xl border-2 border-violet-300/80 shadow-[0_0_0_999px_rgba(0,0,0,0.24)]"}),h.jsx("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:112",className:"pointer-events-none absolute inset-x-8 top-1/2 h-0.5 -translate-y-1/2 bg-violet-200 shadow-[0_0_14px_3px_rgba(196,181,253,0.75)] animate-pulse"})]}),i==="starting"&&h.jsxs("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:116",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-black/50 text-sm text-zinc-200",children:[h.jsx(vr,{"data-loc":"client/src/components/BarcodeScanner.tsx:117",className:"h-6 w-6 animate-spin text-violet-300"}),"éåç¸æ©ä¸â¦"]}),i==="error"&&h.jsxs("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:122",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 px-7 text-center text-sm text-zinc-200",children:[h.jsx(rf,{"data-loc":"client/src/components/BarcodeScanner.tsx:123",className:"h-7 w-7 text-amber-300"}),h.jsx("p",{"data-loc":"client/src/components/BarcodeScanner.tsx:124",children:c})]})]}),h.jsxs("div",{"data-loc":"client/src/components/BarcodeScanner.tsx:128",className:"mt-4 flex items-center justify-center gap-2 text-xs text-zinc-400",children:[h.jsx(Po,{"data-loc":"client/src/components/BarcodeScanner.tsx:129",className:"h-3.5 w-3.5"}),"ç¸æ©åªç¨ä½å³ææç¢¼ï¼ä¸æèªåå²åå½±åã"]})]})]})})}function p3(t,e){const n=Number.isFinite(e)&&e>0?e:1,r=a=>a===null?null:Math.round(a*n*10)/10;return{calories:t.calories===null?null:Math.round(t.calories*n),protein:r(t.protein),carbs:r(t.carbs),fat:r(t.fat),fiber:r(t.fiber),salt:r(t.salt)}}const vc=R.createContext({});function yc(t){const e=R.useRef(null);return e.current===null&&(e.current=t()),e.current}const wc=typeof window<"u",b0=wc?R.useLayoutEffect:R.useEffect,li=R.createContext(null);function bc(t,e){t.indexOf(e)===-1&&t.push(e)}function Cc(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Nn=(t,e,n)=>n>e?e:n<t?t:n;let _c=()=>{};const On={},C0=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function _0(t){return typeof t=="object"&&t!==null}const A0=t=>/^0[^.\s]+$/u.test(t);function Ac(t){let e;return()=>(e===void 0&&(e=t()),e)}const an=t=>t,g3=(t,e)=>n=>e(t(n)),lo=(...t)=>t.reduce(g3),Za=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Ec{constructor(){this.subscriptions=[]}add(e){return bc(this.subscriptions,e),()=>Cc(this.subscriptions,e)}notify(e,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,n,r);else for(let o=0;o<a;o++){const i=this.subscriptions[o];i&&i(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const bn=t=>t*1e3,rn=t=>t/1e3;function E0(t,e){return e?t*(1e3/e):0}const S0=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,m3=1e-7,x3=12;function v3(t,e,n,r,a){let o,i,s=0;do i=e+(n-e)/2,o=S0(i,r,a)-t,o>0?n=i:e=i;while(Math.abs(o)>m3&&++s<x3);return i}function uo(t,e,n,r){if(t===e&&n===r)return an;const a=o=>v3(o,0,1,t,n);return o=>o===0||o===1?o:S0(a(o),e,r)}const I0=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,R0=t=>e=>1-t(1-e),T0=uo(.33,1.53,.69,.99),Sc=R0(T0),N0=I0(Sc),O0=t=>(t*=2)<1?.5*Sc(t):.5*(2-Math.pow(2,-10*(t-1))),Ic=t=>1-Math.sin(Math.acos(t)),D0=R0(Ic),M0=I0(Ic),y3=uo(.42,0,1,1),w3=uo(0,0,.58,1),F0=uo(.42,0,.58,1),b3=t=>Array.isArray(t)&&typeof t[0]!="number",P0=t=>Array.isArray(t)&&typeof t[0]=="number",C3={linear:an,easeIn:y3,easeInOut:F0,easeOut:w3,cir
vendor: 40,064 bytes, lines 53-61
53cIn:Ic,circInOut:M0,circOut:D0,backIn:Sc,backInOut:N0,backOut:T0,anticipate:O0},_3=t=>typeof t=="string",ju=t=>{if(P0(t)){_c(t.length===4);const[e,n,r,a]=t;return uo(e,n,r,a)}else if(_3(t))return C3[t];return t},Oo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function A3(t,e){let n=new Set,r=new Set,a=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(l.schedule(u),t()),u(s)}const l={schedule:(u,d=!1,f=!1)=>{const g=f&&a?n:r;return d&&i.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(s=u,a){o=!0;return}a=!0,[n,r]=[r,n],n.forEach(c),n.clear(),a=!1,o&&(o=!1,l.process(u))}};return l}const E3=40;function k0(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Oo.reduce((b,_)=>(b[_]=A3(o),b),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:g}=i,m=()=>{const b=On.useManualTiming?a.timestamp:performance.now();n=!1,On.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(b-a.timestamp,E3),1)),a.timestamp=b,a.isProcessing=!0,s.process(a),c.process(a),l.process(a),u.process(a),d.process(a),f.process(a),p.process(a),g.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(m))},y=()=>{n=!0,r=!0,a.isProcessing||t(m)};return{schedule:Oo.reduce((b,_)=>{const A=i[_];return b[_]=(T,S=!1,E=!1)=>(n||y(),A.schedule(T,S,E)),b},{}),cancel:b=>{for(let _=0;_<Oo.length;_++)i[Oo[_]].cancel(b)},state:a,steps:i}}const{schedule:Ue,cancel:Jn,state:_t,steps:os}=k0(typeof requestAnimationFrame<"u"?requestAnimationFrame:an,!0);let Vo;function S3(){Vo=void 0}const Vt={now:()=>(Vo===void 0&&Vt.set(_t.isProcessing||On.useManualTiming?_t.timestamp:performance.now()),Vo),set:t=>{Vo=t,queueMicrotask(S3)}},B0=t=>e=>typeof e=="string"&&e.startsWith(t),Rc=B0("--"),I3=B0("var(--"),Tc=t=>I3(t)?R3.test(t.split("/*")[0].trim()):!1,R3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,sa={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},qa={...sa,transform:t=>Nn(0,1,t)},Do={...sa,default:1},Wa=t=>Math.round(t*1e5)/1e5,Nc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function T3(t){return t==null}const N3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Oc=(t,e)=>n=>!!(typeof n=="string"&&N3.test(n)&&n.startsWith(t)||e&&!T3(n)&&Object.prototype.hasOwnProperty.call(n,e)),j0=(t,e,n)=>r=>{if(typeof r!="string")return r;const[a,o,i,s]=r.match(Nc);return{[t]:parseFloat(a),[e]:parseFloat(o),[n]:parseFloat(i),alpha:s!==void 0?parseFloat(s):1}},O3=t=>Nn(0,255,t),is={...sa,transform:t=>Math.round(O3(t))},Ar={test:Oc("rgb","red"),parse:j0("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+is.transform(t)+", "+is.transform(e)+", "+is.transform(n)+", "+Wa(qa.transform(r))+")"};function D3(t){let e="",n="",r="",a="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),a=t.substring(4,5),e+=e,n+=n,r+=r,a+=a),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const Ps={test:Oc("#"),parse:D3,transform:Ar.transform},fo=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Kn=fo("deg"),Cn=fo("%"),te=fo("px"),M3=fo("vh"),F3=fo("vw"),Lu={...Cn,parse:t=>Cn.parse(t)/100,transform:t=>Cn.transform(t*100)},Hr={test:Oc("hsl","hue"),parse:j0("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Cn.transform(Wa(e))+", "+Cn.transform(Wa(n))+", "+Wa(qa.transform(r))+")"},ot={test:t=>Ar.test(t)||Ps.test(t)||Hr.test(t),parse:t=>Ar.test(t)?Ar.parse(t):Hr.test(t)?Hr.parse(t):Ps.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ar.transform(t):Hr.transform(t),getAnimatableNone:t=>{const e=ot.parse(t);return e.alpha=0,ot.transform(e)}},P3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function k3(t){return isNaN(t)&&typeof t=="string"&&(t.match(Nc)?.length||0)+(t.match(P3)?.length||0)>0}const L0="number",V0="color",B3="var",j3="var(",Vu="${}",L3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Qa(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},a=[];let o=0;const s=e.replace(L3,c=>(ot.test(c)?(r.color.push(o),a.push(V0),n.push(ot.parse(c))):c.startsWith(j3)?(r.var.push(o),a.push(B3),n.push(c)):(r.number.push(o),a.push(L0),n.push(parseFloat(c))),++o,Vu)).split(Vu);return{values:n,split:s,indexes:r,types:a}}function U0(t){return Qa(t).values}function z0(t){const{split:e,types:n}=Qa(t),r=e.length;return a=>{let o="";for(let i=0;i<r;i++)if(o+=e[i],a[i]!==void 0){const s=n[i];s===L0?o+=Wa(a[i]):s===V0?o+=ot.transform(a[i]):o+=a[i]}return o}}const V3=t=>typeof t=="number"?0:ot.test(t)?ot.getAnimatableNone(t):t;function U3(t){const e=U0(t);return z0(t)(e.map(V3))}const er={test:k3,parse:U0,createTransformer:z0,getAnimatableNone:U3};function ss(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function z3({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let a=0,o=0,i=0;if(!e)a=o=i=n;else{const s=n<.5?n*(1+e):n+e-n*e,c=2*n-s;a=ss(c,s,t+1/3),o=ss(c,s,t),i=ss(c,s,t-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function qo(t,e){return n=>n>0?e:t}const Ge=(t,e,n)=>t+(e-t)*n,cs=(t,e,n)=>{const r=t*t,a=n*(e*e-r)+r;return a<0?0:Math.sqrt(a)},W3=[Ps,Ar,Hr],H3=t=>W3.find(e=>e.test(t));function Uu(t){const e=H3(t);if(!e)return!1;let n=e.parse(t);return e===Hr&&(n=z3(n)),n}const zu=(t,e)=>{const n=Uu(t),r=Uu(e);if(!n||!r)return qo(t,e);const a={...n};return o=>(a.red=cs(n.red,r.red,o),a.green=cs(n.green,r.green,o),a.blue=cs(n.blue,r.blue,o),a.alpha=Ge(n.alpha,r.alpha,o),Ar.transform(a))},ks=new Set(["none","hidden"]);function $3(t,e){return ks.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function G3(t,e){return n=>Ge(t,e,n)}function Dc(t){return typeof t=="number"?G3:typeof t=="string"?Tc(t)?qo:ot.test(t)?zu:K3:Array.isArray(t)?W0:typeof t=="object"?ot.test(t)?zu:Y3:qo}function W0(t,e){const n=[...t],r=n.length,a=t.map((o,i)=>Dc(o)(o,e[i]));return o=>{for(let i=0;i<r;i++)n[i]=a[i](o);return n}}function Y3(t,e){const n={...t,...e},r={};for(const a in n)t[a]!==void 0&&e[a]!==void 0&&(r[a]=Dc(t[a])(t[a],e[a]));return a=>{for(const o in r)n[o]=r[o](a);return n}}function X3(t,e){const n=[],r={color:0,var:0,number:0};for(let a=0;a<e.values.length;a++){const o=e.types[a],i=t.indexes[o][r[o]],s=t.values[i]??0;n[a]=s,r[o]++}return n}const K3=(t,e)=>{const n=er.createTransformer(e),r=Qa(t),a=Qa(e);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?ks.has(t)&&!a.values.length||ks.has(e)&&!r.values.length?$3(t,e):lo(W0(X3(r,a),a.values),n):qo(t,e)};function H0(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Ge(t,e,n):Dc(t)(t,e)}const Z3=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Ue.update(e,n),stop:()=>Jn(e),now:()=>_t.isProcessing?_t.timestamp:Vt.now()}},$0=(t,e,n=10)=>{let r="";const a=Math.max(Math.round(e/n),2);for(let o=0;o<a;o++)r+=Math.round(t(o/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Qo=2e4;function Mc(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Qo;)e+=n,r=t.next(e);return e>=Qo?1/0:e}function q3(t,e=100,n){const r=n({...t,keyframes:[0,e]}),a=Math.min(Mc(r),Qo);return{type:"keyframes",ease:o=>r.next(a*o).value/e,duration:rn(a)}}const Q3=5;function G0(t,e,n){const r=Math.max(e-Q3,0);return E0(n-t(r),e-r)}const Xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ls=.001;function J3({duration:t=Xe.duration,bounce:e=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let a,o,i=1-e;i=Nn(Xe.minDamping,Xe.maxDamping,i),t=Nn(Xe.minDuration,Xe.maxDuration,rn(t)),i<1?(a=l=>{const u=l*i,d=u*t,f=u-n,p=Bs(l,i),g=Math.exp(-d);return ls-f/p*g},o=l=>{const d=l*i*t,f=d*n+n,p=Math.pow(i,2)*Math.pow(l,2)*t,g=Math.exp(-d),m=Bs(Math.pow(l,2),i);return(-a(l)+ls>0?-1:1)*((f-p)*g)/m}):(a=l=>{const u=Math.exp(-l*t),d=(l-n)*t+1;return-ls+u*d},o=l=>{const u=Math.exp(-l*t),d=(n-l)*(t*t);return u*d});const s=5/t,c=tb(a,o,s);if(t=bn(t),isNaN(c))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:t};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:t}}}const eb=12;function tb(t,e,n){let r=n;for(let a=1;a<eb;a++)r=r-t(r)/e(r);return r}function Bs(t,e){return t*Math.sqrt(1-e*e)}const nb=["duration","bounce"],rb=["stiffness","damping","mass"];function Wu(t,e){return e.some(n=>t[n]!==void 0)}function ab(t){let e={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...t};if(!Wu(t,rb)&&Wu(t,nb))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,o=2*Nn(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:Xe.mass,stiffness:a,damping:o}}else{const n=J3(t);e={...e,...n,mass:Xe.mass},e.isResolvedFromDuration=!0}return e}function Jo(t=Xe.visualDuration,e=Xe.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:a}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],s={done:!1,value:o},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=ab({...n,velocity:-rn(n.velocity||0)}),g=f||0,m=l/(2*Math.sqrt(c*u)),y=i-o,v=rn(Math.sqrt(c/u)),w=Math.abs(y)<5;r||(r=w?Xe.restSpeed.granular:Xe.restSpeed.default),a||(a=w?Xe.restDelta.granular:Xe.restDelta.default);let b;if(m<1){const A=Bs(v,m);b=T=>{const S=Math.exp(-m*v*T);return i-S*((g+m*v*y)/A*Math.sin(A*T)+y*Math.cos(A*T))}}else if(m===1)b=A=>i-Math.exp(-v*A)*(y+(g+v*y)*A);else{const A=v*Math.sqrt(m*m-1);b=T=>{const S=Math.exp(-m*v*T),E=Math.min(A*T,300);return i-S*((g+m*v*y)*Math.sinh(E)+A*y*Math.cosh(E))/A}}const _={calculatedDuration:p&&d||null,next:A=>{const T=b(A);if(p)s.done=A>=d;else{let S=A===0?g:0;m<1&&(S=A===0?bn(g):G0(b,A,T));const E=Math.abs(S)<=r,F=Math.abs(i-T)<=a;s.done=E&&F}return s.value=s.done?i:T,s},toString:()=>{const A=Math.min(Mc(_),Qo),T=$0(S=>_.next(A*S).value,A,30);return A+"ms "+T},toTransition:()=>{}};return _}Jo.applyToOptions=t=>{const e=q3(t,100,Jo);return t.ease=e.ease,t.duration=bn(e.duration),t.type="keyframes",t};function js({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:i,min:s,max:c,restDelta:l=.5,restSpeed:u}){const d=t[0],f={done:!1,value:d},p=E=>s!==void 0&&E<s||c!==void 0&&E>c,g=E=>s===void 0?c:c===void 0||Math.abs(s-E)<Math.abs(c-E)?s:c;let m=n*e;const y=d+m,v=i===void 0?y:i(y);v!==y&&(m=v-d);const w=E=>-m*Math.exp(-E/r),b=E=>v+w(E),_=E=>{const F=w(E),k=b(E);f.done=Math.abs(F)<=l,f.value=f.done?v:k};let A,T;const S=E=>{p(f.value)&&(A=E,T=Jo({keyframes:[f.value,g(f.value)],velocity:G0(b,E,f.value),damping:a,stiffness:o,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:E=>{let F=!1;return!T&&A===void 0&&(F=!0,_(E),S(E)),A!==void 0&&E>=A?T.next(E-A):(!F&&_(E),f)}}}function ob(t,e,n){const r=[],a=n||On.mix||H0,o=t.length-1;for(let i=0;i<o;i++){let s=a(t[i],t[i+1]);if(e){const c=Array.isArray(e)?e[i]||an:e;s=lo(c,s)}r.push(s)}return r}function ib(t,e,{clamp:n=!0,ease:r,mixer:a}={}){const o=t.length;if(_c(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const i=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=ob(e,r,a),c=s.length,l=u=>{if(i&&u<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const f=Za(t[d],t[d+1],u);return s[d](f)};return n?u=>l(Nn(t[0],t[o-1],u)):l}function sb(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const a=Za(0,e,r);t.push(Ge(n,1,a))}}function cb(t){const e=[0];return sb(e,t.length-1),e}function lb(t,e){return t.map(n=>n*e)}function ub(t,e){return t.map(()=>e||F0).splice(0,t.length-1)}function Ha({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const a=b3(r)?r.map(ju):ju(r),o={done:!1,value:e[0]},i=lb(n&&n.length===e.length?n:cb(e),t),s=ib(i,e,{ease:Array.isArray(a)?a:ub(e,a)});return{calculatedDuration:t,next:c=>(o.value=s(c),o.done=c>=t,o)}}const db=t=>t!==null;function Fc(t,{repeat:e,repeatType:n="loop"},r,a=1){const o=t.filter(db),s=a<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!s||r===void 0?o[s]:r}const fb={decay:js,inertia:js,tween:Ha,keyframes:Ha,spring:Jo};function Y0(t){typeof t.type=="string"&&(t.type=fb[t.type])}class Pc{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const hb=t=>t/100;class kc extends Pc{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Vt.now()&&this.tick(Vt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Y0(e);const{type:n=Ha,repeat:r=0,repeatDelay:a=0,repeatType:o,velocity:i=0}=e;let{keyframes:s}=e;const c=n||Ha;c!==Ha&&typeof s[0]!="number"&&(this.mixKeyframes=lo(hb,H0(s[0],s[1])),s=[0,100]);const l=c({...e,keyframes:s});o==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...s].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=Mc(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:a,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:s,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:g,onUpdate:m,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?v<0:v>a;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let b=this.currentTime,_=r;if(d){const E=Math.min(this.currentTime,a)/s;let F=Math.floor(E),k=E%1;!k&&E>=1&&(k=1),k===1&&F--,F=Math.min(F,d+1),!!(F%2)&&(f==="reverse"?(k=1-k,p&&(k-=p/s)):f==="mirror"&&(_=i)),b=Nn(0,1,k)*s}const A=w?{done:!1,value:u[0]}:_.next(b);o&&(A.value=o(A.value));let{done:T}=A;!w&&c!==null&&(T=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return S&&g!==js&&(A.value=Fc(u,this.options,y,this.speed)),m&&m(A.value),S&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return rn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+rn(e)}get time(){return rn(this.currentTime)}set time(e){e=bn(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Vt.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=rn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Z3,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Vt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function pb(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Er=t=>t*180/Math.PI,Ls=t=>{const e=Er(Math.atan2(t[1],t[0]));return Vs(e)},gb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ls,rotateZ:Ls,skewX:t=>Er(Math.atan(t[1])),skewY:t=>Er(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Vs=t=>(t=t%360,t<0&&(t+=360),t),Hu=Ls,$u=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Gu=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),mb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$u,scaleY:Gu,scale:t=>($u(t)+Gu(t))/2,rotateX:t=>Vs(Er(Math.atan2(t[6],t[5]))),rotateY:t=>Vs(Er(Math.atan2(-t[2],t[0]))),rotateZ:Hu,rotate:Hu,skewX:t=>Er(Math.atan(t[4])),skewY:t=>Er(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Us(t){return t.includes("scale")?1:0}function zs(t,e){if(!t||t==="none")return Us(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=mb,a=n;else{const s=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=gb,a=s}if(!a)return Us(e);const o=r[e],i=a[1].split(",").map(vb);return typeof o=="function"?o(i):i[o]}const xb=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return zs(n,e)};function vb(t){return parseFloat(t.trim())}const ca=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],la=new Set(ca),Yu=t=>t===sa||t===te,yb=new Set(["x","y","z"]),wb=ca.filter(t=>!yb.has(t));function bb(t){const e=[];return wb.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Ir={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>zs(e,"x"),y:(t,{transform:e})=>zs(e,"y")};Ir.translateX=Ir.x;Ir.translateY=Ir.y;const Rr=new Set;let Ws=!1,Hs=!1,$s=!1;function X0(){if(Hs){const t=Array.from(Rr).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const a=bb(r);a.length&&(n.set(r,a),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([o,i])=>{r.getValue(o)?.set(i)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hs=!1,Ws=!1,Rr.forEach(t=>t.complete($s)),Rr.clear()}function K0(){Rr.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Hs=!0)})}function Cb(){$s=!0,K0(),X0(),$s=!1}class Bc{constructor(e,n,r,a,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=a,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Rr.add(this),Ws||(Ws=!0,Ue.read(K0),Ue.resolveKeyframes(X0))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:a}=this;if(e[0]===null){const o=a?.get(),i=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const s=r.readValue(n,i);s!=null&&(e[0]=s)}e[0]===void 0&&(e[0]=i),a&&o===void 0&&a.set(e[0])}pb(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Rr.delete(this)}cancel(){this.state==="scheduled"&&(Rr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const _b=t=>t.startsWith("--");function Ab(t,e,n){_b(e)?t.style.setProperty(e,n):t.style[e]=n}const Eb=Ac(()=>window.ScrollTimeline!==void 0),Sb={};function Ib(t,e){const n=Ac(t);return()=>Sb[e]??n()}const Z0=Ib(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ua=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Xu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ua([0,.65,.55,1]),circOut:Ua([.55,0,1,.45]),backIn:Ua([.31,.01,.66,-.59]),backOut:Ua([.33,1.53,.69,.99])};function q0(t,e){if(t)return typeof t=="function"?Z0()?$0(t,e):"ease-out":P0(t)?Ua(t):Array.isArray(t)?t.map(n=>q0(n,e)||Xu.easeOut):Xu[t]}function Rb(t,e,n,{delay:r=0,duration:a=300,repeat:o=0,repeatType:i="loop",ease:s="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const d=q0(s,a);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:a,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),t.animate(u,f)}function Q0(t){return typeof t=="function"&&"applyToOptions"in t}function Tb({type:t,...e}){return Q0(t)&&Z0()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Nb extends Pc{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:a,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:s,onComplete:c}=e;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=e,_c(typeof e.type!="string");const l=Tb(e);this.animation=Rb(n,r,a,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=Fc(a,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):Ab(n,r,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return rn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+rn(e)}get time(){return rn(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=bn(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Eb()?(this.animation.timeline=e,an):n(this)}}const J0={anticipate:O0,backInOut:N0,circInOut:M0};function Ob(t){return t in J0}function Db(t){typeof t.ease=="string"&&Ob(t.ease)&&(t.ease=J0[t.ease])}const Ku=10;class Mb extends Nb{constructor(e){Db(e),Y0(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:a,element:o,...i}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const s=new kc({...i,autoplay:!1}),c=bn(this.finishedTime??this.time);n.setWithVelocity(s.sample(c-Ku).value,s.sample(c).value,Ku),s.stop()}}const Zu=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(er.test(t)||t==="0")&&!t.startsWith("url("));function Fb(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Pb(t,e,n,r){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],i=Zu(a,e),s=Zu(o,e);return!i||!s?!1:Fb(t)||(n==="spring"||Q0(n))&&r}function Gs(t){t.duration=0,t.type="keyframes"}const kb=new Set(["opacity","clipPath","filter","transform"]),Bb=Ac(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function jb(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:a,damping:o,type:i}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=e.owner.getProps();return Bb()&&n&&kb.has(n)&&(n!=="transform"||!l)&&!c&&!r&&a!=="mirror"&&o!==0&&i!=="inertia"}const Lb=40;class Vb extends Pc{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:i="loop",keyframes:s,name:c,motionValue:l,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Vt.now();const f={autoplay:e,delay:n,type:r,repeat:a,repeatDelay:o,repeatType:i,name:c,motionValue:l,element:u,...d},p=u?.KeyframeResolver||Bc;this.keyframeResolver=new p(s,(g,m,y)=>this.onKeyframesResolved(g,m,f,!y),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,r,a){this.keyframeResolver=void 0;const{name:o,type:i,velocity:s,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=Vt.now(),Pb(e,o,i,s)||((On.instantAnimations||!c)&&u?.(Fc(e,r,n)),e[0]=e[e.length-1],Gs(r),r.repeat=0);const f={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>Lb?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},p=!l&&jb(f)?new Mb({...f,element:f.motionValue.owner.current}):new kc(f);p.finished.then(()=>this.notifyFinished()).catch(an),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Cb()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ub=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zb(t){const e=Ub.exec(t);if(!e)return[,];const[,n,r,a]=e;return[`--${n??r}`,a]}function eh(t,e,n=1){const[r,a]=zb(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const i=o.trim();return C0(i)?parseFloat(i):i}return Tc(a)?eh(a,e,n+1):a}function jc(t,e){return t?.[e]??t?.default??t}const th=new Set(["width","height","top","left","right","bottom",...ca]),Wb={test:t=>t==="auto",parse:t=>t},nh=t=>e=>e.test(t),rh=[sa,te,Cn,Kn,F3,M3,Wb],qu=t=>rh.find(nh(t));function Hb(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||A0(t):!0}const $b=new Set(["brightness","contrast","saturate","opacity"]);function Gb(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Nc)||[];if(!r)return t;const a=n.replace(r,"");let o=$b.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+a+")"}const Yb=/\b([a-z-]*)\(.*?\)/gu,Ys={...er,getAnimatableNone:t=>{const e=t.match(Yb);return e?e.map(Gb).join(" "):t}},Qu={...sa,transform:Math.round},Xb={rotate:Kn,rotateX:Kn,rotateY:Kn,rotateZ:Kn,scale:Do,scaleX:Do,scaleY:Do,scaleZ:Do,skew:Kn,skewX:Kn,skewY:Kn,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:qa,originX:Lu,originY:Lu,originZ:te},Lc={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,backgroundPositionX:te,backgroundPositionY:te,...Xb,zIndex:Qu,fillOpacity:qa,strokeOpacity:qa,numOctaves:Qu},Kb={...Lc,color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,filter:Ys,WebkitFilter:Ys},ah=t=>Kb[t];function oh(t,e){let n=ah(t);return n!==Ys&&(n=er),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Zb=new Set(["auto","none","0"]);function qb(t,e,n){let r=0,a;for(;r<t.length&&!a;){const o=t[r];typeof o=="string"&&!Zb.has(o)&&Qa(o).values.length&&(a=t[r]),r++}if(a&&n)for(const o of e)t[o]=oh(n,a)}class Qb extends Bc{constructor(e,n,r,a,o){super(e,n,r,a,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let l=e[c];if(typeof l=="string"&&(l=l.trim(),Tc(l))){const u=eh(l,n.current);u!==void 0&&(e[c]=u),c===e.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!th.has(r)||e.length!==2)return;const[a,o]=e,i=qu(a),s=qu(o);if(i!==s)if(Yu(i)&&Yu(s))for(let c=0;c<e.length;c++){const l=e[c];typeof l=="string"&&(e[c]=parseFloat(l))}else Ir[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let a=0;a<e.length;a++)(e[a]===null||Hb(e[a]))&&r.push(a);r.length&&qb(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ir[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&e.getValue(r,a).jump(a,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const a=e.getValue(n);a&&a.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=Ir[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,c])=>{e.getValue(s).set(c)}),this.resolveNoneKeyframes()}}function Jb(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const a=n?.[t]??r.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}const ih=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function sh(t){return _0(t)&&"offsetHeight"in t}const Ju=30,e4=t=>!isNaN(parseFloat(t));class t4{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=Vt.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Vt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=e4(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Ec);const r=this.events[e].add(n);return e==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Vt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ju)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ju);return E0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qr(t,e){return new t4(t,e)}const{schedule:Vc}=k0(queueMicrotask,!1),un={x:!1,y:!1};function ch(){return un.x||un.y}function n4(t){return t==="x"||t==="y"?un[t]?null:(un[t]=!0,()=>{un[t]=!1}):un.x||un.y?null:(un.x=un.y=!0,()=>{un.x=un.y=!1})}function lh(t,e){const n=Jb(t),r=new AbortController,a={passive:!0,...e,signal:r.signal};return[n,a,()=>r.abort()]}function ed(t){return!(t.pointerType==="touch"||ch())}function r4(t,e,n={}){const[r,a,o]=lh(t,n),i=s=>{if(!ed(s))return;const{target:c}=s,l=e(c,s);if(typeof l!="function"||!c)return;const u=d=>{ed(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,a)};return r.forEach(s=>{s.addEventListener("pointerenter",i,a)}),o}const uh=(t,e)=>e?t===e?!0:uh(t,e.parentElement):!1,Uc=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,a4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function o4(t){return a4.has(t.tagName)||t.tabIndex!==-1}const Uo=new WeakSet;function td(t){return e=>{e.key==="Enter"&&t(e)}}function us(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const i4=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=td(()=>{if(Uo.has(n))return;us(n,"down");const a=td(()=>{us(n,"up")}),o=()=>us(n,"cancel");n.addEventListener("keyup",a,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function nd(t){return Uc(t)&&!ch()}function s4(t,e,n={}){const[r,a,o]=lh(t,n),i=s=>{const c=s.currentTarget;if(!nd(s))return;Uo.add(c);const l=e(c,s),u=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Uo.has(c)&&Uo.delete(c),nd(p)&&typeof l=="function"&&l(p,{success:g})},d=p=>{u(p,c===window||c===document||n.useGlobalTarget||uh(c,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,a),window.addEventListener("pointercancel",f,a)};return r.forEach(s=>{(n.useGlobalTarget?window:s).addEventListener("pointerdown",i,a),sh(s)&&(s.addEventListener("focus",l=>i4(l,a)),!o4(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),o}function dh(t){return _0(t)&&"ownerSVGElement"in t}function c4(t){return dh(t)&&t.tagName==="svg"}const It=t=>!!(t&&t.getVelocity),l4=[...rh,ot,er],u4=t=>l4.find(nh(t)),zc=R.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function rd(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function d4(...t){return e=>{let n=!1;const r=t.map(a=>{const o=rd(a,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<r.length;a++){const o=r[a];typeof o=="function"?o():rd(t[a],null)}}}}function f4(...t){return R.useCallback(d4(...t),t)}class h4 extends R.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=n.offsetParent,a=sh(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=a-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function p4({children:t,isPresent:e,anchorX:n,root:r}){const a=R.useId(),o=R.useRef(null),i=R.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=R.useContext(zc),c=f4(o,t?.ref);return R.useInsertionEffect(()=>{const{width:l,height:u,top:d,left:f,right:p}=i.current;if(e||!o.current||!l||!u)return;const g=n==="left"?`left: ${f}`:`right: ${p}`;o.current.dataset.motionPopId=a;const m=document.createElement("style");s&&(m.nonce=s);const y=r??document.head;return y.appendChild(m),m.sheet&&m.sheet.insertRule(` 54 [data-motion-pop-id="${a}"] { 55 position: absolute !important; 56 width: ${l}px !important; 57 height: ${u}px !important; 58 ${g}px !important; 59 top: ${d}px !important; 60 } 61 `),()=>{y.contains(m)&&y.removeChild(m)}},[e]),h.jsx(h4,{isPresent:e,childRef:o,sizeRef:i,children:R.cloneElement(t,{ref:c})})}const g4=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:a,presenceAffectsLayout:o,mode:i,anchorX:s,root:c})=>{const l=yc(m4),u=R.useId();let d=!0,f=R.useMemo(()=>(d=!1,{id:u,initial:e,isPresent:n,custom:a,onExitComplete:p=>{l.set(p,!0);for(const g of l.values())if(!g)return;r&&r()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,r]);return o&&d&&(f={...f}),R.useMemo(()=>{l.forEach((p,g)=>l.set(g,!1))},[n]),R.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),i==="popLayout"&&(t=h.jsx(p4,{isPresent:n,anchorX:s,root:c,children:t})),h.jsx(li.Provider,{value:f,children:t})};function m4(){return new Map}function fh(t=!0){const e=R.useContext(li);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=e,o=R.useId();R.useEffect(()=>{if(t)return a(o)},[t]);const i=R.useCallback(()=>t&&r&&r(o),[o,r,t]);return!n&&r?[!1,i]:[!0]}const Mo=t=>t.key||"";function ad(t){const e=[];return R.Children.forEach(t,n=>{R.isValidElement(n)&&e.push(n)}),e}const x4=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:o="sync",propagate:i=!1,anchorX:s="left",root:c})=>{const[l,u]=fh(i),d=R.useMemo(()=>ad(t),[t]),f=i&&!l?[]:d.map(Mo),p=R.useRef(!0),g=R.useRef(d),m=yc(()=>new Map),[y,v]=R.useState(d),[w,b]=R.useState(d);b0(()=>{p.current=!1,g.current=d;for(let T=0;T<w.length;T++){const S=Mo(w[T]);f.includes(S)?m.delete(S):m.get(S)!==!0&&m.set(S,!1)}},[w,f.length,f.join("-")]);const _=[];if(d!==y){let T=[...d];for(let S=0;S<w.length;S++){const E=w[S],F=Mo(E);f.includes(F)||(T.splice(S,0,E),_.push(E))}return o==="wait"&&_.length&&(T=_),b(ad(T)),v(d),null}const{forceRender:A}=R.useContext(vc);return h.jsx(h.Fragment,{children:w.map(T=>{const S=Mo(T),E=i&&!l?!1:d===w||f.includes(S),F=()=>
vendor: 4,580 bytes, line 61
61{if(m.has(S))m.set(S,!0);else return;let k=!0;m.forEach(W=>{W||(k=!1)}),k&&(A?.(),b(g.current),i&&u?.(),r&&r())};return h.jsx(g4,{isPresent:E,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:a,mode:o,root:c,onExitComplete:E?void 0:F,anchorX:s,children:T},S)})})},hh=R.createContext({strict:!1}),od={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Jr={};for(const t in od)Jr[t]={isEnabled:e=>od[t].some(n=>!!e[n])};function v4(t){for(const e in t)Jr[e]={...Jr[e],...t[e]}}const y4=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ei(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||y4.has(t)}let ph=t=>!ei(t);function w4(t){typeof t=="function"&&(ph=e=>e.startsWith("on")?!ei(e):t(e))}try{w4(require("@emotion/is-prop-valid").default)}catch{}function b4(t,e,n){const r={};for(const a in t)a==="values"&&typeof t.values=="object"||(ph(a)||n===!0&&ei(a)||!e&&!ei(a)||t.draggable&&a.startsWith("onDrag"))&&(r[a]=t[a]);return r}const ui=R.createContext({});function di(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ja(t){return typeof t=="string"||Array.isArray(t)}const Wc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Hc=["initial",...Wc];function fi(t){return di(t.animate)||Hc.some(e=>Ja(t[e]))}function gh(t){return!!(fi(t)||t.variants)}function C4(t,e){if(fi(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ja(n)?n:void 0,animate:Ja(r)?r:void 0}}return t.inherit!==!1?e:{}}function _4(t){const{initial:e,animate:n}=C4(t,R.useContext(ui));return R.useMemo(()=>({initial:e,animate:n}),[id(e),id(n)])}function id(t){return Array.isArray(t)?t.join(" "):t}const eo={};function A4(t){for(const e in t)eo[e]=t[e],Rc(e)&&(eo[e].isCSSVariable=!0)}function mh(t,{layout:e,layoutId:n}){return la.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!eo[t]||t==="opacity")}const E4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},S4=ca.length;function I4(t,e,n){let r="",a=!0;for(let o=0;o<S4;o++){const i=ca[o],s=t[i];if(s===void 0)continue;let c=!0;if(typeof s=="number"?c=s===(i.startsWith("scale")?1:0):c=parseFloat(s)===0,!c||n){const l=ih(s,Lc[i]);if(!c){a=!1;const u=E4[i]||i;r+=`${u}(${l}) `}n&&(e[i]=l)}}return r=r.trim(),n?r=n(e,a?"":r):a&&(r="none"),r}function $c(t,e,n){const{style:r,vars:a,transformOrigin:o}=t;let i=!1,s=!1;for(const c in e){const l=e[c];if(la.has(c)){i=!0;continue}else if(Rc(c)){a[c]=l;continue}else{const u=ih(l,Lc[c]);c.startsWith("origin")?(s=!0,o[c]=u):r[c]=u}}if(e.transform||(i||n?r.transform=I4(e,t.transform,n):r.transform&&(r.transform="none")),s){const{originX:c="50%",originY:l="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${l} ${u}`}}const Gc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xh(t,e,n){for(const r in e)!It(e[r])&&!mh(r,n)&&(t[r]=e[r])}function R4({transformTemplate:t},e){return R.useMemo(()=>{const n=Gc();return $c(n,e,t),Object.assign({},n.vars,n.style)},[e])}function T4(t,e){const n=t.style||{},r={};return xh(r,n,t),Object.assign(r,R4(t,e)),r}function N4(t,e){const n={},r=T4(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const O4={offset:"stroke-dashoffset",array:"stroke-dasharray"},D4={offset:"strokeDashoffset",array:"strokeDasharray"};function M4(t,e,n=1,r=0,a=!0){t.pathLength=1;const o=a?O4:D4;t[o.offset]=te.transform(-r);const i=te.transform(e),s=te.transform(n);t[o.array]=`${i} ${s}`}function vh(t,{attrX:e,attrY:n,attrScale:r,pathLength:a,pathSpacing:o=1,pathOffset:i=0,...s}
vendor: 4,670 bytes, line 61
61,c,l,u){if($c(t,s,l),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:f}=t;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),a!==void 0&&M4(d,a,o,i,!1)}const yh=()=>({...Gc(),attrs:{}}),wh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function F4(t,e,n,r){const a=R.useMemo(()=>{const o=yh();return vh(o,e,wh(r),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};xh(o,t.style,t),a.style={...o,...a.style}}return a}const P4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yc(t){return typeof t!="string"||t.includes("-")?!1:!!(P4.indexOf(t)>-1||/[A-Z]/u.test(t))}function k4(t,e,n,{latestValues:r},a,o=!1){const s=(Yc(t)?F4:N4)(e,r,a,t),c=b4(e,typeof t=="string",o),l=t!==R.Fragment?{...c,...s,ref:n}:{},{children:u}=e,d=R.useMemo(()=>It(u)?u.get():u,[u]);return R.createElement(t,{...l,children:d})}function sd(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Xc(t,e,n,r){if(typeof e=="function"){const[a,o]=sd(r);e=e(n!==void 0?n:t.custom,a,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,o]=sd(r);e=e(n!==void 0?n:t.custom,a,o)}return e}function zo(t){return It(t)?t.get():t}function B4({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,a){return{latestValues:j4(n,r,a,t),renderState:e()}}function j4(t,e,n,r){const a={},o=r(t,{});for(const f in o)a[f]=zo(o[f]);let{initial:i,animate:s}=t;const c=fi(t),l=gh(t);e&&l&&!c&&t.inherit!==!1&&(i===void 0&&(i=e.initial),s===void 0&&(s=e.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?s:i;if(d&&typeof d!="boolean"&&!di(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const g=Xc(t,f[p]);if(g){const{transitionEnd:m,transition:y,...v}=g;for(const w in v){let b=v[w];if(Array.isArray(b)){const _=u?b.length-1:0;b=b[_]}b!==null&&(a[w]=b)}for(const w in m)a[w]=m[w]}}}return a}const bh=t=>(e,n)=>{const r=R.useContext(ui),a=R.useContext(li),o=()=>B4(t,e,r,a);return n?o():yc(o)};function Kc(t,e,n){const{style:r}=t,a={};for(const o in r)(It(r[o])||e.style&&It(e.style[o])||mh(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(a[o]=r[o]);return a}const L4=bh({scrapeMotionValuesFromProps:Kc,createRenderState:Gc});function Ch(t,e,n){const r=Kc(t,e,n);for(const a in t)if(It(t[a])||It(e[a])){const o=ca.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[o]=t[a]}return r}const V4=bh({scrapeMotionValuesFromProps:Ch,createRenderState:yh}),U4=Symbol.for("motionComponentSymbol");function $r(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function z4(t,e,n){return R.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):$r(n)&&(n.current=r))},[e])}const Zc=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),W4="framerAppearId",_h="data-"+Zc(W4),Ah=R.createContext({});function H4(t,e,n,r,a){const{visualElement:o}=R.useContext(ui),i=R.useContext(hh),s=R.useContext(li),c=R.useContext(zc).reducedMotion,l=R.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(t,{visualState:e,parent:o,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=R.useContext(Ah);u&&!u.projection&&a&&(u.type==="html"||u.type==="svg")&&$4(l.current,n,a,d);const f=R.useRef(!1);R.useInsertionEffect(()=>{u&&f.current&&u.update(n,s)});const p=n[_h],g=R.useRef(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return b0(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),R.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),g.current=!1),u.enteringChildren=void 0)}),u}function $4(t,e,n,r){const{layoutId:a,layout:o,drag:i,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Eh(t.parent)),t.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!i||s&&$r(s),visualElement:t,animationType:typeof o=="str
61ing"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Eh(t){if(t)return t.options.allowProjection!==!1?t.projection:Eh(t.parent)}function ds(t,{forwardMotionProps:e=!1}={},n,r){n&&v4(n);const a=Yc(t)?V4:L4;function o(s,c){let l;const u={...R.useContext(zc),...s,layoutId:G4(s)},{isStatic:d}=u,f=_4(s),p=a(s,d);if(!d&&wc){Y4();const g=X4(u);l=g.MeasureLayout,f.visualElement=H4(t,p,u,r,g.ProjectionNode)}return h.jsxs(ui.Provider,{value:f,children:[l&&f.visualElement?h.jsx(l,{visualElement:f.visualElement,...u}):null,k4(t,s,z4(p,f.visualElement,c),p,d,e)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const i=R.forwardRef(o);return i[U4]=t,i}function G4({layoutId:t}){const e=R.useContext(vc).id;return e&&t!==void 0?e+"-"+t:t}function Y4(t,e){R.useContext(hh).strict}function X4(t){const{drag:e,layout:n}=Jr;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function K4(t,e){if(typeof Proxy>"u")return ds;const n=new Map,r=(o,i)=>ds(o,i,t,e),a=(o,i)=>r(o,i);return new Proxy(a,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,ds(i,void 0,t,e)),n.get(i))})}function Sh({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Z4({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function q4(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function fs(t){return t===void 0||t===1}function Xs({scale:t,scaleX:e,scaleY:n}){return!fs(t)||!fs(e)||!fs(n)}function br(t){return Xs(t)||Ih(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ih(t){return cd(t.x)||cd(t.y)}function cd(t){return t&&t!=="0%"}function ti(t,e,n){const r=t-n,a=e*r;return n+a}function ld(t,e,n,r,a){return a!==void 0&&(t=ti(t,a,r)),ti(t,n,r)+e}function Ks(t,e=0,n=1,r,a){t.min=ld(t.min,e,n,r,a),t.max=ld(t.max,e,n,r,a)}function Rh(t,{x:e,y:n}){Ks(t.x,e.translate,e.scale,e.originPoint),Ks(t.y,n.translate,n.scale,n.originPoint)}const ud=.999999999999,dd=1.0000000000001;function Q4(t,e,n,r=!1){const a=n.length;if(!a)return;e.x=e.y=1;let o,i;for(let s=0;s<a;s++){o=n[s],i=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Yr(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(e.x*=i.x.scale,e.y*=i.y.scale,Rh(t,i)),r&&br(o.latestValues)&&Yr(t,o.latestValues))}e.x<dd&&e.x>ud&&(e.x=1),e.y<dd&&e.y>ud&&(e.y=1)}function Gr(t,e){t.min=t.min+e,t.max=t.max+e}function fd(t,e,n,r,a=.5){const o=Ge(t.min,t.max,a);Ks(t,e,n,o,r)}function Yr(t,e){fd(t.x,e.x,e.scaleX,e.scale,e.originX),fd(t.y,e.y,e.scaleY,e.scale,e.originY)}function Th(t,e){return Sh(q4(t.getBoundingClientRect(),e))}function J4(t,e,n){const r=Th(t,n),{scroll:a}=e;return a&&(Gr(r.x,a.offset.x),Gr(r.y,a.offset.y)),r}const hd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xr=()=>({x:hd(),y:hd()}),pd=()=>({min:0,max:0}),Je=()=>({x:pd(),y:pd()}),ni={current:null},qc={current:!1};function Nh(){if(qc.current=!0,!!wc)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ni.current=t.matches;t.addEventListener("change",e),e()}else ni.current=!1}const eC=new WeakMap;function tC(t,e,n){for(const r in e){const a=e[r],o=n[r];if(It(a))t.addValue(r,a);else if(It(o))t.addValue(r,Qr(a,{owner:t}));else if(o!==a)if(t.hasValue(r)){const i=t.getValue(r);i.liveStyle===!0?i.jump(a):i.hasAnimated||i.set(a)}else{const i=t.getStaticValue(r);t.addValue(r,Qr(i!==void 0?i:a,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const gd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class nC{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:a,blockInitialAnimation:o,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Bc,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Vt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Ue.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=s,this.blockInitialAnimation=!!o,this.isControllingVariants=fi(n),this.isVariantNode=gh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];c[f]!==void 0&&It(p)&&p.set(c[f])}}mount(e){this.current=e,eC.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
vendor: 14,951 bytes, line 61
61h((n,r)=>this.bindToMotionValue(r,n)),qc.current||Nh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ni.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Jn(this.notifyUpdate),Jn(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=la.has(e);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",i=>{this.latestValues[e]=i,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Jr){const n=Jr[e];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[e]&&a&&r(this.props)&&(this.features[e]=new a(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Je()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<gd.length;r++){const a=gd[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const o="on"+a,i=e[o];i&&(this.propEventSubscriptions[a]=this.on(a,i))}this.prevMotionValues=tC(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Qr(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(C0(r)||A0(r))?r=parseFloat(r):!u4(r)&&er.test(n)&&(r=oh(e,n)),this.setBaseTarget(e,It(r)?r.get():r)),It(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Xc(this.props,n,this.presenceContext?.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!It(a)?a:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Ec),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Vc.render(this.render)}}class Oh extends nC{constructor(){super(...arguments),this.KeyframeResolver=Qb}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;It(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Dh(t,{style:e,vars:n},r,a){const o=t.style;let i;for(i in e)o[i]=e[i];a?.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function rC(t){return window.getComputedStyle(t)}class aC extends Oh{constructor(){super(...arguments),this.type="html",this.renderInstance=Dh}readValueFromInstance(e,n){if(la.has(n))return this.projection?.isProjecting?Us(n):xb(e,n);{const r=rC(e),a=(Rc(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Th(e,n)}build(e,n,r){$c(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Kc(e,n,r)}}const Mh=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function oC(t,e,n,r){Dh(t,e,void 0,r);for(const a in e.attrs)t.setAttribute(Mh.has(a)?a:Zc(a),e.attrs[a])}class iC extends Oh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Je}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(la.has(n)){const r=ah(n);return r&&r.default||0}return n=Mh.has(n)?n:Zc(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return Ch(e,n,r)}build(e,n,r){vh(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,a){oC(e,n,r,a)}mount(e){this.isSVGTag=wh(e.tagName),super.mount(e)}}const sC=(t,e)=>Yc(t)?new iC(e):new aC(e,{allowProjection:t!==R.Fragment});function Kr(t,e,n){const r=t.getProps();return Xc(r,e,n!==void 0?n:r.custom,t)}const Zs=t=>Array.isArray(t);function cC(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Qr(n))}function lC(t){return Zs(t)?t[t.length-1]||0:t}function uC(t,e){const n=Kr(t,e);let{transitionEnd:r={},transition:a={},...o}=n||{};o={...o,...r};for(const i in o){const s=lC(o[i]);cC(t,i,s)}}function dC(t){return!!(It(t)&&t.add)}function qs(t,e){const n=t.getValue("willChange");if(dC(n))return n.add(e);if(!n&&On.WillChange){const r=new On.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Fh(t){return t.props[_h]}const fC=t=>t!==null;function hC(t,{repeat:e,repeatType:n="loop"},r){const a=t.filter(fC),o=e&&n!=="loop"&&e%2===1?0:a.length-1;return a[o]}const pC={type:"spring",stiffness:500,damping:25,restSpeed:10},gC=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),mC={type:"keyframes",duration:.8},xC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vC=(t,{keyframes:e})=>e.length>2?mC:la.has(t)?t.startsWith("scale")?gC(e[1]):pC:xC;function yC({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:o,repeatType:i,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Qc=(t,e,n,r={},a,o)=>i=>{const s=jc(r,t)||{},c=s.delay||r.delay||0;let{elapsed:l=0}=r;l=l-bn(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...s,delay:-l,onUpdate:f=>{e.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:t,motionValue:e,element:o?void 0:a};yC(s)||Object.assign(u,vC(t,u)),u.duration&&(u.duration=bn(u.duration)),u.repeatDelay&&(u.repeatDelay=bn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Gs(u),u.delay===0&&(d=!0)),(On.instantAnimations||On.skipAnimations)&&(d=!0,Gs(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!o&&e.get()!==void 0){const f=hC(u.keyframes,s);if(f!==void 0){Ue.update(()=>{u.onUpdate(f),u.onComplete()});return}}return s.isSync?new kc(u):new Vb(u)};function wC({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Ph(t,e,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:i,...s}=e;r&&(o=r);const c=[],l=a&&t.animationState&&t.animationState.getState()[a];for(const u in s){const d=t.getValue(u,t.latestValues[u]??null),f=s[u];if(f===void 0||l&&wC(l,u))continue;const p={delay:n,...jc(o||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const v=Fh(t);if(v){const w=window.MotionHandoffAnimation(v,u,Ue);w!==null&&(p.startTime=w,m=!0)}}qs(t,u),d.start(Qc(u,d,f,t.shouldReduceMotion&&th.has(u)?{type:!1}:p,t,m));const y=d.animation;y&&c.push(y)}return i&&Promise.all(c).then(()=>{Ue.update(()=>{i&&uC(t,i)})}),c}function kh(t,e,n,r=0,a=1){const o=Array.from(t).sort((l,u)=>l.sortNodePosition(u)).indexOf(e),i=t.size,s=(i-1)*r;return typeof n=="function"?n(o,i):a===1?o*r:s-o*r}function Qs(t,e,n={}){const r=Kr(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const o=r?()=>Promise.all(Ph(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:d}=a;return bC(t,e,c,l,u,d,n)}:()=>Promise.resolve(),{when:s}=a;if(s){const[c,l]=s==="beforeChildren"?[o,i]:[i,o];return c().then(()=>l())}else return Promise.all([o(),i(n.delay)])}function bC(t,e,n=0,r=0,a=0,o=1,i){const s=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),s.push(Qs(c,e,{...i,delay:n+(typeof r=="function"?0:r)+kh(t.variantChildren,c,r,a,o)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(s)}function CC(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const a=e.map(o=>Qs(t,o,n));r=Promise.all(a)}else if(typeof e=="string")r=Qs(t,e,n);else{const a=typeof e=="function"?Kr(t,e,n.custom):e;r=Promise.all(Ph(t,a,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function Bh(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const _C=Hc.length;function jh(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?jh(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<_C;n++){const r=Hc[n],a=t.props[r];(Ja(a)||a===!1)&&(e[r]=a)}return e}const AC=[...Wc].reverse(),EC=Wc.length;function SC(t){return e=>Promise.all(e.map(({animation:n,options:r})=>CC(t,n,r)))}function IC(t){let e=SC(t),n=md(),r=!0;const a=c=>(l,u)=>{const d=Kr(t,u,c==="exit"?t.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:p,...g}=d;l={...l,...g,...p}}return l};function o(c){e=c(t)}function i(c){const{props:l}=t,u=jh(t.parent)||{},d=[],f=new Set;let p={},g=1/0;for(let y=0;y<EC;y++){const v=AC[y],w=n[v],b=l[v]!==void 0?l[v]:u[v],_=Ja(b),A=v===c?w.isActive:null;A===!1&&(g=y);let T=b===u[v]&&b!==l[v]&&_;if(T&&r&&t.manuallyAnimateOnMount&&(T=!1),w.protectedKeys={...p},!w.isActive&&A===null||!b&&!w.prevProp||di(b)||typeof b=="boolean")continue;const S=RC(w.prevProp,b);let E=S||v===c&&w.isActive&&!T&&_||y>g&&_,F=!1;const k=Array.isArray(b)?b:[b];let W=k.reduce(a(v),{});A===!1&&(W={});const{prevResolvedValues:z={}}=w,L={...z,...W},le=ne=>{E=!0,f.has(ne)&&(F=!0,f.delete(ne)),w.needsAnimating[ne]=!0;const oe=t.getValue(ne);oe&&(oe.liveStyle=!1)};for(const ne in L){const oe=W[ne],Ce=z[ne];if(p.hasOwnProperty(ne))continue;let Me=!1;Zs(oe)&&Zs(Ce)?Me=!Bh(oe,Ce):Me=oe!==Ce,Me?oe!=null?le(ne):f.add(ne):oe!==void 0&&f.has(ne)?le(ne):w.protectedKeys[ne]=!0}w.prevProp=b,w.prevResolvedValues=W,w.isActive&&(p={...p,...W}),r&&t.blockInitialAnimation&&(E=!1);const fe=T&&S;E&&(!fe||F)&&d.push(...k.map(ne=>{const oe={type:v};if(typeof ne=="string"&&r&&!fe&&t.manuallyAnimateOnMount&&t.parent){const{parent:Ce}=t,Me=Kr(Ce,ne);if(Ce.enteringChildren&&Me){const{delayChildren:sn}=Me.transition||{};oe.delay=kh(Ce.enteringChildren,t,sn)}}return{animation:ne,options:oe}}))}if(f.size){const y={};if(typeof l.initial!="boolean"){const v=Kr(t,Array.isArray(l.initial)?l.initial[0]:l.initial);v&&v.transition&&(y.transition=v.transition)}f.forEach(v=>{const w=t.getBaseTarget(v),b=t.getValue(v);b&&(b.liveStyle=!0),y[v]=w??null}),d.push({animation:y})}let m=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(d):Promise.resolve()}function s(c,l){if(n[c].isActive===l)return Promise.resolve();t.variantChildren?.forEach(d=>d.animationState?.setActive(c,l)),n[c].isActive=l;const u=i(c);for(const d in n)n[d].protectedKeys={};return u}return{animateChanges:i,setActive:s,setAnimateFunction:o,getState:()=>n,reset:()=>{n=md(),r=!0}}}function RC(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Bh(e,t):!1}function xr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function md(){return{animate:xr(!0),whileInView:xr(),whileHover:xr(),whileTap:xr(),whileDrag:xr(),whileFocus:xr(),exit:xr()}}class tr{constructor(e){this.isMounted=!1,this.node=e}update(){}}class TC extends tr{constructor(e){super(e),e.animationState||(e.animationState=IC(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();di(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let NC=0;class OC extends tr{constructor(){super(...arguments),this.id=NC++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const a=this.node.animationState.setActive("exit",!e);n&&!e&&a.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};
vendor: 4,366 bytes, line 61
61n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const DC={animation:{Feature:TC},exit:{Feature:OC}};function to(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function ho(t){return{point:{x:t.pageX,y:t.pageY}}}const MC=t=>e=>Uc(e)&&t(e,ho(e));function $a(t,e,n,r){return to(t,e,MC(n),r)}const Lh=1e-4,FC=1-Lh,PC=1+Lh,Vh=.01,kC=0-Vh,BC=0+Vh;function Pt(t){return t.max-t.min}function jC(t,e,n){return Math.abs(t-e)<=n}function xd(t,e,n,r=.5){t.origin=r,t.originPoint=Ge(e.min,e.max,t.origin),t.scale=Pt(n)/Pt(e),t.translate=Ge(n.min,n.max,t.origin)-t.originPoint,(t.scale>=FC&&t.scale<=PC||isNaN(t.scale))&&(t.scale=1),(t.translate>=kC&&t.translate<=BC||isNaN(t.translate))&&(t.translate=0)}function Ga(t,e,n,r){xd(t.x,e.x,n.x,r?r.originX:void 0),xd(t.y,e.y,n.y,r?r.originY:void 0)}function vd(t,e,n){t.min=n.min+e.min,t.max=t.min+Pt(e)}function LC(t,e,n){vd(t.x,e.x,n.x),vd(t.y,e.y,n.y)}function yd(t,e,n){t.min=e.min-n.min,t.max=t.min+Pt(e)}function Ya(t,e,n){yd(t.x,e.x,n.x),yd(t.y,e.y,n.y)}function tn(t){return[t("x"),t("y")]}const Uh=({current:t})=>t?t.ownerDocument.defaultView:null,wd=(t,e)=>Math.abs(t-e);function VC(t,e){const n=wd(t.x,e.x),r=wd(t.y,e.y);return Math.sqrt(n**2+r**2)}class zh{constructor(e,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=ps(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=VC(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=f,{timestamp:y}=_t;this.history.push({...m,timestamp:y});const{onStart:v,onMove:w}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=hs(p,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=ps(f.type==="pointercancel"?this.lastMoveEventInfo:hs(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,v),m&&m(f,v)},!Uc(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=a||window;const s=ho(e),c=hs(s,this.transformPagePoint),{point:l}=c,{timestamp:u}=_t;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(e,ps(c,this.history)),this.removeListeners=lo($a(this.contextWindow,"pointermove",this.handlePointerMove),$a(this.contextWindow,"pointerup",this.handlePointerUp),$a(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Jn(this.updatePoint)}}function hs(t,e){return e?{point:e(t.point)}:t}function bd(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ps({point:t},e){return{point:t,delta:bd(t,Wh(e)),offset:bd(t,UC(e)),velocity:zC(e,.1)}}function UC(t){return t[0]}function Wh(t){return t[t.length-1]}function zC(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const a=Wh(t);for(;n>=0&&(r=t[n],!(a.timestamp-r.timestamp>bn(e)));)n--;if(!r)return{x:0,y:0};const o=rn(a.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(a.x-r.x)/o,y:(a.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function WC(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Ge(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Ge(n,t,r.max):Math.min(t,n)),t}function Cd(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function HC(t,{top:e,left:n,bottom:r,right:a}){return{x:Cd(t.x,n,a),y:Cd(t.y,e,r)}}function _d(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function $C(t,e){return{x:_d(t.x,e.x),y:_d(t.y,e.y)}}function GC(t,e){let n=.5;const r=Pt(t),a=Pt(e);return a>r?n=Za(e.min,e.max-r,t.min):r>a&&(n=Za(t.min,t.max-a,e.min)),Nn(0,1,n)}function YC(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Js=.35;function XC(t=Js){return t===!1?t=0:t===!0&&(t=Js),{x:Ad(t,"left","right"),y:Ad(t,"top","bottom")}}
vendor: 10,551 bytes, line 61
61function Ad(t,e,n){return{min:Ed(t,e),max:Ed(t,n)}}function Ed(t,e){return typeof t=="number"?t:t[e]||0}const KC=new WeakMap;class ZC{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Je(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ho(d).point)},i=(d,f)=>{const{drag:p,dragPropagation:g,onDragStart:m}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=n4(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tn(v=>{let w=this.getAxisMotionValue(v).get()||0;if(Cn.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const _=b.layout.layoutBox[v];_&&(w=Pt(_)*(parseFloat(w)/100))}}this.originPoint[v]=w}),m&&Ue.postRender(()=>m(d,f)),qs(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:m,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=f;if(g&&this.currentDirection===null){this.currentDirection=qC(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),y&&y(d,f)},c=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>tn(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new zh(e,{onSessionStart:o,onStart:i,onMove:s,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Uh(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,a=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!r)return;const{velocity:i}=a;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Ue.postRender(()=>s(r,a))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:a}=this.getProps();if(!r||!Fo(e,a,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=WC(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;e&&$r(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=HC(r.layoutBox,e):this.constraints=!1,this.elastic=XC(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&tn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=YC(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!$r(e))return!1;const r=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=J4(r,a.root,this.visualElement.getTransformPagePoint());let i=$C(a.layout.layoutBox,o);if(n){const s=n(Z4(i));this.hasMutatedConstraints=!!s,s&&(i=Sh(s))}return i}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=tn(u=>{if(!Fo(u,n,this.currentDirection))return;let d=c&&c[u]||{};i&&(d={min:0,max:0});const f=a?200:1e6,p=a?40:1e7,g={type:"inertia",velocity:r?e[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(l).then(s)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return qs(this.visualElement,e),r.start(Qc(e,r,0,n,this.visualElement,!1))}stopAnimation(){tn(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){tn(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){tn(n=>{const{drag:r}=this.getProps();if(!Fo(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(n);if(a&&a.layout){const{min:i,max:s}=a.layout.layoutBox[n];o.set(e[n]-Ge(i,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!$r(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};tn(i=>{const s=this.getAxisMotionValue(i);if(s&&this.constraints!==!1){const c=s.get();a[i]=GC({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),tn(i=>{if(!Fo(i,e,null))return;const s=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];s.set(Ge(c,l,a[i]))})}addListeners(){if(!this.visualElement.current)return;KC.set(this.visualElement,this);const e=this.visualElement.current,n=$a(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();$r(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,o=a.addEventListener("measure",r);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Ue.read(r);const i=to(window,"resize",()=>this.scalePositionWithinConstraints()),s=a.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(tn(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())}));return()=>{i(),n(),o(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:i=Js,dragMomentum:s=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Fo(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function qC(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class QC extends tr{constructor(e){super(e),this.removeGroupControls=an,this.removeListeners=an,this.controls=new ZC(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||an}unmount(){this.removeGroupControls(),this.removeListeners()}}const Sd=t=>(e,n)=>{t&&Ue.postRender(()=>t(e,n))};class JC extends tr{constructor(){super(...arguments),this.removePointerDownListener=an}onPointerDown(e){this.session=new zh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Uh(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:Sd(e),onStart:Sd(n),onMove:r,onEnd:(o,i)=>{delete this.session,a&&Ue.postRender(()=>a(o,i))}}}mount(){this.removePointerDownListener=$a(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Wo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Id(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fa={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(te.test(t))t=parseFloat(t);else return t;const n=Id(t,e.target.x),r=Id(t,e.target.y);return`${n}% ${r}%`}},e_={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,a=er.parse(t);if(a.length>5)return r;const o=er.createTransformer(t),i=typeof a[0]!="number"?1:0,s=n.x.scale*e.x,c=n.y.scale*e.y;a[0+i]/=s,a[1+i]/=c;const l=Ge(s,c,.5);return typeof a[2+i]=="number"&&(a[2+i]/=l),typeof a[3+i]=="number"&&(a[3+i]/=l),o(a)}};let gs=!1;class t_ extends R.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:o}=e;A4(n_),o&&(n.group&&n.group.add(o),r&&r.register&&a&&r.register(o),gs&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Wo.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:a,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,gs=!0,a||e.layoutDependency!==n||n===void 0||e.isPresent!==o?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Ue.postRender(()=>{const s=i.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Vc.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=e;gs=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Hh(t){const[e,n]=fh(),r=R.useContext(vc);return h.jsx(t_,{...t,layoutGroup:r,switchLayoutGroup:R.useContext(Ah),isPresent:e,safeToRemove:n})}const n_={borderRadius:{...Fa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fa,borderTopRightRadius:Fa,borderBottomLeftRadius:Fa,borderBottomRightRadius:Fa,boxSh
vendor: 5,425 bytes, line 61
61adow:e_};function r_(t,e,n){const r=It(t)?t:Qr(t);return r.start(Qc("",r,e,n)),r.animation}const a_=(t,e)=>t.depth-e.depth;class o_{constructor(){this.children=[],this.isDirty=!1}add(e){bc(this.children,e),this.isDirty=!0}remove(e){Cc(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(a_),this.isDirty=!1,this.children.forEach(e)}}function i_(t,e){const n=Vt.now(),r=({timestamp:a})=>{const o=a-n;o>=e&&(Jn(r),t(o-e))};return Ue.setup(r,!0),()=>Jn(r)}const $h=["TopLeft","TopRight","BottomLeft","BottomRight"],s_=$h.length,Rd=t=>typeof t=="string"?parseFloat(t):t,Td=t=>typeof t=="number"||te.test(t);function c_(t,e,n,r,a,o){a?(t.opacity=Ge(0,n.opacity??1,l_(r)),t.opacityExit=Ge(e.opacity??1,0,u_(r))):o&&(t.opacity=Ge(e.opacity??1,n.opacity??1,r));for(let i=0;i<s_;i++){const s=`border${$h[i]}Radius`;let c=Nd(e,s),l=Nd(n,s);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Td(c)===Td(l)?(t[s]=Math.max(Ge(Rd(c),Rd(l),r),0),(Cn.test(l)||Cn.test(c))&&(t[s]+="%")):t[s]=l}(e.rotate||n.rotate)&&(t.rotate=Ge(e.rotate||0,n.rotate||0,r))}function Nd(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const l_=Gh(0,.5,D0),u_=Gh(.5,.95,an);function Gh(t,e,n){return r=>r<t?0:r>e?1:n(Za(t,e,r))}function Od(t,e){t.min=e.min,t.max=e.max}function Jt(t,e){Od(t.x,e.x),Od(t.y,e.y)}function Dd(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Md(t,e,n,r,a){return t-=e,t=ti(t,1/n,r),a!==void 0&&(t=ti(t,1/a,r)),t}function d_(t,e=0,n=1,r=.5,a,o=t,i=t){if(Cn.test(e)&&(e=parseFloat(e),e=Ge(i.min,i.max,e/100)-i.min),typeof e!="number")return;let s=Ge(o.min,o.max,r);t===o&&(s-=e),t.min=Md(t.min,e,n,s,a),t.max=Md(t.max,e,n,s,a)}function Fd(t,e,[n,r,a],o,i){d_(t,e[n],e[r],e[a],e.scale,o,i)}const f_=["x","scaleX","originX"],h_=["y","scaleY","originY"];function Pd(t,e,n,r){Fd(t.x,e,f_,n?n.x:void 0,r?r.x:void 0),Fd(t.y,e,h_,n?n.y:void 0,r?r.y:void 0)}function kd(t){return t.translate===0&&t.scale===1}function Yh(t){return kd(t.x)&&kd(t.y)}function Bd(t,e){return t.min===e.min&&t.max===e.max}function p_(t,e){return Bd(t.x,e.x)&&Bd(t.y,e.y)}function jd(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Xh(t,e){return jd(t.x,e.x)&&jd(t.y,e.y)}function Ld(t){return Pt(t.x)/Pt(t.y)}function Vd(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class g_{constructor(){this.members=[]}add(e){bc(this.members,e),e.scheduleRender()}remove(e){if(Cc(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(a=>e===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const o=this.members[a];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function m_(t,e,n){let r="";const a=t.x.translate/e.x,o=t.y.translate/e.y,i=n?.z||0;if((a||o||i)&&(r=`translate3d(${a}px, ${o}px, ${i}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:g}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const s=t.x.scale*e.x,c=t.y.scale*e.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||"none"}const ms=["","X","Y","Z"],x_=1e3;let v_=0;function xs(t,e,n,r){const{latestValues:a}=e;a[t]&&(n[t]=a[t],e.setStaticValue(t,0),r&&(r[t]=0))}function Kh(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Fh(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(a||o))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Kh(r)}function Zh({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(i={},s=e?.()){this.id=v_++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>
vendor: 4,304 bytes, line 61
61{this.projectionUpdateScheduled=!1,this.nodes.forEach(b_),this.nodes.forEach(E_),this.nodes.forEach(S_),this.nodes.forEach(C_)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new o_)}addEventListener(i,s){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Ec),this.eventHandlers.get(i).add(s)}notifyListeners(i,...s){const c=this.eventHandlers.get(i);c&&c.notify(...s)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=dh(i)&&!c4(i),this.instance=i;const{layoutId:s,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||s)&&(this.isLayoutDirty=!0),t){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{d=window.innerWidth}),t(i,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=i_(f,250),Wo.hasAnimatedSinceResize&&(Wo.hasAnimatedSinceResize=!1,this.nodes.forEach(Wd)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&l&&(s||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||l.getDefaultTransition()||O_,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=l.getProps(),v=!this.targetLayout||!Xh(this.targetLayout,p),w=!d&&f;if(this.options.layoutRoot||this.resumeFrom||w||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...jc(g,"layout"),onPlay:m,onComplete:y};(l.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(u,w)}else d||Wd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Jn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(I_),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:c}=this.options;if(s===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ud);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zd);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(A_),this.nodes.forEach(y_),this.nodes.forEach(w_)):this.nodes.forEach(zd),this.clearAllSnapshots();const s=Vt.now();_t.delta=Nn(0,1e3/60,s-_t.timestamp),_t.timestamp=s,_t.isProcessing=!0,os.update.process(_t),os.preRender.process(_t),os.render.process(_t),_t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vc.read(this.scheduleUpdate))}
vendor: 6,064 bytes, line 61
61clearAllSnapshots(){this.nodes.forEach(__),this.sharedNodes.forEach(R_)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pt(this.snapshot.measuredBox.x)&&!Pt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Je(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(s=!1),s&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!a)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!Yh(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(s||br(this.latestValues)||u)&&(a(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const s=this.measurePageBox();let c=this.removeElementScroll(s);return i&&(c=this.removeTransform(c)),D_(c),{animationId:this.root.animationId,measuredBox:s,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:i}=this.options;if(!i)return Je();const s=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(M_))){const{scroll:l}=this.root;l&&(Gr(s.x,l.offset.x),Gr(s.y,l.offset.y))}return s}removeElementScroll(i){const s=Je();if(Jt(s,i),this.scroll?.wasRoot)return s;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:d}=l;l!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&Jt(s,i),Gr(s.x,u.offset.x),Gr(s.y,u.offset.y))}return s}applyTransform(i,s=!1){const c=Je();Jt(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!s&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Yr(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),br(u.latestValues)&&Yr(c,u.latestValues)}return br(this.latestValues)&&Yr(c,this.latestValues),c}removeTransform(i){const s=Je();Jt(s,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!br(l.latestValues))continue;Xs(l.latestValues)&&l.updateSnapshot();const u=Je(),d=l.measurePageBox();Jt(u,d),Pd(s,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return br(this.latestValues)&&Pd(s,this.latestValues),s}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==_t.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==s;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=_t.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Je(),this.relativeTargetOrigin=Je(),Ya(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),Jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Je(),this.targetWithTransforms=Je()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),LC(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Jt(this.target,this.layout.layoutBox),Rh(this.target,this.targetDelta)):Jt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Je(),this.relativeTargetOrigin=Je(),Ya(this.relativeTargetOrigin,this.target,f.target),Jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Xs(this.parent.latestValues)||Ih(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const i=this.getLead(),s=!!this.resumingFrom||this!==i;let c=!0;
vendor: 8,671 bytes, line 61
61if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===_t.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Jt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Q4(this.layoutCorrected,this.treeScale,this.path,s),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Je());const{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Dd(this.prevProjectionDelta.x,this.projectionDelta.x),Dd(this.prevProjectionDelta.y,this.projectionDelta.y)),Ga(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Vd(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vd(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){const s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Xr(),this.projectionDelta=Xr(),this.projectionDeltaWithTransform=Xr()}setAnimationOrigin(i,s=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Xr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=Je(),p=c?c.source:void 0,g=this.layout?this.layout.source:void 0,m=p!==g,y=this.getStack(),v=!y||y.members.length<=1,w=!!(m&&!v&&this.options.crossfade===!0&&!this.path.some(N_));this.animationProgress=0;let b;this.mixTargetDelta=_=>{const A=_/1e3;Hd(d.x,i.x,A),Hd(d.y,i.y,A),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ya(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),T_(this.relativeTarget,this.relativeTargetOrigin,f,A),b&&p_(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Je()),Jt(b,this.relativeTarget)),m&&(this.animationValues=u,c_(u,l,this.latestValues,A,w,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Jn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{Wo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Qr(0)),this.currentAnimation=r_(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:s=>{this.mixTargetDelta(s),i.onUpdate&&i.onUpdate(s)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(x_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:s,target:c,layout:l,latestValues:u}=i;if(!(!s||!c||!l)){if(this!==i&&this.layout&&l&&qh(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Je();const d=Pt(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const f=Pt(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+f}Jt(s,c),Yr(s,u),Ga(this.projectionDeltaWithTransform,this.layoutCorrected,s,u)}}registerSharedNode(i,s){this.sharedNodes.has(i)||this.sharedNodes.set(i,new g_),this.sharedNodes.get(i).add(s);const l=s.options.initialPromotionConfig;s.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(s):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){const{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:s,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let s=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(s=!0),!s)return;const l={};c.z&&xs("z",i,l,this.animationValues);for(let u=0;u<ms.length;u++)xs(`rotate${ms[u]}`,i,l,this.animationValues),xs(`skew${ms[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}applyProjectionStyles(i,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=zo(s?.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=zo(s?.pointerEvents)||""),this.hasProjected&&!br(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=m_(this.projectionDeltaWithTransform,this.treeScale,u);c&&(d=c(u,d)),i.transform=d;const{x:f,y:p}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,l.animationValues?i.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in eo){if(u[g]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:v}=eo[g],w=d==="none"?u[g]:m(u[g],l);if(y){const b=y.length;for(let _=0;_<b;_++)i[y[_]]=w}else v?this.options.visualElement.renderState.vars[g]=w:i[g]=w}this.options.layoutId&&(i.pointerEvents=l===this?zo(s?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(Ud),this.root.sharedNodes.clear()}}}function y_(t){t.updateLayout()}function w_(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:a}=t.options,o=e.source!==t.layout.source;a==="size"?tn(u=>{const d=o?e.measuredBox[u]:e.layoutBox[u],f=Pt(d);d.min=n[u].min,d.max=d.min+f}):qh(a,e.layoutBox,n)&&tn(u=>{const d=o?e.measuredBox[u]:e.layoutBox[u],f=Pt(n[u]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+f)});const i=Xr();Ga(i,n,e.layoutBox);const s=Xr();o?Ga(s,t.applyTransform(r,!0),e.measuredBox):Ga(s,n,e.layoutBox);const c=!Yh(i);let l=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:d,layout:f}=u;if(d&&f){const p=Je();Ya(p,e.layoutBox,d.layoutBox);const g=Je();Ya(g,n,f.layoutBox),Xh(p,g)||(l=!0),u.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:s,layoutDelta:i,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function b_(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.
vendor: 5,772 bytes, line 61
61isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function C_(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function __(t){t.clearSnapshot()}function Ud(t){t.clearMeasurements()}function zd(t){t.isLayoutDirty=!1}function A_(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Wd(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function E_(t){t.resolveTargetDelta()}function S_(t){t.calcProjection()}function I_(t){t.resetSkewAndRotation()}function R_(t){t.removeLeadSnapshot()}function Hd(t,e,n){t.translate=Ge(e.translate,0,n),t.scale=Ge(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function $d(t,e,n,r){t.min=Ge(e.min,n.min,r),t.max=Ge(e.max,n.max,r)}function T_(t,e,n,r){$d(t.x,e.x,n.x,r),$d(t.y,e.y,n.y,r)}function N_(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const O_={duration:.45,ease:[.4,0,.1,1]},Gd=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Yd=Gd("applewebkit/")&&!Gd("chrome/")?Math.round:an;function Xd(t){t.min=Yd(t.min),t.max=Yd(t.max)}function D_(t){Xd(t.x),Xd(t.y)}function qh(t,e,n){return t==="position"||t==="preserve-aspect"&&!jC(Ld(e),Ld(n),.2)}function M_(t){return t!==t.root&&t.scroll?.wasRoot}const F_=Zh({attachResizeListener:(t,e)=>to(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vs={current:void 0},Qh=Zh({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!vs.current){const t=new F_({});t.mount(window),t.setOptions({layoutScroll:!0}),vs.current=t}return vs.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),P_={pan:{Feature:JC},drag:{Feature:QC,ProjectionNode:Qh,MeasureLayout:Hh}};function Kd(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,o=r[a];o&&Ue.postRender(()=>o(e,ho(e)))}class k_ extends tr{mount(){const{current:e}=this.node;e&&(this.unmount=r4(e,(n,r)=>(Kd(this.node,r,"Start"),a=>Kd(this.node,a,"End"))))}unmount(){}}class B_ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=lo(to(this.node.current,"focus",()=>this.onFocus()),to(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Zd(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),o=r[a];o&&Ue.postRender(()=>o(e,ho(e)))}class j_ extends tr{mount(){const{current:e}=this.node;e&&(this.unmount=s4(e,(n,r)=>(Zd(this.node,r,"Start"),(a,{success:o})=>Zd(this.node,a,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ec=new WeakMap,ys=new WeakMap,L_=t=>{const e=ec.get(t.target);e&&e(t)},V_=t=>{t.forEach(L_)};function U_({root:t,...e}){const n=t||document;ys.has(n)||ys.set(n,{});const r=ys.get(n),a=JSON.stringify(e);return r[a]||(r[a]=new IntersectionObserver(V_,{root:t,...e})),r[a]}function z_(t,e,n){const r=U_(e);return ec.set(t,n),r.observe(t),()=>{ec.delete(t),r.unobserve(t)}}const W_={some:0,all:1};class H_ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:o}=e,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:W_[a]},s=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return z_(this.node.current,i,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some($_(e,n))&&this.startObserver()}unmount(){}}function $_({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const G_={inView:{Feature:H_},tap:{Feature:j_},focus:{Feature:B_},hover:{Feature:k_}},Y_={layout:{ProjectionNode:Qh,MeasureLayout:Hh}},X_={...DC,...G_,...P_,...Y_},ws=K4(X_,sC);function K_(){!qc.current&&Nh();const[t]=R.useState(ni.current);return t}const qd={delighted:{ring:"border-amber-300/40",eyebrow:"text-amber-700 dark:text-amber-200",particles:["â¦","·","â¦"]},proud:{ring:"border-cyan-300/40",eyebrow:"text-cyan-700 dark:text-cyan-200",particles:["â¦","â","·"]},thoughtful:{ring:"border-white/25",eyebrow:"text-slate-700 dark:text-slate-200",particles:["·","·","â¦"]},gentle:{ring:"border-amber-200/30",eyebrow:"text-amber-700 dark:text-amber-100",particles:["·","â¦","·"]}},Z_={delighted:{y:[0,-9,0,-4,0],rotate:[0,-3,2,0],scale:[1,1.055,1,1.025,1]},proud:{y:[0,-2,0],rotate:[0,-2,1,0],scale:[1,1.025,1]},thoughtful:{y:[0,-2,0],rotate:[0,-8,-8,0],scale:[1,1.01,1]},gentle:{y:[0,-2,0],rotate:[0,1,0],scale:[1,1.018,1]}};function q_({feedback:t,onDismiss:e}){const n=K_(),r=Lt.useUtils(),{data:a}=Lt.pet.getStatus.useQuery(void 0,{enabled:!!t}
61),[o,i]=R.useState(!1),s=R.useRef(null),c=Lt.pet.prepareExpression.useMutation(),l=Lt.pet.unlockExpressionMemory.useMutation();R.useEffect(()=>{if(!t)return;const m=window.setTimeout(e,6500);return()=>window.clearTimeout(m)},[t?.id,e]),R.useEffect(()=>{if(!t||s.current===t.id)return;s.current=t.id,i(!1);const m=t.mood==="delighted"||t.mood==="proud"?t.mood:null;if(t.isCollectible&&!!t.mealRecordId&&!!m&&t.mealRecordId&&m){l.mutate({mealRecordId:t.mealRecordId,expression:m},{onSuccess:v=>{i(v.unlocked),r.pet.getStatus.invalidate()}});return}c.mutate({expression:t.mood},{onSuccess:()=>r.pet.getStatus.invalidate()})},[t?.id]);const u=t?qd[t.mood]:qd.delighted,d=t?.mood||"delighted",f=B1(d),p=a?.displayName||"TAMA",g=k1(d,a?.expressionAssets,a?.pixelPetUrl);return h.jsx(x4,{"data-loc":"client/src/components/MealPetReaction.tsx:70",children:t&&h.jsx(ws.aside,{"data-loc":"client/src/components/MealPetReaction.tsx:72",role:"status","aria-live":"polite",initial:n?{opacity:0}:{opacity:0,y:28,scale:.95},animate:{opacity:1,y:0,scale:1},exit:n?{opacity:0}:{opacity:0,y:16,scale:.97},transition:{type:"spring",damping:22,stiffness:300,mass:.8},className:"pointer-events-none fixed inset-x-3 bottom-[calc(5.5rem+env(safe-area-inset-bottom))] z-[90] mx-auto max-w-md",children:h.jsx("div",{"data-loc":"client/src/components/MealPetReaction.tsx:81",className:`tama-reaction-shell pointer-events-auto relative overflow-hidden rounded-[26px] border ${u.ring} p-[1px]`,children:h.jsxs("div",{"data-loc":"client/src/components/MealPetReaction.tsx:82",className:"relative overflow-hidden rounded-[25px] px-4 py-3.5",children:[h.jsx("div",{"data-loc":"client/src/components/MealPetReaction.tsx:83",className:"tama-reaction-pixel-grid pointer-events-none absolute inset-0"}),u.particles.map((m,y)=>h.jsx(ws.span,{"data-loc":"client/src/components/MealPetReaction.tsx:85","aria-hidden":"true",initial:{opacity:0,scale:.7,y:5},animate:n?{opacity:.55}:{opacity:[0,.9,0],scale:[.7,1.1,.8],y:[5,-13-y*6,-25-y*5]},transition:{duration:1.15,delay:.12+y*.14,repeat:n?0:2,repeatDelay:.65},className:`absolute top-3 text-xs font-bold ${u.eyebrow} ${y===0?"left-[22%]":y===1?"left-[29%] top-1":"left-[15%] top-8"}`,children:m},`${t.id}-${m}-${y}`)),h.jsx("button",{"data-loc":"client/src/components/MealPetReaction.tsx:94",type:"button",onClick:e,"aria-label":"éé主åé¤å¾è©èª",className:"tama-reaction-close absolute right-2.5 top-2.5 z-10 rounded-lg p-1.5",children:h.jsx(za,{"data-loc":"client/src/components/MealPetReaction.tsx:95",className:"h-4 w-4"})}),h.jsxs("div",{"data-loc":"client/src/components/MealPetReaction.tsx:97",className:"relative flex items-center gap-3 pr-5",children:[h.jsx("div",{"data-loc":"client/src/components/MealPetReaction.tsx:98",className:`tama-reaction-pet-stage relative flex h-[82px] w-[82px] shrink-0 items-center justify-center rounded-[23px] border ${u.ring}`,children:h.jsx(ws.img,{"data-loc":"client/src/components/MealPetReaction.tsx:99",src:g,alt:`${p} ${f.title}`,initial:n?!1:{opacity:0,scale:.93,y:5},animate:n?{opacity:1}:{opacity:1,...Z_[d]},transition:n?{duration:.01}:{duration:d==="gentle"?1.4:.88,delay:.05,repeat:2,repeatDelay:.42,ease:"easeInOut"},className:"tama-reaction-sprite h-[76px] w-[76px] object-contain"},`${t.id}-${g}`)}),h.jsxs("div",{"data-loc":"client/src/components/MealPetReaction.tsx:109",className:"min-w-0 flex-1",children:[h.jsxs("div",{"data-loc":"client/src/components/MealPetReaction.tsx:110",className:`flex items-center gap-1 text-[10px] font-bold uppercase tracking-[0.14em] ${u.eyebrow}`,children:[h.jsx(Xn,{"data-loc":"client/src/components/MealPetReaction.tsx:110",className:"h-3 w-3"}),p,"ã»",f.label]}),h.jsx("p",{"data-loc":"client/src/components/MealPetReaction.tsx:111",className:"mt-1 text-sm font-bold text-[var(--pet-reaction-title)]",children:t.title}),h.jsx("p",{"data-loc":"client/src/components/MealPetReaction.tsx:112",className:"mt-1 text-xs leading-relaxed text-[var(--pet-reaction-copy)]",children:t.message}),o&&h.jsxs("p",{"data-loc":"client/src/components/MealPetReaction.tsx:113",className:"mt-1.5 text-[10px] font-semibold text-cyan-600 dark:text-cyan-200",children:["å·²æ¶èï¼",f.label,"åæ¶"]})]})]}),h.jsxs("div",{"data-loc":"client/src/components/MealPetReaction.tsx:116",className:"relative mt-3 flex items-center gap-1 text-[10px] font-medium text-[var(--pet-reaction-note)]",children:[h.jsx(j1,{"data-loc":"client/src/components/MealPetReaction.tsx:116",className:"h-3 w-3"}),"ä½ å®æå
ä»»åï¼å·²åæ TAMA å
æé·è½é"]})]})})})})}const Ho=t=>Math.round(t*10)/10;function Q_({protein:t,carbs:e,fat:n}
61){const r={protein:Math.max(0,t)*4,carbs:Math.max(0,e)*4,fat:Math.max(0,n)*9},a=r.protein+r.carbs+r.fat;return a<=0?{protein:0,carbs:0,fat:0}:{protein:Ho(r.protein/a*100),carbs:Ho(r.carbs/a*100),fat:Ho(r.fat/a*100)}}function J_(t){const e=t.map(r=>({...r,calories:Math.max(0,Number(r.calories)||0)})).filter(r=>r.calories>0),n=e.reduce((r,a)=>r+a.calories,0);return e.sort((r,a)=>a.calories-r.calories).map(r=>({...r,percent:n>0?Ho(r.calories/n*100):0}))}const e8=[{key:"protein",label:"èç½è³ª",color:"#22c55e"},{key:"carbs",label:"碳水",color:"#f59e0b"},{key:"fat",label:"èèª",color:"#f43f5e"}];function t8({theme:t,totals:e,ingredients:n,wholeRecipeCalories:r,servingLabel:a,macroStatus:o="complete"}){const i=Q_(e),s=o==="incomplete",c=J_(n).slice(0,6),l=i.protein,u=i.protein+i.carbs,d=`conic-gradient(#22c55e 0% ${l}%, #f59e0b ${l}% ${u}%, #f43f5e ${u}% 100%)`,f=t==="dark"?"border-white/10 bg-white/[0.045]":"border-white/65 bg-white/26";return h.jsxs("section",{"data-loc":"client/src/components/MealNutritionCharts.tsx:28",className:`rounded-2xl border p-4 ${f}`,"aria-label":"çé¤è¦è¦ºç¸½è¦½",children:[h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:29",className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:30",children:[h.jsx("p",{"data-loc":"client/src/components/MealNutritionCharts.tsx:31",className:"text-xs font-semibold tracking-[0.16em] text-muted-foreground",children:"NUTRITION MAP"}),h.jsx("h3",{"data-loc":"client/src/components/MealNutritionCharts.tsx:32",className:"mt-1 font-semibold",children:"å¢ä¸é¤å
çé¤éé»"})]}),a&&h.jsx("span",{"data-loc":"client/src/components/MealNutritionCharts.tsx:34",className:`rounded-full px-2.5 py-1 text-[11px] font-semibold ${t==="dark"?"bg-cyan-300/10 text-cyan-100":"bg-cyan-100/70 text-cyan-900"}`,children:a})]}),h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:37",className:"mt-4 grid grid-cols-[104px_1fr] items-center gap-4",children:[h.jsx("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:38",className:"relative mx-auto h-[104px] w-[104px] rounded-full",style:{background:s?t==="dark"?"rgba(255,255,255,0.09)":"rgba(15,23,42,0.1)":d},children:h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:39",className:`absolute inset-[13px] flex flex-col items-center justify-center rounded-full ${t==="dark"?"bg-[#151225]":"bg-[#f7f0e7]/95"}`,children:[h.jsx("strong",{"data-loc":"client/src/components/MealNutritionCharts.tsx:40",className:`text-xl leading-none ${t==="dark"?"text-amber-300":"text-amber-800"}`,children:Math.round(e.calories)}),h.jsx("span",{"data-loc":"client/src/components/MealNutritionCharts.tsx:41",className:"mt-1 text-[10px] text-muted-foreground",children:"kcal"})]})}),h.jsx("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:44",className:"space-y-2.5",children:s?h.jsx("p",{"data-loc":"client/src/components/MealNutritionCharts.tsx:45",className:"text-xs leading-relaxed text-muted-foreground",children:"ä¸å¤§çé¤ç´ å°æªå®æ´è®åï¼æä»¥æ«ä¸é¡¯ç¤ºæ¯ä¾ï¼é¿å
å°æªç¥æ¸æèª¤ç¶æ 0gã"}):e8.map(p=>{const g=i[p.key],m=e[p.key];return h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:48",children:[h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:49",className:"mb-1 flex items-center justify-between text-xs",children:[h.jsxs("span",{"data-loc":"client/src/components/MealNutritionCharts.tsx:49",children:[p.label," ",h.jsxs("b",{"data-loc":"client/src/components/MealNutritionCharts.tsx:49",children:[Math.round(m*10)/10,"g"]})]}),h.jsxs("span",{"data-loc":"client/src/components/MealNutritionCharts.tsx:49",className:"text-muted-foreground",children:[g,"% è½é"]})]}),h.jsx("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:50",className:`h-1.5 overflow-hidden rounded-full ${t==="dark"?"bg-white/10":"bg-slate-900/10"}`,children:h.jsx("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:50",className:"h-full rounded-full",style:{width:`${g}%`,backgroundColor:p.color}})})]},p.key)})})]}),r!==void 0&&h.jsxs("p",{"data-loc":"client/src/components/MealNutritionCharts.tsx:56",className:"mt-3 text-center text-xs text-muted-foreground",children:["æ´ä»½é£èç´ ",Math.round(r)," kcalï¼ä¸æ¹çºä½ ä»é¤å¯¦éé£ç¨éã"]}),c.length>1&&h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:58",className:"mt-5 border-t border-current/10 pt-4",children:[h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:59",className:"mb-3 flex items-center justify-between",children:[h.jsx("p",{"data-loc":"client/src/components/MealNutritionCharts.tsx:59",className:"text-sm font-semibold",children:"ç±é主è¦ä¾èªé度ï¼"}),h.jsx("span",{"data-loc":"client/src/components/MealNutritionCharts.tsx:59",className:"text-[11px] text-muted-foreground",children:"æå·²ç¢ºèªé£æ"})]}),h.jsx("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:60",className:"space-y-2.5",children:c.map((p,g)=>h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:61",children:[h.jsxs("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:62",className:"mb-1 flex justify-between gap-3 text-xs",children:[h.jsx("span",{"data-loc":"client/src/components/MealNutritionCharts.tsx:62",className:"truncate",children:p.name}),h.jsxs("span",{"data-loc":"client/src/components/MealNutritionCharts.tsx:62",className:"shrink-0 text-muted-foreground",children:[Math.round(p.calories)," kcal · ",p.percent,"%"]})]}),h.jsx("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:63",className:`h-2 overflow-hidden rounded-full ${t==="dark"?"bg-white/10":"bg-slate-900/10"}`,children:h.jsx("div",{"data-loc":"client/src/components/MealNutritionCharts.tsx:63",className:"h-full rounded-full bg-gradient-to-r from-violet-500 to-cyan-400",style:{width:`${p.percent}%`}})})]},`${p.name}-${g}`))})]})]})}function n8(t){const e=Math.max(0,Number(t.calories)||0),n=Math.max(0,Number(t.protein)||0),r=Math.max(0,Number(t.fat)||0),a=(Number(t.todayCaloriesBefore)||0)+e,o=(Number(t.todayFatBefore)||0)+r;return t.fatTarget&&o>t.fatTarget*1.05?{mood:"gentle",face:"。â¢Ì︿â¢Ì。",label:"è¼è¼æé",title:"TAMA æ¤ä½åä¸é£",message:`å¢é¤å·²å¹«ä½ è¨ä½ã仿¥èèªå¤§ç´ ${Math.round(o)}gï¼ä¸ä¸é¤ææ¸
ç½å²å°±å¾ï¼å使è£åå¼ç¯é£ã`,isCollectible:!1}:a>t.targetCalories*1.15?{mood:"thoughtful",face:"( â¢Ìââ¢Ì )",label:"æªé è¨ç·æ¸",title:"TAMA æèµ·åè¨ç®æ©",message:"ä½ å®æå
é¤é»å·²æ¶å¥½ã仿¥è½éæ¯è¼å¤ï¼ä¸ä¸é¤ç
§å¹³è¡¡ãé£è¿ä½ æ³é£å
å¢å°±å¾ã",isCollectible:!1}:n>=25?{mood:"proud",face:"⦠â¢Ìá´â¢Ì â¦",label:"éç¼ç¼å
",title:"TAMA éç¼ç¼å
ï¼",message:`èç½è³ªæ ${Math.round(n)}gï¼TAMA è¦å°ä½ å¢é¤å¹¾æåéæãç¹¼çºç¨ä½ èæå
ç¯å¥å°±å¾ã`,isCollectible:!0}:e>=350&&n<12?{mood:"thoughtful",face:"( â¢Ìââ¢Ì )",label:"æªé è«ç·",title:"TAMA æä½åçé¤è¡¨è«åè«",message:"å¢é¤è½éæåï¼ä¸ä¸é¤å¦ææ¹ä¾¿ï¼å é»èãè±è
ã奶顿èé¡ï¼ä»¤èªå·±é£å¾æ´æ»¿è¶³ã",isCollectible:!1}:e>=350&&e<=700&&n>=15&&r<=26?{mood:"delighted",face:"â§â¡â¦",label:"éå¿è·³è·³",title:"TAMA çºä½ æä½æï¼",message:"å¢é¤æè½é亦æç
§é¡§å°èªå·±ãTAMA å°å¢åå°éç¨ç¢æ¶é²å表æ
æ¶èã",isCollectible:!0}:{mood:"delighted",face:"â§â¡â¦",label:"éå¿è·³è·³",title:"ä½ å®æåä¸é¤ï¼",message:"TAMA å·²ç¶è¦è並æ¶å¥½å¢é¤ãè¨éä¿äºè§£èªå·±å
ç¯å¥ï¼åä¿è¦ä½ é¤é¤åå°æ»¿åã",isCollectible:!1}}const Qd={label:"馿¸¯é£ç©å®å
¨ä¸å¿çé¤è³ææ¥è©¢ï¼æ¯ 100 å
å¯é£ç¨é¨åï¼",url:"https://www.cfs.gov.hk/tc_chi/nutrient/searchmenu.php"},tc=[{id:"egg",name:"éè",aliases:["è","å
¨è","鿦"],category:"protein",states:[{state:"raw",label:"çã»å»æ®¼å¯é£é¨å",calories:143,protein:12.6,carbs:.7,fat:9.5}]},{id:"chicken-breast",name:"éè¸è",aliases:["éæ³","å»ç®éè¸","éè"],category:"protein",states:[{state:"raw",label:"çã»å»ç®å¯é£é¨å",calories:120,protein:22.5,carbs:0,fat:2.6},{state:"cooked",label:"çã»å»ç®",calories:165,protein:31,carbs:0,fat:3.6}]},{id:"chicken-thigh",name:"éé«è",aliases:["éè
¿è","å»ç®éé«"],
61category:"protein",states:[{state:"raw",label:"çã»å»ç®å¯é£é¨å",calories:144,protein:19.7,carbs:0,fat:6.7},{state:"cooked",label:"çã»å»ç®",calories:179,protein:24.8,carbs:0,fat:8.2}]},{id:"lean-beef",name:"ç¦çè",aliases:["çè","çæ³","çå§"],category:"protein",states:[{state:"raw",label:"çã»ç¦èå¯é£é¨å",calories:172,protein:21.4,carbs:0,fat:9.4},{state:"cooked",label:"çã»ç¦è",calories:217,protein:26.1,carbs:0,fat:11.8}]},{id:"pork-loin",name:"豬æ³",aliases:["ç¦è±¬è","豬è","豬æ"],category:"protein",states:[{state:"raw",label:"çã»ç¦èå¯é£é¨å",calories:143,protein:21,carbs:0,fat:5},{state:"cooked",label:"çã»ç¦è",calories:196,protein:29,carbs:0,fat:7.2}]},{id:"salmon",name:"䏿é",aliases:["é®é","䏿"],category:"protein",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:208,protein:20.4,carbs:0,fat:13.4},{state:"cooked",label:"çã»å¯é£é¨å",calories:232,protein:25.4,carbs:0,fat:14.1}]},{id:"shrimp",name:"è¦ä»",aliases:["è¦","大è¦","ç½ç¼è¦"],category:"protein",states:[{state:"raw",label:"çã»å»æ®¼å¯é£é¨å",calories:85,protein:20,carbs:.2,fat:.5},{state:"cooked",label:"çã»å»æ®¼",calories:99,protein:24,carbs:.2,fat:.3}]},{id:"tofu",name:"硬è±è
",aliases:["è±è
","æ¿è±è
"],category:"protein",states:[{state:"raw",label:"åä»¶ã»å¯é£é¨å",calories:144,protein:17.3,carbs:2.8,fat:8.7}]},{id:"rice",name:"ç½ç±³",aliases:["ç±³","ç½é£¯","飯"],category:"grain",states:[{state:"raw",label:"çç±³ã»ä¹¾é",calories:365,protein:7.1,carbs:80,fat:.7},{state:"cooked",label:"çé£¯ã»æ¿é",calories:130,protein:2.4,carbs:28.2,fat:.3}]},{id:"brown-rice",name:"ç³ç±³",aliases:["ç´
ç±³","ç³ç±³é£¯"],category:"grain",states:[{state:"raw",label:"çç±³ã»ä¹¾é",calories:370,protein:7.9,carbs:77.2,fat:2.9},{state:"cooked",label:"çé£¯ã»æ¿é",calories:123,protein:2.7,carbs:25.6,fat:1}]},{id:"oats",name:"ç麥ç",aliases:["ç麥","oatmeal"],category:"grain",states:[{state:"raw",label:"ä¹¾é",calories:389,protein:16.9,carbs:66.3,fat:6.9},{state:"cooked",label:"ç
®çã»æ¿é",calories:71,protein:2.5,carbs:12,fat:1.5}]},{id:"potato",name:"è¯ä»",aliases:["馬é´è¯","potato"],category:"staple",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:77,protein:2,carbs:17,fat:.1},{state:"cooked",label:"çã»ä¸å æ²¹",calories:87,protein:1.9,carbs:20.1,fat:.1}]},{id:"sweet-potato",name:"çªè¯",aliases:["å°ç","çè¯","sweet potato"],category:"staple",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:86,protein:1.6,carbs:20.1,fat:.1},{state:"cooked",label:"çã»ä¸å æ²¹",calories:90,protein:2,carbs:20.7,fat:.2}]},{id:"broccoli",name:"西èè±",aliases:["椰èè±","broccoli"],category:"vegetable",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:34,protein:2.8,carbs:6.6,fat:.4},{state:"cooked",label:"çã»ä¸å æ²¹",calories:35,protein:2.4,carbs:7.2,fat:.4}]},{id:"spinach",name:"è è",aliases:["spinach"],category:"vegetable",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:23,protein:2.9,carbs:3.6,fat:.4},{state:"cooked",label:"çã»ä¸å æ²¹",calories:23,protein:3,carbs:3.8,fat:.3}]},{id:"tomato",name:"çªè",aliases:["西ç´
æ¿","tomato"],category:"vegetable",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:18,protein:.9,carbs:3.9,fat:.2}]},{id:"cucumber",name:"éç",aliases:["é»ç","cucumber"],category:"vegetable",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:15,protein:.7,carbs:3.6,fat:.1}]},{id:"banana",name:"é¦è",aliases:["banana"],category:"fruit",states:[{state:"raw",label:"çã»å»ç®å¯é£é¨å",calories:89,protein:1.1,carbs:22.8,fat:.3}]},{id:"apple",name:"èæ",aliases:["apple"],category:"fruit",states:[{state:"raw",label:"çã»å¯é£é¨å",calories:52,protein:.3,carbs:13.8,fat:.2}]},{id:"avocado",name:"çæ²¹æ",aliases:["é
ªæ¢¨","avocado"],category:"fruit",states:[{state:"raw",label:"çã»å»ç®å»æ ¸å¯é£é¨å",calories:160,protein:2,carbs:8.5,fat:14.7}]},{id:"milk",name:"å
¨èç奶",aliases:["ç奶","鮮奶","milk"],category:"dairy",states:[{state:"raw",label:"æ¯ 100ml",calories:61,protein:3.2,carbs:4.8,fat:3.3}]},{id:"greek-yogurt",name:"åå³å¸èä¹³é
ª",aliases:["å¸èä¹³é
ª","å¸èä¹³é
ª","greek yogurt"],category:"dairy",states:[{state:"raw",label:"åå³ã»æ¯ 100g",calories:59,protein:10.3,carbs:3.6,fat:.4}]}];function r8(t,e=tc){const n=t.trim().toLocaleLowerCase();return n?e.filter(r=>[r.name,...r.aliases].some(a=>a.toLocaleLowerCase().includes(n))):e}function a8(t,e){const n=Math.max(0,Number.isFinite(e)?e:0)/100;return{calories:Math.round(t.calories*n),protein:Math.round(t.protein*n*10)/10,carbs:Math.round(t.carbs*n*10)/10,fat:Math.round(t.fat*n*10)/10}}function o8(t,e){const n=Math.max(1,Number.parseInt(t,10)||1),r=Math.min(n,Math.max(1,Number.parseInt(e,10)||1));return{servings:n,eaten:r,ratio:r/n}}function i8(t,e){return Math.round(t*e*10)/10}const nc=[{value:"none",label:"å飲",ratio:0},{value:"little",label:"å°é",ratio:.25},{value:"half",label:"åç¢",ratio:.5},{value:"all",label:"飲æ",ratio:1}];function s8(t){return nc.find(e=>e.value===t)?.ratio??1}function c8(t){return/湯åº|湯|broth|soup/i.test(t)}function l8(t,e,n){const r=s8(n);return Object.fromEntries(Object.entries(t).map(([a,o])=>{const i=e[a],s=typeof i=="number"?i:0;return[a,Math.max(0,Math.round((o-s+s*r)*10)/10)]}))}const Jd=6,u8=12*1024*1024,d8=30*1024*1024,f8=new Set(["image/jpeg","image/jpg","image/png","image/webp","image/heic","image/heif"]),h8=new Set(["jpg","jpeg","png","webp","heic","heif"]);function p8(t){const e=t.type?.toLowerCase().trim();if(e&&f8.has(e))return!0;const n=t.name.split(".").pop()?.toLowerCase();return!!(n&&h8.has(n))}function g8(t,e,n){if(t+n.length>Jd)return{valid:!1,message:`æ¯é¤æå¤å¯æ¾ ${Jd} å¼µç¸ï¼è«å
ç§»é¤ä¸å¼µåå å
¥ã`};const r=n.find(i=>!p8(i));if(r)return{valid:!1,message:`${r.name} æ«æåæ¯æ´ï¼è«é¸ JPEGãPNGãWebPãHEIC æ HEIFã`};const a=n.find(i=>i.size>u8);if(a)return{valid:!1,message:`${a.name} 太大ï¼è«é¸æå°æ¼ 12MB çç¸çã`};const o=n.reduce((i,s)=>i+s.size,0);return e+o>d8?{valid:!1,message:"ä»é¤ç¸çç¸½æªæ¡å¤ªå¤§ï¼è«åéå
©æ¬¡åææç§»é¤è¼å¤§çç¸çã"}:{valid:!0,message:null}}function m8(t){return["image/jpeg","image/jpg","image/png","image/webp"].includes(t?.toLowerCase().trim()||"")}function x8(t){return`${t.replace(/\.[^.]+$/,"").trim()||"food-photo"}.jpg`}function v8(t){return Math.ceil(t.reduce((e,n)=>e+n.size,0)*4/3)}function P8(){const{theme:t,toggleTheme:e}
61=L1(),[n,r]=R.useState([]),[a,o]=R.useState([]),[i,s]=R.useState(0),[c,l]=R.useState(!1),[u,d]=R.useState(0),[f,p]=R.useState(null),[g,m]=R.useState(null),[y,v]=R.useState(!1),[w,b]=R.useState(!1),[_,A]=R.useState(""),[T,S]=R.useState("lunch"),[E,F]=R.useState({foodName:"",quantity:"",calories:0,protein:0,carbs:0,fat:0}),k=R.useRef(null),W=R.useRef(null),[z,L]=R.useState({}),[le,fe]=R.useState(!1),[Ve,ne]=R.useState(!1),[oe,Ce]=R.useState(!1),[Me,sn]=R.useState(""),[An,kt]=R.useState(""),[cn,Yt]=R.useState("100g"),[pn,Bt]=R.useState("100"),[gn,Xt]=R.useState(!1),[Dn,Kt]=R.useState(""),[nr,Mn]=R.useState(null),[re,Fn]=R.useState("raw"),[rr,Pn]=R.useState("100"),[ke,ar]=R.useState(!1),[st,kn]=R.useState(!1),[or,Zt]=R.useState("1"),[Bn,ir]=R.useState("1"),[Tr,ua]=R.useState(!1),[Wt,sr]=R.useState("unknown"),[cr,lr]=R.useState(!1),[mn,jn]=R.useState(!1),[da,Nr]=R.useState(null),[Ln,Or]=R.useState(!1),[ae,U]=R.useState({}),[V,K]=R.useState(new Set),ee=async(x,I=5)=>m8(x.type)?new Promise(j=>{let O=!1;const B=Y=>{O||(O=!0,j(Y))},H=window.setTimeout(()=>B(x),12e3),Be=()=>{window.clearTimeout(H),B(x)},J=new FileReader;J.onerror=Be,J.onabort=Be,J.onload=Y=>{const ie=new Image;ie.onerror=Be,ie.onload=()=>{const he=document.createElement("canvas");let{width:q,height:ge}=ie,rt=.9;const me=()=>{he.width=q,he.height=ge;const Qe=he.getContext("2d");if(!Qe)return Be();Qe.drawImage(ie,0,0,q,ge),he.toBlob(Wn=>{if(!Wn)return Be();if(Wn.size>I*1024*1024&&rt>.25)return rt-=.1,me();if(Wn.size>I*1024*1024&&q>960)return q=Math.floor(q*.8),ge=Math.floor(ge*.8),rt=.9,me();window.clearTimeout(H),B(new File([Wn],x8(x.name),{type:"image/jpeg",lastModified:x.lastModified}))},"image/jpeg",rt)};me()},ie.src=Y.target?.result},J.readAsDataURL(x)}):x,G=R.useRef(null),[Fe,Ze]=R.useState(null),[gt,nt]=R.useState({}),[Rt,qt]=R.useState(null),[Ht,Vn]=R.useState(null),[fa,hi]=R.useState(null),[Jc,pi]=R.useState(null),[ha,gi]=R.useState(0),[el,pa]=R.useState(!1),Jh=El(),[Tt,mi]=R.useState(Jh),[ga,xi]=R.useState("today"),[e1,tl]=R.useState(!1),[po,go]=R.useState(""),[Un,nl]=R.useState(100),[rl,ma]=R.useState({}),[t1,xa]=R.useState(!1),[al,ol]=R.useState(!0),[ur,mo]=R.useState(new Set),[n1,vi]=R.useState(!1),[il,va]=R.useState({}),[yi,sl]=R.useState({}),[r1,a1]=R.useState(null),[y8,o1]=R.useState(!1);R.useEffect(()=>{if(!c){d(0);return}const x=[1200,2500,2e3,2e3];let I=0;const j=()=>{I++,I<=4&&d(I)},O=[];let B=0;for(let H=0;H<x.length;H++)B+=x[H],O.push(setTimeout(j,B));return()=>O.forEach(clearTimeout)},[c]),R.useEffect(()=>{f&&ol(!1)},[f]);const En=Lt.useUtils(),i1=El(),{data:s1}=Lt.profile.getProfile.useQuery(),{data:cl=[]}=Lt.meals.getByDate.useQuery({date:i1}),{data:ll}=Lt.recommendations.getDaily.useQuery(),zn=Lt.barcode.lookup.useQuery({barcode:An||"00000000"},{enabled:!!An}),Pe=zn.data&&zn.data.status!=="not_found"?zn.data.product:null,xo=Pe?.nutritionPerServing.calories!==null,ya=cn==="serving"&&xo?"serving":"100g",wi=Pe?ya==="serving"?Pe.nutritionPerServing:Pe.nutritionPer100g:null,bi=Math.max(1,Number.parseFloat(Pe?.servingSize?.match(/[\d.]+/)?.[0]||"100")),c1=Math.max(.01,Number.parseFloat(pn)||(ya==="serving"?bi:100))/(ya==="serving"?bi:100),qe=wi?p3(wi,c1):null,l1=r8(Dn).slice(0,8),Sn=tc.find(x=>x.id===nr)||null,dr=Sn?.states.find(x=>x.state===re)||Sn?.states[0]||null,vo=Math.max(0,Number.parseFloat(rr)||0),Nt=dr?a8(dr,vo):null,Dr=ll?.calories?.targetCalories||Number(s1?.tdee||0)||2e3,wa=ll?.calories?.macroTargets?.fat||Math.round(Dr*.25/9),ul=cl.reduce((x,I)=>x+(Number(I.totalCalories)||0),0),dl=cl.reduce((x,I)=>x+(Number(I.fat)||0),0),ba=(x,I,j)=>{const O=Date.now(),B=n8({...x,todayCaloriesBefore:ul,todayFatBefore:dl,targetCalories:Dr,fatTarget:wa});Nr({id:O,mealRecordId:j,...B})},u1=Lt.meals.analyzeFood.useMutation(),{data:fl=[]}=Lt.meals.getHistory.useQuery({limit:8,offset:0}),xn=Lt.meals.add.useMutation({onSuccess:()=>{_e.success("已宿飲é£è¨éï¼TAMA ç²å¾æé·è½é â
"),_i(),En.meals.getMonthSummary.invalidate(),En.meals.getByDate.invalidate({date:Tt}),En.hydration.getByDate.invalidate({date:Tt}),En.workouts.getByDate.invalidate({date:Tt}
61),En.sleep.getByDate.invalidate({date:Tt}),En.supplements.getDailyChecklist.invalidate({date:Tt.toISOString().slice(0,10)})},onError:x=>{_e.error("å åå°: "+x.message)}}),Ci=Lt.meals.mergeIntoExisting.useMutation({onSuccess:x=>{_e.success(`å·²åä½µå°ä¸ä¸é¤ï¼å
± ${x.itemCount} 樣é£ç© â
`),vi(!1),_i(),En.meals.getMonthSummary.invalidate(),En.meals.getByDate.invalidate(),En.meals.getHistory.invalidate()},onError:x=>{_e.error("åä½µåå°: "+x.message)}}),_i=()=>{r([]),o([]),s(0),p(null),m(null),v(!1),b(!1),A(""),Ze(null),nt({}),qt(null),Vn(null),hi(null),pi(null),gi(0),pa(!1),go(""),nl(100),ma({}),xa(!1),va({}),sl({}),a1(null),o1(!1),L({}),kt(""),sn(""),Bt("100"),Yt("100g"),Xt(!1),Kt(""),Mn(null),Fn("raw"),Pn("100"),ar(!1),kn(!1),Zt("1"),ir("1"),sr("unknown"),lr(!1),jn(!1)},d1=x=>{if(!/^\d{8,14}$/.test(x)){_e.error("å¢åä¼¼ä¹åä¿ææé£åæ¢ç¢¼ï¼è©¦ä¸å°æºå
è£ä¸å
æ¸åã");return}sn(x),kt(x),Yt("100g"),Bt("100"),ne(!1),_e.success("å·²è®åæ¢ç¢¼ï¼æ¥ç·å
è£é£åè³æâ¦")},hl=()=>{const x=Me.replace(/\s/g,"");if(!/^\d{8,14}$/.test(x)){_e.error("è«è¼¸å
¥å
è£ä¸ 8 è³ 14 使¸å
æ¢ç¢¼ã");return}kt(x),Yt("100g"),Bt("100")},f1=async()=>{if(!Pe||!qe||qe.calories===null||qe.protein===null||qe.carbs===null||qe.fat===null){_e.error("å¢ä»¶ç¢åå
ä¸å¤§çé¤è³æå宿´ï¼å»ºè°å½±ç餿¨ç±¤åè¨éã");return}const x=new Date(Tt);x.setHours(12,0,0,0);const I=await xn.mutateAsync({mealType:T,foodItems:[{name:Pe.name,calories:qe.calories,protein:qe.protein,carbs:qe.carbs,fat:qe.fat,quantity:`${Number.parseFloat(pn)||0}gï¼æ¢ç¢¼è³æï¼`,brand:Pe.brand||void 0}],totalCalories:qe.calories,protein:qe.protein,carbs:qe.carbs,fat:qe.fat,aiAnalyzed:!1,date:x,restaurantName:Pe.brand||void 0,portionPercentage:100});ba({calories:qe.calories,protein:qe.protein,carbs:qe.carbs,fat:qe.fat},"meal_log",I.id)},h1=x=>{const I=tc.find(j=>j.id===x);I&&(Mn(I.id),Kt(I.name),Fn(I.states[0].state))},p1=async()=>{if(!Sn||!dr||!Nt||vo<=0){_e.error("è«å
æåææå輸å
¥å¯é£ééã");return}const x=new Date(Tt);x.setHours(12,0,0,0);const I=await xn.mutateAsync({mealType:T,foodItems:[{name:Sn.name,calories:Nt.calories,protein:Nt.protein,carbs:Nt.carbs,fat:Nt.fat,quantity:`${vo}gï¼${dr.label}ï¼`}],totalCalories:Nt.calories,protein:Nt.protein,carbs:Nt.carbs,fat:Nt.fat,aiAnalyzed:!1,ingredients:`åææã»${dr.label}ï¼${Qd.label}`,date:x,portionPercentage:100});ba(Nt,"meal_log",I.id)},pl=x=>(x.ingredientBreakdown||[]).filter(I=>I.status==="included"&&c8(I.name)).reduce((I,j)=>({calories:I.calories+j.calories,protein:I.protein+j.protein,carbs:I.carbs+j.carbs,fat:I.fat+j.fat}),{calories:0,protein:0,carbs:0,fat:0}),yo=x=>l8({calories:x.calories,protein:x.protein,carbs:x.carbs,fat:x.fat},pl(x),Wt),Mr=x=>rl[x]||100,Ca=x=>Math.round(yo(x).calories*Mr(x.id)/100*Un/100),wo=x=>Math.round(yo(x).protein*Mr(x.id)/100*Un/100),bo=x=>Math.round(yo(x).carbs*Mr(x.id)/100*Un/100),Co=x=>Math.round(yo(x).fat*Mr(x.id)/100*Un/100),Ai=()=>f?{calories:f.dishes.reduce((x,I)=>x+Ca(I),0),protein:f.dishes.reduce((x,I)=>x+wo(I),0),carbs:f.dishes.reduce((x,I)=>x+bo(I),0),fat:f.dishes.reduce((x,I)=>x+Co(I),0)}:{calories:0,protein:0,carbs:0,fat:0},Ei=o8(or,Bn),fr=Ei.servings,hr=Ei.eaten,gl=ke&&st?Ei.ratio:1,De=x=>i8(x,gl),Ot=Ai(),Si=!!f?.dishes.some(x=>pl(x).calories>0),ml=nc.find(x=>x.value===Wt)?.label,xl=x=>{const I=x.split(/[ãï¼]/).find(Boolean)?.trim()||x;return I.length>54?`${I.slice(0,54)}â¦`:I},vl=Ot.protein*4+Ot.carbs*4+Ot.fat*9,Ii=!!(f&&Ot.calories>=80&&(vl===0||Ot.calories-vl>=Math.max(100,Ot.calories*.25))),Ri=Ii?["protein","carbs","fat"].filter(x=>Ot[x]===0):[],g1={protein:"èç½è³ª",carbs:"碳水",fat:"èèª"},Ti=(x,I)=>Ri.includes(x)?`${I} å¾
è£`:`${I} ${De(Ot[x])}g`,Ni=(x,I)=>{const j={...gt,[x]:I};if(nt(j),Fe&&g){const O=Xx(Fe,j),B=1+O/100;qt(Math.round(g.calories*B)),Vn(Math.round(g.protein*B)),hi(Math.round(g.carbs*B)),pi(Math.round(g.fat*B)),gi(Math.round(O))}},m1=()=>{if(g&&Rt!==null){const x={...g,calories:Rt,protein:Ht||g.protein,carbs:fa||g.carbs,fat:Jc||g.fat};m(x),Mi(x),pa(!1),_e.success("å·²å¥ç¨å¾®èª¿çµæ â
")}},Oi=async(x,I="food")=>{const j=x.target.files;if(!j||j.length===0)return;const O=Array.from(j),B=g8(n.length,n.reduce((J,Y)=>J+Y.size,0),O);if(!B.valid){_e.error(B.message),x.target.value="";return}const H=[];for(const J of O)if(J.size>5*1024*1024){console.log(`å£ç¸® ${J.name}...`);const Y=await ee(J,5);H.push(Y)}else H.push(J);if(H.length===0)return;const Be=H.map(J=>new Promise((Y,ie)=>{const he=new FileReader;he.onload=q=>Y(q.target?.result),he.onerror=()=>ie(new Error(`${J.name} æªè½è®å`)),he.onabort=()=>ie(new Error(`${J.name}
61 è®å已忶`)),he.readAsDataURL(J)}));Promise.all(Be).then(J=>{const Y=n.length,ie=[...n,...H];r(ie),o(q=>[...q,...J]);const he={};if(H.forEach((q,ge)=>{he[Y+ge]=I}),L(q=>({...q,...he})),!f)p(null),m(null),ie.length>1&&ar(!0);else{const q={};H.forEach((ge,rt)=>{q[Y+rt]="pending"}),va(ge=>({...ge,...q}))}}).catch(J=>{_e.error(J instanceof Error?J.message:"ç¸çæªè½è¼å ¥ï¼è«éæ°é¸æã")}),x.target.value=""},x1=x=>{r(I=>I.filter((j,O)=>O!==x)),o(I=>I.filter((j,O)=>O!==x)),L(I=>{const j={...I};return delete j[x],j}),i>=x&&i>0&&s(i-1)},v1=x=>new Promise((I,j)=>{const O=new FileReader;O.onload=()=>{const H=O.result?.split(",")[1];if(!H){j(new Error(`${x.name} æªè½è½æï¼è«åè©¦ä¸æ¬¡ã`));return}I(H)},O.onerror=()=>j(new Error(`${x.name} æªè½è®åï¼è«éæ°é¸æã`)),O.onabort=()=>j(new Error(`${x.name} è®å已忶ï¼è«åè©¦ä¸æ¬¡ã`)),O.readAsDataURL(x)}),yl=async()=>{if(n.length===0){_e.error("å æå¼µé£ç©ç¸å å");return}if(v8(n)>42*1024*1024){_e.error("ç¸çç¸½æªæ¡å¤ªå¤§ï¼è«ç§»é¤è¼å¤§çç¸çå¾ååæã");return}l(!0),d(0);try{const x=[];for(let Y=0;Y<n.length;Y++){let ie=n[Y];ie.size>5*1024*1024&&(ie=await ee(ie,5));const he=await v1(ie),q=z[Y]==="receipt",ge=Zx(z[Y]),rt=z[Y]==="menu",me=z[Y]==="raw_ingredient";x.push({imageBase64:he,mimeType:ie.type||"image/jpeg",isReceipt:q,isLabel:ge,isMenu:rt,isRawIngredient:me})}const I=ke?`ãèªè£½é£è模å¼ãéäºç¸ç屬åä¸ä»½èªè£½é£èï¼æåç¸åªç¨ä½ç¢ºèªå®æèå¼ï¼ææï¼å è£ç¸åªç¨ä½ç¢ºèªé£æååçï¼çµä¸å¯æå ©è éè¤è¨ç®ã${st?`æ´ä»½åæ ${fr} ä»½ï¼æ¬æ¬¡è¨é ${hr} 份ã`:"鿬¡æç¸çç¶åé£ç¨çä¸ä»½è¨éã"}${_?` 62ç¨æ¶è£å ï¼${_}`:""}`:_||void 0,j=await u1.mutateAsync({images:x,context:I,recipeMode:ke,recipeServings:ke&&st?fr:void 0}),O=j;if(!O.success){_e.error(O.error||"çé¤è³ææªè½å®æ´ç¢ºèªï¼è«é試æè£å 飿份é"),b(!0),va(Y=>({...Y,[i]:"failed"}));return}const B={success:O.success,photoUrl:O.photoUrl,photoUrls:O.photoUrls||void 0,dishes:O.dishes||[],totalCalories:O.totalCalories||0,totalProtein:O.totalProtein||0,totalCarbs:O.totalCarbs||0,totalFat:O.totalFat||0,macroStatus:O.macroStatus==="incomplete"?"incomplete":"complete",overallComment:O.overallComment||"",suggestedMealType:O.suggestedMealType||"lunch",scene:O.scene||null,restaurantName:O.restaurantName||null,overall_confidence:O.overall_confidence||0,aiRawOutput:O.aiRawOutput||null,hasReceiptMode:O.hasReceiptMode||!1,hasOrderEvidenceMode:O.hasOrderEvidenceMode||!1,foodPhotoItems:O.foodPhotoItems||void 0,receiptItems:O.receiptItems||void 0};p(B),sr("unknown"),lr(!1),jn(!1),ba({calories:B.totalCalories,protein:B.totalProtein,carbs:B.totalCarbs,fat:B.totalFat},"meal_analysis"),ma({});const H=new Set((O.photoUrls||[]).map((Y,ie)=>ie));mo(H);const Be={};a.forEach((Y,ie)=>{Be[ie]="done"}),va(Be);const J={};if(B.dishes.forEach(Y=>{J[Y.id]=0}),sl(J),B.hasReceiptMode&&B.receiptItems){const Y={};B.receiptItems.forEach(ie=>{ie.suggestedMatchIndex>=0&&B.foodPhotoItems&&B.foodPhotoItems[ie.suggestedMatchIndex]?Y[ie.id]=[B.foodPhotoItems[ie.suggestedMatchIndex].id]:Y[ie.id]="skip"}),U(Y),K(new Set),Or(!0),_e.success("æ¶æåæå®æï¼è«ç¢ºèªå¹é éä¿ ð§¾")}else if(B.dishes.length>0){const Y=B.dishes[0];m({id:Y.id,foodName:Y.name,brand:Y.brand,cookingMethod:Y.cookingMethod,quantity:`${Y.estimated_grams}g`,calories:Y.calories,protein:Y.protein,carbs:Y.carbs,fat:Y.fat,ingredients:Y.main_ingredients.join(", "),confidence:Math.round(Y.confidence*100),healthComment:Y.notes||""}),S(B.suggestedMealType||"lunch"),B.restaurantName&&go(B.restaurantName)}if(j.scene){const Y=Xl(j.scene);
62if(Y){Ze(Y);const ie={};for(const he of Y.modifiers)if(he.type==="slider"&&he.defaultValue!==void 0)ie[he.id]=he.defaultValue;else if(he.type==="toggle")ie[he.id]=!1;else if(he.type==="select"&&he.options&&he.options.length>0){const q=he.options.find(ge=>ge.calorieImpact===0);ie[he.id]=q?q.value:he.options[0].value}nt(ie),pa(!0)}}j.success?_e.success("åæå®æï¼æè¿ä½ é£å
å¢ ð½ï¸"):(_e.info("AI åæåå°ï¼ä½ å¯ä»¥èªå·±å
¥"),b(!0))}catch(x){_e.error("åæåå°ï¼"+(x.message||"è©¦å¤æ¬¡å¦")),b(!0),va(I=>({...I,[i]:"failed"}))}finally{l(!1)}},y1=x=>{const I={id:x.id,foodName:x.name,brand:x.brand,cookingMethod:x.cookingMethod,quantity:`${x.estimated_grams}g`,calories:x.calories,protein:x.protein,carbs:x.carbs,fat:x.fat,ingredients:x.main_ingredients.join(", "),confidence:Math.round(x.confidence*100),healthComment:x.notes||""};m(I),v(!1),xa(!0)},[w1,Di]=R.useState(!1),[Qt,_a]=R.useState({foodName:"",brand:"",cookingMethod:"",quantity:""}),[wl,bl]=R.useState(!1),b1=Lt.meals.recalculateNutrition.useMutation(),C1=()=>{g&&F({foodName:g.foodName,quantity:g.quantity,calories:g.calories,protein:g.protein,carbs:g.carbs,fat:g.fat}),v(!0)},Mi=x=>{if(!f)return;const I=f.dishes.map(O=>O.id===x.id?{...O,name:x.foodName,brand:x.brand,cookingMethod:x.cookingMethod,estimated_grams:parseInt(x.quantity)||O.estimated_grams,calories:x.calories,protein:x.protein,carbs:x.carbs,fat:x.fat,main_ingredients:x.ingredients?x.ingredients.split(", ").map(B=>B.trim()):O.main_ingredients,notes:x.healthComment||O.notes}:O),j={totalCalories:I.reduce((O,B)=>O+B.calories,0),totalProtein:I.reduce((O,B)=>O+B.protein,0),totalCarbs:I.reduce((O,B)=>O+B.carbs,0),totalFat:I.reduce((O,B)=>O+B.fat,0)};p({...f,dishes:I,...j})},_1=()=>{if(g){const x={...g,...E};m(x),Mi(x)}v(!1)},A1=()=>{g&&_a({foodName:g.foodName,brand:g.brand||"",cookingMethod:g.cookingMethod||"",quantity:g.quantity}),Di(!0)},E1=async()=>{if(g){bl(!0);try{const x=await b1.mutateAsync({foodName:Qt.foodName,brand:Qt.brand||null,cookingMethod:Qt.cookingMethod||null,quantity:Qt.quantity,originalCalories:g.calories});if(x.success){const I={...g,foodName:x.foodName,brand:x.brand,cookingMethod:x.cookingMethod,quantity:x.quantity,calories:x.calories,protein:x.protein,carbs:x.carbs,fat:x.fat,ingredients:x.ingredients,healthComment:x.healthComment};m(I),Mi(I),_e.success("已鿰è¨ç®ç餿å â
")}else _e.error("è¨åå°ï¼ä½ èªå·±æ¹ä¸åæ¸å¦")}catch(x){_e.error("è¨åå°ï¼"+(x.message||"è©¦å¤æ¬¡å¦"))}finally{bl(!1),Di(!1)}}},Cl=()=>{b(!0),F({foodName:"",quantity:"1 份",calories:0,protein:0,carbs:0,fat:0})},S1=x=>{if(!f)return;const I=f.dishes.filter(B=>B.id!==x),j={totalCalories:I.reduce((B,H)=>B+H.calories,0),totalProtein:I.reduce((B,H)=>B+H.protein,0),totalCarbs:I.reduce((B,H)=>B+H.carbs,0),totalFat:I.reduce((B,H)=>B+H.fat,0)};p({...f,dishes:I,...j}),g?.id===x&&(m(null),xa(!1));const O={...rl};delete O[x],ma(O),_e.success("å·²åèµ° â
")},I1=Object.values(il).filter(x=>x==="pending"||x==="failed").length;a.length>0;const _l=x=>Object.values(yi).filter(I=>I===x).length,R1=async()=>{if(w){if(!E.foodName){_e.error("è¦å
¥é£ç©åå
å¾å");return}try{const x=new Date(Tt);x.setHours(12,0,0,0);const I=await xn.mutateAsync({mealType:T,foodItems:[{name:E.foodName,calories:E.calories,protein:E.protein,carbs:E.carbs,fat:E.fat,quantity:E.quantity}],totalCalories:E.calories,protein:E.protein,carbs:E.carbs,fat:E.fat,aiAnalyzed:!1,date:x,restaurantName:po||void 0,portionPercentage:Un});ba({calories:E.calories,protein:E.protein,carbs:E.carbs,fat:E.fat},"meal_log",I.id)}catch(x){console.error("Error adding meal:",x)}}else if(f&&f.dishes.length>0){if(Si&&Wt==="unknown"){_e.error("å
æè¿æå飲湯ï¼å
æç¨æ£ç¢ºæ¹¯åºçé¤è¨éã");return}const x=f.dishes.map(j=>({name:j.name,calories:De(Ca(j)),protein:De(wo(j)),carbs:De(bo(j)),fat:De(Co(j)),quantity:ke&&st?`æ´ä»½é£è ${hr}/${fr} 份ï¼åæç¸½éç´ ${j.estimated_grams}gï¼`:`${j.estimated_grams}g`})),I=Ai();try{const j=new Date(Tt);j.setHours(12,0,0,0);const O=f.photoUrls&&f.photoUrls.length>0?f.photoUrls:a.map((Be,J)=>({url:void 0,type:z[J]==="nutrition_label"||z[J]==="raw_ingredient"?"ingredient":"finished"})),B=ur.size>0?O.filter((Be,J)=>ur.has(J)):O,H=await xn.mutateAsync({mealType:T,foodItems:x,totalCalories:De(I.c
62alories),protein:De(I.protein),carbs:De(I.carbs),fat:De(I.fat),photoUrl:f.photoUrl,aiAnalyzed:!0,date:j,restaurantName:po||void 0,portionPercentage:ke?Math.round(gl*100):Un,aiRawOutput:f.aiRawOutput?JSON.stringify(f.aiRawOutput):void 0,photos:B});ba({calories:De(I.calories),protein:De(I.protein),carbs:De(I.carbs),fat:De(I.fat)},"meal_log",H.id)}catch(j){console.error("Error adding meal:",j)}}else _e.error("å
ææå
¥é£ç©è³æå
å")},T1=async x=>{if(!f||!f.dishes||f.dishes.length===0){_e.error("æªæå¯åä½µå
é£ç©çµæ");return}if(Si&&Wt==="unknown"){_e.error("å
æè¿æå飲湯ï¼å
æç¨æ£ç¢ºæ¹¯åºçé¤åä½µã");return}const I=f.dishes.map(H=>({name:H.name,calories:De(Ca(H)),protein:De(wo(H)),carbs:De(bo(H)),fat:De(Co(H)),quantity:ke&&st?`æ´ä»½é£è ${hr}/${fr} 份ï¼åæç¸½éç´ ${H.estimated_grams}gï¼`:`${H.estimated_grams}g`,cookingMethod:H.cookingMethod||void 0,brand:H.brand||void 0})),j=Ai(),O=f.photoUrls||[],B=ur.size>0?O.filter((H,Be)=>ur.has(Be)):O;await Ci.mutateAsync({targetRecordId:x,foodItems:I,totalCalories:De(j.calories),protein:De(j.protein),carbs:De(j.carbs),fat:De(j.fat),photos:B,primaryPhotoUrl:f.photoUrl||void 0,restaurantName:po||void 0,aiRawOutput:f.aiRawOutput||void 0})},Fi=a[i]||a[0]||"";return h.jsx(V1,{"data-loc":"client/src/pages/FoodRecognition.tsx:1382",title:"AI è¨å¡è·¯é",showBack:!0,children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1383",className:"px-4 py-5 sm:py-7",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1384",className:"mx-auto max-w-3xl space-y-5",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1386",className:"mb-1",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1387",className:"section-kicker",children:"AI FOOD SCAN"}),h.jsx("h1",{"data-loc":"client/src/pages/FoodRecognition.tsx:1388",className:`mt-1 text-2xl font-bold tracking-tight md:text-3xl ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:"æä¸æï¼ç¥éä½ é£ç·ä¹"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1393",className:"mt-1 text-sm text-muted-foreground",children:"ç¸çãé¤çãç餿¨ç±¤ãé»èç´åæ¢ç¢¼ï¼ä¸æ¬¡éå¹«ä½ åæå¯è¨éå
æ¸æã"})]}),h.jsx(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:1397",className:"card-ai-signal mb-6 border-0",children:h.jsxs($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:1398",className:"pt-6 space-y-4",children:[a.length>0&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1401",className:"space-y-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1403",className:"relative rounded-xl overflow-hidden",children:[h.jsx("img",{"data-loc":"client/src/pages/FoodRecognition.tsx:1404",src:Fi,alt:"Food preview",className:`w-full h-56 object-cover transition-all duration-500 ${c?"scale-[1.02]":""}`}),c&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1410",className:"absolute inset-0",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1411",className:"absolute inset-0 bg-gradient-to-b from-black/30 via-black/50 to-black/30"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1412",className:"absolute inset-0 overflow-hidden",children:h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1413",className:"absolute left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-cyan-400 to-transparent animate-scan-line"})}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1415",className:"absolute top-3 left-3 w-8 h-8 border-t-2 border-l-2 border-cyan-400 rounded-tl-lg animate-pulse"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1416",className:"absolute top-3 right-3 w-8 h-8 border-t-2 border-r-2 border-cyan-400 rounded-tr-lg animate-pulse"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1417",className:"absolute bottom-3 left-3 w-8 h-8 border-b-2 border-l-2 border-cyan-400 rounded-bl-lg animate-pulse"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1418",className:"absolute bottom-3 right-3 w-8 h-8 border-b-2 border-r-2 border-cyan-400 rounded-br-lg animate-pulse"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1419",className:"absolute inset-0 flex items-center justify-center",children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1420",className:"relative",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1421",className:"w-20 h-20 rounded-full border-2 border-cyan-400/60 animate-ping"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1422",className:"absolute inset-0 w-20 h-20 rounded-full border border-cyan-300/40 animate-pulse"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1423",className:"absolute inset-[25%] w-10 h-10 rounded-full bg-cyan-400/20 backdrop-blur-sm flex items-center justify-center",children:h.jsx(Xn,{"data-loc":"client/src/pages/FoodRecognition.tsx:1424",className:"w-5 h-5 text-cyan-300 animate-pulse"})})]})}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1428",className:"absolute bottom-6 left-0 right-0 text-center",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1429",className:"inline-flex items-center gap-2 bg-black/60 backdrop-blur-md px-4 py-2 rounded-full border border-cyan-500/30",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1430",className:"w-2 h-2 rounded-full bg-cyan-400 animate-pulse"}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1431",className:"text-sm font-medium text-cyan-100",children:[u===0&&"å³ç·...",u===1&&"AI èå¥ç·é£ç©...",u===2&&"åæåçåç¹èª¿æ¹æ³...",u===3&&"è¨ç®ç餿å...",u>=4&&"çæçµæä¸..."]})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1439",className:"mt-2 mx-auto w-48 h-1 bg-transparent roun
62ded-full overflow-hidden",children:h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1440",className:"h-full bg-gradient-to-r from-cyan-400 to-blue-500 rounded-full transition-all duration-1000 ease-out",style:{width:`${Math.min(95,(u+1)*20)}%`}})})]})]})]}),a.length>1&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1452",className:"flex gap-2 overflow-x-auto pb-1",children:[a.map((x,I)=>{const j=il[I],O=r1===I;return h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1457",className:"relative flex-shrink-0",children:[h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1458",type:"button",onClick:()=>s(I),className:`w-16 h-16 rounded-lg overflow-hidden border-2 transition-all ${I===i?"border-blue-500 ring-2 ring-blue-500/30":j==="done"?"border-green-500/60":j==="failed"?"border-red-500/60":t==="dark"?"border-zinc-700":"border-zinc-200"}`,children:[h.jsx("img",{"data-loc":"client/src/pages/FoodRecognition.tsx:1471",src:x,alt:`Photo ${I+1}`,className:"w-full h-full object-cover"}),j==="done"&&h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1474",className:"absolute inset-0 bg-green-500/20 flex items-center justify-center",children:h.jsx(Fr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1475",className:"w-5 h-5 text-green-400 drop-shadow-md"})}),O&&h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1479",className:"absolute inset-0 bg-black/40 flex items-center justify-center",children:h.jsx(vr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1480",className:"w-5 h-5 text-cyan-400 animate-spin"})}),j==="failed"&&!O&&h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1484",className:"absolute inset-0 bg-red-500/20 flex items-center justify-center",children:h.jsx(rf,{"data-loc":"client/src/pages/FoodRecognition.tsx:1485",className:"w-4 h-4 text-red-400 drop-shadow-md"})})]}),!f&&h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1491",type:"button",onClick:()=>x1(I),className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-red-500 text-white flex items-center justify-center text-xs shadow-md",children:h.jsx(za,{"data-loc":"client/src/pages/FoodRecognition.tsx:1496",className:"w-3 h-3"})}),(()=>{const B=z[I]||"food",H=B==="nutrition_label"?{label:"æ¨ç±¤",className:"bg-amber-500 text-white"}:B==="receipt"?{label:"æ¶æ",className:"bg-green-600 text-white"}:B==="menu"?{label:"é¤ç",className:"bg-violet-600 text-white"}:{label:"é£ç©",className:"bg-blue-500 text-white"};return h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1510",className:`absolute top-0.5 right-0.5 text-[8px] px-1.5 rounded-full font-semibold ${H.className}`,children:H.label})})(),I===i&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1517",className:"absolute bottom-0.5 left-1/2 -translate-x-1/2 text-[9px] bg-blue-500 text-white px-1.5 rounded-full",children:"主"}),j==="done"&&f&&_l(I)>0&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1521",className:"absolute bottom-0.5 right-0.5 text-[9px] bg-green-600 text-white px-1 rounded-full",children:_l(I)})]},I)}),h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1529",type:"button",onClick:()=>k.current?.click(),className:`w-16 h-16 rounded-lg border-2 border-dashed flex items-center justify-center flex-shrink-0 transition-colors ${t==="dark"?"border-zinc-600 hover:border-zinc-500 text-zinc-500":"border-zinc-300 hover:border-zinc-400 text-zinc-400"}`,children:h.jsx(Ea,{"data-loc":"client/src/pages/FoodRecognition.tsx:1536",className:"w-5 h-5"})})]})]}),a.length===0&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1544",className:"scan-stage p-8 text-center",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1545",className:"scan-orbit left-1/2 top-5 -translate-x-1/2","aria-hidden":"true"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1546",className:"relative mx-auto mb-4 flex h-20 w-20 items-center justify-center rounded-[26px] border border-cyan-200/20 bg-cyan-300/10 shadow-[0_0_30px_rgba(34,211,238,0.18)]",children:[h.jsx(Po,{"data-loc":"client/src/pages/FoodRecognition.tsx:1547",className:`h-10 w-10 ${t==="dark"?"text-cyan-200":"text-cyan-700"}`}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1548",className:"absolute -right-3 -top-3 text-2xl drop-shadow-[0_5px_10px_rgba(167,139,250,0.45)]","aria-hidden":"true",children:"ð¥"})]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1550",className:"brand-chip relative mb-3",children:[h.jsx(Xn,{"data-loc":"client/src/pages/FoodRecognition.tsx:1550",className:"h-3 w-3"}),"AI ç餿æ"]}
62),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1551",className:`relative mb-1 text-lg font-semibold ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:"影張é£ç©ç¸ï¼æè
å¾ç¸ç°¿æ"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1554",className:`relative mb-5 text-xs ${t==="dark"?"text-cyan-100/65":"text-cyan-800/75"}`,children:"å½±å®å
çºæ¯å¼µç¸æé¡åï¼é£ç©ãé¤çãæ¨ç±¤ãæ¶ææåææã"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1555",className:"relative flex gap-3 justify-center",children:[h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1556",onClick:()=>G.current?.click(),className:"flex-1 bg-gradient-to-r from-amber-400 to-orange-500 py-3.5 text-base font-bold text-slate-950 shadow-[0_10px_24px_rgba(251,146,60,0.25)] hover:from-amber-300 hover:to-orange-400",children:[h.jsx(Po,{"data-loc":"client/src/pages/FoodRecognition.tsx:1560",className:"w-4 h-4 mr-2"}),"å½±ç¸"]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1563",onClick:()=>k.current?.click(),variant:"outline",className:`flex-1 rounded-2xl py-3.5 text-base font-semibold ${t==="dark"?"border-white/12 bg-white/[0.06] text-white hover:bg-white/[0.11]":"bg-white/45 border-zinc-300/75 text-zinc-900 hover:bg-white/65"}`,children:[h.jsx(J1,{"data-loc":"client/src/pages/FoodRecognition.tsx:1572",className:"w-4 h-4 mr-2"}),"ç¸ç°¿"]})]})]}),!f&&a.length===0&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1580",className:"grid grid-cols-2 gap-3",children:[h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1581",type:"button",onClick:()=>Ce(x=>!x),className:`rounded-2xl border p-4 text-left transition-all active:scale-[0.98] ${t==="dark"?"border-cyan-300/20 bg-cyan-300/[0.07] hover:bg-cyan-300/[0.11]":"border-cyan-500/25 bg-cyan-100/18 hover:bg-cyan-100/30"}`,children:[h.jsx(Pa,{"data-loc":"client/src/pages/FoodRecognition.tsx:1586",className:`h-5 w-5 ${t==="dark"?"text-cyan-200":"text-cyan-800"}`}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1587",className:"mt-3 text-sm font-semibold",children:"å
è£é£å"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1588",className:"mt-1 text-xs text-muted-foreground",children:"ææ¢ç¢¼ææå輸碼"})]}),h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1590",type:"button",onClick:()=>Xt(x=>!x),className:`rounded-2xl border p-4 text-left transition-all active:scale-[0.98] ${t==="dark"?"border-violet-300/20 bg-violet-300/[0.07] hover:bg-violet-300/[0.11]":"border-violet-500/25 bg-violet-100/18 hover:bg-violet-100/30"}`,children:[h.jsx(Nl,{"data-loc":"client/src/pages/FoodRecognition.tsx:1595",className:`h-5 w-5 ${t==="dark"?"text-violet-200":"text-violet-800"}`}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1596",className:"mt-3 text-sm font-semibold",children:"åææè¨ç®"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1597",className:"mt-1 text-xs text-muted-foreground",children:"æçï¼çééè¨ç®"})]})]}),!f&&a.length===0&&h.jsx(kr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1603",open:gn,onOpenChange:Xt,children:h.jsx(Br,{"data-loc":"client/src/pages/FoodRecognition.tsx:1604",className:"mt-4",children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1605",className:`rounded-2xl border p-4 ${t==="dark"?"border-violet-300/20 bg-violet-300/[0.07]":"border-violet-300/35 bg-white/20"} backdrop-blur-md`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1606",className:"flex items-start gap-3",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1607",className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl ${t==="dark"?"bg-violet-300/12 text-violet-200":"bg-violet-200/55 text-violet-800"}`,children:h.jsx(Nl,{"data-loc":"client/src/pages/FoodRecognition.tsx:1608",className:"h-5 w-5"})}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1610",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1611",className:"font-semibold",children:"åææè¨ç®"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1612",className:"mt-0.5 text-xs text-muted-foreground",children:"é©åéèãéè¸ãç½ç±³ãè¬èçå®ä¸é£æï¼è«æè¿çéæçéã"})]})]}),h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:1616",htmlFor:"raw-ingredient-search",className:"mt-4 block text-xs font-medium",children:"æå°åæ
62æ"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1617",id:"raw-ingredient-search",value:Dn,onChange:x=>{Kt(x.target.value),Sn&&x.target.value!==Sn.name&&Mn(null)},placeholder:"ä¾å¦ï¼éè¸ãéèãç½ç±³ã西èè±",className:"input-fitdiet mt-2"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1627",className:"mt-2 flex max-h-32 flex-wrap gap-2 overflow-y-auto pr-1",children:l1.map(x=>h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1629",type:"button",size:"sm",variant:"outline",onClick:()=>h1(x.id),className:`h-8 rounded-full ${nr===x.id?t==="dark"?"border-violet-300/50 bg-violet-300/16 text-violet-100":"border-violet-500/50 bg-violet-100/70 text-violet-900":t==="dark"?"border-white/10 text-zinc-300":"border-slate-300/70 bg-white/15 text-slate-700"}`,children:x.name},x.id))}),Sn&&dr&&Nt&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1645",className:`mt-4 rounded-xl border p-3 ${t==="dark"?"border-white/10 bg-black/20":"border-white/50 bg-white/14"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1646",className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1647",className:"font-semibold",children:Sn.name}),h.jsx("a",{"data-loc":"client/src/pages/FoodRecognition.tsx:1648",href:Qd.url,target:"_blank",rel:"noreferrer",className:`text-[11px] underline underline-offset-2 ${t==="dark"?"text-cyan-200":"text-cyan-800"}`,children:"è³æä¾æº"})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1650",className:"mt-3 grid grid-cols-2 gap-2",children:Sn.states.map(x=>h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1652",type:"button",variant:"outline",onClick:()=>Fn(x.state),className:`h-auto min-h-11 whitespace-normal py-2 text-xs ${re===x.state?t==="dark"?"border-cyan-300/45 bg-cyan-300/12 text-cyan-100":"border-cyan-600/45 bg-cyan-100/55 text-cyan-900":t==="dark"?"border-white/10 text-zinc-300":"border-slate-300/70 bg-white/15 text-slate-700"}`,children:x.label},x.state))}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1663",className:"mt-3 flex items-center justify-between gap-3",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:1664",htmlFor:"raw-ingredient-weight",className:"text-sm font-medium",children:"ä½ é£åå¹¾å¤å¯é£é¨åï¼"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1665",className:`flex w-32 items-center rounded-xl border px-3 ${t==="dark"?"border-white/10 bg-black/20":"border-white/50 bg-white/18"}`,children:[h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1666",id:"raw-ingredient-weight",value:rr,onChange:x=>Pn(x.target.value.replace(/[^\d.]/g,"")),inputMode:"decimal",className:"h-9 border-0 bg-transparent p-0 text-right shadow-none focus-visible:ring-0"}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1667",className:"ml-1 text-xs text-muted-foreground",children:"g"})]})]}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1670",className:"mt-2 text-[11px] text-muted-foreground",children:["以 ",dr.label," çæ¯ 100g å¯é£ç¨é¨åæç®ï¼ç¹èª¿å æ²¹ã鬿±è«å¦è¡è¨éã"]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1671",className:"mt-3 grid grid-cols-4 gap-1.5 text-center",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1672",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1672",className:`text-base font-bold ${t==="dark"?"text-amber-300":"text-amber-800"}`,children:Nt.calories}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1672",className:"text-[10px] text-muted-foreground",children:"kcal"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1673",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1673",className:`text-base font-bold ${t==="dark"?"text-sky-300":"text-sky-800"}`,children:[Nt.protein,"g"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1673",className:"text-[10px] text-muted-foreground",children:"èç½è³ª"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1674",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1674",className:`text-base font-bold ${t==="dark"?"text-emerald-300":"text-emerald-800"}`,children:[Nt.carbs,"g"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1674",className:"text-[10px] text-muted-foreground",children:"碳水"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1675",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1675",className:`text-base font-bold ${t==="dark"?"text-rose-300":"text-rose-800"}`,children:[Nt.fat,"g"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1675",className:"text-[10px] text-muted-foreground",children:"èèª"})]})]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1677",onClick:p1,disabled:xn.isPending||vo<=0,className:"mt-4 w-full bg-gradient-to-r from-amber-400 to-orange-500 text-slate-950 hover:from-amber-300 hover:to-orange-400",children:[xn.isPending?h.jsx(vr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1678",className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Fr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1678",className:"mr-2 h-4 w-4"}),"å å
¥é£²é£è¨é"]})]})]})})}),!f&&oe&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1688",className:`card-glass-subtle rounded-2xl border p-4 ${t==="dark"?"border-cyan-200/12":"border-zinc-200 bg-zinc-50/70"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1689",className:"flex items-center gap-2",children:[h.jsx(Pa,{"data-loc":"client/src/pages/FoodRecognition.tsx:1690",className:`h-4 w-4 ${t==="dark"?"text-cyan-200":"text-violet-700"}`}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1691",className:"text-sm font-semibold",children:"å
è£é£åæ¢ç¢¼"})]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1693",onClick:()=>ne(!0),variant:"outline",className:`mt-3 w-full ${t==="dark"?"border-cyan-300/30 bg-cyan-300/10 text-cyan-100 hover:bg-cyan-300/15":"border-cyan-500/35 bg-cyan-100/35 text-cyan-900 hover:bg-cyan-100/55"}`,children:[h.jsx(Pa,{"data-loc":"client/src/pages/FoodRecognition.tsx:1693",className:"mr-2 h-4 w-4"}),"éåç¸æ©ææ"]}
62),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1694",className:"mt-3 flex gap-2",children:[h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1695",value:Me,onChange:x=>sn(x.target.value.replace(/\D/g,"")),onKeyDown:x=>{x.key==="Enter"&&hl()},inputMode:"numeric",maxLength:14,placeholder:"ä¾å¦ 4890000000000",className:`input-fitdiet ${t==="dark"?"placeholder:text-zinc-500":"placeholder:text-slate-400"}`}),h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1704",onClick:hl,disabled:!Me||zn.isFetching,className:"shrink-0 bg-cyan-300 text-slate-950 shadow-[0_8px_18px_rgba(34,211,238,0.2)] hover:bg-cyan-200",children:zn.isFetching?h.jsx(vr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1705",className:"h-4 w-4 animate-spin"}):"æ¥è©¢"})]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1708",className:"mt-2 text-xs text-muted-foreground",children:"æ¯æ´ EANï¼UPC ç常è¦å
è£æ¢ç¢¼ï¼è³æåº«æªå¿
è¦èææé¦æ¸¯ç¢åã"})]}),zn.isError&&h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1713",className:"rounded-2xl border border-amber-400/30 bg-amber-400/10 p-4 text-sm text-amber-100",children:zn.error.message}),zn.data?.status==="not_found"&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1719",className:`rounded-2xl border p-4 ${t==="dark"?"border-white/10 bg-black/20 text-zinc-300":"border-zinc-200 bg-zinc-50 text-zinc-700"}`,children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1720",className:"font-semibold",children:"æµåå°å¢ä»¶å
è£é£å"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1721",className:"mt-1 text-sm text-muted-foreground",children:"ä½ å¯ä»¥å½±ç餿¨ç±¤ï¼AI æç´æ¥è®åå
è£ä¸å
æ¸å¼ï¼åæè
æå輸å
¥é£åè³æã"}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1722",onClick:()=>W.current?.click(),variant:"outline",className:`mt-3 border-amber-500/40 hover:bg-amber-500/10 ${t==="dark"?"text-amber-300":"text-amber-700"}`,children:[h.jsx(rp,{"data-loc":"client/src/pages/FoodRecognition.tsx:1723",className:"mr-2 h-4 w-4"}),"å½±ç餿¨ç±¤"]})]}),Pe&&wi&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1729",className:`card-ai-signal rounded-2xl p-4 ${t==="dark"?"border-cyan-300/18":"border-cyan-700/20"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1730",className:"flex gap-3",children:[Pe.imageUrl?h.jsx("img",{"data-loc":"client/src/pages/FoodRecognition.tsx:1731",src:Pe.imageUrl,alt:"ç¢åå
è£",className:"h-16 w-12 rounded-lg bg-white object-cover"}):h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1731",className:"flex h-16 w-12 items-center justify-center rounded-lg bg-violet-500/15",children:h.jsx(Pa,{"data-loc":"client/src/pages/FoodRecognition.tsx:1731",className:"h-5 w-5 text-violet-300"})}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1732",className:"min-w-0 flex-1",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1733",className:"truncate font-semibold",children:Pe.name}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1734",className:"mt-0.5 truncate text-xs text-muted-foreground",children:[Pe.brand,Pe.quantity].filter(Boolean).join(" · ")||"å
è£é£å"}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1735",className:"mt-1 text-[11px] text-muted-foreground",children:["便ºï¼",Pe.source,Pe.reviewedAt?` · æ ¸å°ï¼${Pe.reviewedAt}`:Pe.importedAt?` · å¯å
¥ï¼${Pe.importedAt}`:""]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1736",className:"mt-0.5 text-[11px] text-muted-foreground",children:Pe.sourceDetail||"è«ä»¥æä¸å
è£ç餿¨ç±¤çºæºã"}),Pe.sourceUrl&&h.jsx("a",{"data-loc":"client/src/pages/FoodRecognition.tsx:1738",href:Pe.sourceUrl,target:"_blank",rel:"noreferrer",className:`mt-1 inline-block text-[11px] underline underline-offset-2 ${t==="dark"?"text-cyan-200 hover:text-cyan-100":"text-cyan-700 hover:text-cyan-900"}`,children:"æ¥çç¢åè³æä¾æº"})]})]}),Pe.nutritionAvailable?h.jsxs(h.Fragment,{children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1746",className:"mt-4 grid grid-cols-2 gap-2",children:[h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1747",type:"button",onClick:()=>{Yt("100g"),Bt("100")},variant:"outline",className:`h-auto min-h-12 whitespace-normal border ${ya==="100g"?t==="dark"?"border-cyan-300/50 bg-cyan-300/12 text-cyan-100":"border-cyan-500/50 bg-cyan-50 text-cyan-800":t==="dark"?"border-white/10 text-muted-foreground":"border-slate-200 text-slate-600"}`,children:"æ¯ 100g"}),h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1748",type:"button",onClick:()=>{xo&&(Yt("serving"),Bt(String(bi)))},variant:"outline",disabled:!xo,className:`h-auto min-h-12 whitespace-normal border ${ya==="serving"?t==="dark"?"border-cyan-300/50 bg-cyan-300/12 text-cyan-100":"border-cyan-500/50 bg-cyan-50 text-cyan-800":t==="dark"?"border-white/10 text-muted-foreground":"border-slate-200 text-slate-600"}`,children:xo?`æ¯ä»½${Pe.servingSize?`ï¼${Pe.servingSize}ï¼`:""}`:"æªææ¯ä»½è³æ"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1750",className:"mt-3 flex items-center justify-between gap-3",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:1751",htmlFor:"barcode-portion",className:"text-sm font-medium",children:"ä½ é£åå¹¾å¤ï¼"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1752",className:`flex w-32 items-center rounded-xl border px-3 ${t==="dark"?"border-white/10 bg-black/20":"border-slate-200 bg-white/75"}`,children:[h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1753",id:"barcode-portion",value:pn,onChange:x=>Bt(x.target.value.replace(/[^\d.]/g,"")),inputMode:"decimal",className:"h-9 border-0 bg-transparent p-0 text-right shadow-none focus-visible:ring-0"}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1754",className:"ml-1 text-xs text-muted-foreground",children:"g"})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1757",className:"mt-4 grid grid-cols-4 gap-2 text-center",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1758",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1758",className:`text-lg font-bold ${t==="dark"?"text-amber-300":"text-amber-700"}`,children:qe?.calories??"â"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1758",className:"text-[11px] text-muted-foreground",children:"kcal"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1759",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1759",className:`text-lg font-bold ${t==="dark"?"text-sky-300":"text-sky-700"}`,children:[qe?.protein??"â","g"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1759",className:"text-[11px] text-muted-foreground",children:"èç½è³ª"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1760",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1760",className:`text-lg font-bold ${t==="dark"?"text-emerald-300":"text-emerald-700"}`,children:[qe?.carbs??"â","g"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1760",className:"text-[11px] text-muted-foreground",children:"碳水"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1761",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1761",className:`text-lg font-bold ${t==="dark"?"text-rose-300":"text-rose-700"}`,children:[qe?.fat??"â","g"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1761",className:"text-[11px] text-muted-foreground",children:"èèª"})]})]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1763",onClick:f1,disabled:xn.isPending,className:"mt-4 w-full bg-gradient-to-r from-amber-400 to-orange-500 text-slate-950 hover:from-amber-300 hover:to-orange-400",children:[xn.isPending?h.jsx(vr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1764",className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Fr,{"data-loc":"client/src/pages/FoodRecognition.tsx:1764",className:"mr-2 h-4 w-4"}),"å å
¥é£²é£è¨é"]})]}):h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1743",className:`mt-4 rounded-xl bg-amber-400/10 p-3 text-sm ${t==="dark"?"text-amber-200":"text-amber-800"}`,children:"ç¢åå·²æ¾å°ï¼ä½ä¸å¤§çé¤è³ææªå®æ´ã建è°å½±ç餿¨ç±¤
62å
è¨éã"})]}),a.length>0&&!f&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1772",className:"flex flex-col gap-3",children:[a.length>1&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1774",className:`rounded-2xl border p-4 ${ke?t==="dark"?"border-cyan-300/35 bg-cyan-300/[0.08]":"border-cyan-500/35 bg-cyan-50/55":t==="dark"?"border-white/10 bg-white/[0.035]":"border-slate-300/55 bg-white/30"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1775",className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1776",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1777",className:"text-sm font-semibold",children:"å¢å¹¾å¼µç¸ä¿åªä¸é½æ´å
ä¸é¤ï¼"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1778",className:"mt-1 text-xs text-muted-foreground",children:"éåå¾ï¼AI æèªåå辨æåãåææåå
è£ï¼åä½¿ä½ éå¼µåé¡ã"})]}),h.jsx(Wl,{"data-loc":"client/src/pages/FoodRecognition.tsx:1780",checked:ke,onCheckedChange:x=>{ar(x),x||kn(!1)},"aria-label":"åç¨æºè½é£è模å¼"})]}),ke&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1783",className:"mt-3 grid grid-cols-3 gap-2 text-center text-[11px]",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1784",className:`rounded-xl px-2 py-2 ${t==="dark"?"bg-black/20 text-cyan-100":"bg-white/55 text-cyan-900"}`,children:"1. AI æ´çç¸ç"}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1785",className:`rounded-xl px-2 py-2 ${t==="dark"?"bg-black/20 text-cyan-100":"bg-white/55 text-cyan-900"}`,children:"2. æç¸çå¢ä»½è¨é"}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1786",className:`rounded-xl px-2 py-2 ${t==="dark"?"bg-black/20 text-cyan-100":"bg-white/55 text-cyan-900"}`,children:"3. åªæ ¸å°çé»"})]})]}),a.length>0&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1794",className:"space-y-1.5",children:[ke&&h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1796",type:"button",onClick:()=>ua(x=>!x),className:"text-xs font-medium text-cyan-700 underline underline-offset-4 dark:text-cyan-200",children:Tr?"æ¶èµ·éå¼µç¸çè¨å®":"AI å忏
å
æ³ï¼éå¼µæå®ç¸çç¨é"}),(!ke||Tr)&&h.jsxs(h.Fragment,{children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1801",className:"text-xs text-muted-foreground",children:"ç¸çé¡åï¼é»æåæï¼é£ç©ç¸ â é¤ç â ç餿¨ç±¤ â æ¶æï¼é»èç´ â åææï¼"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1802",className:"flex flex-wrap gap-2",children:a.map((x,I)=>{const j=z[I]||"food",O={food:"ð´ é£ç©ç¸",menu:"ð½ï¸ é¤ç/èå®",nutrition_label:"ð·ï¸ ç餿¨ç±¤",receipt:"ð§¾ æ¶æ/é»èç´",raw_ingredient:"ð¾ åææ"},B={food:t==="dark"?"bg-blue-900/40 border-blue-600/50 text-blue-300":"bg-blue-50 border-blue-300 text-blue-700",menu:t==="dark"?"bg-violet-900/40 border-violet-600/50 text-violet-300":"bg-violet-50 border-violet-300 text-violet-700",nutrition_label:t==="dark"?"bg-amber-900/40 border-amber-600/50 text-amber-300":"bg-amber-50 border-amber-300 text-amber-700",receipt:t==="dark"?"bg-green-900/40 border-green-600/50 text-green-300":"bg-green-50 border-green-300 text-green-700",raw_ingredient:t==="dark"?"bg-cyan-900/40 border-cyan-600/50 text-cyan-200":"bg-cyan-50 border-cyan-300 text-cyan-800"};return h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1820",type:"button",onClick:()=>L(H=>({...H,[I]:Kx(j)})),className:`flex items-center gap-1 px-2.5 py-1 rounded-full border text-xs font-medium transition-colors ${B[j]||B.food}`,children:[h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1826",children:["ç¸",I+1]}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1827",children:O[j]})]},I)})})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1835",className:"flex gap-3",children:[h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1836",onClick:()=>k.current?.click(),variant:"outline",className:"flex-1",children:[h.jsx(Ea,{"data-loc":"client/src/pages/FoodRecognition.tsx:1841",className:"w-4 h-4 mr-2"}),"å å¤å¼µç¸"]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1844",onClick:()=>G.current?.click(),variant:"outline",className:"flex-1",children:[h.jsx(Po,{"data-loc":"client/src/pages/FoodRecognition.tsx:1849",className:"w-4 h-4 mr-2"}),"åå½±å¤å¼µ"]})]})]}),h.jsx("input",{"data-loc":"client/src/pages/FoodRecognition.tsx:1856",ref:k,type:"file",accept:"image/*,.heic,.heif",multiple:!0,onChange:x=>Oi(x,"food"),className:"hidden"}),h.jsx("input",{"data-loc":"client/src/pages/FoodRecognition.tsx:1864",ref:G,type:"file",accept:"image/*,.heic,.heif",onChange:x=>Oi(x,"food"),className:"hidden"}),h.jsx("input",{"data-loc":"client/src/pages/FoodRecognition.tsx:1871",ref:W,type:"file",accept:"image/*,.heic,.heif",multiple:!0,onChange:x=>Oi(x,"nutrition_label"),className:"hidden"}),a.length>0&&!f&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1881",className:"space-y-3",children:[ke&&st&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1883",className:`rounded-2xl border p-4 ${t==="dark"?"border-cyan-300/35 bg-cyan-300/[0.08]":"border-cyan-500/35 bg-cyan-50/55"}`,children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1884",className:"text-sm font-semibold",children:"大份é£èï¼åé¤å
è¨å®"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1885",className:"mt-3 grid grid-cols-2 gap-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1886",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:1887",htmlFor:"recipe-servings",className:"text-xs",children:"æ´å幾份ï¼"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1888",id:"recipe-servings",inputMode:"numeric",value:or,onChange:x=>Zt(x.target.value.replace(/\D/g,"")),className:"input-fitdiet mt-1"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1890",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:1891",htmlFor:"recipe-eaten",className:"text-xs",children:"ä½ é£å幾份ï¼"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1892",id:"recipe-eaten",inputMode:"numeric",value:
62Bn,onChange:x=>ir(x.target.value.replace(/\D/g,"")),className:"input-fitdiet mt-1"})]})]})]}),ke&&!st&&h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1898",type:"button",onClick:()=>kn(!0),className:`w-full rounded-xl border px-3 py-2.5 text-left text-xs font-medium transition-colors ${t==="dark"?"border-white/10 bg-white/[0.04] text-zinc-300 hover:border-cyan-300/35 hover:text-cyan-100":"border-zinc-200 bg-white/65 text-zinc-600 hover:border-cyan-500/35 hover:text-cyan-800"}`,children:"仿¬¡ä¿æ´å¤§ä»½ï¼è¦åé¤ï¼å
è¨å®ä»½æ¸"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1906",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:1907",className:"text-sm text-muted-foreground",children:ke?"æåææç¨éï¼ç¹èª¿è£å
ï¼ï¼å»ºè°å¡«ï¼":"æåè£å
è³æï¼ï¼å¯é¸ï¼"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1910",placeholder:ke?"ä¾å¦ï¼2 å¡é¤
ç®ã1 å
è¹èã2 湯åé¬ã2 çè士ï¼åç¨æ²¹":"ä¾å¦ï¼å¢åä¿èé¤é£å
ãå¤è³£ãèªå·±ç
®...",value:_,onChange:x=>A(x.target.value),className:"mt-1"})]}),h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:1918",onClick:yl,disabled:c,className:"w-full h-12 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-lg font-semibold",children:c?h.jsxs(h.Fragment,{children:[h.jsx(ki,{"data-loc":"client/src/pages/FoodRecognition.tsx:1925",className:"w-5 h-5 mr-2"}),"AI åæç·..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Xn,{"data-loc":"client/src/pages/FoodRecognition.tsx:1930",className:"w-5 h-5 mr-2"}),"éå§åæ"]})})]})]})}),f&&f.hasReceiptMode&&Ln&&f.receiptItems&&f.foodPhotoItems&&h.jsxs(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:1942",className:"mb-6 card-premium",children:[h.jsxs(_o,{"data-loc":"client/src/pages/FoodRecognition.tsx:1943",className:"pb-3",children:[h.jsxs(Ao,{"data-loc":"client/src/pages/FoodRecognition.tsx:1944",className:`text-lg flex items-center gap-2 ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1947",className:"text-xl",children:"ð§¾"}),"æ¶æå°æ¯ç¢ºèª"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1950",className:`text-xs ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:"è«ç¢ºèªæ¯é
æ¶æèå¼å°æåªå¼µé£ç©ç¸ï¼æä¸»å鏿 AI ä¼°ç®ï¼æªç¢ºèªé
ç®æ«æä¸æè¨å
¥ç±é"})]}),h.jsxs($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:1954",className:"space-y-4",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1956",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:1957",className:`text-xs font-semibold mb-2 ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:"ð· é£ç©ç¸èå¥å°çé£ç©"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1960",className:"space-y-1.5",children:f.foodPhotoItems.map((x,I)=>h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1962",className:`flex items-center gap-2 p-2.5 rounded-xl border text-sm ${V.has(x.id)?t==="dark"?"border-zinc-700/30 bg-zinc-800/30 opacity-40":"border-zinc-200 bg-zinc-100 opacity-40":t==="dark"?"border-zinc-700/60 bg-white/5":"border-zinc-200 bg-zinc-50"}`,children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1970",className:`w-5 h-5 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0 ${t==="dark"?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-600"}`,children:I+1}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:1973",className:"flex-1 min-w-0",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1974",className:`font-medium truncate block ${t==="dark"?"text-zinc-200":"text-zinc-700"}`,children:x.name}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:1977",className:"text-orange-400 text-xs",children:[x.calories," kcal"]})]}),h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:1979",type:"button",onClick:()=>K(j=>{const O=new Set(j);return O.has(x.id)?O.delete(x.id):O.add(x.id),O}),className:`text-xs px-2 py-1 rounded-lg flex-shrink-0 ${V.has(x.id)?"bg-zinc-500/20 text-zinc-400":t==="dark"?"bg-red-500/15 text-red-400 hover:bg-red-500/25":"bg-red-50 text-red-500 hover:bg-red-100"}`,children:V.has(x.id)?"æ¢å¾©":"ç§»é¤"})]},x.id))})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2001",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2002",className:`text-xs font-semibold mb-2 ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:"ð§¾ æ¶æé
ç®å¹é
ï¼å¯å¤é¸é£ç©ç¸é
ç®ï¼ç±éæå 總ï¼"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2005",className:"space-y-3",children:f.receiptItems.map(x=>{const I=ae[x.id]??"skip",j=I==="use_estimate",O=I==="skip",B=j||O?[]:I,H=f.foodPhotoItems.filter(q=>B.includes(q.id)),Be=H.reduce((q,ge)=>q+ge.calories,0),J=H.reduce((q,ge)=>q+ge.protein,0),Y=H.reduce((q,ge)=>q+ge.carbs,0),ie=H.reduce((q,ge)=>q+ge.fat,0),he=q=>{U(ge=>{const rt=ge[x.id],me=rt==="use_estimate"||rt==="skip"?[]:[...rt],Qe=me.indexOf(q);return Qe>=0?me.splice(Qe,1):me.push(q),{...ge,[x.id]:me.length>0?me:"use_estimate"}})};return h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2028",className:`p-3 rounded-xl border ${t==="dark"?"border-zinc-700/60 bg-white/5":"border-zinc-200 bg-zinc-50"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2032",className:"flex items-start gap-2 mb-2",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2033",className:`text-sm font-semibold flex-1 ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:x.receiptName}),x.quantity>1&&h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2037",className:`text-xs px-1.5 py-0.5 rounded-full flex-shrink-0 ${t==="dark"?"bg-zinc-700 text-zinc-400":"bg-zinc-200 text-zinc-500"}`,children:["Ã",x.quantity]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2043",className:"flex flex-wrap gap-1.5",children:[h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2044",type:"button",onClick:()=>U(q=>({...q,[x.id]:"skip"})),className:`text-xs px-2.5 py-1.5 rounded-lg border transition-all ${O?"border-zinc-500 bg-zinc-500/20 text-zinc-300 font-semibold":t==="dark"?"border-zinc-600 text-zinc-400 hover:border-zinc-500":"border-zinc-300 text-zinc-500 hover:border-zinc-400"}`,children:"æ«ä¸å å
¥"}),h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2056",type:"button",onClick:()=>U(q=>({...q,[x.id]:"use_estimate"})),className:`text-xs px-2.5 py-1.5 rounded-lg border transition-all ${j?"border-amber-500 bg-amber-500/20 text-amber-400 font-semibold":t==="dark"?"border-zinc-600 text-zinc-400 hover:border-amber-500/50":"border-zinc-300 text-zinc-500 hover:border-amber-400"}`,children:["⨠AIä¼°ç® ",x.estimatedCalories,"kcal"]}),f.foodPhotoItems.map((q,ge)=>{const rt=B.includes(q.id);return h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2071",type:"button",disabled:V.has(q.id),onClick:()=>he(q.id),className:`text-xs px-2.5 py-1.5 rounded-lg border transition-all ${V.has(q.id)?"opacity-30 curs
62or-not-allowed border-zinc-700 text-zinc-500":rt?"border-blue-500 bg-blue-500/20 text-blue-400 font-semibold":t==="dark"?"border-zinc-600 text-zinc-400 hover:border-blue-500/50":"border-zinc-300 text-zinc-500 hover:border-blue-400"}`,children:[rt?"âï¸":"","ð·ç¸",ge+1," ",q.name," ",q.calories,"kcal"]},q.id)})]}),!j&&H.length>0&&(()=>{const q=ul+Be,ge=dl+ie,rt=Dr>0?q/Dr:0,me=wa>0?ge/wa:0,Qe=rt>1,Wn=!Qe&&rt>.8,Aa=me>1,Pi=!Aa&&me>.8;return h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2100",className:"mt-1.5 space-y-1",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2101",className:`text-xs ${t==="dark"?"text-blue-400":"text-blue-600"}`,children:["âï¸ å·²é¸ ",H.length," é
",H.length>1&&h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2105",className:"ml-1 opacity-70",children:["(",H.map(N1=>N1.name).join(" + "),")"]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2108",className:"flex flex-wrap gap-x-3 gap-y-0.5",children:[h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2109",className:`text-xs font-semibold ${Qe?"text-red-500":Wn?"text-amber-400":t==="dark"?"text-orange-400":"text-orange-600"}`,children:["ç±é ",Be," kcal",Qe?" â ï¸":Wn?" ð¡":""]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2112",className:`text-xs ${t==="dark"?"text-blue-300":"text-blue-600"}`,children:["èç½ ",J,"g"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2115",className:`text-xs ${t==="dark"?"text-green-300":"text-green-600"}`,children:["碳水 ",Y,"g"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2118",className:`text-xs font-semibold ${Aa?"text-red-500":Pi?"text-amber-400":t==="dark"?"text-red-300":"text-red-500"}`,children:["èèª ",ie,"g",Aa?" â ï¸":Pi?" ð¡":""]})]}),Qe&&h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2124",className:"text-xs text-red-500 font-semibold",children:["â ï¸ å å
¥å¾ä»æ¥ç±éå°è¶
æ¨ï¼é è¨ ",Math.round(q)," kcalï¼ç®æ¨ ",Math.round(Dr)," kcal"]}),!Qe&&Wn&&h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2127",className:"text-xs text-amber-400",children:["ð¡ æ¥è¿ç±éä¸éï¼é è¨ ",Math.round(q)," kcalï¼",Math.round(Dr)," kcal"]}),Aa&&h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2130",className:"text-xs text-red-500 font-semibold",children:["â ï¸ å å
¥å¾ä»æ¥èèªå°è¶
æ¨ï¼é è¨ ",Math.round(ge),"gï¼ç®æ¨ ",Math.round(wa),"g"]}),!Aa&&Pi&&h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2133",className:"text-xs text-amber-400",children:["ð¡ æ¥è¿èèªä¸éï¼é è¨ ",Math.round(ge),"gï¼",Math.round(wa),"g"]})]})})(),j&&h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2139",className:`text-xs mt-1.5 ${t==="dark"?"text-amber-400":"text-amber-600"}`,children:["⨠å°ç¨ AI ä¼°ç®ç±é (",x.estimatedCalories," kcal)"]}),O&&h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2144",className:"text-xs mt-1.5 text-muted-foreground",children:"æ«æªç¢ºèªï¼åæè¨å
¥ä»é¤ç±éã"})]},x.id)})})]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2153",onClick:()=>{if(!f.foodPhotoItems||!f.receiptItems)return;const x=[],I=new Set;if(f.receiptItems.forEach((O,B)=>{const H=ae[O.id]??"skip";if(H!=="skip")if(H==="use_estimate")x.push({id:Date.now()+B,name:O.receiptName,brand:null,cookingMethod:null,estimated_grams:O.estimatedGrams,calories:O.estimatedCalories,protein:O.estimatedProtein,carbs:O.estimatedCarbs,fat:O.estimatedFat,confidence:.7,main_ingredients:[],notes:"AI ä¼°ç®ï¼æ¶æé
ç®ï¼"});else{const Be=H,J=f.foodPhotoItems.filter(me=>Be.includes(me.id));if(J.length===0)return;J.forEach(me=>I.add(me.id));const Y=J.reduce((me,Qe)=>me+Qe.calories,0),ie=J.reduce((me,Qe)=>me+Qe.protein,0),he=J.reduce((me,Qe)=>me+Qe.carbs,0),q=J.reduce((me,Qe)=>me+Qe.fat,0),ge=J.reduce((me,Qe)=>me+Qe.estimated_grams,0),rt=J.length>1?`ç±éä¾èªé£ç©ç¸ï¼${J.map(me=>me.name).join(" + ")}`:J.length===1?`ç±éä¼°ç®ä¾èªé£ç©ç¸ã${J[0].name}ã`:"AI ä¼°ç®";x.push({id:Date.now()+B,name:O.receiptName,brand:J[0]?.brand||null,cookingMethod:J[0]?.cookingMethod||null,estimated_grams:ge||O.estimatedGrams,calories:Y||O.estimatedCalories,protein:ie||O.estimatedProtein,
62carbs:he||O.estimatedCarbs,fat:q||O.estimatedFat,confidence:J[0]?.confidence||.7,main_ingredients:J.flatMap(me=>me.main_ingredients),notes:rt})}}),f.foodPhotoItems.forEach(O=>{!I.has(O.id)&&!V.has(O.id)&&x.push({...O,id:Date.now()+O.id})}),x.length===0){_e.error("è«è³å°ç¢ºèªä¸é
æ¶æèå¼ï¼æè
鏿 AI ä¼°ç®");return}const j={totalCalories:x.reduce((O,B)=>O+B.calories,0),totalProtein:x.reduce((O,B)=>O+B.protein,0),totalCarbs:x.reduce((O,B)=>O+B.carbs,0),totalFat:x.reduce((O,B)=>O+B.fat,0)};if(p(O=>O&&{...O,dishes:x,...j,hasReceiptMode:!1}),Or(!1),x.length>0){const O=x[0];m({id:O.id,foodName:O.name,brand:O.brand,cookingMethod:O.cookingMethod,quantity:`${O.estimated_grams}g`,calories:O.calories,protein:O.protein,carbs:O.carbs,fat:O.fat,ingredients:O.main_ingredients.join(", "),confidence:Math.round(O.confidence*100),healthComment:O.notes||""}),S(f.suggestedMealType||"lunch"),f.restaurantName&&go(f.restaurantName)}_e.success(`å¹é
宿ï¼å
± ${x.length} 樣é£ç© â
`)},className:"w-full h-11 bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white font-semibold",children:[h.jsx(Fr,{"data-loc":"client/src/pages/FoodRecognition.tsx:2258",className:"w-4 h-4 mr-2"}),"確èªå¹é
ï¼æ¥çåä½µçµæ"]})]})]}),f&&Fi&&!Ln&&!f.hasReceiptMode&&h.jsx(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:2267",className:"mb-6 card-premium overflow-hidden",children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2268",className:"relative",children:[h.jsx("img",{"data-loc":"client/src/pages/FoodRecognition.tsx:2269",src:Fi,alt:"é£ç©ç¸ç",className:"w-full h-48 object-cover"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2274",className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2275",className:"absolute bottom-3 left-4 right-4",children:h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2276",className:"text-white text-sm font-medium",children:"ð· ä½ å½±å
é£ç©"})})]})}),f&&f.dishes&&f.dishes.length>0&&!w&&!Ln&&h.jsxs(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:2284",className:"mb-6 card-premium",children:[h.jsxs(_o,{"data-loc":"client/src/pages/FoodRecognition.tsx:2285",className:"pb-3",children:[h.jsxs(Ao,{"data-loc":"client/src/pages/FoodRecognition.tsx:2286",className:`text-lg flex items-center gap-2 ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:[h.jsx(Fr,{"data-loc":"client/src/pages/FoodRecognition.tsx:2289",className:"w-5 h-5 text-green-500"}),"ä¸é¤ç¸½çµ"]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2292",className:"flex items-center gap-2 flex-wrap",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2293",className:`text-sm ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:ke&&st?`èªè£½é£èï¼æ´ä»½å ${fr} 份ï¼ä»é¤è¨é ${hr} 份`:`å
± ${f.dishes.filter(x=>!x.brand?.includes("[æ¶æ]")).length} 樣é£ç©ï¼æå
¥å»æ¹/åª`}),n.length>1&&h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2297",className:"text-xs px-2 py-0.5 rounded-full bg-blue-500/20 text-blue-400",children:["ð· æ¬é¤å
± ",n.length," å¼µç¸"]}),n.some((x,I)=>z[I]==="receipt")&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2302",className:"text-xs px-2 py-0.5 rounded-full bg-green-500/20 text-green-400",children:"ð§¾ å«æ¶æé
ç®"}),f.hasOrderEvidenceMode&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2307",className:"text-xs px-2 py-0.5 rounded-full bg-cyan-500/20 text-cyan-300",children:"é¤çï¼æ¶æå·²åä½µ"})]}),ke&&st&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2313",className:`mt-3 rounded-xl border px-3 py-2 text-center text-xs ${t==="dark"?"border-cyan-300/20 bg-cyan-300/[0.07] text-cyan-100":"border-cyan-500/25 bg-cyan-50/55 text-cyan-900"}`,children:["æ´ä»½é£èç´ ",Ot.calories," kcal · æ¬æ¬¡ ",hr,"/",fr," ä»½å·²ææ¯ä¾è¨å
¥"]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2318",className:"text-center py-3",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2319",className:`text-4xl font-bold ${t==="dark"?"text-orange-400":"text-orange-600"}`,children:De(Ot.calories)}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2324",className:`text-lg ml-1 ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:"kcal"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2325",className:"text-xs text-muted-foreground mt-1",children:ke&&st?`æ¬æ¬¡é£ç¨ ${hr} 份ï¼è«æ ¸å°æ¯é
實éç¨é`:"AI ä¼°ç®ï¼è«èªè¡æ ¸å°ä»½é"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2328",className:"flex justify-center gap-4 text-sm font-medium",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2329",className:"text-green-400",children:Ti("protein","èç½")}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2330",className:"text-yellow-400",children:Ti("carbs","碳水")}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2331",className:"text-red-400",children:Ti("fat","èèª")})]}),f.hasOrderEvidenceMode&&h.jsx(kr,{"data-loc":"client/src/pages/FoodRecognition.tsx:2334",open:mn,onOpenChange:jn,children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2335",className:`mt-3 rounded-xl border px-3 py-2 text-left text-xs ${t==="dark"?"border-cyan-300/20 bg-cyan-300/[0.07] text-cyan-100":"border-cyan-500/25 bg-cyan-50/60 text-cyan-900"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2336",className:"flex items-center justify-between gap-3",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2337",className:"font-semibold",children:"é¤çåèµ°æå·²å¥ç¨"}),h.jsx(Na,{"data-loc":"client/src/pages/FoodRecognition.tsx:2338",asChild:!0,children:h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2339",type:"button",className:"shrink-0 font-semibold underline underline-offset-2",children:mn?"æ¶èµ·":"黿¨£è¨ï¼"})})]}),h.jsx(Br,{"data-loc":"client/src/pages/FoodRecognition.tsx:2342",children:h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2343",className:"mt-2 leading-relaxed",children:"é¤çå®åºæºææï¼æ¶æèçãèµ°ï¼å ï¼å°ãï¼é£ç©ç¸åªåå©ä¼°ä»½éã"})})]})})]}),h.jsxs($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:2349",className:"space-y-3",children:[Ii&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2350",className:`rounded-xl border px-3 py-2 text-xs leading-relaxed ${t==="dark"?"border-amber-200/20 bg-amber-300/10 text-amber-100":"border-amber-700/15 bg-amber-50/60 text-amber-900"}`,children:["AI å·²è®å°ç±éï¼ä½",Ri.length?Ri.map(x=>g1[x]).join("ã"):"ä¸å¤§çé¤ç´ åç±é","è³ææªå®æ´ï¼æ£ç¢ºå¼åæè©²ç¶æ 0gãè«éæ°åæä¸æ¬¡ï¼æè
åºä¸æ¹çºé£æè£å
å
è£ï¼ä»½éè³æã"]}),Si&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2352",className:`rounded-xl border p-3 ${t==="dark"?"border-cyan-300/20 bg-cyan-300/[0.07]":"border-cyan-500/25 bg-cyan-50/60"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2353",className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2354",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2355",className:`text-sm font-semibold ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:"æå飲湯ï¼"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2356",className:`mt-0.5 text-xs ${t==="dark"?"text-zinc-400":"text-zinc-600"}`,children:"åªæèª¿æ´æ¹¯åºï¼ç±³ç·åé
æåè®ã"})]}),ml&&h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2358",className:`shrink-0 rounded-full px-2 py-1 text-xs font-semibold ${t==="dark"?"bg-cyan-300/15 text-cyan-100":"bg-cyan-100 text-cyan-900"}`,children:["å·²é¸ï¼",ml]})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2360",className:"mt-3 grid grid-cols-4 gap-2",children:nc.map(x=>h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2362",type:"button",onClick:()=>
62sr(x.value),className:`rounded-lg border px-2 py-2 text-xs font-semibold transition-colors ${Wt===x.value?t==="dark"?"border-cyan-300/70 bg-cyan-300/15 text-cyan-100":"border-cyan-600 bg-cyan-100 text-cyan-950":t==="dark"?"border-white/10 bg-black/10 text-zinc-300 hover:border-white/25":"border-zinc-200 bg-white/70 text-zinc-700 hover:border-zinc-300"}`,children:x.label},x.value))}),Wt==="unknown"&&h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2374",className:`mt-2 text-xs ${t==="dark"?"text-amber-200":"text-amber-800"}`,children:"æä¸åå
å¯ä»¥å²åï¼é¿å
å°æªé£²ç湯è¨å
¥ã"})]}),h.jsx(t8,{"data-loc":"client/src/pages/FoodRecognition.tsx:2377",theme:t,totals:{calories:De(Ot.calories),protein:De(Ot.protein),carbs:De(Ot.carbs),fat:De(Ot.fat)},macroStatus:Ii||f.macroStatus==="incomplete"?"incomplete":"complete",wholeRecipeCalories:ke?Ot.calories:void 0,servingLabel:ke?`é£å ${hr}/${fr} 份`:void 0,ingredients:f.dishes.map(x=>({name:x.name,calories:De(Ca(x))}))}),f.dishes.map(x=>h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2392",className:`w-full text-left p-4 rounded-xl border-2 transition-all duration-200 cursor-pointer ${g?.id===x.id?t==="dark"?"border-blue-500 bg-blue-500/15":"border-blue-500 bg-blue-50":t==="dark"?"border-white/10 bg-white/5 backdrop-blur-sm hover:border-white/20":"border-zinc-200 bg-zinc-50 hover:border-zinc-300"}`,onClick:()=>y1(x),children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2405",className:"flex items-start justify-between",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2406",className:"flex-1",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2407",className:"flex items-center gap-2 mb-1 flex-wrap",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2408",className:`font-semibold ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:x.name}),x.brand?.includes("[æ¶æ]")&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2410",className:"text-xs px-2 py-0.5 rounded-full bg-green-500/20 text-green-400 font-semibold",children:"ð§¾ æ¶æ"}),x.brand&&!x.brand.includes("[æ¶æ]")&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2415",className:"text-xs px-2 py-0.5 rounded-full bg-purple-500/20 text-purple-400",children:x.brand}),x.cookingMethod&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2420",className:"text-xs px-2 py-0.5 rounded-full bg-orange-500/20 text-orange-400",children:x.cookingMethod}),a.length>1&&yi[x.id]!==void 0&&h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2426",className:"text-xs px-1.5 py-0.5 rounded-full bg-blue-500/15 text-blue-400",children:["ç¸",yi[x.id]+1]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2430",className:`text-xs px-2 py-0.5 rounded-full ${x.confidence>=.8?"bg-green-500/20 text-green-400":x.confidence>=.6?"bg-yellow-500/20 text-yellow-400":"bg-red-500/20 text-red-400"}`,children:[Math.round(x.confidence*100),"%"]})]}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2440",className:`text-sm mb-1 ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:["ç´ ",x.estimated_grams,"g"]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2441",className:"flex gap-3 text-xs font-medium",children:[h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2442",className:"text-orange-400",children:[Ca(x)," kcal"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2443",className:"text-green-400",children:["èç½ ",wo(x),"g"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2444",className:"text-yellow-400",children:["碳水 ",bo(x),"g"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2445",className:"text-red-400",children:["èèª ",Co(x),"g"]})]}),x.ingredientBreakdown&&x.ingredientBreakdown.length>0&&h.jsxs(kr,{"data-loc":"client/src/pages/FoodRecognition.tsx:2448",open:cr,onOpenChange:lr,children:[h.jsx(Na,{"data-loc":"client/src/pages/FoodRecognition.tsx:2449",asChild:!0,children:h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2450",type:"button",onClick:I=>I.stopPropagation(),className:`mt-3 flex w-full items-center justify-between rounded-lg px-2.5 py-2 text-xs font-semibold ${t==="dark"?"bg-white/5 text-zinc-300 hover:bg-white/10":"bg-zinc-100 text-zinc-700 hover:bg-zinc-200"}`,children:[h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2451",children:["æææç´°ï¼",x.ingredientBreakdown.length," é
ï¼"]}),cr?h.jsx(Rl,{"data-loc":"client/src/pages/FoodRecognition.tsx:2452",className:"h-4 w-4"}):h.jsx(bs,{"data-loc":"client/src/pages/FoodRecognition.tsx:2452",className:"h-4 w-4"})]})}),h.jsx(Br,{"data-loc":"client/src/pages/FoodRecognition.tsx:2455",onClick:I=>I.stopPropagation(),children:h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2456",className:`mt-2 overflow-hidden rounded-xl border ${t==="dark"?"border-white/10 bg-black/15":"border-zinc-200 bg-white/70"}`,children:h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2457",className:"divide-y divide-zinc-200/60 dark:divide-white/10",children:x.ingredientBreakdown.map((I,j)=>{const O=I.status==="included",B=I.status==="removed",H=O&&I.source.includes("èªåæ"),Be=H?"å·²ç¨é è¨":O?"å·²è¨å
¥":B?"已移é¤":"å¾
確èª",J=O?H?t==="dark"?"bg-cyan-300/15 text-cyan-100":"bg-cyan-50 text-cyan-800":t==="dark"?"bg-emerald-400/15 text-emerald-200":"bg-emerald-50 text-emerald-700":B?t==="dark"?"bg-zinc-500/20 text-zinc-300":"bg-zinc-100 text-zinc-600":t==="dark"?"bg-amber-300/15 text-amber-100":"bg-amber-50 text-amber-800";return h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2471",className:`px-3 py-2.5 ${B?"opacity-60":""}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2472",className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2473",className:"min-w-0",children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2474",className:`text-xs font-medium ${B?"line-through":""} ${t==="dark"?"text-zinc-100":"text-zinc-800"}`,children:[I.name,I.estimatedGrams>0?` · ç´ ${I.estimatedGrams}g`:""]}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2477",className:"mt-0.5 text-[11px] text-zinc-500",children:["便ºï¼",I.source]})]}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2479",className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold ${J}`,children:Be})]}),O?h.jsxs(h.Fragment,{children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2483",className:"mt-1.5 flex flex-wrap gap-x-2.5 gap-y-0.5 text-[11px] font-medium",children:[h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2484",className:"text-orange-500",children:[I.calories," kcal"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2485",className:"text-green-500",children:["è
62ç½ ",I.protein,"g"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2486",className:"text-yellow-600",children:["碳水 ",I.carbs,"g"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2487",className:"text-red-500",children:["èèª ",I.fat,"g"]})]}),H&&h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2489",className:`mt-1 text-[11px] ${t==="dark"?"text-cyan-100/70":"text-cyan-800/80"}`,children:"å·²æå¸¸è¦ä»½éè¨å
¥ï¼æé¡¯é£å¤ï¼é£å°å
ç¨ä¸æ¹ä»½é調æ´ã"})]}):h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2492",className:"mt-1 text-[11px] text-zinc-500",children:"æªè¨å
¥æ¬é¤çé¤"})]},`${x.id}-breakdown-${j}`)})})})})]})]}),h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2504",type:"button",onClick:I=>{I.stopPropagation(),S1(x.id)},className:`ml-2 p-1.5 rounded-lg transition-colors ${t==="dark"?"hover:bg-red-500/20 text-zinc-500 hover:text-red-400":"hover:bg-red-50 text-zinc-400 hover:text-red-500"}`,children:h.jsx(za,{"data-loc":"client/src/pages/FoodRecognition.tsx:2511",className:"w-4 h-4"})})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2516",className:"mt-2 pt-2 border-t border-zinc-700/20",onClick:I=>I.stopPropagation(),children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2517",className:"flex items-center justify-between",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2518",className:`text-xs ${t==="dark"?"text-zinc-500":"text-zinc-400"}`,children:"份é"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2519",className:"flex items-center gap-2",children:[h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2520",type:"button",onClick:()=>ma(I=>({...I,[x.id]:Math.max(25,(I[x.id]||100)-10)})),className:`w-7 h-7 rounded-full flex items-center justify-center border transition-colors ${t==="dark"?"border-zinc-600 hover:border-zinc-500 text-zinc-400":"border-zinc-300 hover:border-zinc-400 text-zinc-500"}`,children:h.jsx(ep,{"data-loc":"client/src/pages/FoodRecognition.tsx:2527",className:"w-3 h-3"})}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2529",className:`text-sm font-bold min-w-[40px] text-center ${Mr(x.id)!==100?"text-blue-400":t==="dark"?"text-zinc-300":"text-zinc-600"}`,children:[Mr(x.id),"%"]}),h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2536",type:"button",onClick:()=>ma(I=>({...I,[x.id]:Math.min(300,(I[x.id]||100)+10)})),className:`w-7 h-7 rounded-full flex items-center justify-center border transition-colors ${t==="dark"?"border-zinc-600 hover:border-zinc-500 text-zinc-400":"border-zinc-300 hover:border-zinc-400 text-zinc-500"}`,children:h.jsx(Ea,{"data-loc":"client/src/pages/FoodRecognition.tsx:2543",className:"w-3 h-3"})})]})]})}),x.notes&&h.jsxs(kr,{"data-loc":"client/src/pages/FoodRecognition.tsx:2550",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2551",className:`mt-2 flex items-start justify-between gap-2 text-xs ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,onClick:I=>I.stopPropagation(),children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2552",className:"min-w-0",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2552",className:"font-semibold",children:"ä¼°ç®éé»ï¼"}),xl(x.notes)]}),h.jsx(Na,{"data-loc":"client/src/pages/FoodRecognition.tsx:2553",asChild:!0,children:h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2553",type:"button",className:"shrink-0 font-semibold underline underline-offset-2",children:"詳æ
"})})]}),h.jsx(Br,{"data-loc":"client/src/pages/FoodRecognition.tsx:2555",onClick:I=>I.stopPropagation(),children:h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2556",className:"mt-1 text-xs leading-relaxed text-zinc-500",children:x.notes})})]})]},x.id)),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2564",className:`p-3 rounded-xl border mt-2 ${t==="dark"?"border-zinc-700/60 bg-white/5":"border-zinc-200 bg-zinc-50"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2567",className:"flex items-center justify-between mb-2",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2568",className:`text-sm font-medium ${t==="dark"?"text-zinc-300":"text-zinc-600"}`,children:"å
¨å±ä»½é調æ´"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2569",className:`text-sm font-bold ${t==="dark"?"text-blue-400":"text-blue-600"}`,children:[Un,"%"]})]}),h.jsx(Sl,{"data-loc":"client/src/pages/FoodRecognition.tsx:2571",value:[Un],onValueChange:x=>nl(x[0]),min:25,max:200,step:5,className:"w-full"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2579",className:"flex justify-between text-xs mt-1",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2580",className:t==="dark"?"text-zinc-500":"text-zinc-400",children:"25%"}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2581",className:t==="dark"?"text-zinc-500":"text-zinc-400",children:"200%"})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2586",className:`p-3 rounded-xl border ${t==="dark"?"border-zinc-700/60 bg-white/5":"border-zinc-200 bg-zinc-50"}`,children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2589",className:`text-sm font-medium ${t==="dark"?"text-zinc-300":"text-zinc-600"}
62`,children:"é¤å»³åï¼å¯ç空ï¼"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2590",placeholder:"ä¾å¦ï¼ç¿ è¯è¶é¤å»³ã大家æ¨ãèªå·±ç
®",value:po,onChange:x=>go(x.target.value),className:"mt-1"})]}),f.overallComment&&h.jsx(kr,{"data-loc":"client/src/pages/FoodRecognition.tsx:2599",children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2600",className:`p-3 rounded-xl border mt-2 ${t==="dark"?"bg-amber-500/10 border-amber-500/30":"bg-amber-50 border-amber-200"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2605",className:`text-sm font-medium flex items-start gap-2 ${t==="dark"?"text-amber-400":"text-amber-700"}`,children:[h.jsx(Xn,{"data-loc":"client/src/pages/FoodRecognition.tsx:2608",className:"w-4 h-4 mt-0.5 flex-shrink-0 text-amber-500"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2609",className:"flex-1",children:xl(f.overallComment)}),h.jsx(Na,{"data-loc":"client/src/pages/FoodRecognition.tsx:2610",asChild:!0,children:h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2610",type:"button",className:"shrink-0 text-xs font-semibold underline underline-offset-2",children:"詳æ
"})})]}),h.jsx(Br,{"data-loc":"client/src/pages/FoodRecognition.tsx:2612",children:h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2613",className:`mt-2 border-t pt-2 text-xs leading-relaxed ${t==="dark"?"border-amber-500/20 text-amber-200/80":"border-amber-200 text-amber-900/80"}`,children:f.overallComment})})]})})]})]}),f&&a.length>1&&!w&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2624",className:`mb-4 p-3 rounded-2xl border ${t==="dark"?"border-zinc-700/40 bg-white/3":"border-zinc-200 bg-zinc-50/50"}`,children:[h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2627",className:`text-xs mb-2 ${t==="dark"?"text-zinc-500":"text-zinc-400"}`,children:["å·²åæ ",a.length," å¼µç¸çï¼åä½µè¨ç®ï¼"]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2630",className:"flex gap-2 flex-wrap",children:a.map((x,I)=>h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2632",className:"relative",children:[h.jsx("img",{"data-loc":"client/src/pages/FoodRecognition.tsx:2633",src:x,alt:`ç¸${I+1}`,className:"w-14 h-14 rounded-xl object-cover"}),z[I]==="receipt"&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2635",className:"absolute -top-1 -right-1 text-xs bg-green-500 text-white rounded-full w-4 h-4 flex items-center justify-center",children:"ð§¾"}),z[I]==="nutrition_label"&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2638",className:"absolute -top-1 -right-1 text-xs bg-amber-500 text-white rounded-full w-4 h-4 flex items-center justify-center",children:"ð·ï¸"}),z[I]==="raw_ingredient"&&h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2641",className:"absolute -top-1 -right-1 text-[9px] bg-cyan-600 text-white rounded-full w-4 h-4 flex items-center justify-center",children:"å"})]},I))})]}),Fe&&g&&el&&!w&&h.jsxs(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:2651",className:"mb-6 card-premium overflow-hidden",children:[h.jsxs(_o,{"data-loc":"client/src/pages/FoodRecognition.tsx:2652",className:"pb-3 bg-gradient-to-r from-cyan-500/10 to-blue-500/10",children:[h.jsxs(Ao,{"data-loc":"client/src/pages/FoodRecognition.tsx:2653",className:"text-lg flex items-center gap-2",children:[h.jsx(Tl,{"data-loc":"client/src/pages/FoodRecognition.tsx:2654",className:"w-5 h-5 text-cyan-500"}),Fe.icon," å ´æ¯å¾®èª¿ï¼",Fe.name]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2657",className:"text-sm text-muted-foreground",children:"æ ¹æä½ å
實éæ
æ³å¾®èª¿ï¼å¡è·¯éæå³ææ´æ°"})]}),h.jsxs($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:2659",className:"pt-4 space-y-4",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2661",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2662",className:"text-xs text-muted-foreground mb-1 block",children:"飲é£å ´æ¯ï¼AI 嵿¸¬é¯å¯ä»¥èªå·±æï¼"}),h.jsxs(Bi,{"data-loc":"client/src/pages/FoodRecognition.tsx:2663",value:Fe.id,onValueChange:x=>{const I=Xl(x);if(I){Ze(I);const j={};for(const O of I.modifiers)if(O.type==="slider"&&O.defaultValue!==void 0)j[O.id]=O.defaultValue;else if(O.type==="toggle")j[O.id]=!1;else if(O.type==="select"&&O.options&&O.options.length>0){const B=O.options.find(H=>H.calorieImpact===0);j[O.id]=B?B.value:O.options[0].value}nt(j),qt(null),Vn(null),hi(null),pi(null),gi(0)}},children:[h.jsx(ji,{"data-loc":"client/src/pages/FoodRecognition.tsx:2689",className:"h-9 text-sm",children:h.jsx(Li,{"data-loc":"client/src/pages/FoodRecognition.tsx:2690"})}),h.jsx(Vi,{"data-loc":"client/src/pages/FoodRecognition.tsx:2692",className:"max-h-[300px]",children:r0.map(x=>h.jsxs(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:2694",value:x.id,children:[x.icon," ",x.name]},x.id))})]})]}),Fe.modifiers.map(x=>h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2703",className:"space-y-2",children:[x.type==="slider"&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2705",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2706",className:"flex items-center justify-between mb-1",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2707",className:"text-sm font-medium",children:x.label}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2708",className:"text-sm font-bold text-cyan-400",children:[typeof gt[x.id]=="number"?gt[x.id]:x.defaultValue,x.label.includes("å¹¾å¤")?"":"%"]})]}),h.jsx(Sl,{"data-loc":"client/src/pages/FoodRecognition.tsx:2713",value:[typeof gt[x.id]=="number"?gt[x.id]:x.defaultValue||0],min:x.min||0,max:x.max||100,step:x.step||1,onValueChange:([I])=>Ni(x.id,I),className:"w-full"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2721",className:"flex justify-between text-xs text-muted-foreground mt-0.5",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2722",children:x.min}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2723",children:x.max})]})]}),x.type==="toggle"&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2728",className:"flex items-center justify-between py-1",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2729",className:"text-sm font-medium",children:x.label}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2730",className:"flex items-center gap-2",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2731",className:"text-xs text-muted-foreground",children:x.calorieImpact&&x.calorieImpact>0?`+${x.calorieImpact}%`:`${x.calorieImpact}%`}),h.jsx(Wl,{"data-loc":"client/src/pages/FoodRecognition.tsx:2734",checked:!!gt[x.id],onCheckedChange:I=>Ni(x.id,I)})]})]}),x.type==="select"&&x.options&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2742",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2743",className:"text-sm font-medium mb-1 block",children:x.label}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2744",className:"flex flex-wrap gap-2",children:x.options.map(I=>h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:2746",type:"button",onClick:()=>
62Ni(x.id,I.value),className:`px-3 py-1.5 rounded-full text-xs font-medium transition-all ${gt[x.id]===I.value?"bg-cyan-500 text-white shadow-md":"bg-muted/50 text-muted-foreground hover:bg-muted"}`,children:[I.label,h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2757",className:"ml-1 opacity-70",children:I.calorieImpact>0?`+${I.calorieImpact}%`:I.calorieImpact===0?"":`${I.calorieImpact}%`})]},I.value))})]})]},x.id)),ha!==0&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2770",className:"bg-gradient-to-r from-cyan-500/10 to-blue-500/10 p-4 rounded-xl border border-cyan-500/30 mt-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2771",className:"flex items-center justify-between mb-2",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2772",className:"text-sm font-medium text-cyan-300",children:"調æ´å¾ä¼°ç®"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2773",className:`text-sm font-bold ${ha>0?"text-red-400":"text-green-400"}`,children:[ha>0?"+":"",ha,"%"]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2777",className:"grid grid-cols-4 gap-2",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2778",className:"text-center",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2779",className:"text-xs text-muted-foreground",children:"ç±é"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2780",className:"text-sm font-bold text-orange-400",children:Rt})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2782",className:"text-center",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2783",className:"text-xs text-muted-foreground",children:"èç½è³ª"}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2784",className:"text-sm font-bold text-green-400",children:[Ht,"g"]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2786",className:"text-center",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2787",className:"text-xs text-muted-foreground",children:"碳水"}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2788",className:"text-sm font-bold text-yellow-400",children:[fa,"g"]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2790",className:"text-center",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2791",className:"text-xs text-muted-foreground",children:"èèª"}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2792",className:"text-sm font-bold text-red-400",children:[Jc,"g"]})]})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2798",className:"flex gap-2 pt-2",children:[h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2799",variant:"outline",onClick:()=>pa(!1),className:"flex-1",children:"å使微調"}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2806",onClick:m1,disabled:ha===0,className:"flex-1 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-700 hover:to-blue-700 text-white",children:[h.jsx(Fr,{"data-loc":"client/src/pages/FoodRecognition.tsx:2811",className:"w-4 h-4 mr-1"}),"å¥ç¨å¾®èª¿"]})]})]})]}),h.jsx(Xf,{"data-loc":"client/src/pages/FoodRecognition.tsx:2820",open:t1,onOpenChange:xa,children:h.jsxs(Kf,{"data-loc":"client/src/pages/FoodRecognition.tsx:2821",className:t==="dark"?"bg-zinc-900 border-zinc-700":"bg-white border-zinc-200",children:[h.jsxs(Zf,{"data-loc":"client/src/pages/FoodRecognition.tsx:2824",children:[h.jsx(qf,{"data-loc":"client/src/pages/FoodRecognition.tsx:2825",className:t==="dark"?"text-zinc-100":"text-zinc-900",children:y?"æ¹ç餿¸å":g?.foodName||"é£ç©è©³æ
"}),h.jsx(Qf,{"data-loc":"client/src/pages/FoodRecognition.tsx:2828",children:y?"ä¿®æ¹å®æ³ãOK æ¹å¥½å²ãå²å":"ç詳細ç餿åï¼å¯ä»¥æ¹æ¸åæéæ°è¨ç®"})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2832",className:"px-4 overflow-y-auto flex-1 min-h-0",style:{paddingBottom:"40vh"},onFocusCapture:x=>{const I=x.target;(I.tagName==="INPUT"||I.tagName==="TEXTAREA")&&setTimeout(()=>{I.scrollIntoView({block:"center",behavior:"smooth"})},450)},children:g&&h.jsx(h.Fragment,{children:y?h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2849",className:"space-y-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2850",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2851",className:"text-sm",children:"é£ç©å稱"}),h.jsx(Il,{"data-loc":"client/src/pages/FoodRecognition.tsx:2852",value:E.foodName,onChange:x=>F({...E,foodName:x.target.value}),className:"mt-1 min-h-0 h-10 resize-none py-2",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,name:"food-edit-name-x7k","data-form-type":"other","data-lpignore":"true",rows:1,onKeyDown:x=>{x.key==="Enter"&&x.preventDefault()}})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2867",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2868",className:"text-sm",children:"份é"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2869",value:E.quantity,onChange:x=>F({...E,quantity:x.target.value}),className:"mt-1",autoComplete:"off",name:"food-qty-fd-x9z","data-form-type":"other","data-lpignore":"true"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2879",className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2880",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2881",className:"text-sm",children:"ç±é (kcal)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2882",type:"number",min:"0",value:E.calories,onChange:x=>F({...E,calories:parseInt(x.target.value)||0}),className:"mt-1",autoComplete:"off",name:"food-cal-fd-x9z","data-form-type":"other","data-lpignore":"true"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2893",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2894",className:"text-sm",children:"èç½è³ª (g)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2895",type:"number",min:"0",value:E.protein,onChange:x=>F({...E,protein:parseInt(x.target.value)||0}),className:"mt-1",autoComplete:"off",name:"food-prot-fd-x9z","data-form-type":"other","data-lpignore":"true"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2906",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2907",className:"text-sm",children:"碳水ååç© (g)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2908",type:"number",min:"0",value:E.carbs,onChange:x=>F({...E,carbs:parseInt(x.target.value)||0}),className:"mt-1",autoComplete:"off",name:"food-carbs-fd-x9z","data-form-type":"other","data-lpignore":"true"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2919",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:2920",className:"text-sm",children:"èèª (g)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2921",type:"number",min:"0",value:E.fat,onChange:x=>F({...E,fat:parseInt(x.target.value)||0}),className:"mt-1",autoComplete:"off",name:"food-fat-fd-x9z","data-form-type":"other","data-lpignore":"true"})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2933",className:"flex gap-3",children:[h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2934",variant:"outline",onClick:()=>v(!1),className:"flex-1",children:"ç®å¦"}),h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2937",onClick:_1,className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white",children:"OK æ¹å¥½å²"})]})]}):h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2943",className:"space-y-4",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2945",className:`p-4 rounded-xl border ${t==="dark"?"bg-transparent border-white/8 backdrop-blur-xl":"bg-transparent border-zinc-200 backdrop-blur-sm"}`,children:[h.jsx("h3",{"data-loc":"client/src/pages/FoodRecognition.tsx:2948",className:`font-bold text-xl ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:g.foodName}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2949",className:"flex items-center gap-2 mt-2 flex-wrap",children:[g.brand&&h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2951",className:"text-xs px-2.5 py-1 rounded-full bg-purple-500/20 text-purple-400 font-medium",children:["ðª ",g.brand]}),g.cookingMethod&&h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2956",className:"text-xs px-2.5 py-1 rounded-full bg-orange-500/20 text-orange-400 font-medium",children:["ð³ ",g.cookingMethod]})]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2961",className:`text-sm mt-2 ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:g.quantity}),g.ingredients&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2963",className:"mt-3 space-y-1.5",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:2964",className:`text-xs font-medium ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:"飿æç´°ï¼"}),g.ingredients.split(",").map((x,I)=>{const j=x.trim(),O=j.match(/^(.+?)\s*(\d+\.?\d*)\s*(g|ml|å
|毫å)?$/i),B=O?O[1].trim():j,H=O?O[2]:"",Be
62=O&&O[3]||"g";return h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:2972",className:"flex items-center gap-2 text-xs",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2973",className:`min-w-[60px] ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:B}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:2974",type:"number",min:"0",className:"h-6 w-16 text-xs px-1 py-0 text-center",defaultValue:H,onChange:J=>{const Y=g.ingredients.split(",").map(q=>q.trim()),ie=J.target.value,he=Y[I]?.match(/^(.+?)\s*\d+\.?\d*\s*(g|ml|å
|毫å)?$/i);he?Y[I]=`${he[1].trim()} ${ie}${Be}`:Y[I]=`${Y[I]} ${ie}${Be}`,m({...g,ingredients:Y.join(", ")})}}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:2991",className:`${t==="dark"?"text-zinc-500":"text-zinc-400"}`,children:Be})]},I)})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3000",className:`p-4 rounded-xl border ${t==="dark"?"bg-transparent border-white/8 backdrop-blur-xl":"bg-transparent border-zinc-200 backdrop-blur-sm"}`,children:[h.jsx("h4",{"data-loc":"client/src/pages/FoodRecognition.tsx:3003",className:`text-sm font-semibold mb-4 ${t==="dark"?"text-zinc-200":"text-zinc-700"}`,children:"ð ç餿å Breakdown"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3005",className:"text-center mb-5",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3006",className:`text-xs uppercase tracking-wider ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:"總ç±é"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3007",className:"text-4xl font-black text-orange-400 mt-1",children:g.calories}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3008",className:`text-sm ${t==="dark"?"text-zinc-500":"text-zinc-400"}`,children:"kcal"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3011",className:"space-y-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3012",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3013",className:"flex justify-between items-center mb-1",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3014",className:`text-xs font-medium ${t==="dark"?"text-zinc-300":"text-zinc-600"}`,children:"èç½è³ª"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3015",className:"text-sm font-bold text-green-400",children:[g.protein,"g"]})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3017",className:`h-3 rounded-full overflow-hidden ${t==="dark"?"bg-zinc-700/50":"bg-zinc-200"}`,children:h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3018",className:"h-full rounded-full bg-gradient-to-r from-green-500 to-emerald-400 transition-all duration-500",style:{width:`${Math.min(g.protein/(g.calories/4||1)*100,100)}%`}})})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3024",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3025",className:"flex justify-between items-center mb-1",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3026",className:`text-xs font-medium ${t==="dark"?"text-zinc-300":"text-zinc-600"}`,children:"碳水ååç©"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3027",className:"text-sm font-bold text-yellow-400",children:[g.carbs,"g"]})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3029",className:`h-3 rounded-full overflow-hidden ${t==="dark"?"bg-zinc-700/50":"bg-zinc-200"}`,children:h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3030",className:"h-full rounded-full bg-gradient-to-r from-yellow-500 to-amber-400 transition-all duration-500",style:{width:`${Math.min(g.carbs/(g.calories/4||1)*100,100)}%`}})})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3036",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3037",className:"flex justify-between items-center mb-1",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3038",className:`text-xs font-medium ${t==="dark"?"text-zinc-300":"text-zinc-600"}`,children:"èèª"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3039",className:"text-sm font-bold text-red-400",children:[g.fat,"g"]})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3041",className:`h-3 rounded-full overflow-hidden ${t==="dark"?"bg-zinc-700/50":"bg-zinc-200"}`,children:h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3042",className:"h-full rounded-full bg-gradient-to-r from-red-500 to-rose-400 transition-all duration-500",style:{width:`${Math.min(g.fat/(g.calories/9||1
62)*100,100)}%`}})})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3051",className:"flex justify-center gap-4 mt-4 pt-3 border-t border-zinc-700/30",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3052",className:"flex items-center gap-1.5",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3053",className:"w-2.5 h-2.5 rounded-full bg-green-400"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3054",className:`text-xs ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:["èç½ ",Math.round(g.protein*4/(g.calories||1)*100),"%"]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3058",className:"flex items-center gap-1.5",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3059",className:"w-2.5 h-2.5 rounded-full bg-yellow-400"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3060",className:`text-xs ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:["碳水 ",Math.round(g.carbs*4/(g.calories||1)*100),"%"]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3064",className:"flex items-center gap-1.5",children:[h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3065",className:"w-2.5 h-2.5 rounded-full bg-red-400"}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3066",className:`text-xs ${t==="dark"?"text-zinc-400":"text-zinc-500"}`,children:["èèª ",Math.round(g.fat*9/(g.calories||1)*100),"%"]})]})]})]}),w1?h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3107",className:"bg-cyan-500/10 p-4 rounded-xl border border-cyan-500/30 space-y-3 mt-2",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3108",className:"flex items-center gap-2 mb-1",children:[h.jsx(Xn,{"data-loc":"client/src/pages/FoodRecognition.tsx:3109",className:"w-4 h-4 text-cyan-400"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3110",className:"text-sm font-medium text-cyan-300",children:"å¾®èª¿è³æï¼AI æéæ°è¨ç®çé¤"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3112",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3113",className:"text-xs text-muted-foreground",children:"é£ç©å稱"}),h.jsx(Il,{"data-loc":"client/src/pages/FoodRecognition.tsx:3114",value:Qt.foodName,onChange:x=>_a({...Qt,foodName:x.target.value}),className:"mt-1 h-9 min-h-0 resize-none py-1.5 text-sm",placeholder:"ä¾å¦ï¼åç飯ãBig Mac...",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,name:"food-tweak-name-x7k","data-form-type":"other","data-lpignore":"true",rows:1,onKeyDown:x=>{x.key==="Enter"&&x.preventDefault()}})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3130",className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3131",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3132",className:"text-xs text-muted-foreground",children:"åç/é¤å»³"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3133",value:Qt.brand,onChange:x=>_a({...Qt,brand:x.target.value}),className:"mt-1 h-9 text-sm",placeholder:"ä¾å¦ï¼éº¥ç¶åã大家æ¨...",autoComplete:"new-password",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,name:"food-brand-x7k","data-form-type":"other","data-lpignore":"true"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3147",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3148",className:"text-xs text-muted-foreground",children:"ç¹èª¿æ¹æ³"}),h.jsxs(Bi,{"data-loc":"client/src/pages/FoodRecognition.tsx:3149",value:Qt.cookingMethod,onValueChange:x=>_a({...Qt,cookingMethod:x}),children:[h.jsx(ji,{"data-loc":"client/src/pages/FoodRecognition.tsx:3153",className:"mt-1 h-9 text-sm",children:h.jsx(Li,{"data-loc":"client/src/pages/FoodRecognition.tsx:3154",placeholder:"æç¹èª¿æ¹æ³"})}),h.jsxs(Vi,{"data-loc":"client/src/pages/FoodRecognition.tsx:3156",children:[h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3157",value:"ç¸",children:"ç¸ï¼æå¤æ²¹ï¼"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3158",value:"ç
",children:"ç
"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3159",value:"ç",children:"ç"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3160",value:"ç",children:"ç"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3161",value:"ç¤",children:"ç¤"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3162",value:"ç",children:"ç"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3163",value:"ç´
ç",children:"ç´
ç"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3164",value:"è¸",children:"è¸"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3165",value:"ç½ç¼",children:"ç½ç¼ï¼æå°æ²¹ï¼"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3166",value:"æ»·",children:"æ»·"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3167",value:"ç",children:"çé£"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3168",value:"å
¶ä»",children:"å
¶ä»"})]})]})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3173",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3174",className:"text-xs text-muted-foreground",children:"份é"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3175",value:Qt.quantity,onChange:x=>_a({...Qt,quantity:x.target.value}
62),className:"mt-1 h-9 text-sm",placeholder:"ä¾å¦ï¼1ç¢ç´300g"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3182",className:"flex gap-2 pt-1",children:[h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3183",variant:"outline",size:"sm",onClick:()=>Di(!1),className:"flex-1",children:"ç®å¦"}),h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3191",size:"sm",onClick:E1,disabled:wl,className:"flex-1 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-700 hover:to-blue-700 text-white",children:wl?h.jsxs(h.Fragment,{children:[h.jsx(ki,{"data-loc":"client/src/pages/FoodRecognition.tsx:3199",className:"w-4 h-4 mr-1"}),"è¨ç®ä¸..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Xn,{"data-loc":"client/src/pages/FoodRecognition.tsx:3204",className:"w-4 h-4 mr-1"}),"AI éæ°è¨ç®"]})})]})]}):h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3075",className:"flex gap-2 pt-2 flex-wrap",children:[Fe&&!el&&h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3077",variant:"outline",size:"sm",onClick:()=>{pa(!0),xa(!1)},className:"flex-1 border-cyan-200 text-cyan-700 hover:bg-cyan-50",children:[h.jsx(Tl,{"data-loc":"client/src/pages/FoodRecognition.tsx:3083",className:"w-4 h-4 mr-1"}),Fe.icon," å ´æ¯å¾®èª¿"]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3087",variant:"outline",size:"sm",onClick:A1,className:"flex-1 border-cyan-200 text-cyan-700 hover:bg-cyan-50",children:[h.jsx(Xn,{"data-loc":"client/src/pages/FoodRecognition.tsx:3093",className:"w-4 h-4 mr-1"}),"æåå¾®èª¿Â·éæ°è¨ç®"]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3096",variant:"outline",size:"sm",onClick:C1,className:"border-gray-200",children:[h.jsx(Eo,{"data-loc":"client/src/pages/FoodRecognition.tsx:3102",className:"w-4 h-4 mr-1"}),"ç´æ¥æ¹æ¸å"]})]})]})})})]})}),w&&h.jsxs(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:3222",className:"mb-6 card-premium",children:[h.jsxs(_o,{"data-loc":"client/src/pages/FoodRecognition.tsx:3223",className:"pb-3",children:[h.jsxs(Ao,{"data-loc":"client/src/pages/FoodRecognition.tsx:3224",className:"text-lg flex items-center gap-2",children:[h.jsx(Eo,{"data-loc":"client/src/pages/FoodRecognition.tsx:3225",className:"w-5 h-5 text-purple-500"}),"èªå·±å
¥é£ç©è³æ"]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3228",className:"text-sm text-muted-foreground",children:"èªå·±å¡«è¿é£ç©å
ç餿¸æ"})]}),h.jsxs($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:3230",className:"space-y-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3231",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3232",className:"text-sm",children:"é£ç©å稱"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3233",placeholder:"ä¾å¦ï¼åç飯ãéç¿ã奶è¶...",value:E.foodName,onChange:x=>F({...E,foodName:x.target.value}),className:"mt-1",autoComplete:"new-password",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,name:"food-manual-name-x7k","data-form-type":"other","data-lpignore":"true"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3247",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3248",className:"text-sm",children:"份é"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3249",placeholder:"ä¾å¦ï¼1ç¢ã2ä»¶ã1æ¯...",value:E.quantity,onChange:x=>F({...E,quantity:x.target.value}),className:"mt-1"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3256",className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3257",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3258",className:"text-sm",children:"ç±é (kcal)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3259",type:"number",min:"0",placeholder:"0",value:E.calories||"",onChange:x=>F({...E,calories:parseInt(x.target.value)||0}),className:"mt-1"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3267",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3268",className:"text-sm",children:"èç½è³ª (g)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3269",type:"number",min:"0",placeholder:"0",value:E.protein||"",onChange:x=>F({...E,protein:parseInt(x.target.value)||0}),className:"mt-1"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3277",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3278",className:"text-sm",children:"碳水ååç© (g)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3279",type:"number",min:"0",placeholder:"0",value:E.carbs||"",onChange:x=>F({...E,carbs:parseInt(x.target.value)||0}),className:"mt-1"})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3287",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3288",className:"text-sm",children:"èèª (g)"}),h.jsx(Ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3289",type:"number",min:"0",placeholder:"0",value:E.fat||"",onChange:x=>F({...E,fat:parseInt(x.target.value)||0}),className:"mt-1"})]})]})]})]}),(f&&f.dishes&&f.dishes.length>0||w)&&h.jsx(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:3304",className:"mb-6 card-premium",children:h.jsxs($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:3305",className:"pt-6 space-y-5",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3307",children:[h.jsx(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3308",className:`text-sm font-semibold ${t==="dark"?"text-zinc-200":"text-zinc-700"}`,children:"å¢é¤ä¿éé¤ï¼"}),h.jsxs(Bi,{"data-loc":"client/src/pages/FoodRecognition.tsx:3309",value:T,onValueChange:x=>S(x),children:[h.jsx(ji,{"data-loc":"client/src/pages/FoodRecognition.tsx:3310",className:"mt-1.5",children:h.jsx(Li,{"data-loc":"client/src/pages/FoodRecognition.tsx:3310"})}),h.jsxs(Vi,{"data-loc":"client/src/pages/FoodRecognition.tsx:3311",children:[h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3312",value:"breakfast",children:"æ©é¤ ð
"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3313",value:"lunch",children:"åé¤ âï¸"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3314",value:"dinner",children:"æé¤ ð"}),h.jsx(wt,{"data-loc":"client/src/pages/FoodRecognition.tsx:3315",value:"snack",children:"å°é£/å®µå¤ ð¿"})]})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3321",children:[h.jsxs(Ee,{"data-loc":"client/src/pages/FoodRecognition.tsx:3322",className:`text-sm font-semibold flex items-center gap-1.5 ${t==="dark"?"text-zinc-200":"text-zinc-700"}`,children:[h.jsx(tp,{"data-loc":"client/src/pages/FoodRecognition.tsx:3323",className:"w-4 h-4"}),"è¨éå°é䏿¥ï¼"]}
62),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3326",className:"flex gap-2 mt-2",children:[h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3327",type:"button",onClick:()=>{xi("today"),mi(new Date)},className:`flex-1 py-2.5 px-3 rounded-xl text-sm font-medium border-2 transition-all duration-200 ${ga==="today"?"border-blue-500 bg-blue-500/15 text-blue-400 shadow-[0_0_8px_rgba(59,130,246,0.2)]":t==="dark"?"border-zinc-700 text-zinc-400 hover:border-zinc-600":"border-zinc-200 text-zinc-500 hover:border-zinc-300"}`,children:"仿¥"}),h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3340",type:"button",onClick:()=>{xi("yesterday");const x=new Date;x.setDate(x.getDate()-1),mi(x)},className:`flex-1 py-2.5 px-3 rounded-xl text-sm font-medium border-2 transition-all duration-200 ${ga==="yesterday"?"border-blue-500 bg-blue-500/15 text-blue-400 shadow-[0_0_8px_rgba(59,130,246,0.2)]":t==="dark"?"border-zinc-700 text-zinc-400 hover:border-zinc-600":"border-zinc-200 text-zinc-500 hover:border-zinc-300"}`,children:"æ¨æ¥"}),h.jsxs(U1,{"data-loc":"client/src/pages/FoodRecognition.tsx:3358",open:e1,onOpenChange:tl,children:[h.jsx(z1,{"data-loc":"client/src/pages/FoodRecognition.tsx:3359",asChild:!0,children:h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3360",type:"button",className:`flex-1 py-2.5 px-3 rounded-xl text-sm font-medium border-2 transition-all duration-200 ${ga==="custom"?"border-blue-500 bg-blue-500/15 text-blue-400 shadow-[0_0_8px_rgba(59,130,246,0.2)]":t==="dark"?"border-zinc-700 text-zinc-400 hover:border-zinc-600":"border-zinc-200 text-zinc-500 hover:border-zinc-300"}`,children:ga==="custom"?`${Tt.getMonth()+1}/${Tt.getDate()}`:"èªè¨"})}),h.jsx(W1,{"data-loc":"client/src/pages/FoodRecognition.tsx:3373",className:"w-auto p-0",align:"center",children:h.jsx(ix,{"data-loc":"client/src/pages/FoodRecognition.tsx:3374",mode:"single",selected:Tt,onSelect:x=>{x&&(mi(x),xi("custom"),tl(!1))},disabled:x=>x>new Date,initialFocus:!0})})]})]}),ga!=="today"&&h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3391",className:`text-xs mt-2 ${t==="dark"?"text-zinc-500":"text-zinc-400"}`,children:["ð
è¨éå°ï¼",Tt.getFullYear(),"/",Tt.getMonth()+1,"/",Tt.getDate()]})]}),f?.photoUrls&&f.photoUrls.length>0&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3399",className:`p-3 rounded-xl border ${t==="dark"?"border-zinc-700 bg-zinc-800/50":"border-zinc-200 bg-zinc-50"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3400",className:"flex items-center justify-between mb-2",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3401",className:`text-xs font-medium ${t==="dark"?"text-zinc-300":"text-zinc-600"}`,children:"ð· æé¸è¦å²åå
ç¸ç"}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3402",className:"flex gap-2",children:[h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3403",type:"button",onClick:()=>mo(new Set(f.photoUrls.map((x,I)=>I))),className:"text-[10px] text-blue-400 hover:text-blue-300",children:"å
¨é¸"}),h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3404",type:"button",onClick:()=>mo(new Set),className:"text-[10px] text-zinc-500 hover:text-zinc-400",children:"å
¨ä¸é¸"})]})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3407",className:"flex gap-2 overflow-x-auto pb-1 scrollbar-hide",children:f.photoUrls.map((x,I)=>{const j=ur.has(I);return h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3411",type:"button",onClick:()=>{const O=new Set(ur);j?O.delete(I):O.add(I),mo(O)},className:`flex-shrink-0 relative w-16 h-16 rounded-xl overflow-hidden border-2 transition-all duration-150 ${j?"border-blue-500 scale-105":"border-transparent opacity-40"}`,children:[h.jsx("img",{"data-loc":"client/src/pages/FoodRecognition.tsx:3423",src:x.url,alt:`ç¸ç ${I+1}`,className:"w-full h-full object-cover"}),j&&h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3425",className:"absolute top-0.5 right-0.5 w-4 h-4 bg-blue-500 rounded-full flex items-center justify-center",children:h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3426",className:"text-white text-[8px] font-bold",children:"â"})})]},I)})}),h.jsxs("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3433",className:`text-[10px] mt-1.5 ${t==="dark"?"text-zinc-500":"text-zinc-400"}`,children:["å·²é¸ ",ur.size," / ",f.photoUrls.length," å¼µ"]})]}),h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3440",onClick:R1,disabled:xn.isPending,className:"w-full h-14 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white text-lg font-bold rounded-xl shadow-[0_4px_14px_rgba(37,99,235,0.4)] active:scale-[0.97] transition-transform duration-150",children:xn.isPending?h.jsxs(h.Fragment,{children:[h.jsx(ki,{"data-loc":"client/src/pages/FoodRecognition.tsx:3447",className:"w-5 h-5 mr-2"}),"å ç·..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Ea,{"data-loc":"client/src/pages/FoodRecognition.tsx:3452",className:"w-5 h-5 mr-2"}),"å å
¥é£²é£è¨é"]})}
62),!w&&(f?.dishes?.length??0)>0&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3459",className:"space-y-2",children:[h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3460",type:"button",variant:"outline",onClick:()=>vi(x=>!x),disabled:Ci.isPending,className:`w-full h-11 rounded-xl border-2 ${t==="dark"?"border-violet-500/50 text-violet-300 hover:bg-violet-500/10":"border-violet-300 text-violet-700 hover:bg-violet-50"}`,children:Ci.isPending?h.jsxs(h.Fragment,{children:[h.jsx(vr,{"data-loc":"client/src/pages/FoodRecognition.tsx:3472",className:"w-4 h-4 mr-2 animate-spin"}),"åä½µç·..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Ea,{"data-loc":"client/src/pages/FoodRecognition.tsx:3474",className:"w-4 h-4 mr-2"}),"åä½µå°ä¸ä¸é¤"]})}),n1&&h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3479",className:`rounded-xl border p-3 space-y-2 ${t==="dark"?"border-violet-500/30 bg-violet-500/5":"border-violet-200 bg-violet-50/70"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3482",className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3483",children:[h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3484",className:`text-sm font-semibold ${t==="dark"?"text-violet-200":"text-violet-900"}`,children:"æè¦åä½µå
å·²è¨éé¤é»"}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3485",className:"text-xs text-muted-foreground mt-0.5",children:"æè¿½å é£ç©ãç餿¸ååä½ æåå
ç¸ï¼åæ¬å
§å®¹åæè¢«è¦èã"})]}),h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3487",type:"button",onClick:()=>vi(!1),className:"text-muted-foreground hover:text-foreground","aria-label":"æ¶èµ·åä½µé¤é»é¸æ",children:h.jsx(za,{"data-loc":"client/src/pages/FoodRecognition.tsx:3488",className:"w-4 h-4"})})]}),h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3491",className:"max-h-52 overflow-y-auto space-y-1.5 pr-1",children:fl.length>0?fl.map(x=>{const I=new Date(x.createdAt),O=(Array.isArray(x.foodItems)?x.foodItems:[]).slice(0,2).map(B=>B.name).filter(Boolean).join("ã");return h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3497",type:"button",onClick:()=>T1(x.id),className:`w-full text-left rounded-lg border p-2.5 transition-colors ${t==="dark"?"border-zinc-700 hover:border-violet-400/70 hover:bg-white/5":"border-zinc-200 hover:border-violet-300 hover:bg-white"}`,children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3505",className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3506",className:"text-sm font-medium",children:[I.toLocaleDateString("zh-HK",{month:"numeric",day:"numeric"})," · ",x.mealType==="breakfast"?"æ©é¤":x.mealType==="lunch"?"åé¤":x.mealType==="dinner"?"æé¤":"å°é£"]}),h.jsxs("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3507",className:"text-xs text-orange-400",children:[Number(x.totalCalories||0)," kcal"]})]}),h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3509",className:"text-xs text-muted-foreground mt-1 truncate",children:O||"æªå½åé¤é»"})]},x.id)}):h.jsx("p",{"data-loc":"client/src/pages/FoodRecognition.tsx:3513",className:"text-sm text-muted-foreground text-center py-3",children:"æ«æåå·²è¨éå
é¤é»å¯ä»¥åä½µã"})})]})]}),h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3522",className:"flex gap-3",children:[w&&n.length>0&&h.jsx(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3525",variant:"outline",onClick:yl,disabled:c,className:`flex-1 text-sm h-11 rounded-xl border-2 ${t==="dark"?"border-amber-600/60 hover:border-amber-500 text-amber-400":"border-amber-300 hover:border-amber-400 text-amber-600"}`,children:c?h.jsxs(h.Fragment,{children:[h.jsx(vr,{"data-loc":"client/src/pages/FoodRecognition.tsx:3535",className:"w-4 h-4 mr-1 animate-spin"}),"åæç·..."]}):h.jsxs(h.Fragment,{children:[h.jsx(np,{"data-loc":"client/src/pages/FoodRecognition.tsx:3540",className:"w-4 h-4 mr-1"}),"éæ°åæ"]})}),!w&&h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3547",variant:"outline",onClick:Cl,className:`flex-1 text-sm h-11 rounded-xl border-2 ${t==="dark"?"border-zinc-700 hover:border-zinc-600":"border-zinc-200 hover:border-zinc-300"}`,children:[h.jsx(Eo,{"data-loc":"client/src/pages/FoodRecognition.tsx:3554",className:"w-4 h-4 mr-1"}),"èªå·±æåå
¥"]}),h.jsxs(ye,{"data-loc":"client/src/pages/FoodRecognition.tsx:3558",variant:"outline",onClick:_i,className:`flex-1 text-sm h-11 rounded-xl border-2 ${t==="dark"?"border-zinc-700 hover:border-zinc-600":"border-zinc-200 hover:border-zinc-300"}`,children:[h.jsx(H1,{"data-loc":"client/src/pages/FoodRecognition.tsx:3565",className:"w-4 h-4 mr-1"}),"åå½±ä¸å¼µ"]})]})]})}),a.length===0&&!w&&h.jsx("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3575",className:"text-center mt-4",children:h.jsxs("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3576",onClick:Cl,className:`inline-flex items-center gap-2 text-sm cursor-pointer transition-colors ${t==="dark"?"text-zinc-400 hover:text-zinc-200":"text-zinc-500 hover:text-zinc-800"}`,children:[h.jsx(Eo,{"data-loc":"client/src/pages/FoodRecognition.tsx:3582",className:"w-4 h-4"}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3583",children:"忳影ç¸ï¼èªå·±æåå
¥"})]})}),h.jsx(kr,{"data-loc":"client/src/pages/FoodRecognition.tsx:3589",open:al,onOpenChange:ol,children:h.jsxs(Hn,{"data-loc":"client/src/pages/FoodRecognition.tsx:3590",className:"mt-6 card-premium",children:[h.jsx(Na,{"data-loc":"client/src/pages/FoodRecognition.tsx:3591",asChild:!0,children:h.jsx("button",{"data-loc":"client/src/pages/FoodRecognition.tsx:3592",type:"button",className:"w-full text-left",children:h.jsx($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:3593",className:"pt-5 pb-3",children:h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3594",className:"flex items-center justify-between",children:[h.jsxs("div",{"data-loc":"client/src/pages/FoodRecognition.tsx:3595",className:"flex items-center gap-2",children:[h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3596",className:"text-xl",children:"ð¡"}),h.jsx("span",{"data-loc":"client/src/pages/FoodRecognition.tsx:3597",className:`font-semibold ${t==="dark"?"text-zinc-100":"text-zinc-900"}`,children:"使ç¨è²¼å£«"})]}),al?h.jsx(Rl,{"data-loc":"client/src/pages/FoodRecognition.tsx:3602",className:`w-4 h-4 ${t==="dark"?"text-zinc-400":"text-zinc-500"}`}):h.jsx(bs,{"data-loc":"client/src/pages/FoodRecognition.tsx:3604",className:`w-4 h-4 ${t==="dark"?"text-zinc-400":"text-zinc-500"}`})]})})})}),h.jsx(Br,{"data-loc":"client/src/pages/FoodRecognition.tsx:3610",children:h.jsx($n,{"data-loc":"client/src/pages/FoodRecognition.tsx:3611",className:"pt-0 pb-5",children:h.jsxs("ul",{"data-loc":"client/src/pages/FoodRecognition.tsx:3612",className:`space-y-2.5 text-sm ${t==="dark"?"text-zinc-300":"text-zinc-600"}`,children:[h.jsx("li",{"data-loc":"client/src/pages/FoodRecognition.tsx:3615",children:"⢠å
ç·å
è¶³ãé£ç©æ¸
æ°ï¼AI èå¥ææ´æºç¢º"}),h.jsx("li",{"data-loc":"client/src/pages/FoodRecognition.tsx:3616",children:"⢠ç¡é影齿æå¢ï¼å
æ¬é£²ååé
èï¼"}),h.jsx("li",{"data-loc":"client/src/pages/FoodRecognition.tsx:3617",children:"⢠AI çµæåªä¿ä¼°ç®ï¼å¯ä»¥æåä¿®æ¹æ¸å¼"}),h.jsx("li",{"data-loc":"client/src/pages/FoodRecognition.tsx:3618",children:"⢠AI èåå°å
話ï¼å¯ä»¥èªå·±æåå
¥"}),h.jsx("li",{"data-loc":"client/src/pages/FoodRecognition.tsx:3619",children:"⢠èé¤/æé
Œ
é£ç©å¯ä»¥åºè£å
è³æåº¦è£"}),h.jsx("li",{"data-loc":"client/src/pages/FoodRecognition.tsx:3620",children:"⢠å¯ä»¥å½±å¤å¼µç¸ï¼æä¸»ç¸ååæ"})]})})})]})})]}),h.jsx(h3,{"data-loc":"client/src/pages/FoodRecognition.tsx:3627",open:Ve,onOpenChange:ne,onDetected:d1}),h.jsx(q_,{"data-loc":"client/src/pages/FoodRecognition.tsx:3628",feedback:da,onDismiss:()=>Nr(null)})]})})}export{P8 as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.