PageSourceSearch

https://cacttus.cl/_next/static/chunks/pages/_app-b09a65748cff54a5.js

js cacttus.cl collected 2026-10-01 23:54:43 UTC 1,944,078 bytes, 61 lines download raw bytes

1!function(){try{var m="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},g=(new m.Error).stack;g&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[g]="074400e3-da26-4f2d-a2e1-2bcf2e54e89a",m._sentryDebugIdIdentifier="sentry-dbid-074400e3-da26-4f2d-a2e1-2bcf2e54e89a")}catch(m){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{27484:function(m){var g,v,x,k,E,T,K,et,en,er,ei,es,el,ec,eu,ed,ep,em,ef,eh,eg,ev;m.exports=(g="millisecond",v="second",x="minute",k="hour",E="week",T="month",K="quarter",et="year",en="date",er="Invalid Date",ei=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,es=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,el=function(m,g,v){var x=String(m);return!x||x.length>=g?m:""+Array(g+1-x.length).join(v)+m},(eu={})[ec="en"]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(m){var g=["th","st","nd","rd"],v=m%100;return"["+m+(g[(v-20)%10]||g[v]||"th")+"]"}},ed="$isDayjsObject",ep=function(m){return m instanceof eg||!(!m||!m[ed])},em=function t(m,g,v){var x;if(!m)return ec;if("string"==typeof m){var k=m.toLowerCase();eu[k]&&(x=k),g&&(eu[k]=g,x=k);var E=m.split("-");if(!x&&E.length>1)return t(E[0])}else{var T=m.name;eu[T]=m,x=T}return!v&&x&&(ec=x),x||!v&&ec},ef=function(m,g){if(ep(m))return m.clone();var v="object"==typeof g?g:{};return v.date=m,v.args=arguments,new eg(v)},(eh={s:el,z:function(m){var g=-m.utcOffset(),v=Math.abs(g);return(g<=0?"+":"-")+el(Math.floor(v/60),2,"0")+":"+el(v%60,2,"0")},m:function t(m,g){if(m.date()<g.date())return-t(g,m);var v=12*(g.year()-m.year())+(g.month()-m.month()),x=m.clone().add(v,T),k=g-x<0,E=m.clone().add(v+(k?-1:1),T);return+(-(v+(g-x)/(k?x-E:E-x))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return({M:T,y:et,w:E,d:"day",D:en,h:k,m:x,s:v,ms:g,Q:K})[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return void 0===m}}).l=em,eh.i=ep,eh.w=function(m,g){return ef(m,{locale:g.$L,utc:g.$u,x:g.$x,$offset:g.$offset})},ev=(eg=function(){function M(m){this.$L=em(m.locale,null,!0),this.parse(m),this.$x=this.$x||m.x||{},this[ed]=!0}var m=M.prototype;return m.parse=function(m){this.$d=function(m){var g=m.date,v=m.utc;if(null===g)return new Date(NaN);if(eh.u(g))return new Date;if(g instanceof Date)return new Date(g);if("string"==typeof g&&!/Z$/i.test(g)){var x=g.match(ei);if(x){var k=x[2]-1||0,E=(x[7]||"0").substring(0,3);return v?new Date(Date.UTC(x[1],k,x[3]||1,x[4]||0,x[5]||0,x[6]||0,E)):new Date(x[1],k,x[3]||1,x[4]||0,x[5]||0,x[6]||0,E)}}return new Date(g)}(m),this.init()},m.init=function(){var m=this.$d;this.$y=m.getFullYear(),this.$M=m.getMonth(),this.$D=m.getDate(),this.$W=m.getDay(),this.$H=m.getHours(),this.$m=m.getMinutes(),this.$s=m.getSeconds(),this.$ms=m.getMilliseconds()},m.$utils=function(){return eh},m.isValid=function(){return this.$d.toString()!==er},m.isSame=function(m,g){var v=ef(m);return this.startOf(g)<=v&&v<=this.endOf(g)},m.isAfter=function(m,g){return ef(m)<this.startOf(g)},m.isBefore=function(m,g){return this.endOf(g)<ef(m)},m.$g=function(m,g,v){return eh.u(m)?this[g]:this.set(v,m)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(m,g){var K=this,er=!!eh.u(g)||g,ei=eh.p(m),l=function(m,g){var v=eh.w(K.$u?Date.UTC(K.$y,g,m):new Date(K.$y,g,m),K);return er?v:v.endOf("day")},$=function(m,g){return eh.w(K.toDate()[m].apply(K.toDate("s"),(er?[0,0,0,0]:[23,59,59,999]).slice(g)),K)},es=this.$W,el=this.$M,ec=this.$D,eu="set"+(this.$u?"UTC":"");switch(ei){case et:return er?l(1,0):l(31,11);case T:return er?l(1,el):l(0,el+1);case E:var ed=this.$locale().weekStart||0,ep=(es<ed?es+7:es)-ed;return l(er?ec-ep:ec+(6-ep),el);case"day":case en:return $(eu+"Hours",0);case k:return $(eu+"Minutes",1);case x:return $(eu+"Seconds",2);case v:return $(eu+"Milliseconds",3);default:return this.clone()}},m.endOf=function(m){return this.startOf(m,!1)},m.$set=function(m,E){var K,er=eh.p(m),ei="set"+(this.$u?"UTC":""),es=((K={}
1).day=ei+"Date",K[en]=ei+"Date",K[T]=ei+"Month",K[et]=ei+"FullYear",K[k]=ei+"Hours",K[x]=ei+"Minutes",K[v]=ei+"Seconds",K[g]=ei+"Milliseconds",K)[er],el="day"===er?this.$D+(E-this.$W):E;if(er===T||er===et){var ec=this.clone().set(en,1);ec.$d[es](el),ec.init(),this.$d=ec.set(en,Math.min(this.$D,ec.daysInMonth())).$d}else es&&this.$d[es](el);return this.init(),this},m.set=function(m,g){return this.clone().$set(m,g)},m.get=function(m){return this[eh.p(m)]()},m.add=function(m,g){var K,en=this;m=Number(m);var er=eh.p(g),y=function(g){var v=ef(en);return eh.w(v.date(v.date()+Math.round(g*m)),en)};if(er===T)return this.set(T,this.$M+m);if(er===et)return this.set(et,this.$y+m);if("day"===er)return y(1);if(er===E)return y(7);var ei=((K={})[x]=6e4,K[k]=36e5,K[v]=1e3,K)[er]||1,es=this.$d.getTime()+m*ei;return eh.w(es,this)},m.subtract=function(m,g){return this.add(-1*m,g)},m.format=function(m){var g=this,v=this.$locale();if(!this.isValid())return v.invalidDate||er;var x=m||"YYYY-MM-DDTHH:mm:ssZ",k=eh.z(this),E=this.$H,T=this.$m,K=this.$M,et=v.weekdays,en=v.months,ei=v.meridiem,h=function(m,v,k,E){return m&&(m[v]||m(g,x))||k[v].slice(0,E)},d=function(m){return eh.s(E%12||12,m,"0")},el=ei||function(m,g,v){var x=m<12?"AM":"PM";return v?x.toLowerCase():x};return x.replace(es,function(m,x){return x||function(m){switch(m){case"YY":return String(g.$y).slice(-2);case"YYYY":return eh.s(g.$y,4,"0");case"M":return K+1;case"MM":return eh.s(K+1,2,"0");case"MMM":return h(v.monthsShort,K,en,3);case"MMMM":return h(en,K);case"D":return g.$D;case"DD":return eh.s(g.$D,2,"0");case"d":return String(g.$W);case"dd":return h(v.weekdaysMin,g.$W,et,2);case"ddd":return h(v.weekdaysShort,g.$W,et,3);case"dddd":return et[g.$W];case"H":return String(E);case"HH":return eh.s(E,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return el(E,T,!0);case"A":return el(E,T,!1);case"m":return String(T);case"mm":return eh.s(T,2,"0");case"s":return String(g.$s);case"ss":return eh.s(g.$s,2,"0");case"SSS":return eh.s(g.$ms,3,"0");case"Z":return k}return null}(m)||k.replace(":","")})},m.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},m.diff=function(m,g,en){var er,ei=this,es=eh.p(g),el=ef(m),ec=(el.utcOffset()-this.utcOffset())*6e4,eu=this-el,D=function(){return eh.m(ei,el)};switch(es){case et:er=D()/12;break;case T:er=D();break;case K:er=D()/3;break;case E:er=(eu-ec)/6048e5;break;case"day":er=(eu-ec)/864e5;break;case k:er=eu/36e5;break;case x:er=eu/6e4;break;case v:er=eu/1e3;break;default:er=eu}return en?er:eh.a(er)},m.daysInMonth=function(){return this.endOf(T).$D},m.$locale=function(){return eu[this.$L]},m.locale=function(m,g){if(!m)return this.$L;var v=this.clone(),x=em(m,g,!0);return x&&(v.$L=x),v},m.clone=function(){return eh.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}()).prototype,ef.prototype=ev,[["$ms",g],["$s",v],["$m",x],["$H",k],["$W","day"],["$M",T],["$y",et],["$D",en]].forEach(function(m){ev[m[1]]=function(g){return this.$g(g,m[0],m[1])}}),ef.extend=function(m,g){return m.$i||(m(g,eg,ef),m.$i=!0),ef},ef.locale=em,ef.isDayjs=ep,ef.unix=function(m){return ef(1e3*m)},ef.en=eu[ec],ef.Ls=eu,ef.p={},ef)},67763:function(m,g,v){var x,k;m.exports=(x=v(27484),k={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},ordinal:function(m){return m+"\xba"}},(x&&"object"==typeof x&&"default"in x?x:{default:x}).default.locale(k,null,!0),k)},1646:function(m){var g,v,x,k,E,T,K,et,en,er,ei,es,el;m.exports=(x=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,k=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,E={years:31536e6,months:2628e6,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},T=function(m){return m instanceof es},K=function(m,g,v){return new es(m,v,g.$l)},et=function(m){return v.p(m)+"s"},en=function(m){return m<0},er=function(m){return en(m)?Math.ceil(m):Math.floor(m)},ei=function(m,g){return m?en(m)?{negative:!0,format:""+Math.abs(m)+g}:{negative:!1,format:""+m+g}:{negative:!1,format:""}}
1,es=function(){function l(m,g,v){var k=this;if(this.$d={},this.$l=v,void 0===m&&(this.$ms=0,this.parseFromMilliseconds()),g)return K(m*E[et(g)],this);if("number"==typeof m)return this.$ms=m,this.parseFromMilliseconds(),this;if("object"==typeof m)return Object.keys(m).forEach(function(g){k.$d[et(g)]=m[g]}),this.calMilliseconds(),this;if("string"==typeof m){var T=m.match(x);if(T){var en=T.slice(2).map(function(m){return null!=m?Number(m):0});return this.$d.years=en[0],this.$d.months=en[1],this.$d.weeks=en[2],this.$d.days=en[3],this.$d.hours=en[4],this.$d.minutes=en[5],this.$d.seconds=en[6],this.calMilliseconds(),this}}return this}var m=l.prototype;return m.calMilliseconds=function(){var m=this;this.$ms=Object.keys(this.$d).reduce(function(g,v){return g+(m.$d[v]||0)*E[v]},0)},m.parseFromMilliseconds=function(){var m=this.$ms;this.$d.years=er(m/31536e6),m%=31536e6,this.$d.months=er(m/2628e6),m%=2628e6,this.$d.days=er(m/864e5),m%=864e5,this.$d.hours=er(m/36e5),m%=36e5,this.$d.minutes=er(m/6e4),m%=6e4,this.$d.seconds=er(m/1e3),m%=1e3,this.$d.milliseconds=m},m.toISOString=function(){var m=ei(this.$d.years,"Y"),g=ei(this.$d.months,"M"),v=+this.$d.days||0;this.$d.weeks&&(v+=7*this.$d.weeks);var x=ei(v,"D"),k=ei(this.$d.hours,"H"),E=ei(this.$d.minutes,"M"),T=this.$d.seconds||0;this.$d.milliseconds&&(T+=this.$d.milliseconds/1e3,T=Math.round(1e3*T)/1e3);var K=ei(T,"S"),et=m.negative||g.negative||x.negative||k.negative||E.negative||K.negative,en=k.format||E.format||K.format?"T":"",er=(et?"-":"")+"P"+m.format+g.format+x.format+en+k.format+E.format+K.format;return"P"===er||"-P"===er?"P0D":er},m.toJSON=function(){return this.toISOString()},m.format=function(m){var g={Y:this.$d.years,YY:v.s(this.$d.years,2,"0"),YYYY:v.s(this.$d.years,4,"0"),M:this.$d.months,MM:v.s(this.$d.months,2,"0"),D:this.$d.days,DD:v.s(this.$d.days,2,"0"),H:this.$d.hours,HH:v.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:v.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:v.s(this.$d.seconds,2,"0"),SSS:v.s(this.$d.milliseconds,3,"0")};return(m||"YYYY-MM-DDTHH:mm:ss").replace(k,function(m,v){return v||String(g[m])})},m.as=function(m){return this.$ms/E[et(m)]},m.get=function(m){var g=this.$ms,v=et(m);return"milliseconds"===v?g%=1e3:g="weeks"===v?er(g/E[v]):this.$d[v],g||0},m.add=function(m,g,v){var x;return x=g?m*E[et(g)]:T(m)?m.$ms:K(m,this).$ms,K(this.$ms+x*(v?-1:1),this)},m.subtract=function(m,g){return this.add(m,g,!0)},m.locale=function(m){var g=this.clone();return g.$l=m,g},m.clone=function(){return K(this.$ms,this)},m.humanize=function(m){return g().add(this.$ms,"ms").locale(this.$l).fromNow(!m)},m.valueOf=function(){return this.asMilliseconds()},m.milliseconds=function(){return this.get("milliseconds")},m.asMilliseconds=function(){return this.as("milliseconds")},m.seconds=function(){return this.get("seconds")},m.asSeconds=function(){return this.as("seconds")},m.minutes=function(){return this.get("minutes")},m.asMinutes=function(){return this.as("minutes")},m.hours=function(){return this.get("hours")},m.asHours=function(){return this.as("hours")},m.days=function(){return this.get("days")},m.asDays=function(){return this.as("days")},m.weeks=function(){return this.get("weeks")},m.asWeeks=function(){return this.as("weeks")},m.months=function(){return this.get("months")},m.asMonths=function(){return this.as("months")},m.years=function(){return this.get("years")},m.asYears=function(){return this.as("years")},l}(),el=function(m,g,v){return m.add(g.years()*v,"y").add(g.months()*v,"M").add(g.days()*v,"d").add(g.hours()*v,"h").add(g.minutes()*v,"m").add(g.seconds()*v,"s").add(g.milliseconds()*v,"ms")},function(m,x,k){g=k,v=k().$utils(),k.duration=function(m,g){return K(m,{$l:k.locale()},g)},k.isDuration=T;var E=x.prototype.add,et=x.prototype.subtract;x.prototype.add=function(m,g){return T(m)?el(this,m,1):E.bind(this)(m,g)},x.prototype.subtract=function(m,g){return T(m)?el(this,m,-1):et.bind(this)(m,g)}})},79212:function(m){m.exports=function(m,g){g.prototype.isSameOrAfter=function(m,g){return this.isSame(m,g)||this.isAfter(m,g)}}},84110:function(m){m.exports=function(m,g,v){m=m||{};var x=g.prototype,k={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(m,g,v,k){return x.fromToBase(m,g,v,k)}v.en.relativeTime=k,x.fromToBase=function(g,x,E,T,K){for(var et,en,er,ei=E.$locale().relativeTime||k,es=m.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],el=es.length,ec=0;ec<el;ec+=1){var eu=es[ec];eu.d&&(et=T?v(g).diff(E,eu.d,!0):E.diff(g,eu.d,!0));var ed=(m.rounding||Math.round)(Math.abs(et));if(er=et>0,ed<=eu.r||!eu.r){ed<=1&&ec>0&&(eu=es[ec-1]);var ep=ei[eu.l];K&&(ed=K(""+ed)),en="string"==typeof ep?ep.replace("%d",ed):ep(ed,x,eu.l,er);break}}if(x)return en;var em=er?ei.future:ei.past;return"function"==typeof em?em(en):em.replace("%s",en)},x.to=function(m,g){return i(m,g,this,!0)},x.from=function(m,g){return i(m,g,this)};var d=function(m){return m.$u?v.utc():v()};x.toNow=function(m){return this.to(d(this),m)},x.fromNow=function(m){return this.from(d(this),m)}}},29387:function(m){var g,v;m.exports=(g={year:0,month:1,day:2,hour:3,minute:4,second:5},v={},function(m,x,k){var E,u=function(m,g,x){void 0===x&&(x={});var k,E,T,K,et=new Date(m);return(void 0===(k=x)&&(k={}),(K=v[T=g+"|"+(E=k.timeZoneName||"short")])||(K=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:g,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:E}),v[T]=K),K).formatToParts(et)},a=function(m,v){for(var x=u(m,v),E=[],T=0;T<x.length;T+=1){var K=x[T],et=K.type,en=K.value,er=g[et];er>=0&&(E[er]=parseInt(en,10))}var ei=E[3],es=E[0]+"-"+E[1]+"-"+E[2]+" "+(24===ei?0:ei)+":"+E[4]+":"+E[5]+":000",el=+m;return(k.utc(es).valueOf()-(el-=el%1e3))/6e4},T=x.prototype;T.tz=function(m,g){void 0===m&&(m=E);
1var v,x=this.utcOffset(),T=this.toDate(),K=T.toLocaleString("en-US",{timeZone:m}),et=a(+T,m);if(Number(et)){if(v=k(K,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(et,!0),g){var en=v.utcOffset();v=v.add(x-en,"minute")}}else v=this.utcOffset(0,g);return v.$x.$timezone=m,v},T.offsetName=function(m){var g=this.$x.$timezone||k.tz.guess(),v=u(this.valueOf(),g,{timeZoneName:m}).find(function(m){return"timezonename"===m.type.toLowerCase()});return v&&v.value};var K=T.startOf;T.startOf=function(m,g){if(!this.$x||!this.$x.$timezone)return K.call(this,m,g);var v=k(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return K.call(v,m,g).tz(this.$x.$timezone,!0)},k.tz=function(m,g,v){var x=v&&g,T=v||g||E,K=a(+k(),T);if("string"!=typeof m)return k(m).tz(T);var et=function(m,g,v){var x=m-60*g*1e3,k=a(x,v);if(g===k)return[x,g];var E=a(x-=60*(k-g)*1e3,v);return k===E?[x,k]:[m-60*Math.min(k,E)*1e3,Math.max(k,E)]}(k.utc(m,x).valueOf(),K,T),en=et[0],er=et[1],ei=k(en).utcOffset(er);return ei.$x.$timezone=T,ei},k.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},k.tz.setDefault=function(m){E=m}})},70178:function(m){var g,v,x;m.exports=(g="minute",v=/[+-]\d\d(?::?\d\d)?/g,x=/([+-]|\d\d)/g,function(m,k,E){var T=k.prototype;E.utc=function(m){var g={date:m,utc:!0,args:arguments};return new k(g)},T.utc=function(m){var v=E(this.toDate(),{locale:this.$L,utc:!0});return m?v.add(this.utcOffset(),g):v},T.local=function(){return E(this.toDate(),{locale:this.$L,utc:!1})};var K=T.parse;T.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),K.call(this,m)};var et=T.init;T.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else et.call(this)};var en=T.utcOffset;T.utcOffset=function(m,k){var E=this.$utils().u;if(E(m))return this.$u?0:E(this.$offset)?en.call(this):this.$offset;if("string"==typeof m&&null===(m=function(m){void 0===m&&(m="");var g=m.match(v);if(!g)return null;var k=(""+g[0]).match(x)||["-",0,0],E=k[0],T=60*+k[1]+ +k[2];return 0===T?0:"+"===E?T:-T}(m)))return this;var T=16>=Math.abs(m)?60*m:m;if(0===T)return this.utc(k);var K=this.clone();if(k)return K.$offset=T,K.$u=!1,K;var et=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(K=this.local().add(T+et,g)).$offset=T,K.$x.$localOffset=et,K};var er=T.format;T.format=function(m){var g=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return er.call(this,g)},T.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},T.isUTC=function(){return!!this.$u},T.toISOString=function(){return this.toDate().toISOString()},T.toString=function(){return this.toDate().toUTCString()};var ei=T.toDate;T.toDate=function(m){return"s"===m&&this.$offset?E(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():ei.call(this)};var es=T.diff;T.diff=function(m,g,v){if(m&&this.$u===m.$u)return es.call(this,m,g,v);var x=this.local(),k=E(m).local();return es.call(x,k,g,v)}})},18552:function(m,g,v){var x=v(10852)(v(55639),"DataView");m.exports=x},1989:function(m,g,v){var x=v(51789),k=v(80401),E=v(57667),T=v(21327),K=v(81866);function Hash(m){var g=-1,v=null==m?0:m.length;for(this.clear();++g<v;){var x=m[g];this.set(x[0],x[1])}}Hash.prototype.clear=x,Hash.prototype.delete=k,Hash.prototype.get=E,Hash.prototype.has=T,Hash.prototype.set=K,m.exports=Hash},38407:function(m,g,v){var x=v(27040),k=v(14125),E=v(82117),T=v(67518),K=v(54705);function ListCache(m){var g=-1,v=null==m?0:m.length;for(this.clear();++g<v;){var x=m[g];this.set(x[0],x[1])}}ListCache.prototype.clear=x,ListCache.prototype.delete=k,ListCache.prototype.get=E,ListCache.prototype.has=T,ListCache.prototype.set=K,m.exports=ListCache},57071:function(m,g,v){var x=v(10852)(v(55639),"Map");m.exports=x},83369:function(m,g,v){var x=v(24785),k=v(11285),E=v(96e3),T=v(49916),K=v(95265);function MapCache(m){var g=-1,v=null==m?0:m.length;for(this.clear();++g<v;){var x=m[g];this.set(x[0],x[1])}}MapCache.prototype.clear=x,MapCache.prototype.delete=k,MapCache.prototype.get=E,MapCache.prototype.has=T,MapCache.prototype.set=K,m.exports=MapCache},53818:function(m,g,v){var x=v(10852)(v(55639),"Promise");m.exports=x},58525:function(m,g,v){var x=v(10852)(v(55639),"Set");m.exports=x},46384:function(m,g,v){var x=v(38407),k=v(37465),E=v(63779),T=v(67599),K=v(44758),et=v(34309);function Stack(m){var g=this.__data__=new x(m);this.size=g.size}Stack.prototype.clear=k,Stack.prototype.delete=E,Stack.prototype.get=T,Stack.prototype.has=K,Stack.prototype.set=et,m.exports=Stack},62705:function(m,g,v){var x=v(55639).Symbol;m.exports=x},11149:function(m,g,v){var x=v(55639).Uint8Array;m.exports=x},70577:function(m,g,v){var x=v(10852)(v(55639),"WeakMap");m.exports=x}
1,77412:function(m){m.exports=function(m,g){for(var v=-1,x=null==m?0:m.length;++v<x&&!1!==g(m[v],v,m););return m}},34963:function(m){m.exports=function(m,g){for(var v=-1,x=null==m?0:m.length,k=0,E=[];++v<x;){var T=m[v];g(T,v,m)&&(E[k++]=T)}return E}},14636:function(m,g,v){var x=v(22545),k=v(35694),E=v(1469),T=v(44144),K=v(65776),et=v(36719),en=Object.prototype.hasOwnProperty;m.exports=function(m,g){var v=E(m),er=!v&&k(m),ei=!v&&!er&&T(m),es=!v&&!er&&!ei&&et(m),el=v||er||ei||es,ec=el?x(m.length,String):[],eu=ec.length;for(var ed in m)(g||en.call(m,ed))&&!(el&&("length"==ed||ei&&("offset"==ed||"parent"==ed)||es&&("buffer"==ed||"byteLength"==ed||"byteOffset"==ed)||K(ed,eu)))&&ec.push(ed);return ec}},62488:function(m){m.exports=function(m,g){for(var v=-1,x=g.length,k=m.length;++v<x;)m[k+v]=g[v];return m}},34865:function(m,g,v){var x=v(89465),k=v(77813),E=Object.prototype.hasOwnProperty;m.exports=function(m,g,v){var T=m[g];E.call(m,g)&&k(T,v)&&(void 0!==v||g in m)||x(m,g,v)}},18470:function(m,g,v){var x=v(77813);m.exports=function(m,g){for(var v=m.length;v--;)if(x(m[v][0],g))return v;return -1}},44037:function(m,g,v){var x=v(98363),k=v(3674);m.exports=function(m,g){return m&&x(g,k(g),m)}},63886:function(m,g,v){var x=v(98363),k=v(81704);m.exports=function(m,g){return m&&x(g,k(g),m)}},89465:function(m,g,v){var x=v(38777);m.exports=function(m,g,v){"__proto__"==g&&x?x(m,g,{configurable:!0,enumerable:!0,value:v,writable:!0}):m[g]=v}},85990:function(m,g,v){var x=v(46384),k=v(77412),E=v(34865),T=v(44037),K=v(63886),et=v(64626),en=v(278),er=v(18805),ei=v(1911),es=v(58234),el=v(66590),ec=v(64160),eu=v(43824),ed=v(29148),ep=v(38517),em=v(1469),ef=v(44144),eh=v(56688),eg=v(13218),ev=v(72928),ey=v(3674),eb=v(81704),ex="[object Arguments]",e_="[object Function]",ew="[object Object]",eS={};eS[ex]=eS["[object Array]"]=eS["[object ArrayBuffer]"]=eS["[object DataView]"]=eS["[object Boolean]"]=eS["[object Date]"]=eS["[object Float32Array]"]=eS["[object Float64Array]"]=eS["[object Int8Array]"]=eS["[object Int16Array]"]=eS["[object Int32Array]"]=eS["[object Map]"]=eS["[object Number]"]=eS[ew]=eS["[object RegExp]"]=eS["[object Set]"]=eS["[object String]"]=eS["[object Symbol]"]=eS["[object Uint8Array]"]=eS["[object Uint8ClampedArray]"]=eS["[object Uint16Array]"]=eS["[object Uint32Array]"]=!0,eS["[object Error]"]=eS[e_]=eS["[object WeakMap]"]=!1,m.exports=function baseClone(m,g,v,eC,ek,eE){var ej,eN=1&g,eR=2&g,eI=4&g;if(v&&(ej=ek?v(m,eC,ek,eE):v(m)),void 0!==ej)return ej;if(!eg(m))return m;var eP=em(m);if(eP){if(ej=eu(m),!eN)return en(m,ej)}else{var eT=ec(m),eO=eT==e_||"[object GeneratorFunction]"==eT;if(ef(m))return et(m,eN);if(eT==ew||eT==ex||eO&&!ek){if(ej=eR||eO?{}:ep(m),!eN)return eR?ei(m,K(ej,m)):er(m,T(ej,m))}else{if(!eS[eT])return ek?m:{};ej=ed(m,eT,eN)}}eE||(eE=new x);var eA=eE.get(m);if(eA)return eA;eE.set(m,ej),ev(m)?m.forEach(function(x){ej.add(baseClone(x,g,v,x,m,eE))}):eh(m)&&m.forEach(function(x,k){ej.set(k,baseClone(x,g,v,k,m,eE))});var eM=eI?eR?el:es:eR?eb:ey,eD=eP?void 0:eM(m);return k(eD||m,function(x,k){eD&&(x=m[k=x]),E(ej,k,baseClone(x,g,v,k,m,eE))}),ej}},3118:function(m,g,v){var x=v(13218),k=Object.create,E=function(){function object(){}return function(m){if(!x(m))return{};if(k)return k(m);object.prototype=m;var g=new object;return object.prototype=void 0,g}}();m.exports=E},68866:function(m,g,v){var x=v(62488),k=v(1469);m.exports=function(m,g,v){var E=g(m);return k(m)?E:x(E,v(m))}},44239:function(m,g,v){var x=v(62705),k=v(89607),E=v(28436),T=x?x.toStringTag:void 0;m.exports=function(m){return null==m?void 0===m?"[object Undefined]":"[object Null]":T&&T in Object(m)?k(m):E(m)}},9454:function(m,g,v){var x=v(44239),k=v(37005);m.exports=function(m){return k(m)&&"[object Arguments]"==x(m)}},25588:function(m,g,v){var x=v(64160),k=v(37005);m.exports=function(m){return k(m)&&"[object Map]"==x(m)}},28458:function(m,g,v){var x=v(23560),k=v(15346),E=v(13218),T=v(80346),K=/^\[object .+?Constructor\]$/,et=Object.prototype,en=Function.prototype.toString,er=et.hasOwnProperty,ei=RegExp("^"+en.call(er).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");m.exports=function(m){return!(!E(m)||k(m))&&(x(m)?ei:K).test(T(m))}},29221:function(m,g,v){var x=v(64160),k=v(37005);m.exports=function(m){return k(m)&&"[object Set]"==x(m)}},38749:function(m,g,v){var x=v(44239),k=v(41780),E=v(37005),T={};
vendor: 3,702 bytes, line 1
1T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Arguments]"]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object Boolean]"]=T["[object DataView]"]=T["[object Date]"]=T["[object Error]"]=T["[object Function]"]=T["[object Map]"]=T["[object Number]"]=T["[object Object]"]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object WeakMap]"]=!1,m.exports=function(m){return E(m)&&k(m.length)&&!!T[x(m)]}},280:function(m,g,v){var x=v(25726),k=v(86916),E=Object.prototype.hasOwnProperty;m.exports=function(m){if(!x(m))return k(m);var g=[];for(var v in Object(m))E.call(m,v)&&"constructor"!=v&&g.push(v);return g}},10313:function(m,g,v){var x=v(13218),k=v(25726),E=v(33498),T=Object.prototype.hasOwnProperty;m.exports=function(m){if(!x(m))return E(m);var g=k(m),v=[];for(var K in m)"constructor"==K&&(g||!T.call(m,K))||v.push(K);return v}},22545:function(m){m.exports=function(m,g){for(var v=-1,x=Array(m);++v<m;)x[v]=g(v);return x}},7518:function(m){m.exports=function(m){return function(g){return m(g)}}},74318:function(m,g,v){var x=v(11149);m.exports=function(m){var g=new m.constructor(m.byteLength);return new x(g).set(new x(m)),g}},64626:function(m,g,v){m=v.nmd(m);var x=v(55639),k=g&&!g.nodeType&&g,E=k&&m&&!m.nodeType&&m,T=E&&E.exports===k?x.Buffer:void 0,K=T?T.allocUnsafe:void 0;m.exports=function(m,g){if(g)return m.slice();var v=m.length,x=K?K(v):new m.constructor(v);return m.copy(x),x}},57157:function(m,g,v){var x=v(74318);m.exports=function(m,g){var v=g?x(m.buffer):m.buffer;return new m.constructor(v,m.byteOffset,m.byteLength)}},93147:function(m){var g=/\w*$/;m.exports=function(m){var v=new m.constructor(m.source,g.exec(m));return v.lastIndex=m.lastIndex,v}},40419:function(m,g,v){var x=v(62705),k=x?x.prototype:void 0,E=k?k.valueOf:void 0;m.exports=function(m){return E?Object(E.call(m)):{}}},77133:function(m,g,v){var x=v(74318);m.exports=function(m,g){var v=g?x(m.buffer):m.buffer;return new m.constructor(v,m.byteOffset,m.length)}},278:function(m){m.exports=function(m,g){var v=-1,x=m.length;for(g||(g=Array(x));++v<x;)g[v]=m[v];return g}},98363:function(m,g,v){var x=v(34865),k=v(89465);m.exports=function(m,g,v,E){var T=!v;v||(v={});for(var K=-1,et=g.length;++K<et;){var en=g[K],er=E?E(v[en],m[en],en,v,m):void 0;void 0===er&&(er=m[en]),T?k(v,en,er):x(v,en,er)}return v}},18805:function(m,g,v){var x=v(98363),k=v(99551);m.exports=function(m,g){return x(m,k(m),g)}},1911:function(m,g,v){var x=v(98363),k=v(51442);m.exports=function(m,g){return x(m,k(m),g)}},14429:function(m,g,v){var x=v(55639)["__core-js_shared__"];m.exports=x},38777:function(m,g,v){var x=v(10852),k=function(){try{var m=x(Object,"defineProperty");return m({},"",{}),m}catch(m){}}();m.exports=k},31957:function(m,g,v){var x="object"==typeof v.g&&v.g&&v.g.Object===Object&&v.g;m.exports=x},58234:function(m,g,v){var x=v(68866),k=v(99551),E=v(3674);m.exports=function(m){return x(m,E,k)}},66590:function(m,g,v){var x=v(68866),k=v(51442),E=v(81704);m.exports=function(m){return x(m,E,k)}},45050:function(m,g,v){var x=v(37019);m.exports=function(m,g){var v=m.__data__;return x(g)?v["string"==typeof g?"string":"hash"]:v.map}},10852:function(m,g,v){var x=v(28458),k=v(47801);m.exports=function(m,g){var v=k(m,g);return x(v)?v:void 0}},85924:function(m,g,v){var x=v(5569)(Object.getPrototypeOf,Object);m.exports=x},89607:function(m,g,v){var x=v(62705),k=Object.prototype,E=k.hasOwnProperty,T=k.toString,K=x?x.toStringTag:void 0;m.exports=function(m){var g=E.call(m,K),v=m[K];try{m[K]=void 0;var x=!0}
vendor: 4,285 bytes, line 1
1catch(m){}var k=T.call(m);return x&&(g?m[K]=v:delete m[K]),k}},99551:function(m,g,v){var x=v(34963),k=v(70479),E=Object.prototype.propertyIsEnumerable,T=Object.getOwnPropertySymbols,K=T?function(m){return null==m?[]:x(T(m=Object(m)),function(g){return E.call(m,g)})}:k;m.exports=K},51442:function(m,g,v){var x=v(62488),k=v(85924),E=v(99551),T=v(70479),K=Object.getOwnPropertySymbols?function(m){for(var g=[];m;)x(g,E(m)),m=k(m);return g}:T;m.exports=K},64160:function(m,g,v){var x=v(18552),k=v(57071),E=v(53818),T=v(58525),K=v(70577),et=v(44239),en=v(80346),er="[object Map]",ei="[object Promise]",es="[object Set]",el="[object WeakMap]",ec="[object DataView]",eu=en(x),ed=en(k),ep=en(E),em=en(T),ef=en(K),eh=et;(x&&eh(new x(new ArrayBuffer(1)))!=ec||k&&eh(new k)!=er||E&&eh(E.resolve())!=ei||T&&eh(new T)!=es||K&&eh(new K)!=el)&&(eh=function(m){var g=et(m),v="[object Object]"==g?m.constructor:void 0,x=v?en(v):"";if(x)switch(x){case eu:return ec;case ed:return er;case ep:return ei;case em:return es;case ef:return el}return g}),m.exports=eh},47801:function(m){m.exports=function(m,g){return null==m?void 0:m[g]}},51789:function(m,g,v){var x=v(94536);m.exports=function(){this.__data__=x?x(null):{},this.size=0}},80401:function(m){m.exports=function(m){var g=this.has(m)&&delete this.__data__[m];return this.size-=g?1:0,g}},57667:function(m,g,v){var x=v(94536),k=Object.prototype.hasOwnProperty;m.exports=function(m){var g=this.__data__;if(x){var v=g[m];return"__lodash_hash_undefined__"===v?void 0:v}return k.call(g,m)?g[m]:void 0}},21327:function(m,g,v){var x=v(94536),k=Object.prototype.hasOwnProperty;m.exports=function(m){var g=this.__data__;return x?void 0!==g[m]:k.call(g,m)}},81866:function(m,g,v){var x=v(94536);m.exports=function(m,g){var v=this.__data__;return this.size+=this.has(m)?0:1,v[m]=x&&void 0===g?"__lodash_hash_undefined__":g,this}},43824:function(m){var g=Object.prototype.hasOwnProperty;m.exports=function(m){var v=m.length,x=new m.constructor(v);return v&&"string"==typeof m[0]&&g.call(m,"index")&&(x.index=m.index,x.input=m.input),x}},29148:function(m,g,v){var x=v(74318),k=v(57157),E=v(93147),T=v(40419),K=v(77133);m.exports=function(m,g,v){var et=m.constructor;switch(g){case"[object ArrayBuffer]":return x(m);case"[object Boolean]":case"[object Date]":return new et(+m);case"[object DataView]":return k(m,v);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return K(m,v);case"[object Map]":case"[object Set]":return new et;case"[object Number]":case"[object String]":return new et(m);case"[object RegExp]":return E(m);case"[object Symbol]":return T(m)}}},38517:function(m,g,v){var x=v(3118),k=v(85924),E=v(25726);m.exports=function(m){return"function"!=typeof m.constructor||E(m)?{}:x(k(m))}},65776:function(m){var g=/^(?:0|[1-9]\d*)$/;m.exports=function(m,v){var x=typeof m;return!!(v=null==v?9007199254740991:v)&&("number"==x||"symbol"!=x&&g.test(m))&&m>-1&&m%1==0&&m<v}},37019:function(m){m.exports=function(m){var g=typeof m;return"string"==g||"number"==g||"symbol"==g||"boolean"==g?"__proto__"!==m:null===m}},15346:function(m,g,v){var x,k=v(14429),E=(x=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"";m.exports=function(m){return!!E&&E in m}},25726:function(m){var g=Object.prototype;m.exports=function(m){var v=m&&m.constructor;return m===("function"==typeof v&&v.prototype||g)}},27040:function(m){m.exports=function(){this.__data__=[],this.size=0}},14125:function(m,g,v){var x=v(18470),k=Array.prototype.splice;m.exports=function(m){var g=this.__data__,v=x(g,m);return!(v<0)&&(v==g.length-1?g.pop():k.call(g,v,1),--this.size,!0)}},82117:function(m,g,v){var x=v(18470);m.exports=function(m){var g=this.__data__,v=x(g,m);return v<0?void 0:g[v][1]}},67518:function(m,g,v){var x=v(18470);m.exports=function(m){return x(this.__data__,m)>-1}},54705:function(m,g,v){var x=v(18470);m.exports=function(m,g){var v=this.__data__,k=x(v,m);return k<0?(++this.size,v.push([m,g])):v[k][1]=g,this}},24785:function(m,g,v){var x=v(1989),k=v(38407),E=v(57071);m.exports=function(){this.size=0,this.__data__={hash:new x,map:new(E||k),string:new x}}}
1,11285:function(m,g,v){var x=v(45050);m.exports=function(m){var g=x(this,m).delete(m);return this.size-=g?1:0,g}},96e3:function(m,g,v){var x=v(45050);m.exports=function(m){return x(this,m).get(m)}},49916:function(m,g,v){var x=v(45050);m.exports=function(m){return x(this,m).has(m)}},95265:function(m,g,v){var x=v(45050);m.exports=function(m,g){var v=x(this,m),k=v.size;return v.set(m,g),this.size+=v.size==k?0:1,this}},94536:function(m,g,v){var x=v(10852)(Object,"create");m.exports=x},86916:function(m,g,v){var x=v(5569)(Object.keys,Object);m.exports=x},33498:function(m){m.exports=function(m){var g=[];if(null!=m)for(var v in Object(m))g.push(v);return g}},31167:function(m,g,v){m=v.nmd(m);var x=v(31957),k=g&&!g.nodeType&&g,E=k&&m&&!m.nodeType&&m,T=E&&E.exports===k&&x.process,K=function(){try{var m=E&&E.require&&E.require("util").types;if(m)return m;return T&&T.binding&&T.binding("util")}catch(m){}}();m.exports=K},28436:function(m){var g=Object.prototype.toString;m.exports=function(m){return g.call(m)}},5569:function(m){m.exports=function(m,g){return function(v){return m(g(v))}}},55639:function(m,g,v){var x=v(31957),k="object"==typeof self&&self&&self.Object===Object&&self,E=x||k||Function("return this")();m.exports=E},37465:function(m,g,v){var x=v(38407);m.exports=function(){this.__data__=new x,this.size=0}},63779:function(m){m.exports=function(m){var g=this.__data__,v=g.delete(m);return this.size=g.size,v}},67599:function(m){m.exports=function(m){return this.__data__.get(m)}},44758:function(m){m.exports=function(m){return this.__data__.has(m)}},34309:function(m,g,v){var x=v(38407),k=v(57071),E=v(83369);m.exports=function(m,g){var v=this.__data__;if(v instanceof x){var T=v.__data__;if(!k||T.length<199)return T.push([m,g]),this.size=++v.size,this;v=this.__data__=new E(T)}return v.set(m,g),this.size=v.size,this}},80346:function(m){var g=Function.prototype.toString;m.exports=function(m){if(null!=m){try{return g.call(m)}catch(m){}try{return m+""}catch(m){}}return""}},50361:function(m,g,v){var x=v(85990);m.exports=function(m){return x(m,5)}},77813:function(m){m.exports=function(m,g){return m===g||m!=m&&g!=g}},35694:function(m,g,v){var x=v(9454),k=v(37005),E=Object.prototype,T=E.hasOwnProperty,K=E.propertyIsEnumerable,et=x(function(){return arguments}())?x:function(m){return k(m)&&T.call(m,"callee")&&!K.call(m,"callee")};m.exports=et},1469:function(m){var g=Array.isArray;m.exports=g},98612:function(m,g,v){var x=v(23560),k=v(41780);m.exports=function(m){return null!=m&&k(m.length)&&!x(m)}},44144:function(m,g,v){m=v.nmd(m);var x=v(55639),k=v(95062),E=g&&!g.nodeType&&g,T=E&&m&&!m.nodeType&&m,K=T&&T.exports===E?x.Buffer:void 0,et=K?K.isBuffer:void 0;m.exports=et||k},23560:function(m,g,v){var x=v(44239),k=v(13218);m.exports=function(m){if(!k(m))return!1;var g=x(m);return"[object Function]"==g||"[object GeneratorFunction]"==g||"[object AsyncFunction]"==g||"[object Proxy]"==g}},41780:function(m){m.exports=function(m){return"number"==typeof m&&m>-1&&m%1==0&&m<=9007199254740991}},56688:function(m,g,v){var x=v(25588),k=v(7518),E=v(31167),T=E&&E.isMap,K=T?k(T):x;m.exports=K},13218:function(m){m.exports=function(m){var g=typeof m;return null!=m&&("object"==g||"function"==g)}},37005:function(m){m.exports=function(m){return null!=m&&"object"==typeof m}},72928:function(m,g,v){var x=v(29221),k=v(7518),E=v(31167),T=E&&E.isSet,K=T?k(T):x;m.exports=K},36719:function(m,g,v){var x=v(38749),k=v(7518),E=v(31167),T=E&&E.isTypedArray,K=T?k(T):x;m.exports=K},3674:function(m,g,v){var x=v(14636),k=v(280),E=v(98612);m.exports=function(m){return E(m)?x(m):k(m)}},81704:function(m,g,v){var x=v(14636),k=v(10313),E=v(98612);m.exports=function(m){return E(m)?x(m,!0):k(m)}},70479:function(m){m.exports=function(){return[]}},95062:function(m){m.exports=function(){return!1}},5799:function(m,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.regionAPIs=void 0,g.regionAPIs=new Map([["us","https://api-iam.intercom.io"],["eu","https://api-iam.eu.intercom.io"],["ap","https://api-iam.au.intercom.io"]])},48943:function(m,g,v){"use strict";var x=this&&this.__rest||function(m,g){var v={};for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&0>g.indexOf(x)&&(v[x]=m[x]);if(null!=m&&"function"==typeof Object.getOwnPropertySymbols)for(var k=0,x=Object.getOwnPropertySymbols(m);k<x.length;k++)0>g.indexOf(x[k])&&Object.prototype.propertyIsEnumerable.call(m,x[k])&&(v[x[k]]=m[x[k]]);return v};
1Object.defineProperty(g,"__esModule",{value:!0}),g.startConversation=g.hideNotifications=g.onUserEmailSupplied=g.showConversation=g.showTicket=g.startChecklist=g.startSurvey=g.showNews=g.showArticle=g.startTour=g.whoami=g.getVisitorId=g.trackEvent=g.onUnreadCountChange=g.onShow=g.onHide=g.showNewMessage=g.showMessages=g.showSpace=g.show=g.hide=g.update=g.shutdown=g.boot=g.Intercom=void 0;let k=v(5799),E=v(13866),callIntercomMethod=(m,...g)=>{if(window.Intercom)return window.Intercom(m,...g);console.warn("Please ensure Intercom is setup and running on client-side!")};g.Intercom=m=>{if("object"!=typeof m){console.warn("Intercom initialiser called with invalid parameters.");return}let{region:g="us",widgetUrl:v}=m,T=x(m,["region","widgetUrl"]);"undefined"==typeof window||E.ref||(window.intercomSettings=Object.assign(Object.assign({},T),{api_base:k.regionAPIs.get(g)}),(0,E.init)({widgetUrl:v}))},g.default=g.Intercom,g.boot=m=>callIntercomMethod("boot",m),g.shutdown=()=>callIntercomMethod("shutdown"),g.update=m=>callIntercomMethod("update",m),g.hide=()=>callIntercomMethod("hide"),g.show=()=>callIntercomMethod("show"),g.showSpace=m=>callIntercomMethod("showSpace",m),g.showMessages=()=>callIntercomMethod("showMessages"),g.showNewMessage=m=>callIntercomMethod("showNewMessage",m),g.onHide=m=>callIntercomMethod("onHide",m),g.onShow=m=>callIntercomMethod("onShow",m),g.onUnreadCountChange=m=>callIntercomMethod("onUnreadCountChange",m),g.trackEvent=(...m)=>callIntercomMethod("trackEvent",...m),g.getVisitorId=()=>callIntercomMethod("getVisitorId"),g.whoami=()=>callIntercomMethod("whoami"),g.startTour=m=>callIntercomMethod("startTour",m),g.showArticle=m=>callIntercomMethod("showArticle",m),g.showNews=m=>callIntercomMethod("showNews",m),g.startSurvey=m=>callIntercomMethod("startSurvey",m),g.startChecklist=m=>callIntercomMethod("startChecklist",m),g.showTicket=m=>callIntercomMethod("showTicket",m),g.showConversation=m=>callIntercomMethod("showConversation",m),g.onUserEmailSupplied=m=>callIntercomMethod("onUserEmailSupplied",m),g.hideNotifications=m=>callIntercomMethod("hideNotifications",m),g.startConversation=m=>callIntercomMethod("startConversation",m)},13866:function(m,g){"use strict";var v=this&&this.__awaiter||function(m,g,v,x){return new(v||(v=Promise))(function(k,E){function fulfilled(m){try{step(x.next(m))}catch(m){E(m)}}function rejected(m){try{step(x.throw(m))}catch(m){E(m)}}function step(m){var g;m.done?k(m.value):((g=m.value)instanceof v?g:new v(function(m){m(g)})).then(fulfilled,rejected)}step((x=x.apply(m,g||[])).next())})};Object.defineProperty(g,"__esModule",{value:!0}),g.ref=g.init=void 0;let x="_intercom_npm_loader",queueHolder=function(){queueHolder.loaderQueue(arguments)};queueHolder.q=[],queueHolder.loaderQueue=function(m){queueHolder.q.push(m)};let addWidgetToPage=function(m){var g,v,k=document;if(!k.getElementById(x)){var E=k.createElement("script");E.type="text/javascript",E.async=!0,E.id=x,E.src=m||"https://widget.intercom.io/widget/"+(null===(g=window.intercomSettings)||void 0===g?void 0:g.app_id);var T=k.getElementsByTagName("script")[0];null===(v=T.parentNode)||void 0===v||v.insertBefore(E,T)}},isDocumentReady=()=>"complete"===document.readyState||"interactive"===document.readyState;g.init=(...m)=>v(void 0,[...m],void 0,function*(m={}){var g=window,v=g.Intercom;g.intercomSettings&&(g.intercomSettings.installation_type="npm-package"),"function"==typeof v?(v("reattach_activator"),v("update",g.intercomSettings)):(g.Intercom=queueHolder,isDocumentReady()?addWidgetToPage(m.widgetUrl):(document.addEventListener("readystatechange",function(){isDocumentReady()&&addWidgetToPage(m.widgetUrl)}),g.attachEvent?g.attachEvent("onload",()=>addWidgetToPage(m.widgetUrl)):g.addEventListener("load",()=>addWidgetToPage(m.widgetUrl),!1)))}),g.ref=void 0},81862:function(m,g){"use strict";g.M=void 0;let v="https://sdk.mercadopago.com/js/v2",x=/^https:\/\/sdk\.mercadopago\.com\/js\/v2\/?(\?.*)?$/,k="MercadoPago has already been initialized in your window, please remove the duplicate import",findScript=()=>{for(var m=document.querySelectorAll(`script[src^="${v}"`),g=0;g<m.length;g++){var k=m[g];if(x.test(k.src))return k}return null},injectScript=()=>{let m=document.createElement("script");m.src=v;let g=document.head||document.body;if(!g)throw Error("Expected document.body or document.head not to be null. MercadoPago requires a <body> or a <head> element, please add on your project.");return g.appendChild(m),m},E=null;g.M=()=>null!==E?E:E=new Promise((m,g)=>{if("undefined"==typeof window){m(null);return}if(window.MercadoPago){console.warn(k),m(window.MercadoPago);return}try{let v=findScript();v?console.warn(k):v||(v=injectScript()),v.addEventListener("load",()=>{window.MercadoPago?m(window.MercadoPago):g(Error("MercadoPago.js not available"))}),v.addEventListener("error",()=>{g(Error("Failed to load MercadoPago.js"))})}catch(m){g(m);return}})},6323:function(m,g,v){"use strict";v.d(g,{Wg:function(){return cardPayment},Aw:function(){return statusScreen},R6:function(){return mercadoPago_initMercadoPago}});var x=v(81862);let initMercadoPago_MercadoPagoInstance=class initMercadoPago_MercadoPagoInstance{static getInstance(){var m,g,v,k;return m=this,g=void 0,v=void 0,k=function*(){if(this.publicKey)return this.loadedInstanceMercadoPago||(yield(0,x.M)(),this.loadedInstanceMercadoPago=!0),this.instanceMercadoPago||(this.instanceMercadoPago=new window.MercadoPago(this.publicKey,this.options)),this.instanceMercadoPago;console.error("Expected the PUBLIC_KEY to render the MercadoPago SDK React")},new(v||(v=Promise))(function(x,E){function fulfilled(m){try{step(k.next(m))}catch(m){E(m)}}function rejected(m){try{step(k.throw(m))}catch(m){E(m)}}function step(m){var g;m.done?x(m.value):((g=m.value)instanceof v?g:new v(function(m){m(g)})).then(fulfilled,rejected)}step((k=k.apply(m,g||[])).next())})}};initMercadoPago_MercadoPagoInstance.publicKey=null,initMercadoPago_MercadoPagoInstance.options={},initMercadoPago_MercadoPagoInstance.instanceMercadoPago=void 0,initMercadoPago_MercadoPagoInstance.loadedInstanceMercadoPago=!1;var mercadoPago_initMercadoPago=(m,g)=>{let v=Object.assign(Object.assign({},g),{frontEndStack:"react"}),x=!function(m,g){let v=Object.keys(m).length===Object.keys(g).length&&Object.keys(m).every(v=>Object.prototype.hasOwnProperty.call(g,v)&&m[v]===g[v]);return v}(initMercadoPago_MercadoPagoInstance.options,v);(m!==initMercadoPago_MercadoPagoInstance.publicKey||x)&&(initMercadoPago_MercadoPagoInstance.publicKey=m,initMercadoPago_MercadoPagoInstance.options=v,initMercadoPago_MercadoPagoInstance.instanceMercadoPago=void 0)},k=v(2784);let initial_onSubmitDefault=()=>{var m,g,v,x;return m=void 0,g=void 0,x=function*(){},new(v=void 0,v=Promise)(function(k,E){function fulfilled(m){try{step(x.next(m))}catch(m){E(m)}}function rejected(m){try{step(x.throw(m))}catch(m){E(m)}}function step(m){var g;m.done?k(m.value):((g=m.value)instanceof v?g:new v(function(m){m(g)})).then(fulfilled,rejected)}step((x=x.apply(m,g||[])).next())})},initial_onReadyDefault=()=>{},initial_onErrorDefault=m=>{console.error(m)},initial_onBinChangeDefault=m=>{console.log(m)},renderBrick_initBrick=({settings:m,name:g,containerId:v,controller:x})=>{var k,E,T,K;return k=void 0,E=void 0,T=void 0,K=function*(){let k=yield initMercadoPago_MercadoPagoInstance.getInstance(),E=null==k?void 0:k.bricks();
1window[x]=yield null==E?void 0:E.create(g,v,m)},new(T||(T=Promise))(function(m,g){function fulfilled(m){try{step(K.next(m))}catch(m){g(m)}}function rejected(m){try{step(K.throw(m))}catch(m){g(m)}}function step(g){var v;g.done?m(g.value):((v=g.value)instanceof T?v:new T(function(m){m(v)})).then(fulfilled,rejected)}step((K=K.apply(k,E||[])).next())})};var cardPayment=({onReady:m=initial_onReadyDefault,onError:g=initial_onErrorDefault,onSubmit:v=initial_onSubmitDefault,onBinChange:x=initial_onBinChangeDefault,initialization:E,customization:T,locale:K,id:et="cardPaymentBrick_container"})=>((0,k.useEffect)(()=>{let k={settings:{initialization:E,customization:T,callbacks:{onReady:m,onSubmit:v,onError:g,onBinChange:x},locale:K},name:"cardPayment",containerId:et,controller:"cardPaymentBrickController"},en=setTimeout(()=>{renderBrick_initBrick(k)},200);return()=>{var m;clearTimeout(en),null===(m=window.cardPaymentBrickController)||void 0===m||m.unmount()}},[E,T,x,m,g,v]),k.createElement("div",{id:et})),statusScreen=({onReady:m=initial_onReadyDefault,onError:g=initial_onErrorDefault,customization:v,initialization:x,locale:E,id:T="statusScreenBrick_container"})=>((0,k.useEffect)(()=>{let k={settings:{initialization:x,customization:v,locale:E,callbacks:{onReady:m,onError:g}},name:"statusScreen",containerId:T,controller:"statusScreenBrickController"},K=setTimeout(()=>{renderBrick_initBrick(k)},200);return()=>{var m;clearTimeout(K),null===(m=window.statusScreenBrickController)||void 0===m||m.unmount()}},[x,v,m,g]),k.createElement("div",{id:T}))},57307:function(m,g,v){"use strict";var x=v(29236),k=Object.prototype.toString,isNumber=function(m){var g=typeof m;return"number"===g||"object"===g&&"[object Number]"===k.call(m)},E="function"==typeof Array.isArray?Array.isArray:function(m){return"[object Array]"===k.call(m)},arrayEach=function(m,g){for(var v=0;v<g.length&&!1!==m(g[v],v,g);v+=1);},baseEach=function(m,g){for(var v=x(g),k=0;k<v.length&&!1!==m(g[v[k]],v[k],g);k+=1);};m.exports=function(m,g){return(null!=g&&(E(g)||"function"!==g&&isNumber(g.length))?arrayEach:baseEach).call(this,m,g)}},29236:function(m){"use strict";var g=Object.prototype.hasOwnProperty,v=String.prototype.charAt,x=Object.prototype.toString,charAt=function(m,g){return v.call(m,g)},has=function(m,v){return g.call(m,v)},indexKeys=function(m,g){g=g||has;for(var v=[],x=0,k=m.length;x<k;x+=1)g(m,x)&&v.push(String(x));return v},objectKeys=function(m,g){g=g||has;var v=[];for(var x in m)g(m,x)&&v.push(String(x));return v};m.exports=function(m){return null==m?[]:"[object String]"===x.call(m)?indexKeys(m,charAt):null!=m&&"function"!=typeof m&&"number"==typeof m.length?indexKeys(m,has):objectKeys(m)}},20321:function(m,g,v){"use strict";var x=v(57307);m.exports=function(m,g){if("function"!=typeof m)throw TypeError("Expected a function but received a "+typeof m);var v=[];return x(function(g,x,k){v.push(m(g,x,k))},g),v}},39160:function(m){m.exports=function(m){var g;return"(function(){\n\n  // Create a queue, but don't obliterate an existing one!\n  var analytics = window.analytics = window.analytics || [];\n\n  // If the real analytics.js is already on the page return.\n  if (analytics.initialize) return;\n\n  // If the snippet was invoked already show an error.\n  if (analytics.invoked) {\n    if (window.console && console.error) {\n      console.error('Segment snippet included twice.');\n    }\n    return;\n  }\n\n  // Invoked flag, to make sure the snippet\n  // is never invoked twice.\n  analytics.invoked = true;\n\n  // A list of the methods in Analytics.js to stub.\n  analytics.methods = [\n    'trackSubmit',\n    'trackClick',\n    'trackLink',\n    'trackForm',\n    'pageview',\n    'identify',\n    'reset',\n    'group',\n    'track',\n    'ready',\n    'alias',\n    'debug',\n    'page',\n    'once',\n    'off',\n    'on',\n    'addSourceMiddleware',\n    'addIntegrationMiddleware',\n    'setAnonymousId',\n    'addDestinationMiddleware'\n  ];\n\n  // Define a factory to create stubs. These are placeholders\n  // for methods in Analytics.js so that you never have to wait\n  // for it to load to actually record data. The `method` is\n  // stored as the first argument, so we can replay the data.\n  analytics.factory = function(e){\n    return function(){\n      if (window.analytics.initialized) {\n        // Sometimes users assigned analytics to a variable before analytics is done loading, resulting in a stale reference.\n        // If so, proxy any calls to the 'real' analytics instance.\n        return window.analytics[e].apply(window.analytics, arguments);\n      }\n      var args = Array.prototype.slice.call(arguments);\n      args.unshift(e);\n      analytics.push(args);\n      return analytics;\n    };\n  };\n\n\n  // For each of our methods, generate a queueing stub.\n  for (var i = 0; i < analytics.methods.length;
1 i++) {\n    var key = analytics.methods[i];\n    analytics[key] = analytics.factory(key);\n  }\n\n  // Define a method to load Analytics.js from our CDN,\n  // and that will be sure to only ever load it once.\n  analytics.load = function(key, options){\n    // Create an async script element based on your key.\n    var t = document.createElement('script');\n    t.type = 'text/javascript';\n    t.async = true;\n    t.src = \"https://"+(null==(g=m.host)?"":g)+(null==(g=m.ajsPath)?"":g)+"\";\n\n    // Insert our script next to the first script element.\n    var first = document.getElementsByTagName('script')[0];\n    first.parentNode.insertBefore(t, first);\n    analytics._loadOptions = options;\n  };\n  analytics._writeKey = '"+(null==(g=m.apiKey)?"":g)+"';\n\n  "+(null==(g=m.optionalCDN)?"":g)+"\n\n  // Add a version to keep track of what's in the wild.\n  analytics.SNIPPET_VERSION = '4.16.1';\n\n  // Load Analytics.js with your key, which will automatically\n  // load the tools you've enabled for your account. Boosh!\n  "+(null==(g=m.load)?"":g)+"\n\n  // Make the first page call to load the integrations. If\n  // you'd like to manually name or tag the page, edit or\n  // move this call however you'd like.\n  "+(null==(g=m.page)?"":g)+"\n})();\n"}},82700:function(m){m.exports=function(m){var g;return'!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){if(window.analytics.initialized)return window.analytics[e].apply(window.analytics,arguments);var i=Array.prototype.slice.call(arguments);i.unshift(e);analytics.push(i);return analytics}};for(var i=0;i<analytics.methods.length;i++){var key=analytics.methods[i];analytics[key]=analytics.factory(key)}analytics.load=function(key,i){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://'+(null==(g=m.host)?"":g)+(null==(g=m.ajsPath)?"":g)+'";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=i};analytics._writeKey="'+(null==(g=m.apiKey)?"":g)+'";'+(null==(g=m.optionalCDN)?"":g)+';analytics.SNIPPET_VERSION="4.16.1";\n'+(null==(g=m.load)?"":g)+"\n"+(null==(g=m.page)?"":g)+"\n}}();"}},70490:function(m,g,v){"use strict";var x=v(20321),k=(v(39160),v(82700)),E=Object.prototype.hasOwnProperty;g.V=function(m){var g,v=((g=m)||(g={}),g.apiKey||(g.apiKey="YOUR_API_KEY"),g.host||(g.host="cdn.segment.com"),g.ajsPath||(g.ajsPath='/analytics.js/v1/" + key + "/analytics.min.js'),g.useHostForBundles||(g.useHostForBundles=!1),E.call(g,"page")||(g.page=!0),E.call(g,"load")||(g.load=!0),g);return v.load=function(m){if(!m.load)return"";if("boolean"!=typeof m.load){var g=JSON.stringify(m.load);return'analytics.load("'+m.apiKey+'", '+g+");"}return'analytics.load("'+m.apiKey+'");'}(v),v.page=function(m){if(!m)return"";var g=[];return m.category&&g.push(m.category),m.name&&g.push(m.name),m.properties&&g.push(m.properties),"analytics.page("+x(JSON.stringify,g).join(", ")+");"}(v.page),v.optionalCDN=v&&"boolean"==typeof v.useHostForBundles&&v.useHostForBundles?'analytics._cdn = "https://'+v.host+'"':"",k(v)}},97159:function(m,g,v){"use strict";var x,k,E,T,K,et,en,er=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return er.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32"},m),x||(x=er.createElement("path",{fill:"#fff",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.773 6.227c.64.146 1.174.306 1.56.426a7.45 7.45 0 0 1 2.88-1.573A10.3 10.3 0 0 1 27.12 5a7.73 7.73 0 0 1-.08 3.907A10 10 0 0 1 25.253 12c.254.96.494 1.933.734 2.893a12.73 12.73 0 0 1 0 6.667c-1.267 3.587-6.054 5.613-10 5.613-3.947 0-8.707-2.04-9.974-5.613a12.73 12.73 0 0 1 0-6.667c.24-.96.48-1.933.734-2.893A10 10 0 0 1 4.96 8.907 7.73 7.73 0 0 1 4.88 5a10.3 10.3 0 0 1 3.907.08c1.066.308 2.05.85 2.88 1.587.386-.12.92-.28 1.56-.427A11 11 0 0 1 16 5.787c.94.028 1.871.176 2.773.44"})),k||(k=er.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.627 6.547v2.746M20.373 6.547v2.746M16 6.547v4.573"})),E||(E=er.createElement("path",{fill:"#000",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.68 15.92a.48.48 0 1 0 0-.96.48.48 0 0 0 0 .96M20.32 15.92a.48.48 0 1 0 0-.96.48.48 0 0 0 0 .96"})),T||(T=er.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m16.267 20.373.68-1.186a.294.294 0 0 0-.254-.454H15.36a.293.293 0 0 0-.253.454l.68 1.186a.307.307 0 0 0 .48 0"})),K||(K=er.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M16 20.24a2.4 2.4 0 1 1-4.8 0M20.8 20.24a2.4 2.4 0 0 1-4.8 0"})),et||(et=er.createElement("circle",{cx:11.733,cy:15.467,r:1.333,fill:"#000"})),en||(en=er.createElement("circle",{cx:20.4,cy:15.467,r:1.333,fill:"#000"})))}},11440:function(m,g,v){"use strict";var x,k,E=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return E.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},m),x||(x=E.createElement("g",{clipPath:"url(#check-circle-green_svg__a)"},E.createElement("path",{fill:"#BBF7D0",d:"M10 18.335a8.333 8.333 0 1 0 0-16.667 8.333 8.333 0 0 0 0 16.667"}),E.createElement("path",{stroke:"#16A34A",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m5.834 10.418 2.5 2.5 5.833-5.833"}))),k||(k=E.createElement("defs",null,E.createElement("clipPath",{id:"check-circle-green_svg__a"},E.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})))))}},63406:function(m,g,v){"use strict";var x,k,E,T=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return T.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},m),x||(x=T.createElement("path",{stroke:"currentColor",strokeWidth:1.5,d:"M11.48 2.456a2 2 0 0 0-2.957 0l-.499.547a2 2 0 0 1-1.572.65l-.739-.034a2 2 0 0 0-2.091 2.092l.035.739a2 2 0 0 1-.652 1.572l-.547.498a2 2 0 0 0 0 2.957l.547.499a2 2 0 0 1 .652 1.572l-.035.739a2 2 0 0 0 2.091 2.091l.74-.035a2 2 0 0 1 1.571.652l.499.547a2 2 0 0 0 2.957 0l.498-.547a2 2 0 0 1 1.572-.652l.74.035a2 2 0 0 0 2.09-2.091l-.034-.74a2 2 0 0 1 .651-1.571l.547-.499a2 2 0 0 0 0-2.957l-.547-.498a2 2 0 0 1-.651-1.572l.035-.74a2 2 0 0 0-2.092-2.09l-.739.034a2 2 0 0 1-1.572-.651z"})),k||(k=T.createElement("path",{fill:"currentColor",d:"M7.917 12.917a.833.833 0 1 0 0-1.667.833.833 0 0 0 0 1.667M12.083 8.749a.833.833 0 1 0 0-1.667.833.833 0 0 0 0 1.667"})),E||(E=T.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m7.084 7.082 5.833 5.833"})))}},60458:function(m,g,v){"use strict";var x,k,E,T,K,et,en,er,ei,es,el,ec,eu=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return eu.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none"},m),x||(x=eu.createElement("ellipse",{cx:16,cy:16.5,fill:"#fff",rx:11,ry:10.5})),k||(k=eu.createElement("path",{fill:"#000",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M11.467 15.067a.507.507 0 1 0 0-1.014.507.507 0 0 0 0 1.014M20.533 15.067a.507.507 0 1 0 0-1.014.507.507 0 0 0 0 1.014M16.413 19.507l1.094-1.88a.48.48 0 0 0-.414-.72h-2.186a.48.48 0 0 0-.414.72l1.094 1.88a.48.48 0 0 0 .826 0"})),E||(E=eu.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"m12 6.467.427-.174A10.1 10.1 0 0 1 16 5.68M13.987 26.44a8.72 8.72 0 0 1-7.32-3.307 8.15 8.15 0 0 1-.787-7.88"})),T||(T=eu.createElement("path",{fill:"currentColor",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M10.667 4.467C8.76 3.52 5.88 6.56 5.333 7.133c-.546.574-4.093 4.307-2.666 6.667a3.76 3.76 0 0 0 4 1.333c1.333-.413 1.08-1.426 4-5.333A4.64 4.64 0 0 0 12 7.133a2.95 2.95 0 0 0-1.333-2.666"})),K||(K=eu.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"m20 6.467-.427-.174A10.1 10.1 0 0 0 16 5.68M18.013 26.44a8.72 8.72 0 0 0 7.32-3.307 8.15 8.15 0 0 0 .787-7.88"})),et||(et=eu.createElement("path",{fill:"currentColor",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M21.333 4.467c1.907-.947 4.787 2.093 5.334 2.666.546.574 4.093 4.307 2.666 6.667a3.76 3.76 0 0 1-4 1.333c-1.333-.413-1.08-1.426-4-5.333A4.64 4.64 0 0 1 20 7.133a2.95 2.95 0 0 1 1.333-2.666"})),en||(en=eu.createElement("circle",{cx:11.333,cy:14.533,r:1.333,fill:"#000"})),er||(er=eu.createElement("circle",{cx:20.4,cy:14.533,r:1.333,fill:"#000"})),ei||(ei=eu.createElement("path",{fill:"currentColor",d:"m16 21 1.732 2.25h-3.464z"})),es||(es=eu.createElement("path",{fill:"currentColor",d:"M18.013 22.12v3.36A2.146 2.146 0 0 1 16 27.72a2.146 2.146 0 0 1-2.013-2.24v-3.36"})),el||(el=eu.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M18.013 22.12v3.36A2.146 2.146 0 0 1 16 27.72a2.146 2.146 0 0 1-2.013-2.24v-3.36"})),ec||(ec=eu.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M16 19.6a2.52 2.52 0 0 1-5.04 0M21.04 19.6a2.52 2.52 0 0 1-5.04 0"})))}},34160:function(m,g,v){"use strict";var x,k,E=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return E.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),x||(x=E.createElement("g",{clipPath:"url(#times_svg__a)"},E.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6.757 17.243 12 12m5.243-5.243L12 12m0 0L6.757 6.757M12 12l5.243 5.243"}))),k||(k=E.createElement("defs",null,E.createElement("clipPath",{id:"times_svg__a"},E.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))}},28294:function(m,g,v){"use strict";var x,k,E=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return E.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),x||(x=E.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M20.043 21H3.957c-1.538 0-2.5-1.664-1.734-2.997l8.043-13.988c.77-1.337 2.699-1.337 3.468 0l8.043 13.988C22.543 19.336 21.58 21 20.043 21ZM12 9v4"})),k||(k=E.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m12 17.01.01-.011"})))}},77546:function(m,g,v){"use strict";var x,k,E=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return E.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},m),x||(x=E.createElement("g",{clipPath:"url(#warning_svg__a)"},E.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,clipPath:"url(#warning_svg__b)"},E.createElement("path",{d:"M8 4.667v4M8 11.34l.007-.008M8 14.666A6.667 6.667 0 1 0 8 1.333a6.667 6.667 0 0 0 0 13.333"})))),k||(k=E.createElement("defs",null,E.createElement("clipPath",{id:"warning_svg__a"},E.createElement("path",{fill:"currentColor",d:"M0 0h16v16H0z"})),E.createElement("clipPath",{id:"warning_svg__b"},E.createElement("path",{fill:"currentColor",d:"M0 0h16v16H0z"})))))}},88649:function(m,g,v){"use strict";var x,k=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}g.Z=function(m){return k.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 25 24"},m),x||(x=k.createElement("path",{fill:"currentColor",d:"m6.405 16.572.67.335.208-.415-.279-.37zm1.523 1.524.45-.6-.37-.279-.415.208zm-3.047 1.523-.67-.335a.75.75 0 0 0 1.005 1.006zM9.452 8.952l-.45-.6a.75.75 0 0 0-.3.6zm6.096 6.096v.75a.75.75 0 0 0 .573-.267zm-5.622-6.45-.45-.6zm1.213.514-.744.093zm.172 1.375.744-.093zm-.217.634-.53-.53zm4.791 3.526-.573-.483zm-.472-1.245.108-.742zm-1.392-.204.109-.742zm-.649.215.53.53zM4.131 12c0 1.883.623 3.624 1.674 5.022l1.2-.9A6.84 6.84 0 0 1 5.63 12zM12.5 3.631A8.37 8.37 0 0 0 4.131 12h1.5A6.87 6.87 0 0 1 12.5 5.131zM20.87 12a8.37 8.37 0 0 0-8.37-8.369v1.5A6.87 6.87 0 0 1 19.37 12zm-8.37 8.37A8.37 8.37 0 0 0 20.87 12h-1.5a6.87 6.87 0 0 1-6.87 6.87zm-5.022-1.675A8.34 8.34 0 0 0 12.5 20.37v-1.5a6.84 6.84 0 0 1-4.121-1.373zM5.216 20.29l3.048-1.524-.671-1.341-3.047 1.523zm.518-4.053L4.21 19.284l1.342.67 1.523-3.047zm2.968-7.285v.762h1.5v-.762zm6.084 6.846h.762v-1.5h-.762zM8.702 9.714a6.083 6.083 0 0 0 6.084 6.084v-1.5a4.583 4.583 0 0 1-4.584-4.584zm1.2
1-.162.474-.355-.9-1.2-.474.355zm.493-.347.172 1.375 1.488-.186-.172-1.375zm.168 1.385-.88.88 1.062 1.06.879-.879zm.004-.01q0 .006-.004.01l1.061 1.061c.33-.33.489-.794.431-1.257zm-.191-1.383.006-.003h-.002l.008.002q.007.004.006.004v-.001.006l1.49-.186a1.512 1.512 0 0 0-2.408-1.022zm5.745 6.334.338-.401-1.147-.966-.338.4zm-.6-2.871-1.391-.204-.217 1.484 1.391.204zm-2.679.223-.872.872 1.06 1.061.873-.872zm1.288-.427c-.473-.069-.95.09-1.288.427l1.06 1.06a.01.01 0 0 1 .01-.003zm2.33 2.674a1.512 1.512 0 0 0-.939-2.47l-.217 1.484q.009.001.007.002l-.001-.001q0-.001.004.007.002.008.001.007v-.001l-.003.006z"})))}},49732:function(m,g,v){"use strict";v.d(g,{Ry:function(){return hideOthers}});var x=new WeakMap,k=new WeakMap,E={},T=0,unwrapHost=function(m){return m&&(m.host||unwrapHost(m.parentNode))},applyAttributeToOthers=function(m,g,v,K){var et=(Array.isArray(m)?m:[m]).map(function(m){if(g.contains(m))return m;var v=unwrapHost(m);return v&&g.contains(v)?v:(console.error("aria-hidden",m,"in not contained inside",g,". Doing nothing"),null)}).filter(function(m){return!!m});E[v]||(E[v]=new WeakMap);var en=E[v],er=[],ei=new Set,es=new Set(et),keep=function(m){!m||ei.has(m)||(ei.add(m),keep(m.parentNode))};et.forEach(keep);var deep=function(m){!m||es.has(m)||Array.prototype.forEach.call(m.children,function(m){if(ei.has(m))deep(m);else try{var g=m.getAttribute(K),E=null!==g&&"false"!==g,T=(x.get(m)||0)+1,et=(en.get(m)||0)+1;x.set(m,T),en.set(m,et),er.push(m),1===T&&E&&k.set(m,!0),1===et&&m.setAttribute(v,"true"),E||m.setAttribute(K,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return deep(g),ei.clear(),T++,function(){er.forEach(function(m){var g=x.get(m)-1,E=en.get(m)-1;x.set(m,g),en.set(m,E),g||(k.has(m)||m.removeAttribute(K),k.delete(m)),E||m.removeAttribute(v)}),--T||(x=new WeakMap,x=new WeakMap,k=new WeakMap,E={})}},hideOthers=function(m,g,v){void 0===v&&(v="data-aria-hidden");var x=Array.from(Array.isArray(m)?m:[m]),k=g||("undefined"==typeof document?null:(Array.isArray(m)?m[0]:m).ownerDocument.body);return k?(x.push.apply(x,Array.from(k.querySelectorAll("[aria-live], script"))),applyAttributeToOthers(x,k,v,"aria-hidden")):function(){return null}}},89644:function(m,g,v){m.exports=v(25644)},70353:function(m,g,v){"use strict";var x=v(93044),k=v(86955),E=v(92233),T=v(68030),K=v(97948),et=v(51875),en=v(60842),er=v(98560),ei=v(21218),es=v(68047),el=v(10738);m.exports=function(m){return new Promise(function(g,v){var ec,eu=m.data,ed=m.headers,ep=m.responseType;function done(){m.cancelToken&&m.cancelToken.unsubscribe(ec),m.signal&&m.signal.removeEventListener("abort",ec)}x.isFormData(eu)&&x.isStandardBrowserEnv()&&delete ed["Content-Type"];var em=new XMLHttpRequest;if(m.auth){var ef=m.auth.username||"",eh=m.auth.password?unescape(encodeURIComponent(m.auth.password)):"";ed.Authorization="Basic "+btoa(ef+":"+eh)}var eg=K(m.baseURL,m.url);function onloadend(){if(em){var x="getAllResponseHeaders"in em?et(em.getAllResponseHeaders()):null;k(function(m){g(m),done()},function(m){v(m),done()},{data:ep&&"text"!==ep&&"json"!==ep?em.response:em.responseText,status:em.status,statusText:em.statusText,headers:x,config:m,request:em}),em=null}}if(em.open(m.method.toUpperCase(),T(eg,m.params,m.paramsSerializer),!0),em.timeout=m.timeout,"onloadend"in em?em.onloadend=onloadend:em.onreadystatechange=function(){em&&4===em.readyState&&(0!==em.status||em.responseURL&&0===em.responseURL.indexOf("file:"))&&setTimeout(onloadend)},em.onabort=function(){em&&(v(new ei("Request aborted",ei.ECONNABORTED,m,em)),em=null)},em.onerror=function(){v(new ei("Network Error",ei.ERR_NETWORK,m,em,em)),em=null},em.ontimeout=function(){var g=m.timeout?"timeout of "+m.timeout+"ms exceeded":"timeout exceeded",x=m.transitional||er;m.timeoutErrorMessage&&(g=m.timeoutErrorMessage),v(new ei(g,x.clarifyTimeoutError?ei.ETIMEDOUT:ei.ECONNABORTED,m,em)),em=null},x.isStandardBrowserEnv()){var ev=(m.withCredentials||en(eg))&&m.xsrfCookieName?E.read(m.xsrfCookieName):void 0;ev&&(ed[m.xsrfHeaderName]=ev)}"setRequestHeader"in em&&x.forEach(ed,function(m,g){void 0===eu&&"content-type"===g.toLowerCase()?delete ed[g]:em.setRequestHeader(g,m)}),x.isUndefined(m.withCredentials)||(em.withCredentials=!!m.withCredentials),ep&&"json"!==ep&&(em.responseType=m.responseType),"function"==typeof m.onDownloadProgress&&em.addEventListener("progress",m.onDownloadProgress),"function"==typeof m.onUploadProgress&&em.upload&&em.upload.addEventListener("progress",m.onUploadProgress),(m.cancelToken||m.signal)&&(ec=function(m){em&&(v(!m||m&&m.type?new es:m),em.abort(),em=null)},m.cancelToken&&m.cancelToken.subscribe(ec),m.signal&&(m.signal.aborted?ec():m.signal.addEventListener("abort",ec))),eu||(eu=null);var ey=el(eg);if(ey&&-1===["http","https","file"].indexOf(ey)){v(new ei("Unsupported protocol "+ey+":",ei.ERR_BAD_REQUEST,m));return}em.send(eu)})}},25644:function(m,g,v){"use strict";var x=v(93044),k=v(73644),E=v(62215),T=v(92937),K=function createInstance(m){var g=new E(m),v=k(E.prototype.request,g);return x.extend(v,E.prototype,g),x.extend(v,g),v.create=function(g){return createInstance(T(m,g))},v}(v(10663));
vendor: 6,203 bytes, line 1
1K.Axios=E,K.CanceledError=v(68047),K.CancelToken=v(34089),K.isCancel=v(98041),K.VERSION=v(29241).version,K.toFormData=v(49027),K.AxiosError=v(21218),K.Cancel=K.CanceledError,K.all=function(m){return Promise.all(m)},K.spread=v(70783),K.isAxiosError=v(65587),m.exports=K,m.exports.default=K},34089:function(m,g,v){"use strict";var x=v(68047);function CancelToken(m){if("function"!=typeof m)throw TypeError("executor must be a function.");this.promise=new Promise(function(m){g=m});var g,v=this;this.promise.then(function(m){if(v._listeners){var g,x=v._listeners.length;for(g=0;g<x;g++)v._listeners[g](m);v._listeners=null}}),this.promise.then=function(m){var g,x=new Promise(function(m){v.subscribe(m),g=m}).then(m);return x.cancel=function(){v.unsubscribe(g)},x},m(function(m){v.reason||(v.reason=new x(m),g(v.reason))})}CancelToken.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},CancelToken.prototype.subscribe=function(m){if(this.reason){m(this.reason);return}this._listeners?this._listeners.push(m):this._listeners=[m]},CancelToken.prototype.unsubscribe=function(m){if(this._listeners){var g=this._listeners.indexOf(m);-1!==g&&this._listeners.splice(g,1)}},CancelToken.source=function(){var m;return{token:new CancelToken(function(g){m=g}),cancel:m}},m.exports=CancelToken},68047:function(m,g,v){"use strict";var x=v(21218);function CanceledError(m){x.call(this,null==m?"canceled":m,x.ERR_CANCELED),this.name="CanceledError"}v(93044).inherits(CanceledError,x,{__CANCEL__:!0}),m.exports=CanceledError},98041:function(m){"use strict";m.exports=function(m){return!!(m&&m.__CANCEL__)}},62215:function(m,g,v){"use strict";var x=v(93044),k=v(68030),E=v(946),T=v(6895),K=v(92937),et=v(97948),en=v(17525),er=en.validators;function Axios(m){this.defaults=m,this.interceptors={request:new E,response:new E}}Axios.prototype.request=function(m,g){"string"==typeof m?(g=g||{}).url=m:g=m||{},(g=K(this.defaults,g)).method?g.method=g.method.toLowerCase():this.defaults.method?g.method=this.defaults.method.toLowerCase():g.method="get";var v,x=g.transitional;void 0!==x&&en.assertOptions(x,{silentJSONParsing:er.transitional(er.boolean),forcedJSONParsing:er.transitional(er.boolean),clarifyTimeoutError:er.transitional(er.boolean)},!1);var k=[],E=!0;this.interceptors.request.forEach(function(m){("function"!=typeof m.runWhen||!1!==m.runWhen(g))&&(E=E&&m.synchronous,k.unshift(m.fulfilled,m.rejected))});var et=[];if(this.interceptors.response.forEach(function(m){et.push(m.fulfilled,m.rejected)}),!E){var ei=[T,void 0];for(Array.prototype.unshift.apply(ei,k),ei=ei.concat(et),v=Promise.resolve(g);ei.length;)v=v.then(ei.shift(),ei.shift());return v}for(var es=g;k.length;){var el=k.shift(),ec=k.shift();try{es=el(es)}catch(m){ec(m);break}}try{v=T(es)}catch(m){return Promise.reject(m)}for(;et.length;)v=v.then(et.shift(),et.shift());return v},Axios.prototype.getUri=function(m){return k(et((m=K(this.defaults,m)).baseURL,m.url),m.params,m.paramsSerializer)},x.forEach(["delete","get","head","options"],function(m){Axios.prototype[m]=function(g,v){return this.request(K(v||{},{method:m,url:g,data:(v||{}).data}))}}),x.forEach(["post","put","patch"],function(m){function generateHTTPMethod(g){return function(v,x,k){return this.request(K(k||{},{method:m,headers:g?{"Content-Type":"multipart/form-data"}:{},url:v,data:x}))}}Axios.prototype[m]=generateHTTPMethod(),Axios.prototype[m+"Form"]=generateHTTPMethod(!0)}),m.exports=Axios},21218:function(m,g,v){"use strict";var x=v(93044);function AxiosError(m,g,v,x,k){Error.call(this),this.message=m,this.name="AxiosError",g&&(this.code=g),v&&(this.config=v),x&&(this.request=x),k&&(this.response=k)}x.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var k=AxiosError.prototype,E={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(m){E[m]={value:m}}),Object.defineProperties(AxiosError,E),Object.defineProperty(k,"isAxiosError",{value:!0}),AxiosError.from=function(m,g,v,E,T,K){var et=Object.create(k);return x.toFlatObject(m,et,function(m){return m!==Error.prototype}),AxiosError.call(et,m.message,g,v,E,T),et.name=m.name,K&&Object.assign(et,K),et},m.exports=AxiosError},946:function(m,g,v){"use strict";var x=v(93044);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function(m,g,v){return this.handlers.push({fulfilled:m,rejected:g,synchronous:!!v&&v.synchronous,runWhen:v?v.runWhen:null}),this.handlers.length-1},InterceptorManager.prototype.eject=function(m){this.handlers[m]&&(this.handlers[m]=null)},InterceptorManager.prototype.forEach=function(m){x.forEach(this.handlers,function(g){null!==g&&m(g)})},m.exports=InterceptorManager},97948:function(m,g,v){"use strict";var x=v(99192),k=v(48762);m.exports=function(m,g){return m&&!x(g)?k(m,g):g}},6895:function(m,g,v){"use strict";var x=v(93044),k=v(38556),E=v(98041),T=v(10663),K=v(68047);function throwIfCancellationRequested(m){if(m.cancelToken&&m.cancelToken.throwIfRequested(),m.signal&&m.signal.aborted)throw new K}m.exports=function(m){return throwIfCancellationRequested(m),m.headers=m.headers||{},m.data=k.call(m,m.data,m.headers,m.transformRequest),m.headers=x.merge(m.headers.common||{},m.headers[m.method]||{},m.headers),x.forEach(["delete","get","head","post","put","patch","common"],function(g){delete m.headers[g]}),(m.adapter||T.adapter)(m).then(function(g){return throwIfCancellationRequested(m),g.data=k.call(m,g.data,g.headers,m.transformResponse),g},function(g){return!E(g)&&(throwIfCancellationRequested(m),g&&g.response&&(g.response.data=k.call(m,g.response.data,g.response.headers,m.transformResponse))),Promise.reject(g)})}},92937:function(m,g,v){"use strict";var x=v(93044);m.exports=function(m,g){g=g||{};var v={};function getMergedValue(m,g){return x.isPlainObject(m)&&x.isPlainObject(g)?x.merge
1(m,g):x.isPlainObject(g)?x.merge({},g):x.isArray(g)?g.slice():g}function mergeDeepProperties(v){return x.isUndefined(g[v])?x.isUndefined(m[v])?void 0:getMergedValue(void 0,m[v]):getMergedValue(m[v],g[v])}function valueFromConfig2(m){if(!x.isUndefined(g[m]))return getMergedValue(void 0,g[m])}function defaultToConfig2(v){return x.isUndefined(g[v])?x.isUndefined(m[v])?void 0:getMergedValue(void 0,m[v]):getMergedValue(void 0,g[v])}function mergeDirectKeys(v){return v in g?getMergedValue(m[v],g[v]):v in m?getMergedValue(void 0,m[v]):void 0}var k={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys};return x.forEach(Object.keys(m).concat(Object.keys(g)),function(m){var g=k[m]||mergeDeepProperties,E=g(m);x.isUndefined(E)&&g!==mergeDirectKeys||(v[m]=E)}),v}},86955:function(m,g,v){"use strict";var x=v(21218);m.exports=function(m,g,v){var k=v.config.validateStatus;!v.status||!k||k(v.status)?m(v):g(new x("Request failed with status code "+v.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(v.status/100)-4],v.config,v.request,v))}},38556:function(m,g,v){"use strict";var x=v(93044),k=v(10663);m.exports=function(m,g,v){var E=this||k;return x.forEach(v,function(v){m=v.call(E,m,g)}),m}},10663:function(m,g,v){"use strict";var x,k=v(93542),E=v(93044),T=v(98868),K=v(21218),et=v(98560),en=v(49027),er={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(m,g){!E.isUndefined(m)&&E.isUndefined(m["Content-Type"])&&(m["Content-Type"]=g)}var ei={transitional:et,adapter:("undefined"!=typeof XMLHttpRequest?x=v(70353):void 0!==k&&"[object process]"===Object.prototype.toString.call(k)&&(x=v(70353)),x),transformRequest:[function(m,g){if(T(g,"Accept"),T(g,"Content-Type"),E.isFormData(m)||E.isArrayBuffer(m)||E.isBuffer(m)||E.isStream(m)||E.isFile(m)||E.isBlob(m))return m;if(E.isArrayBufferView(m))return m.buffer;if(E.isURLSearchParams(m))return setContentTypeIfUnset(g,"application/x-www-form-urlencoded;charset=utf-8"),m.toString();var v,x=E.isObject(m),k=g&&g["Content-Type"];if((v=E.isFileList(m))||x&&"multipart/form-data"===k){var K=this.env&&this.env.FormData;return en(v?{"files[]":m}:m,K&&new K)}return x||"application/json"===k?(setContentTypeIfUnset(g,"application/json"),function(m,g,v){if(E.isString(m))try{return(0,JSON.parse)(m),E.trim(m)}catch(m){if("SyntaxError"!==m.name)throw m}return(0,JSON.stringify)(m)}(m)):m}],transformResponse:[function(m){var g=this.transitional||ei.transitional,v=g&&g.silentJSONParsing,x=g&&g.forcedJSONParsing,k=!v&&"json"===this.responseType;if(k||x&&E.isString(m)&&m.length)try{return JSON.parse(m)}catch(m){if(k){if("SyntaxError"===m.name)throw K.from(m,K.ERR_BAD_RESPONSE,this,null,this.response);throw m}}return m}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:v(84684)},validateStatus:function(m){return m>=200&&m<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};E.forEach(["delete","get","head"],function(m){ei.headers[m]={}}
1),E.forEach(["post","put","patch"],function(m){ei.headers[m]=E.merge(er)}),m.exports=ei},98560:function(m){"use strict";m.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},29241:function(m){m.exports={version:"0.27.2"}},73644:function(m){"use strict";m.exports=function(m,g){return function(){for(var v=Array(arguments.length),x=0;x<v.length;x++)v[x]=arguments[x];return m.apply(g,v)}}},68030:function(m,g,v){"use strict";var x=v(93044);function encode(m){return encodeURIComponent(m).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}m.exports=function(m,g,v){if(!g)return m;if(v)k=v(g);else if(x.isURLSearchParams(g))k=g.toString();else{var k,E=[];x.forEach(g,function(m,g){null!=m&&(x.isArray(m)?g+="[]":m=[m],x.forEach(m,function(m){x.isDate(m)?m=m.toISOString():x.isObject(m)&&(m=JSON.stringify(m)),E.push(encode(g)+"="+encode(m))}))}),k=E.join("&")}if(k){var T=m.indexOf("#");-1!==T&&(m=m.slice(0,T)),m+=(-1===m.indexOf("?")?"?":"&")+k}return m}},48762:function(m){"use strict";m.exports=function(m,g){return g?m.replace(/\/+$/,"")+"/"+g.replace(/^\/+/,""):m}},92233:function(m,g,v){"use strict";var x=v(93044);m.exports=x.isStandardBrowserEnv()?{write:function(m,g,v,k,E,T){var K=[];K.push(m+"="+encodeURIComponent(g)),x.isNumber(v)&&K.push("expires="+new Date(v).toGMTString()),x.isString(k)&&K.push("path="+k),x.isString(E)&&K.push("domain="+E),!0===T&&K.push("secure"),document.cookie=K.join("; ")},read:function(m){var g=document.cookie.match(RegExp("(^|;\\s*)("+m+")=([^;]*)"));return g?decodeURIComponent(g[3]):null},remove:function(m){this.write(m,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},99192:function(m){"use strict";m.exports=function(m){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(m)}},65587:function(m,g,v){"use strict";var x=v(93044);m.exports=function(m){return x.isObject(m)&&!0===m.isAxiosError}},60842:function(m,g,v){"use strict";var x=v(93044);m.exports=x.isStandardBrowserEnv()?function(){var m,g=/(msie|trident)/i.test(navigator.userAgent),v=document.createElement("a");function resolveURL(m){var x=m;return g&&(v.setAttribute("href",x),x=v.href),v.setAttribute("href",x),{href:v.href,protocol:v.protocol?v.protocol.replace(/:$/,""):"",host:v.host,search:v.search?v.search.replace(/^\?/,""):"",hash:v.hash?v.hash.replace(/^#/,""):"",hostname:v.hostname,port:v.port,pathname:"/"===v.pathname.charAt(0)?v.pathname:"/"+v.pathname}}return m=resolveURL(window.location.href),function(g){var v=x.isString(g)?resolveURL(g):g;return v.protocol===m.protocol&&v.host===m.host}}():function(){return!0}},98868:function(m,g,v){"use strict";var x=v(93044);m.exports=function(m,g){x.forEach(m,function(v,x){x!==g&&x.toUpperCase()===g.toUpperCase()&&(m[g]=v,delete m[x])})}},84684:function(m){m.exports=null},51875:function(m,g,v){"use strict";var x=v(93044),k=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];m.exports=function(m){var g,v,E,T={};return m&&x.forEach(m.split("\n"),function(m){E=m.indexOf(":"),g=x.trim(m.substr(0,E)).toLowerCase(),v=x.trim(m.substr(E+1)),g&&!(T[g]&&k.indexOf(g)>=0)&&("set-cookie"===g?T[g]=(T[g]?T[g]:[]).concat([v]):T[g]=T[g]?T[g]+", "+v:v)}),T}},10738:function(m){"use strict";m.exports=function(m){var g=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m);return g&&g[1]||""}},70783:function(m){"use strict";m.exports=function(m){return function(g){return m.apply(null,g)}}},49027:function(m,g,v){"use strict";var x=v(79644).Buffer,k=v(93044);m.exports=function(m,g){g=g||new FormData;var v=[];function convertValue(m){return null===m?"":k.isDate(m)?m.toISOString():k.isArrayBuffer(m)||k.isTypedArray(m)?"function"==typeof Blob?new Blob([m]):x.from(m):m}return function build(m,x){if(k.isPlainObject(m)||k.isArray(m)){if(-1!==v.indexOf(m))throw Error("Circular reference detected in "+x);v.push(m),k.forEach(m,function(m,v){if(!k.isUndefined(m)){var E,T=x?x+"."+v:v;if(m&&!x&&"object"==typeof m){if(k.endsWith(v,"{}"))m=JSON.stringify(m);
1else if(k.endsWith(v,"[]")&&(E=k.toArray(m))){E.forEach(function(m){k.isUndefined(m)||g.append(T,convertValue(m))});return}}build(m,T)}}),v.pop()}else g.append(x,convertValue(m))}(m),g}},17525:function(m,g,v){"use strict";var x=v(29241).version,k=v(21218),E={};["object","boolean","number","function","string","symbol"].forEach(function(m,g){E[m]=function(v){return typeof v===m||"a"+(g<1?"n ":" ")+m}});var T={};E.transitional=function(m,g,v){function formatMessage(m,g){return"[Axios v"+x+"] Transitional option '"+m+"'"+g+(v?". "+v:"")}return function(v,x,E){if(!1===m)throw new k(formatMessage(x," has been removed"+(g?" in "+g:"")),k.ERR_DEPRECATED);return g&&!T[x]&&(T[x]=!0,console.warn(formatMessage(x," has been deprecated since v"+g+" and will be removed in the near future"))),!m||m(v,x,E)}},m.exports={assertOptions:function(m,g,v){if("object"!=typeof m)throw new k("options must be an object",k.ERR_BAD_OPTION_VALUE);for(var x=Object.keys(m),E=x.length;E-- >0;){var T=x[E],K=g[T];if(K){var et=m[T],en=void 0===et||K(et,T,m);if(!0!==en)throw new k("option "+T+" must be "+en,k.ERR_BAD_OPTION_VALUE);continue}if(!0!==v)throw new k("Unknown option "+T,k.ERR_BAD_OPTION)}},validators:E}},93044:function(m,g,v){"use strict";var x,k,E=v(73644),T=Object.prototype.toString,K=(x=Object.create(null),function(m){var g=T.call(m);return x[g]||(x[g]=g.slice(8,-1).toLowerCase())});function kindOfTest(m){return m=m.toLowerCase(),function(g){return K(g)===m}}function isArray(m){return Array.isArray(m)}function isUndefined(m){return void 0===m}var et=kindOfTest("ArrayBuffer");function isObject(m){return null!==m&&"object"==typeof m}function isPlainObject(m){if("object"!==K(m))return!1;var g=Object.getPrototypeOf(m);return null===g||g===Object.prototype}var en=kindOfTest("Date"),er=kindOfTest("File"),ei=kindOfTest("Blob"),es=kindOfTest("FileList");function isFunction(m){return"[object Function]"===T.call(m)}var el=kindOfTest("URLSearchParams");function forEach(m,g){if(null!=m){if("object"!=typeof m&&(m=[m]),isArray(m))for(var v=0,x=m.length;v<x;v++)g.call(null,m[v],v,m);else for(var k in m)Object.prototype.hasOwnProperty.call(m,k)&&g.call(null,m[k],k,m)}}var ec=(k="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(m){return k&&m instanceof k});m.exports={isArray:isArray,isArrayBuffer:et,isBuffer:function(m){return null!==m&&!isUndefined(m)&&null!==m.constructor&&!isUndefined(m.constructor)&&"function"==typeof m.constructor.isBuffer&&m.constructor.isBuffer(m)},isFormData:function(m){var g="[object FormData]";return m&&("function"==typeof FormData&&m instanceof FormData||T.call(m)===g||isFunction(m.toString)&&m.toString()===g)},isArrayBufferView:function(m){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(m):m&&m.buffer&&et(m.buffer)},isString:function(m){return"string"==typeof m},isNumber:function(m){return"number"==typeof m},isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:en,isFile:er,isBlob:ei,isFunction:isFunction,isStream:function(m){return isObject(m)&&isFunction(m.pipe)},isURLSearchParams:el,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:forEach,merge:function merge(){var m={};function assignValue(g,v){isPlainObject(m[v])&&isPlainObject(g)?m[v]=merge(m[v],g):isPlainObject(g)?m[v]=merge({},g):isArray(g)?m[v]=g.slice():m[v]=g}for(var g=0,v=arguments.length;g<v;g++)forEach(arguments[g],assignValue);return m},extend:function(m,g,v){return forEach(g,function(g,x){v&&"function"==typeof g?m[x]=E(g,v):m[x]=g}),m},trim:function(m){return m.trim?m.trim():m.replace(/^\s+|\s+$/g,"")},stripBOM:function(m){return 65279===m.charCodeAt(0)&&(m=m.slice(1)),m},inherits:function(m,g,v,x){m.prototype=Object.create(g.prototype,x),m.prototype.constructor=m,v&&Object.assign(m.prototype,v)},toFlatObject:function(m,g,v){var x,k,E,T={};g=g||{};do{for(k=(x=Object.getOwnPropertyNames(m)).length;k-- >0;)T[E=x[k]]||(g[E]=m[E],T[E]=!0);m=Object.getPrototypeOf(m)}while(m&&(!v||v(m,g))&&m!==Object.prototype);return g},kindOf:K,kindOfTest:kindOfTest,endsWith:function(m,g,v){m=String(m),(void 0===v||v>m.length)&&(v=m.length),v-=g.length;var x=m.indexOf(g,v);return -1!==x&&x===v},toArray:function(m){if(!m)return null;var g=m.length;if(isUndefined(g))return null;for(var v=Array(g);g-- >0;)v[g]=m[g];return v},isTypedArray:ec,isFileList:es}},13421:function(m,g){"use strict";/*!
2 * cookie
3 * Copyright(c) 2012-2014 Roman Shtylman
4 * Copyright(c) 2015 Douglas Christopher Wilson
5 * MIT Licensed
6 */g.Q=function(m,g){if("string"!=typeof m)throw TypeError("argument str must be a string");for(var x={},k=m.split(";"),E=(g||{}).decode||v,T=0;T<k.length;T++){var K=k[T],et=K.indexOf("=");if(!(et<0)){var en=K.substring(0,et).trim();if(void 0==x[en]){var er=K.substring(et+1,K.length).trim();'"'===er[0]&&(er=er.slice(1,-1)),x[en]=function(m,g){try{return g(m)}catch(g){return m}}(er,E)}}}return x},g.q=function(m,g,v){var E=v||{},T=E.encode||x;if("function"!=typeof T)throw TypeError("option encode is invali
6d");if(!k.test(m))throw TypeError("argument name is invalid");var K=T(g);if(K&&!k.test(K))throw TypeError("argument val is invalid");var et=m+"="+K;if(null!=E.maxAge){var en=E.maxAge-0;if(isNaN(en)||!isFinite(en))throw TypeError("option maxAge is invalid");et+="; Max-Age="+Math.floor(en)}if(E.domain){if(!k.test(E.domain))throw TypeError("option domain is invalid");et+="; Domain="+E.domain}if(E.path){if(!k.test(E.path))throw TypeError("option path is invalid");et+="; Path="+E.path}if(E.expires){if("function"!=typeof E.expires.toUTCString)throw TypeError("option expires is invalid");et+="; Expires="+E.expires.toUTCString()}if(E.httpOnly&&(et+="; HttpOnly"),E.secure&&(et+="; Secure"),E.sameSite)switch("string"==typeof E.sameSite?E.sameSite.toLowerCase():E.sameSite){case!0:case"strict":et+="; SameSite=Strict";break;case"lax":et+="; SameSite=Lax";break;case"none":et+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return et};var v=decodeURIComponent,x=encodeURIComponent,k=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/},50381:function(m,g,v){"use strict";var x=v(91706),k={"text/plain":"Text","text/html":"Url",default:"Text"};m.exports=function(m,g){var v,E,T,K,et,en,er,ei,es=!1;g||(g={}),T=g.debug||!1;try{if(et=x(),en=document.createRange(),er=document.getSelection(),(ei=document.createElement("span")).textContent=m,ei.ariaHidden="true",ei.style.all="unset",ei.style.position="fixed",ei.style.top=0,ei.style.clip="rect(0, 0, 0, 0)",ei.style.whiteSpace="pre",ei.style.webkitUserSelect="text",ei.style.MozUserSelect="text",ei.style.msUserSelect="text",ei.style.userSelect="text",ei.addEventListener("copy",function(v){if(v.stopPropagation(),g.format){if(v.preventDefault(),void 0===v.clipboardData){T&&console.warn("unable to use e.clipboardData"),T&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=k[g.format]||k.default;window.clipboardData.setData(x,m)}else v.clipboardData.clearData(),v.clipboardData.setData(g.format,m)}g.onCopy&&(v.preventDefault(),g.onCopy(v.clipboardData))}),document.body.appendChild(ei),en.selectNodeContents(ei),er.addRange(en),!document.execCommand("copy"))throw Error("copy command was unsuccessful");es=!0}catch(x){T&&console.error("unable to copy using execCommand: ",x),T&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(g.format||"text",m),g.onCopy&&g.onCopy(window.clipboardData),es=!0}catch(x){T&&console.error("unable to copy using clipboardData: ",x),T&&console.error("falling back to prompt"),v="message"in g?g.message:"Copy to clipboard: #{key}, Enter",E=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",K=v.replace(/#{\s*key\s*}/g,E),window.prompt(K,m)}}finally{er&&("function"==typeof er.removeRange?er.removeRange(en):er.removeAllRanges()),ei&&document.body.removeChild(ei),et()}return es}},73463:function(m,g,v){"use strict";var x=v(48570),k={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},E={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},T={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},K={};function getStatics(m){return x.isMemo(m)?T:K[m.$$typeof]||k}K[x.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},K[x.Memo]=T;var et=Object.defineProperty,en=Object.getOwnPropertyNames,er=Object.getOwnPropertySymbols,ei=Object.getOwnPropertyDescriptor,es=Object.getPrototypeOf,el=Object.prototype;m.exports=function hoistNonReactStatics(m,g,v){if("string"!=typeof g){if(el){var x=es(g);x&&x!==el&&hoistNonReactStatics(m,x,v)}var k=en(g);er&&(k=k.concat(er(g)));for(var T=getStatics(m),K=getStatics(g),ec=0;ec<k.length;++ec){var eu=k[ec];if(!E[eu]&&!(v&&v[eu])&&!(K&&K[eu])&&!(T&&T[eu])){var ed=ei(g,eu);try{et(m,eu,ed)}catch(m){}}}}return m}},7685:function(m,g,v){var x,k,E,T,K,et,en,er,ei,es,el,ec,eu,ed,ep,em;E=function(m,g,v){if(!es(g)||ec(g)||eu(g)||ed(g)||ei(g))return g;var x,k=0,T=0;if(el(g))for(x=[],T=g.length;k<T;k++)x.push(E(m,g[k],v));else for(var K in x={},g)Object.prototype.hasOwnProperty.call(g,K)&&(x[m(K,v)]=E(m,g[K],v));return x},T=function(m,g){var v=(g=g||{}).separator||"_",x=g.split||/(?=[A-Z])/;return m.split(x).join(v)},K=function(m){return ep(m)?m:(m=m.replace(/[\-_\s]+(.)?/g,function(m,g){return g?g.toUpperCase():""})).substr(0,1).toLowerCase()+m.substr(1)},et=function(m){var g=K(m);return g.substr(0,1).toUpperCase()+g.substr(1)},en=function(m,g){return T(m,g).toLowerCase()},er=Object.prototype.toString,ei=function(m){return"function"==typeof m},es=function(m){return m===Object(m)},el=function(m){return"[object Array]"==er.call(m)},ec=function(m){return"[object Date]"==er.call(m)},eu=function(m){return"[object RegExp]"==er.call(m)},ed=function(m){return"[object Boolean]"==er.call(m)},ep=function(m){return(m-=0)==m},em=function(m,g){var v=g&&"process"in g?g.process:g;return"function"!=typeof v?m:function(g,x){return v(g,m,x)}},void 0!==(k="function"==typeof(x={camelize:K,decamelize:en,pascalize:et,depascalize:en,camelizeKeys:function(m,g){return E(em(K,g),m)},decamelizeKeys:function(m,g){return E(em(en,g),m,g)},pascalizeKeys:function(m,g){return E(em(et,g),m)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}}
6)?x.call(g,v,g,m):x)&&(m.exports=k)},86570:function(m,g,v){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return v(94973)}])},13933:function(m,g,v){"use strict";v.d(g,{a:function(){return VerificationCodeInput}});var x=v(52322),k=v(2784);function VerificationCodeInput(m){let{value:g,onChange:v,length:E=6,disabled:T=!1,error:K}=m,et=(0,k.useRef)([]);(0,k.useEffect)(()=>{et.current=et.current.slice(0,E)},[E]);let handleChange=(m,x)=>{if(x.length>1)return;let k=g.split("");k[m]=x;let T=k.join("");if(v(T),x&&m<E-1){var K;null===(K=et.current[m+1])||void 0===K||K.focus()}},handleKeyDown=(m,v)=>{if("Backspace"===v.key&&!g[m]&&m>0){var x;null===(x=et.current[m-1])||void 0===x||x.focus()}},handlePaste=m=>{m.preventDefault();let g=m.clipboardData.getData("text/plain").replace(/\D/g,"");g.length<=E&&v(g.padEnd(E,""))};return(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)("div",{className:"flex gap-2 justify-center",children:Array.from({length:E},(m,v)=>(0,x.jsx)("input",{ref:m=>et.current[v]=m,type:"text",maxLength:1,value:g[v]||"",onChange:m=>handleChange(v,m.target.value),onKeyDown:m=>handleKeyDown(v,m),onPaste:handlePaste,disabled:T,className:"\n              w-12 h-12 text-center text-lg font-semibold border rounded-lg\n              focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n              ".concat(K?"border-red-500":"border-gray-300","\n              ").concat(T?"bg-gray-100 cursor-not-allowed":"bg-white","\n            ")},v))}),K&&(0,x.jsx)("p",{className:"text-sm text-red-600 text-center",children:K})]})}},69567:function(m,g,v){"use strict";v.d(g,{c:function(){return VerificationModal}});var x=v(52322),k=v(2784),E=v(4028),T=v(46262),K=v(93227),et=v(13933);function VerificationModal(m){let{isOpen:g,onClose:v,onSuccess:en,type:er,value:ei,onVerify:es,isLoading:el=!1,error:ec}=m,[eu,ed]=(0,k.useState)(""),[ep,em]=(0,k.useState)(!1);(0,k.useEffect)(()=>{6===eu.length&&handleVerify()},[eu]);let handleVerify=async()=>{if(6===eu.length)try{await es(eu),em(!0),setTimeout(()=>{en&&en(ei),handleClose()},1500)}catch(m){}},handleClose=()=>{ed(""),em(!1),v()};return g?(0,x.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black bg-opacity-50",children:(0,x.jsxs)("div",{className:"w-full max-w-sm bg-white rounded-lg shadow-xl",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[(0,x.jsxs)("h3",{className:"text-lg font-semibold text-gray-900",children:["Verificar ","email"===er?"Email":"Tel\xe9fono"]}),(0,x.jsx)("button",{onClick:handleClose,className:"text-gray-400 hover:text-gray-600 transition-colors",children:(0,x.jsx)(E.Z,{className:"h-5 w-5"})})]}),(0,x.jsx)("div",{className:"p-4",children:ep?(0,x.jsxs)("div",{className:"text-center py-8",children:[(0,x.jsx)(T.Z,{className:"h-12 w-12 text-green-500 mx-auto mb-4"}),(0,x.jsx)("h4",{className:"text-lg font-medium text-gray-900 mb-2",children:"\xa1Verificaci\xf3n exitosa!"}),(0,x.jsxs)("p",{className:"text-sm text-gray-600",children:["email"===er?"Email":"Tel\xe9fono"," verificado correctamente"]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"text-center mb-6",children:[(0,x.jsx)("p",{className:"text-sm text-gray-600 mb-2",children:"Ingresa el c\xf3digo de verificaci\xf3n enviado a:"}),(0,x.jsx)("p",{className:"font-medium text-gray-900",children:"email"===er?ei:"+56 ".concat(ei)})]}),ec&&(0,x.jsxs)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg flex items-center space-x-2",children:[(0,x.jsx)(K.Z,{className:"h-4 w-4 text-red-500 flex-shrink-0"}),(0,x.jsx)("p",{className:"text-sm text-red-700",children:ec})]}),(0,x.jsx)(et.a,{value:eu,onChange:ed,disabled:el,error:ec}),(0,x.jsx)("div",{className:"mt-4 text-center",children:(0,x.jsx)("p",{className:"text-xs text-gray-500",children:"El c\xf3digo expira en 10 minutos"})})]})}),!ep&&(0,x.jsxs)("div",{className:"flex items-center justify-between p-4 border-t border-gray-200",children:[(0,x.jsx)("button",{onClick:handleClose,className:"text-sm text-gray-600 hover:text-gray-800 transition-colors",disabled:el,children:"Cancelar"}),(0,x.jsx)("button",{onClick:()=>{handleVerify()},disabled:6!==eu.length||el,className:"px-4 py-2 bg-blue-500 text-white text-sm font-medium rounded-lg hover:bg-blue-600 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:el?"Verificando...":"Verificar"})]})]})}):null}},19249:function(m,g,v){"use strict";var x=v(52322),k=v(2784),E=v(12635),T=v(93829),K=v(85320),et=v(65575),en=v(77353);let er=(0,x.jsx)("div",{className:"w-10 h-10 bg-gray-100 rounded flex items-center justify-center",children:(0,x.jsx)(E.Z,{className:"w-6 h-6 text-gray-600"})});g.Z=m=>{let{disabled:g=!1,onCardChange:v}=m,{data:E}=(0,en.P)(),[ei,es]=(0,k.useState)(!1),{data:el,refetch:ec,isLoading:eu}
6=(0,et.g)(),ed=!!E&&!!(null==E?void 0:E.card_number)&&(null==E?void 0:E.response_code)===0,ep=!!el&&el.has_card&&!!el.default_card,em=null==el?void 0:el.default_card,handleCardUpdate=()=>{v?v():es(!0)},renderCardRow=m=>{let{icon:v,title:k,subtitle:E,buttonLabel:K,buttonVariant:et,onClick:en}=m;return(0,x.jsx)("div",{className:"border border-gray-300 rounded-lg p-4 bg-white",children:(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsxs)("div",{className:"flex items-center space-x-3",children:[v,(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{"data-ph-public":!0,className:"text-sm font-medium text-gray-900",children:k}),(0,x.jsx)("p",{className:"text-sm text-gray-500",children:E})]})]}),(0,x.jsx)(T.z,{"data-ph-public":!0,onClick:en,variant:et,size:"sm",disabled:g,className:"py-1 px-2",children:K})]})})};if(eu)return(0,x.jsx)("div",{className:"py-3 px-4 bg-gray-50 border border-gray-200 rounded-full",children:(0,x.jsx)("p",{className:"text-sm text-gray-500 text-center",children:"Cargando informaci\xf3n de pago..."})});if(ep&&em&&em.last_four_digits){let m=em.card_type||"",g=function(m){let g=null==m?void 0:m.toLowerCase();return g&&g.includes("master")?"/static/icons/card-brands/mastercard.svg":g&&g.includes("visa")?"/static/icons/card-brands/visa.svg":g&&g.includes("ame")?"/static/icons/card-brands/american-express.svg":g&&g.includes("redcompra")||g&&g.includes("prepago")?"/static/icons/card-brands/red-compra.svg":"/static/icons/card-brands/visa.svg"}(m),v={visa:"Visa",master:"Mastercard",amex:"American Express",debmaster:"Mastercard D\xe9bito",debvisa:"Visa D\xe9bito",redcompra:"RedCompra",prepago:"D\xe9bito"}[m.toLowerCase()]||m;return(0,x.jsxs)(x.Fragment,{children:[renderCardRow({icon:g?(0,x.jsx)("img",{className:"h-8",alt:v,src:g}):er,title:v,subtitle:"•••• ".concat(em.last_four_digits),buttonLabel:"Cambiar tarjeta",buttonVariant:"brand-outline",onClick:handleCardUpdate}),(0,x.jsx)(K.Z,{isOpen:ei,onClose:()=>es(!1),onUpdateSuccess:()=>void ec(),hasCard:null==el?void 0:el.has_card})]})}return(0,x.jsxs)(x.Fragment,{children:[ed&&(0,x.jsx)("p",{className:"text-sm text-neutral-600 mb-2",children:"Tu tarjeta anterior dej\xf3 de estar disponible porque cambiamos de procesador de pagos. Inscribe tu tarjeta nuevamente para seguir cobrando tus cuotas."}),renderCardRow({icon:er,title:"Sin tarjeta inscrita",subtitle:"Inscribe tu tarjeta para pagar tus cuotas",buttonLabel:"Inscribir tarjeta",buttonVariant:"brand",onClick:handleCardUpdate}),(0,x.jsx)(K.Z,{isOpen:ei,onClose:()=>es(!1),onUpdateSuccess:()=>void ec(),hasCard:!1})]})}},85320:function(m,g,v){"use strict";v.d(g,{Z:function(){return MercadoPagoCardUpdate}});var x=v(52322),k=v(2784),E=v(96577),T=v.n(E),K=v(39097),et=v.n(K),en=v(53538),er=v(6323),ei=v(77152),es=v(55830),el=v(62350),ec=v(44994),eu=v(14016),ed=v(13346),ep=v(22908),em=v(67669);let useSaveCardMutation=()=>{let m=(0,es.NL)();return(0,el.D)({mutationFn:async m=>{try{let g=await (0,ec.h)(ep.hf,{method:"POST",url:ed.Z.mercadopago.saveCard(),data:{token:m.token,payment_method_id:m.paymentMethodId,device_id:m.deviceId}});return g.data}catch(m){(0,eu.zG)(m,"Hubo un error al guardar la tarjeta. Por favor, intenta nuevamente.")}},onSuccess:()=>{m.invalidateQueries({queryKey:em.a.mercadopago.customerInfo()})}})};var ef=v(676),eh=v(20463),eg=v(78233),ev=v(39776);async function ensureDeviceId(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,v=Date.now()+m;for(;Date.now()<v;){let m=function(){let m=window.MP_DEVICE_SESSION_ID;return"string"==typeof m&&m.length>0?m:void 0}();if(m)return m;await new Promise(m=>setTimeout(m,g))}}let ey=["Instagram","FBAN","FBAV","FB_IAB","Line/","TikTok","musical_ly","Snapchat","Pinterest","LinkedInApp","Twitter"];function MercadoPagoCardUpdate(m){let{isOpen:g,onClose:v,onUpdateSuccess:E,hasCard:K}=m;(0,eg.I_)();let{status:es,retry:el}=(0,eg.$M)(g),{toast:ec}=(0,ef.pm)(),[ed,ep]=(0,k.useState)(0),[em,eb]=(0,k.useState)(null),[ex,e_]=(0,k.useState)(!1),ew=useSaveCardMutation(),{data:eS,isLoading:eC}=(0,ev.a)();(0,k.useEffect)(()=>{e_(function(){if("undefined"==typeof navigator)return!1;let m=navigator.userAgent||"";return ey.some(g=>m.includes(g))}())},[]);let ek=(0,k.useRef)(!1);(0,k.useEffect)(()=>{var m;if(!g){ek.current=!1;return}ex&&!ek.current&&(ek.current=!0,(0,eh.Tb)(Error("MercadoPago brick bloqueado en navegador in-app"),{level:"warning",tags:{mp_brick_issue:"in_app_browser_blocked",mp_brick_flow:K?"update":"create"},fingerprint:["mp-brick-in-app-browser"],extra:{user_agent:"undefined"!=typeof navigator?navigator.userAgent:null,user_id:null!==(m=null==eS?void 0:eS.id)&&void 0!==m?m:null},silent:!0}))},[g,ex,K,null==eS?void 0:eS.id]);let eE=(0,k.useRef)(!1);(0,k.useEffect)(()=>{var m;if(!g){eE.current=!1;return}"error"!==es||eE.current||(eE.current=!0,(0,eh.Tb)(Error("No se pudo cargar el SDK de MercadoPago (script load failed)"),{level:"warning",tags:{mp_brick_issue:"sdk_script_load_failed",mp_brick_flow:K?"update":"create"},fingerprint:["mp-sdk-script-load-failed"],extra:{flow:K?"update":"create",user_id:null!==(m=null==eS?void 0:eS.id)&&void 0!==m?m:null},silent:!0}))},[g,es,K,null==eS?void 0:eS.id]),(0,k.useEffect)(()=>{g?ep(m=>m+1):eb(null)},[g]),(0,k.useEffect)(()=>{var m;if(!g||eC||em)return;let v=null==eS?void 0:null===(m=eS.email)||void 0===m?void 0:m.trim();eb(v?{amount:1e3,payer:{email:v}}:{amount:1e3})},[em,g,eC,null==eS?void 0:eS.email]);let ej=(0,k.useRef)(null);(0,k.useEffect)(()=>
6{if(!g){ej.current=null;return}if(em){if(null===ej.current){ej.current=em;return}if(ej.current!==em){var m;(0,eh.Tb)(Error("CardPayment initialization cambi\xf3 tras el montaje (riesgo de desync DEV-3337)"),{level:"warning",tags:{mp_brick_issue:"initialization_changed_after_mount",mp_brick_flow:K?"update":"create"},fingerprint:["mp-brick-init-desync"],extra:{flow:K?"update":"create",user_id:null!==(m=null==eS?void 0:eS.id)&&void 0!==m?m:null,brick_key:ed},silent:!0}),ej.current=em}}},[em,g,K,null==eS?void 0:eS.id,ed]);let eN=(0,k.useRef)(v),eR=(0,k.useRef)(E),eI=(0,k.useRef)(ew.mutateAsync);eN.current=v,eR.current=E,eI.current=ew.mutateAsync;let eP=(0,k.useRef)({hasCard:K,userId:null==eS?void 0:eS.id});eP.current={hasCard:K,userId:null==eS?void 0:eS.id};let eT=(0,k.useRef)(!1),eO=(0,k.useCallback)(async m=>{var g,v;if(eT.current)return;eT.current=!0;let x=null!=m?m:{},k=null!==(g=x.token)&&void 0!==g?g:"",E=null!==(v=x.payment_method_id)&&void 0!==v?v:"";if(!k||!E){(0,eh.Tb)(Error("MP brick: missing token after submit")),ec.error("No se pudo obtener el token de la tarjeta. Intenta nuevamente."),eT.current=!1;return}let T=Date.now(),K=await ensureDeviceId(3e3),et=!K;if(K||((0,eg.PU)(),K=await ensureDeviceId(2e3)),!K){let{hasCard:m,userId:g}=eP.current;(0,eh.Tb)(Error("MercadoPago brick: device_id ausente en submit"),{level:"warning",tags:{mp_device_id_missing:"true",mp_brick_flow:m?"update":"create"},fingerprint:["mp-device-id-missing"],extra:{flow:m?"update":"create",user_id:null!=g?g:null,waited_ms:Date.now()-T,reinjected:et},silent:!0})}try{await eI.current({token:k,paymentMethodId:E,deviceId:K}),eR.current(),eN.current()}catch(v){ep(m=>m+1);let{message:m,details:g}=(0,eu.EV)(v,"Error al guardar la tarjeta. Por favor, intenta nuevamente.");ec({title:"Error al guardar la tarjeta",description:m+g,variant:"destructive"})}finally{eT.current=!1}},[ec]),eA=(0,k.useCallback)(m=>{var g,v;let x=null!=m?m:{},k=x.cause||x.message||"unknown";"non_critical"!==x.type&&(0,eh.Tb)(Error("MercadoPago brick error: ".concat(k)),{level:"error",tags:{mp_brick_cause:k,mp_brick_flow:K?"update":"create"},fingerprint:["mp-brick-error",k],extra:{brick_error:x,flow:K?"update":"create",user_id:null!==(g=null==eS?void 0:eS.id)&&void 0!==g?g:null}}),ec.error(k?k.startsWith("missing_")?"Completa todos los campos del formulario.":null!==(v=({payment_method_not_in_allowed_types:"Esta tarjeta no es compatible con nuestro procesador. Intenta con una Visa o Mastercard chilena.",invalid_card_number:"El n\xfamero de tarjeta no es v\xe1lido. Revisa los d\xedgitos e intenta nuevamente.",invalid_expiry_date:"La fecha de vencimiento es inv\xe1lida.",expired_card:"La tarjeta est\xe1 vencida.",invalid_security_code:"El c\xf3digo de seguridad (CVV) es incorrecto.",invalid_cvv:"El c\xf3digo de seguridad (CVV) es incorrecto.",invalid_identification_number:"El RUT ingresado no es v\xe1lido.",invalid_identification_type:"El RUT ingresado no es v\xe1lido.",invalid_cardholder_name:"El nombre del titular no es v\xe1lido."})[k])&&void 0!==v?v:"No pudimos inscribir tu tarjeta. Intenta con otra o cont\xe1ctanos si el problema persiste.":"No pudimos inscribir tu tarjeta. Intenta con otra o cont\xe1ctanos si el problema persiste.")},[ec,K,null==eS?void 0:eS.id]),eM=(0,k.useCallback)(()=>{},[]),eD=(0,k.useCallback)(async()=>{try{await navigator.clipboard.writeText(window.location.href),ec({title:"Enlace copiado",description:"P\xe9galo en Chrome o Safari para continuar."})}catch(m){ec.error("No pudimos copiar el enlace. C\xf3pialo desde la barra de direcciones de tu navegador.")}},[ec]),eL=(0,k.useMemo)(()=>({paymentMethods:{maxInstallments:1},visual:{hideFormTitle:!0,hidePaymentButton:!1,texts:{formSubmit:K?"Actualizar tarjeta":"Guardar tarjeta"}}}),[K]),eF=g&&(eC||!em),eZ=(0,k.useMemo)(()=>{var m,v;return!!g&&!eC&&!!eS&&!en.Z_().email().safeParse(null!==(v=null===(m=eS.email)||void 0===m?void 0:m.trim())&&void 0!==v?v:"").success},[g,eC,eS]);return(0,x.jsx)(ei.yo,{open:g,onOpenChange:m=>{m||v()},children:(0,x.jsxs)(ei.ue,{className:"flex h-full flex-col overflow-y-scroll p-0",children:[(0,x.jsx)(ei.Tu,{className:"flex justify-end sm:block p-4 sm:p-0 shadow-3xl sm:shadow-none",children:(0,x.jsx)(ei.bC,{className:"text-2xl font-bold text-center px-12 mt-6 sm:mt-9",children:ew.isLoading?K?"Actualizando tarjeta...":"Guardando tarjeta...":K?"Actualizar tarjeta con MercadoPago":"Guardar tarjeta con MercadoPago"})}),(0,x.jsxs)("div",{className:"h-full flex flex-col",children:[(0,x.jsx)("div",{className:ew.isLoading?"flex-1 flex items-center justify-center":"hidden",children:(0,x.jsxs)("div",{className:"flex flex-col items-center justify-center px-8 py-16 max-w-md",children:[(0,x.jsx)("div",{className:"mb-8",children:(0,x.jsx)(T(),{src:"/static/dashboard_dog.svg",alt:"Cacttus mascot",width:140,height:140,className:"opacity-90 animate-pulse"})}),(0,x.jsxs)("div",{className:"text-center space-y-3",children:[(0,x.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:K?"Actualizando tarjeta":"Guardando tarjeta"}),(0,x.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed",children:K?"Estamos validando y actualizando tu tarjeta de forma segura con MercadoPago.":"Estamos validando y guardando tu tarjeta de forma segura con MercadoPago."}),(0,x.jsx)("div",{className:"flex items-center justify-center gap-2 pt-2",children:(0,x.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,x.jsx)("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,x.jsx)("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})}),(0,x.jsx)("span",{className:"text-xs font-medium text-gray-700",children:"Conexi\xf3n segura"})]})})]})]})}),(0,x.jsxs)("div",{className:ew.isLoading?"hidden":"flex-1 flex flex-col",children:[(0,x.jsx)("div",{className:"px-6 py-5 bg-white border-b border-gray-200",children:(0,x.jsxs)("div",{className:"flex items-start gap-4 p-4 bg-blue-50 border-l-4 border-blue-500 rounded-r-lg shadow-sm",children:[(0,x.jsx)("div",{className:"flex-shrink-0",children:(0,x.jsx)("div",{className:"w-10 h-10 bg-blue-500 rounded-lg flex items-center justify-center",children:(0,x.jsx)("svg",{className:"w-6 h-6 text-white",f
6ill:"currentColor",viewBox:"0 0 20 20",children:(0,x.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})})}),(0,x.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,x.jsx)("p",{className:"text-sm font-semibold text-gray-900 mb-1",children:K?"Actualiza tu m\xe9todo de pago":"M\xe9todo de pago seguro"}),(0,x.jsx)("p",{className:"text-sm text-gray-700",children:K?"Ingresa los datos de tu nueva tarjeta. Ser\xe1 validada antes de actualizar tu m\xe9todo de pago.":"Tus datos ser\xe1n validados y encriptados para garantizar la seguridad de tus transacciones."})]})]})}),(0,x.jsx)("div",{className:"flex-1 overflow-auto bg-white px-6 py-6",children:ex?(0,x.jsxs)("div",{className:"flex min-h-[360px] flex-col items-center justify-center gap-4 text-center",children:[(0,x.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-yellow-50",children:(0,x.jsx)("svg",{className:"h-6 w-6 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,x.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,x.jsxs)("div",{className:"space-y-2 max-w-sm",children:[(0,x.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Abre esta p\xe1gina en tu navegador"}),(0,x.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed",children:"Est\xe1s navegando dentro de otra app (como Instagram o Facebook) y no podemos validar tu tarjeta de forma segura aqu\xed. Abre el enlace en Chrome o Safari para continuar."})]}),(0,x.jsx)("button",{type:"button",onClick:()=>void eD(),className:"rounded-lg bg-blue-500 px-6 py-3 text-sm font-semibold text-white shadow-cta-blue transition-shadow hover:shadow-cta-blue-hover",children:"Copiar enlace"})]}):"error"===es?(0,x.jsxs)("div",{className:"flex min-h-[360px] flex-col items-center justify-center gap-4 text-center",children:[(0,x.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-yellow-50",children:(0,x.jsx)("svg",{className:"h-6 w-6 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,x.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,x.jsxs)("div",{className:"space-y-2 max-w-sm",children:[(0,x.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"No pudimos cargar el formulario de pago"}),(0,x.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed",children:"Revisa tu conexi\xf3n a internet o desactiva extensiones que puedan bloquear scripts, y vuelve a intentar."})]}),(0,x.jsx)("button",{type:"button",onClick:el,className:"rounded-lg bg-blue-500 px-6 py-3 text-sm font-semibold text-white shadow-cta-blue transition-shadow hover:shadow-cta-blue-hover",children:"Reintentar"})]}):eZ?(0,x.jsxs)("div",{className:"flex min-h-[360px] flex-col items-center justify-center gap-4 text-center",children:[(0,x.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-yellow-50",children:(0,x.jsx)("svg",{className:"h-6 w-6 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,x.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,x.jsxs)("div",{className:"space-y-2 max-w-sm",children:[(0,x.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Revisa tu correo electr\xf3nico"}),(0,x.jsxs)("p",{className:"text-sm text-gray-600 leading-relaxed",children:["Tu correo ",(null==eS?void 0:eS.email)?(0,x.jsx)("span",{className:"font-medium",children:eS.email}):""," parece tener un error y MercadoPago no podr\xe1 validar tu tarjeta. 
6Corr\xedgelo en tu perfil para continuar."]})]}),(0,x.jsx)(et(),{href:{pathname:"/profile",query:{tab:"settings"}},className:"rounded-lg bg-blue-500 px-6 py-3 text-sm font-semibold text-white shadow-cta-blue transition-shadow hover:shadow-cta-blue-hover",children:"Editar mi perfil"})]}):eF||"loading"===es?(0,x.jsx)("div",{className:"flex min-h-[360px] items-center justify-center",children:(0,x.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-gray-200 border-t-blue-500"})}):em?(0,x.jsx)(er.Wg,{initialization:em,customization:eL,onReady:eM,onSubmit:eO,onError:eA},ed):null})]})]})]})})}},33776:function(m,g,v){"use strict";v.d(g,{V1:function(){return FlowActionBar},sn:function(){return FlowSummaryCard}});var x=v(52322),k=v(2784),E=v(25987);let T={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"};function FlowSummaryCard(m){let{icon:g,rows:v,footer:K}=m;return(0,x.jsxs)("div",{className:"relative mt-11 shadow-3xl rounded-lg bg-white",children:[(0,x.jsx)("div",{className:"absolute mx-auto left-0 right-0 bg-white -top-7 w-14 h-14 rounded-full shrink-0 flex justify-center items-center",children:(0,x.jsx)(g,{className:"w-8 h-8 text-neutral-200"})}),(0,x.jsx)("div",{className:"sm:hidden grid grid-cols-[1fr_1.25rem_1fr] pt-8 px-6 pb-6 gap-y-2",children:v.map(m=>(0,x.jsxs)(k.Fragment,{children:[(0,x.jsx)("div",{className:"font-bold text-neutral-500",children:m.label}),(0,x.jsx)("div",{className:"text-sm font-bold text-neutral-500",children:":"}),(0,x.jsx)("div",{className:"break-words",children:m.value})]},m.label))}),(0,x.jsx)("div",{className:"hidden sm:block pt-9 pb-6",children:(function(m,g){let v=[];for(let x=0;x<m.length;x+=g)v.push(m.slice(x,x+g));return v})(v,3).map((m,g)=>{var v;return(0,x.jsxs)(k.Fragment,{children:[g>0&&(0,x.jsx)("div",{className:"mx-6 border-t my-6"}),(0,x.jsx)("div",{className:(0,E.cn)("grid divide-x",null!==(v=T[m.length])&&void 0!==v?v:"grid-cols-3"),children:m.map(m=>(0,x.jsxs)("div",{className:"px-6 min-w-0",children:[(0,x.jsx)("div",{className:"font-bold text-neutral-500",children:m.label}),(0,x.jsx)("div",{className:"mt-1 break-words",children:m.value})]},m.label))})]},g)})}),K&&(0,x.jsx)("div",{className:"px-6 pb-6 text-center",children:K})]})}function FlowActionBar(m){let{children:g}=m;return(0,x.jsx)("div",{className:"w-full px-6 sm:px-0 py-4 sm:py-0 bg-white shadow-3xl fixed bottom-0 left-0 sm:relative sm:bg-transparent sm:shadow-none sm:mt-6",children:(0,x.jsx)("div",{className:"flex justify-center",children:g})})}},31980:function(m,g,v){"use strict";v.d(g,{Z:function(){return PetInfo}});var x=v(52322);v(2784);var k=v(27484),E=v.n(k),T=v(60458),K=v(97159),et=v(28294),en=v(25987);function PetInfo(m){let{pet:g,isBgBlue:v=!1,showError:k=!1,subtitle:er}=m,ei=function(m){let g=E()().diff(E()(m),"year");if(0===g){let g=E()().diff(E()(m),"month");return"".concat(g," ").concat(1===g?"mes":"meses")}return"".concat(g," ").concat(1===g?"a\xf1o":"a\xf1os")}(g.birthdate),es="".concat(g.breed," ").concat("male"===g.gender?"macho":"hembra"," de ").concat(ei);return(0,x.jsxs)("div",{className:"flex items-center gap-4 grow w-full",children:[(0,x.jsx)("div",{className:(0,en.cn)("rounded-2xl p-3 sm:p-5 flex items-center justify-center flex-shrink-0 transition-colors",{"bg-blue-100":v&&!k,"bg-gray-100":!v&&!k,"bg-red-100":k}),children:k?(0,x.jsx)(et.Z,{className:"w-8 h-8 text-red-500"}):"D"===g.kind?(0,x.jsx)(T.Z,{className:(0,en.cn)("w-8 h-8",{"text-blue-500":v,"text-gray-500":!v})}):(0,x.jsx)(K.Z,{className:"w-8 h-8 text-gray-500"})}),(0,x.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,x.jsx)("div",{className:(0,en.cn)("font-bold text-gray-900 truncate",{"text-gray-500":k}),children:g.name}),null!=er?er:(0,x.jsx)("div",{className:(0,en.cn)("text-sm text-gray-600 mt-0.5",{"text-gray-400":k}),children:es})]})]})}},94386:function(m,g,v){"use strict";v.d(g,{Z:function(){return PersonalDataForm}});var x=v(52322),k=v(2784),E=v(45447),T=v(88883),K=v(84631),et=v(3101),en=v(63955),er=v(93829),ei=v(31021),es=v(14016),el=v(676),ec=v(26991),eu=v(70333),ed=v(65544),ep=v(42818);let em=/^[A-Za-z]?\d{9}$/,ef=K.ZP.object({firstName:K.ZP.string().min(1,"El nombre es requerido"),lastName:K.ZP.string().min(1,"El apellido es requerido"),email:K.ZP.string().email("Ingrese un correo v\xe1lido"),phone:K.ZP.string().min(9,"El tel\xe9fono debe tener 9 d\xedgitos").max(9,"El tel\xe9fono debe tener 9 d\xedgitos").refine(m=>/^\d+$/.test(m),"El tel\xe9fono solo debe contener n\xfameros").transform(m=>m.replace(/\D/g,"")),birthdate:K.ZP.string().min(1,"La fecha de nacimiento es requerida"),identityDocumentNumber:K.ZP.string().transform(m=>m.replace(/[.\-\s]/g,"").toUpperCase()).refine(m=>""===m||em.test(m),"El n\xfamero de documento debe tener 9 d\xedgitos")});function PersonalDataForm(m){var g,v,K,em,eh,eg,ev;let{user:ey,isLoading:eb=!1,onClose:ex}=m,{data:e_=[],isLoading:ew,isError:eS,refetch:eC}=(0,ec.e$)(),{register:ek,handleSubmit:eE,formState:{isDirty:ej,errors:eN},reset:eR,watch:eI,setValue:eP}=(0,en.cI)({resolver:(0,T.F)(ef),mode:"onTouched",defaultValues:{firstName:null!==(em=null==ey?void 0:ey.first_name)&&void 0!==em?em:"",lastName:null!==(eh=null==ey?void 0:ey.last_name)&&void 0!==eh?eh:"",email:null!==(eg=null==ey?void 0:ey.email)&&void 0!==eg?eg:"",phone:(null==ey?void 0:ey.phone)?ey.phone.toString():"",birthdate:(null==ey?void 0:ey.birthdate)?ey.birthdate.toString().split("T")[0]:"",identityDocumentNumber:null!==(ev=null==ey?void 0:ey.identity_document_number)&&void 0!==ev?ev:""}}
6);k.useEffect(()=>{if(ey){var m;eR({firstName:ey.first_name,lastName:ey.last_name,email:ey.email,phone:ey.phone?ey.phone.toString():"",birthdate:ey.birthdate?ey.birthdate.toString().split("T")[0]:"",identityDocumentNumber:null!==(m=ey.identity_document_number)&&void 0!==m?m:""},{keepDefaultValues:!0})}},[ey,eR]);let eT=(0,ei.kD)();async function onSubmit(m){try{let g={...m,birthdate:"".concat(m.birthdate,"T12:00:00Z"),identityDocumentNumber:m.identityDocumentNumber||void 0};await eT.mutateAsync(g),eR({},{keepValues:!0})}catch(m){el.Am.error((0,es.EV)(m).message)}}return(0,x.jsx)("form",{className:"w-full space-y-6",onSubmit:eE(onSubmit),children:ew||eS||eb?(0,x.jsx)(eu.o,{isLoading:ew||eb,isError:eS,refetch:()=>void eC()}):(0,x.jsxs)(x.Fragment,{children:[ex&&(0,x.jsx)("div",{className:"flex justify-end",children:(0,x.jsx)("button",{type:"button",className:"text-blue-500 hover:text-blue-600 text-sm font-medium",onClick:ex,children:"Cerrar"})}),(0,x.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-6 shadow-sm",children:[(0,x.jsxs)("div",{className:"flex items-center mb-6",children:[(0,x.jsx)("div",{className:"w-1 h-6 bg-blue-500 rounded-full mr-3"}),(0,x.jsx)("h3",{className:"text-lg font-semibold text-gray-800",children:"Datos Personales"})]}),(0,x.jsxs)("div",{className:"space-y-6",children:[(0,x.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"RUT"}),(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)(E.Z,{theme:"square",inputProps:{value:(null==ey?void 0:ey.rut)?(0,et.format)(ey.rut):""},disabled:!0}),e_&&e_.length>0&&(0,x.jsxs)("div",{className:"absolute -top-2 -right-2 w-5 h-5 bg-blue-100 rounded-full flex items-center justify-center cursor-help group",children:[(0,x.jsx)("span",{className:"text-blue-600 text-xs font-bold",children:"i"}),(0,x.jsxs)("div",{className:"absolute bottom-full right-0 mb-2 px-3 py-2 bg-gray-800 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity max-w-sm z-20",children:["El RUT no se puede cambiar porque tienes p\xf3lizas en el sistema.",(0,x.jsx)("div",{className:"absolute top-full right-4 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-gray-800"})]})]})]})]}),(0,x.jsxs)("div",{children:[(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nombre"}),(0,x.jsx)(E.Z,{theme:"square",inputProps:ek("firstName"),errorMessage:null===(g=eN.firstName)||void 0===g?void 0:g.message})]})]}),(0,x.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Apellido"}),(0,x.jsx)(E.Z,{theme:"square",inputProps:ek("lastName"),errorMessage:null===(v=eN.lastName)||void 0===v?void 0:v.message})]}),(0,x.jsxs)("div",{children:[(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Fecha de nacimiento"}),(0,x.jsx)("input",{type:"date",className:"w-full rounded-lg border border-gray-300 bg-white px-4 py-2.5 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",...ek("birthdate")}),eN.birthdate&&(0,x.jsx)("p",{className:"text-red-600 text-sm mt-1",children:eN.birthdate.message})]})]}),(0,x.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:(0,x.jsxs)("div",{children:[(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"N\xfamero de documento del carnet"}),(0,x.jsx)(E.Z,{theme:"square",inputProps:{...ek("identityDocumentNumber"),placeholder:"123.456.789",autoComplete:"off"},errorMessage:null===(K=eN.identityDocumentNumber)||void 0===K?void 0:K.message}),(0,x.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:(null==ey?void 0:ey.identity_document_status)==="verified"?"Documento verificado.":"Es el n\xfamero que aparece bajo la foto de tu carnet. Lo pediremos antes de tu primer reembolso."})]})})]}),(0,x.jsxs)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:[(0,x.jsx)("div",{className:"flex justify-end",children:(0,x.jsx)(er.z,{variant:"brand",type:"submit",disabled:!ej||eT.isLoading,loading:eT.isLoading,className:"px-8",children:eT.isLoading?"Guardando...":"Guardar"})}),eT.isSuccess&&(0,x.jsx)("p",{className:"text-green-600 text-sm mt-3 text-center",children:"Datos personales actualizados correctamente"})]})]}),(0,x.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-6 shadow-sm",children:[(0,x.jsxs)("div",{className:"flex items-center mb-6",children:[(0,x.jsx)("div",{className:"w-1 h-6 bg-green-500 rounded-full mr-3"}),(0,x.jsx)("h3",{className:"text-lg font-semibold text-gray-800",children:"Datos de Contacto"})]}),(0,x.jsxs)("div",{className:"space-y-6",children:[(0,x.jsx)("div",{children:(0,x.jsx)(ed.c,{value:eI("email"),onChange:m=>eP("email",m,{shouldDirty:!0}),onVerified:m=>{console.log("Email verificado en perfil:",m)},label:"Mail",placeholder:"[email protected]",verified:null==ey?void 0:ey.verified_email})}),(0,x.jsx)("div",{children:(0,x.jsx)(ep.I,{value:eI("phone"),onChange:m=>eP("phone",m,{shouldDirty:!0}),onVerified:m=>{console.log("Tel\xe9fono verificado en perfil:",m)},label:"Tel\xe9fono",placeholder:"9 1234 5678",verified:null==ey?void 0:ey.verified_phone})})]}),(0,x.jsx)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:(0,x.jsx)("p",{className:"text-xs text-gray-500 text-center",children:"Los cambios en email y tel\xe9fono requieren verificaci\xf3n por seguridad"})})]})]})})}},27350:function(m,g,v){"use strict";v.d(g,{n:function(){return ShareYourLinkBox},Z:function(){return InviteReferral}});var x,k,E,T,K=v(52322),et=v(2784),en=v(39776),er=v(82819),ei=v(18128),es=v(96984),el=v(63955),ec=v(35151),eu=v(11168),ed=v(47994),ep=v(93829);function EmailInvite(m){let{register:g,handleSubmit:v,formState:{errors:x}}=(0,el.cI)({mode:"onBlur"}),k={required:{value:!0,message:"Este campo es requerido"}},[E,T]=(0,et.useState)(!1),[en,er]=(0,et.useState)(""),[ei,es]=(0,et.useState)(!1),onSubmit=async()=>{var g;T(()=>!0),await ec.Z.post("".concat(eu.yx,"/api/referral/leads/"),{emails:[en]}),er(()=>""),T(()=>!1),es(()=>!0),null===(g=m.onShare)||void 0===g||g.call(m)};return(0,K.jsxs)("form",{className:"mt-3 w-full",onSubmit:v(onSubmit,m=>{console.error(m)}),children:[(0,K.jsxs)("div",{className:"flex items-center",children:[(0,K.jsx)("div",{className:"relative w-full",children:(0,K.jsx)(ed.I,{className:"h-auto w-full px-4 py-2.5 shadow-none placeholder:text-neutral-300 rounded-full border-neutral-200",placeholder:"Escribe un email",value:en,...g("email",k),onChange:m=>{er(m.target.value),g("email",k).onChange(m)}})}),(0,K.jsx)(ep.z,{type:"submit",variant:"brand-outline",className:"ml-3",loading:E,children:"Enviar"})]}),x.email?(0,K.jsx)("div",{className:"text-red-500 mt-1 text-sm",children:x.email.message}):ei?(0,K.jsx)("div",{className:"text-green-500 mt-1 text-sm",children:"\xa1Invitaci\xf3n enviada! Env\xeda todas las que quieras"}):void 0]})}var em=v(10298),ef=v(11440);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var circle_outline=function(m){return et.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},m),x||(x=et.createElement("g",{clipPath:"url(#circle-outline_svg__a)"},et.createElement("g",{clipPath:"url(#circle-outline_svg__b)"},et.createElement("path",{stroke:"#E5E5E5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M10 18.335a8.333 8.333 0 1 0 0-16.667 8.333 8.333 0 0 0 0 16.667"})))),k||(k=et.createElement("defs",null,et.createElement("clipPath",{id:"circle-outline_svg__a"},et.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})),et.createElement("clipPath",{id:"circle-outline_svg__b"},et.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})))))};
6function headset_extends(){return(headset_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var headset=function(m){return et.createElement("svg",headset_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),E||(E=et.createElement("g",{stroke:"currentColor",strokeWidth:1.5,clipPath:"url(#headset_svg__a)"},et.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 11a8 8 0 1 0-16 0"}),et.createElement("path",{d:"M2 15.438v-1.876a2 2 0 0 1 1.515-1.94l1.74-.436a.6.6 0 0 1 .745.582v5.464a.6.6 0 0 1-.746.582l-1.74-.435A2 2 0 0 1 2 15.439ZM22 15.438v-1.876a2 2 0 0 0-1.515-1.94l-1.74-.436a.6.6 0 0 0-.745.582v5.464a.6.6 0 0 0 .745.582l1.74-.435A2 2 0 0 0 22 15.439ZM20 18v.5a2 2 0 0 1-2 2h-3.5"}),et.createElement("path",{d:"M13.5 22h-3a1.5 1.5 0 0 1 0-3h3a1.5 1.5 0 0 1 0 3Z"}))),T||(T=et.createElement("defs",null,et.createElement("clipPath",{id:"headset_svg__a"},et.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},eh=v(41904),eg=v(37903),ev=v(70333);function getRewardStatusPriority(m){if(m.is_redeemed)return 3;if(!m.redeemable_at)return 4;let g=new Date(m.redeemable_at),v=new Date;return g<=v?1:2}function RewardStatus(m){let{redeemable_at:g,is_redeemed:v}=m;if(v)return(0,K.jsx)("span",{className:"text-green-500",children:"Beneficio canjeado"});if(!g)return(0,K.jsx)("span",{className:"text-pink-500",children:"Requisito no cumplido"});let x=new Date(g),k=new Date;return x<=k?(0,K.jsx)("span",{className:"text-blue-500",children:"Procesando"}):(0,K.jsxs)("span",{className:"text-neutral-500",children:["Disponible el ",(0,eg.TT)(x)]})}function RewardsList(m){let{rewards:g,showInsuredName:v=!1}=m;if(0===g.length)return(0,K.jsx)("div",{className:"text-neutral-500 text-center py-4",children:"No hay cuotas ganadas a\xfan"});let x=[...g].sort((m,g)=>getRewardStatusPriority(m)-getRewardStatusPriority(g));return(0,K.jsx)("div",{className:"space-y-4 max-h-52 overflow-y-scroll",children:x.map(m=>{var g,x;return(0,K.jsxs)("div",{className:"flex justify-between items-center",children:[(0,K.jsxs)("div",{children:[(0,K.jsxs)("div",{className:"font-medium",children:["P\xf3liza #",(null===(g=m.related_policy)||void 0===g?void 0:g.document_number)||(null===(x=m.related_policy)||void 0===x?void 0:x.readable_id)]}),v&&m.related_policy&&(0,K.jsxs)("div",{className:"text-sm text-neutral-500",children:[m.related_policy.insured.first_name," ",m.related_policy.insured.last_name]})]}),(0,K.jsx)(RewardStatus,{redeemable_at:m.redeemable_at,is_redeemed:m.is_redeemed})]},m.id)})})}function RewardsBox(){let{data:m,isLoading:g,isError:v,refetch:x}=(0,eh.ZP)();if(g||v)return(0,K.jsx)(ev.o,{isLoading:g,isError:v,refetch:()=>void x()});let k=m.filter(m=>m.is_owner),E=m.filter(m=>!m.is_owner);return(0,K.jsxs)("div",{className:"space-y-8",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"font-bold text-lg mb-4",children:"Cuotas ganadas por referir"}),(0,K.jsx)(RewardsList,{rewards:k,showInsuredName:!0})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"font-bold text-lg mb-4",children:"Cuotas ganadas en la renovaci\xf3n"}),(0,K.jsx)(RewardsList,{rewards:E})]})]})}var ey=v(23551),eb=v(21524);let ex="profile_invite";function NeedHelpButton(m){return(0,K.jsx)(ep.z,{className:m.className,variant:"muted-link",iconLeft:(0,K.jsx)(headset,{className:"h-6 w-6"}),onClick:()=>(0,er.D)("showNewMessage"),children:"\xbfNecesitas ayuda?"})}function ShareYourLinkBox(m){if(!m.user.referrer_code)throw Error("No referrer code");return(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"text-lg font-bold",children:"Comparte tu enlace"}),(0,K.jsx)("div",{className:"mt-6",children:"Aseg\xfarate que la persona que invites use tu link al crear su cuenta."}),(0,K.jsx)(ei.Z,{referrerCode:m.user.referrer_code,referralSource:ex,onCopy:()=>{(0,eb.j)(ey.Cn,{source:ex,method:"copy"})}}),(0,K.jsx)(es.Z,{referrerCode:m.user.referrer_code,referralSource:ex,onShare:()=>{(0,eb.j)(ey.Cn,{source:ex,method:"whatsapp"})}}),(0,K.jsx)("div",{className:"font-bold mt-6",children:"Invitar por email"}),(0,K.jsx)(EmailInvite,{onShare:()=>{(0,eb.j)(ey.Cn,{source:ex,method:"email"})}})]})}function AffiliatesBox(m){if(void 0===m.affiliates)throw Error("No affiliates");return(0,K.jsxs)("div",{children:[(0,K.jsxs)("div",{className:"font-bold text-lg",children:["Mis referidos (",m.affiliates.length,")"]}),(0,K.jsx)("div",{className:"mt-6 space-y-4 max-h-52 overflow-y-scroll",children:m.affiliates.map((m,g)=>(0,K.jsxs)("div",{className:"flex justify-between",children:[(0,K.jsxs)("div",{className:"flex items-center",children:[(0,K.jsx)("div",{children:m.is_active?(0,K.jsx)(ef.Z,{className:"h-5 w-5"}):(0,K.jsx)(circle_outline,{className:"h-5 w-5 text-neutral-200"})}),(0,K.jsxs)("div",{className:"ml-2",children:[m.user.first_name," ",m.user.last_name]})]}),(0,K.jsx)("div",{className:"text-neutral-500",children:m.is_active?"P\xf3liza inscrita":"Cotizando"})]},g))}),(0,K.jsx)(ep.z,{variant:"muted-link",className:"mt-6",onClick:()=>(0,er.D)("showNewMessage"),children:"Mi referido no aparece"})]})}function InviteReferral(){let{data:m}=(0,en.a)();return(0,et.useEffect)(()=>{(0,er.D)("hide")},[]),(0,K.jsx)("div",{className:"flex flex-col justify-center md:grid md:grid-cols-6 h-full pb-64",children:(0,K.jsxs)("div",{className:"md:col-span-4 md:col-start-2",children:[(0,K.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-center mt-6 mx-6 space-y-4 sm:sp
6ace-y-0 md:mt-12",children:[(0,K.jsx)("div",{className:"font-bold text-xl text-center sm:text-left",children:"\xa1Invita amigos y gana cuotas gratis!"}),(0,K.jsx)(NeedHelpButton,{className:"shrink-0"})]}),(0,K.jsx)("div",{className:"mt-2 mx-6 text-xs text-neutral-500 text-center sm:text-left",children:(0,K.jsx)("a",{href:"https://cacttus-media-prod.s3.sa-east-1.amazonaws.com/legal_documents/Bases+y+Condiciones+Campan%CC%83a+Referidos+Cacttus.pdf",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Ver bases y condiciones del programa de referidos"})}),m&&(0,K.jsxs)("div",{className:"sm:grid sm:grid-cols-2 sm:gap-x-6",children:[(0,K.jsxs)("div",{className:"px-6 mt-6 pt-6 border-t sm:border-0",children:[(0,K.jsx)(ShareYourLinkBox,{user:m}),(0,K.jsx)("div",{className:"border-t mt-6 pt-9 hidden sm:block",children:(0,K.jsx)(AffiliatesBox,{affiliates:m.affiliates})})]}),(0,K.jsx)("div",{className:"px-6 mt-6 pt-6 border-t sm:border-0",children:(0,K.jsx)(em.Z,{})}),(0,K.jsx)("div",{className:"px-6 border-t mt-6 pt-6 sm:pt-9 sm:hidden",children:(0,K.jsx)(AffiliatesBox,{affiliates:m.affiliates})}),(0,K.jsx)("div",{className:"col-span-2 px-6 mt-6 pt-6 border-t",children:(0,K.jsx)(RewardsBox,{})})]})]})})}},44273:function(m,g,v){"use strict";v.d(g,{Z:function(){return UserAddressForm},s:function(){return hasRegisteredAddress}});var x=v(52322),k=v(2784),E=v(37175),T=v(39776),K=v(23551),et=v(21524),en=v(55830),er=v(62350),ei=v(20463),es=v(14016),el=v(35151),ec=v(13346),eu=v(53538);eu.Ry({id:eu.Rx().optional(),city:eu.Z_(),comuna:eu.Z_(),country:eu.Z_(),formatted_address:eu.Z_(),number:eu.Z_(),additional_info:eu.Z_().optional(),place_id_google_maps:eu.Z_().optional(),region:eu.Z_(),street:eu.Z_(),lat:eu.Rx().optional(),lng:eu.Rx().optional(),utc_offset_minutes:eu.Rx().optional(),user:eu.Rx().optional()}).passthrough();var ed=v(43335),ep=v(93829),em=v(68096),ef=v(5632),eh=v(77588),eg=v(33776);function hasRegisteredAddress(m){var g;return!!((null==m?void 0:null===(g=m.address)||void 0===g?void 0:g.street)&&m.address.number)}function UserAddressForm(m){let{onCompleted:g,layout:v="profile"}=m,{data:eu}=(0,T.a)(),ev=(0,ef.useRouter)(),ey=(0,en.NL)(),eb=function(){let m=(0,en.NL)();return(0,er.D)({mutationFn:async m=>{try{await el.Z.post(ec.Z.user.address.create(),{...m})}catch(g){let m=(0,ei.nZ)();m.setTag("userAdrees","fail"),m.setTag("transaction","createUserAddressFail"),(0,es.zG)(g,"No se pudo guardar la direcci\xf3n. Por favor, intenta nuevamente.")}},onSuccess:async()=>
6{await m.invalidateQueries(T.E)}})}(),ex=function(){let m=(0,en.NL)();return(0,er.D)({mutationFn:async m=>{try{await el.Z.put(ec.Z.user.address.update(m.id),{city:m.city,comuna:m.comuna,country:m.country,formatted_address:m.formatted_address,number:m.number,additional_info:m.additional_info,place_id_google_maps:m.place_id_google_maps,region:m.region,street:m.street,lat:m.lat,lng:m.lng,utc_offset_minutes:m.utc_offset_minutes})}catch(g){let m=(0,ei.nZ)();m.setTag("userAdrees","fail"),m.setTag("transaction","createUserAddressFail"),(0,es.zG)(g,"No se pudo guardar la direcci\xf3n. Por favor, intenta nuevamente.")}},onSuccess:async()=>{await m.invalidateQueries(T.E)}})}(),[e_,ew]=(0,k.useState)(!0),[eS,eC]=(0,k.useState)(!1),{data:ek}=(0,em.Y)();(0,k.useEffect)(()=>{eu&&(hasRegisteredAddress(eu)?ew(!1):(ew(!0),eC(!0)))},[eu]);let handleSubmit=async m=>{var v;(null==eu?void 0:eu.address)?await ex.mutateAsync({...m,id:eu.address.id}):eu&&await eb.mutateAsync({...m,user:eu.id});try{await ey.invalidateQueries(T.E)}catch(m){(0,ei.Tb)(m)}(0,et.j)(K.N4,{userId:null==eu?void 0:eu.id,comuna:m.comuna,quote_id:null==ek?void 0:null===(v=ek.quote_set[0])||void 0===v?void 0:v.id}),g?g():e_&&ev.push(ec.Z.frontend.checkout.index()),eC(!1)},handleConfirmExisting=()=>{var m;(null==eu?void 0:eu.address)&&g&&((0,et.j)(K.N4,{userId:eu.id,comuna:eu.address.comuna,quote_id:null==ek?void 0:null===(m=ek.quote_set[0])||void 0===m?void 0:m.id}),g())},eE=e_||eS,ej=(0,x.jsx)(eh.Z,{initialAddress:null==eu?void 0:eu.address,onSubmit:handleSubmit,onCancel:()=>{eC(!1)},mode:(null==eu?void 0:eu.address)?"edit":"create",submitText:e_?"Continuar":"Guardar",cancelText:"Cancelar",showCancelButton:eS});return"flow"===v?eE?(0,x.jsx)("div",{className:"mt-6 shadow-3xl rounded-lg bg-white px-6 py-6",children:ej}):(0,x.jsxs)("div",{children:[(0,x.jsx)(eg.sn,{icon:E.Z,rows:[{label:"Direcci\xf3n",value:(null==eu?void 0:eu.address)?(0,ed.r2)(eu.address):""}],footer:(0,x.jsx)(ep.z,{variant:"brand-link",type:"button",onClick:()=>eC(!0),children:"Editar direcci\xf3n"})}),(0,x.jsx)(eg.V1,{children:(0,x.jsx)(ep.z,{variant:"brand",type:"button",className:"w-full sm:w-60",onClick:handleConfirmExisting,children:"Confirmar y continuar"})})]}):(0,x.jsxs)("div",{className:"flex flex-col rounded-xl",children:[!e_&&(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex justify-between items-center ".concat(eS?"":"mb-3"),children:[(0,x.jsx)("h3",{className:"font-bold text-xl text-gray-900",children:"Direcci\xf3n"}),(0,x.jsx)(ep.z,{variant:eS?"brand-outline":"brand",onClick:()=>eC(!eS),children:eS?"Cancelar":"Editar"})]}),!eS&&(null==eu?void 0:eu.address)&&(0,x.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-300 rounded-xl",children:(0,x.jsx)("p",{className:"text-gray-800",children:(0,ed.r2)(eu.address)})}),!eS&&(null==eu?void 0:eu.address)&&g&&(0,x.jsx)(ep.z,{variant:"brand",size:"full",className:"mt-4",onClick:handleConfirmExisting,children:"Confirmar y continuar"})]}),eE&&ej]})}},19167:function(m,g,v){"use strict";v.d(g,{Z:function(){return DocumentsInfoModal}});var x=v(52322),k=v(2784),E=v(96577),T=v.n(E),K=v(84355),et=v(93829),en=v(68945),er=v(37228),ei=v(25987),es=v(48328),el=v(70391),ec=v(35882),eu=v(78134);let ed=[{category:"accident",icon:"/static/icons/claims/broken-bone.svg"},{category:"sickness",icon:"/static/icons/claims/measure-device.svg"},{category:"complementary-therapy",icon:"/static/icons/claims/lotus-flower.svg"},{category:"preventive-vaccines",icon:"/static/icons/claims/syringe.svg"},{category:"preventive-exams",icon:"/static/icons/claims/sample-tube.svg"},{category:"preventive-consultation",icon:"/static/icons/claims/dog-frame.svg"}];function RequirementCard(m){let{item:g,badge:v,badgeColor:k,index:E}=m,T="diagnosis"===g.type?"/static/informe_clinico.pdf":"budget"===g.type?"/static/presupuesto.pdf":null;return(0,x.jsxs)("div",{className:"p-4 rounded-xl border border-gray-200 bg-white",children:[(0,x.jsxs)("div",{className:"flex items-start gap-3",children:[(0,x.jsx)("span",{className:"w-6 h-6 rounded-full bg-blue-500 text-white text-sm font-bold flex items-center justify-center flex-shrink-0",children:E}),(0,x.jsxs)("div",{className:"flex-1",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,x.jsx)("p",{className:"font-medium text-gray-900",children:g.label}),(0,x.jsx)("span",{className:(0,ei.cn)("text-xs px-2 py-0.5 rounded-full font-medium",{pink:"bg-pink-100 text-pink-700",blue:"bg-blue-100 text-blue-700",gray:"bg-gray-100 text-gray-500"}[k]),children:v})]}),(0,x.jsx)("p",{className:"text-sm text-gray-500",children:g.description}),g.conditionalNote&&(0,x.jsx)("p",{className:"text-xs text-amber-700 mt-2 bg-amber-50 p-2 rounded-lg",children:g.conditionalNote})]})]}),T&&(0,x.jsx)("div",{className:"flex items-center justify-center",children:(0,x.jsx)(et.z,{onClick:()=>{T&&window.open(T,"_blank")},variant:"brand-ghost",size:"sm",className:"mt-2",iconLeft:(0,x.jsx)(el.Z,{className:"w-4 h-4"}),children:"Descargar plantilla"})})]})}function CategorySelector(m){let{onSelect:g}=m;return(0,x.jsx)("div",{className:"space-y-2",children:ed.map(m=>{let{category:v,icon:k}=m;return(0,x.jsxs)("button",{onClick:()=>g(v),className:"w-full flex items-center gap-3 p-4 rounded-xl border border-gray-200 hover:border-blue-300 hover:bg-blue-50 transition-all text-left",children:[(0,x.jsx)("div",{className:"w-12 h-12 bg-blue-50 rounded-full flex items-center justify-center flex-shrink-0",children:(0,x.jsx)(T(),{src:k,alt:en.sY[v],width:28,height:28,className:"text-blue-600"})}),(0,x.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,x.jsx)("p",{className:"font-medium text-gray-900",children:en.sY[v]}),(0,x.jsx)("p",{className:"text-sm text-gray-500 truncate",children:en.Yi[v]})]}),(0,x.jsx)(ec.Z,{className:"w-5 h-5 text-gray-400"})]},v)})})}function RequirementsList(m){var g;let{category:v}=m,k=(0,er.Q4)(v),E=0;return(0,x.jsxs)("div",{className:"space-y-3",children:[k.required.map(m=>(0,x.jsx)(RequirementCard,{item:m,badge:"Obligatorio",badgeColor:"pink",index:++E},m.type)),null===(g=k.expected)||void 0===g?void 0:g.map(m=>(0,x.jsx)(RequirementCard,{item:m,badge:"Recomendado",badgeColor:"blue",index:++E},m.type)),k.optional.map(m=>(0,x.jsx)(RequirementCard,{item:m,badge:"Opcional",badgeColor:"gray",index:++E},m.type)),(0,x.jsx)(es.Z,{variant:"info",description:"Sube todos los documentos juntos. Nuestra IA los clasificar\xe1 autom\xe1ticamente.",className:"mt-4"})]})}function DocumentsInfoModal(m){let{isOpen:g,onClose:v,onContinue:E,showContinueButton:T=!1,category:er}=m,[ei,es]=(0,k.useState)(null!=er?er:null),handleClose=()=>
6{v(),er||setTimeout(()=>es(null),300)},el=!er&&!ei,ec=null!=er?er:ei;return(0,x.jsx)(K.Vq,{open:g,onOpenChange:m=>!m&&handleClose(),children:(0,x.jsxs)(K.cZ,{className:"sm:max-w-lg max-h-[90vh] overflow-hidden p-0",children:[(0,x.jsx)(K.fK,{className:"px-6 pt-5 pb-4 border-b border-gray-100",children:(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[!er&&ei&&(0,x.jsx)("button",{onClick:()=>{es(null)},className:"p-1 -ml-1 rounded-lg hover:bg-gray-100 transition-colors",children:(0,x.jsx)(eu.Z,{className:"w-5 h-5 text-gray-600"})}),(0,x.jsxs)("div",{children:[(0,x.jsx)(K.$N,{className:"text-lg font-semibold text-gray-900",children:el?"\xbfQu\xe9 desea reembolsar?":"Documentos necesarios"}),ec&&(0,x.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:en.sY[ec]})]})]})}),(0,x.jsx)("div",{className:"px-6 py-4 overflow-y-auto max-h-[60vh] bg-gray-50",children:el?(0,x.jsx)(CategorySelector,{onSelect:es}):ec?(0,x.jsx)(RequirementsList,{category:ec}):null}),(0,x.jsx)("div",{className:"px-6 py-4 border-t border-gray-100 bg-white",children:T&&E&&ec?(0,x.jsxs)("div",{className:"flex gap-3",children:[(0,x.jsx)(et.z,{onClick:handleClose,variant:"brand-outline",size:"full",className:"flex-1",children:"Cerrar"}),(0,x.jsx)(et.z,{variant:"brand",onClick:()=>{handleClose(),E()},size:"full",className:"flex-1",children:"Continuar"})]}):(0,x.jsx)(et.z,{onClick:handleClose,variant:"brand",size:"full",children:"Entendido"})})]})})}},48023:function(m,g,v){"use strict";v.d(g,{Z:function(){return ClaimDetailContent}});var x,k,E=v(52322),T=v(2784);function claimViewKindFor(m){if(!m.last_claim_history)throw Error("Claim must have last_claim_history to choose its view");switch(m.last_claim_history.status_key){case"info_needed":return"info_needed";case"adjusted":return"adjusted";case"appeal_response":return"appeal_response";case"payment_error":return"payment_error";case"denied":return"denied";case"settled":return"approved";case"paid":var g;return(null!==(g=m.payable_amount)&&void 0!==g?g:0)>0?"approved":"closed";default:return"processing"}}var K=v(87078),et=v(93829),en=v(84355),er=v(37903),ei=v(27484),es=v.n(ei);(x=k||(k={}))[x.REFUND_RECEIVED=1]="REFUND_RECEIVED",x[x.ASSIGNING_AGENT=2]="ASSIGNING_AGENT",x[x.CASE_ASSIGNED=3]="CASE_ASSIGNED",x[x.REVIEWING_BACKGROUND=4]="REVIEWING_BACKGROUND",x[x.REQUESTING_ADDITIONAL_INFO=5]="REQUESTING_ADDITIONAL_INFO",x[x.REVIEWING_ADDITIONAL_INFO=6]="REVIEWING_ADDITIONAL_INFO",x[x.COMPANY_REVIEW=7]="COMPANY_REVIEW",x[x.SETTLEMENT=8]="SETTLEMENT",x[x.SETTLEMENT_ACCEPTED=9]="SETTLEMENT_ACCEPTED",x[x.PAYMENT_COMPLETED=10]="PAYMENT_COMPLETED",x[x.CASE_CLOSED=11]="CASE_CLOSED";let el=["processing","settled","denied","info_needed","paid","payment_error","further_investigation","processing_delayed","adjusted","appealed","appeal_response"],ec=[{id:1,title:"Reembolso recibido",description:"Hemos recibido tu solicitud de reembolso.",statusKeys:el},{id:2,title:"Asignando a agente",description:"Estamos asignando tu caso a un agente especializado.",statusKeys:el},{id:3,title:"Caso asignado a un agente",description:"Un agente est\xe1 comenzando a revisar tu solicitud.",statusKeys:el},{id:4,title:"Revisando antecedentes",description:"Estamos analizando la informaci\xf3n y documentos proporcionados.",statusKeys:["processing","processing_delayed","further_investigation","appealed"]},{id:5,title:"Solicitando antecedentes adicionales",description:"Te pediremos informaci\xf3n adicional si es necesario.",statusKeys:["info_needed"],isVariable:!0,requiresUserAction:!0},{id:6,title:"Revisi\xf3n de antecedentes adicionales",description:"Estamos revisando la informaci\xf3n adicional proporcionada.",statusKeys:["processing","processing_delayed","further_investigation"],isVariable:!0},{id:7,title:"Revisi\xf3n por parte de la compa\xf1\xeda",description:"La aseguradora est\xe1 evaluando tu solicitud.",statusKeys:["adjusted"]},{id:8,title:"Liquidaci\xf3n",description:"Te enviaremos el monto definido para el reembolso.",statusKeys:["adjusted","settled","appealed","appeal_response"]},{id:9,title:"Liquidaci\xf3n aceptada / impugnada",description:"Puedes aceptar o rechazar la liquidaci\xf3n propuesta.",statusKeys:["settled"]},{id:10,title:"Pago realizado",description:"Tu reembolso fue pagado exitosamente.",statusKeys:["paid"]},{id:11,title:"Caso cerrado",description:"El proceso ha finalizado.",statusKeys:["paid","denied"]}];function isSettlementHistory(m){return"adjusted"===m.status_key||"settled"===m.status_key}var eu=v(25987),ed=v(38681);function TimelineStepItem(m){let{step:g,isLast:v}=m;return(0,E.jsxs)("div",{className:(0,eu.cn)("flex items-start",!v&&"mb-4",g.isCurrent&&"bg-pink-50 border border-pink-200 p-3 rounded-xl -mx-1"),
6children:[(0,E.jsxs)("div",{className:"flex flex-col items-center mr-3",children:[g.isCompleted?(0,E.jsx)(ed.Z,{className:"w-6 h-6 text-blue-500"}):g.isCurrent?(0,E.jsx)(K.Z,{className:"w-6 h-6 text-pink-500"}):(0,E.jsx)("div",{className:"w-6 h-6 rounded-full bg-gray-200 flex items-center justify-center",children:(0,E.jsx)("div",{className:"w-2 h-2 rounded-full bg-gray-400"})}),!v&&(0,E.jsx)("div",{className:(0,eu.cn)("w-0.5 h-6 mt-1",g.isCompleted?"bg-blue-300":g.isCurrent?"bg-pink-300":"bg-gray-200")})]}),(0,E.jsx)("div",{className:"flex-1 min-w-0",children:(0,E.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,E.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,E.jsx)("p",{className:(0,eu.cn)("text-sm font-medium",g.isCompleted?"text-gray-800":g.isCurrent?"text-pink-600":"text-gray-400"),children:g.title}),g.requiresUserAction&&g.isCurrent&&(0,E.jsx)("span",{className:"inline-block mt-1 px-2 py-0.5 text-xs font-medium text-red-600 bg-red-100 rounded-full",children:"Requiere tu acci\xf3n"}),(0,E.jsx)("p",{className:(0,eu.cn)("text-xs mt-0.5",g.isCurrent?"text-pink-600":"text-gray-500"),children:g.customDescription||g.description})]}),g.date&&(0,E.jsxs)("div",{className:"text-right flex-shrink-0",children:[(0,E.jsx)("p",{className:(0,eu.cn)("text-xs",g.isCompleted?"text-gray-500":g.isCurrent?"text-pink-500":"text-gray-400"),children:(0,er.p6)(g.date)}),(0,E.jsx)("p",{className:(0,eu.cn)("text-xs",g.isCompleted?"text-gray-500":g.isCurrent?"text-pink-500":"text-gray-400"),children:(0,er.mr)(g.date)})]})]})})]})}function ClaimTimeline(m){var g,v,x;let{claim:k}=m;if(!k.last_claim_history)return null;let T=function(m){var g,v;let x=function(m){if(!m.last_claim_history)throw Error("Claim must have last_claim_history");let g=m.last_claim_history.status_key;if(!g)throw Error("Claim last_claim_history must have a valid status_key");return g}(m),k=[...null!==(g=m.claim_history)&&void 0!==g?g:[]].sort((m,g)=>{var v,x;return es()(null!==(v=m.created_at)&&void 0!==v?v:"").isBefore(es()(null!==(x=g.created_at)&&void 0!==x?x:""))?-1:1}),E=k.some(m=>"info_needed"===m.status_key),T=k.some(isSettlementHistory),K=ec.filter(m=>!m.isVariable||(5!==m.id||!!E)&&(6!==m.id||!!E&&!!T)).map(g=>(function(m,g,v,x){var k,E,T,K,et,en,er,ei;let es,el=!1;switch(m.id){case 1:case 2:el=!0,es=null!==(k=v.claim_date)&&void 0!==k?k:void 0;break;case 3:{let m=x[0];if(!m)throw Error("Claim must have at least one history entry");el=!0,es=null!==(E=m.created_at)&&void 0!==E?E:void 0;break}case 6:{let m=x.find(isSettlementHistory);m&&(el=!0,es=null!==(T=m.created_at)&&void 0!==T?T:void 0);break}case 10:{el="paid"===g;let m=x.find(m=>"paid"===m.status_key);es=null!==(K=null==m?void 0:m.created_at)&&void 0!==K?K:void 0;break}case 11:{el="paid"===g||"denied"===g;let m=x.find(m=>"paid"===m.status_key||"denied"===m.status_key);es=null!==(et=null==m?void 0:m.created_at)&&void 0!==et?et:void 0;break}case 9:{el="paid"===g;let m=x.find(m=>"settled"===m.status_key);es=null!==(en=null==m?void 0:m.created_at)&&void 0!==en?en:void 0;break}case 5:{let m=x.find(m=>"info_needed"===m.status_key);m&&(es=null!==(er=m.created_at)&&void 0!==er?er:void 0,el="info_needed"!==g);break}default:{let g=x.find(g=>!!g.status_key&&m.statusKeys.includes(g.status_key));g&&(el=!0,es=null!==(ei=g.created_at)&&void 0!==ei?ei:void 0)}}return{id:m.id,title:m.title,description:m.description,isCompleted:el,isCurrent:!1,date:es,requiresUserAction:m.requiresUserAction}})(g,x,m,k)),et=K.find(m=>!m.isCompleted);if(et&&(et.isCurrent=!0),"appealed"===x||"appeal_response"===x){let m=K.find(m=>9===m.id);if(m){m.isCurrent=!0,m.isCompleted=!1,m.customDescription="Revisando tu impugnaci\xf3n",m.requiresUserAction=!1;let g=k.find(m=>"appealed"===m.status_key||"appeal_response"===m.status_key);g&&(m.date=null!==(v=g.created_at)&&void 0!==v?v:void 0),K.forEach(g=>{g!==m&&(g.isCurrent=!1)})}}return K}(k),K=null!==(x=null!==(v=null===(g=k.last_claim_history)||void 0===g?void 0:g.created_at)&&void 0!==v?v:k.claim_date)&&void 0!==x?x:"";return(0,E.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between mb-4 pb-3 border-b border-gray-100",children:[(0,E.jsx)("h4",{className:"text-sm font-semibold text-gray-700",children:"Estado de tu reembolso"}),(0,E.jsxs)("p",{className:"text-xs text-gray-500",children:["\xdaltima actualizaci\xf3n ",(0,er.o0)(K)]})]}),(0,E.jsx)("div",{children:T.map((m,g)=>(0,E.jsx)(TimelineStepItem,{step:m,isLast:g===T.length-1},m.id))}),(0,E.jsxs)("p",{className:"text-xs text-gray-400 text-center mt-4 pt-3 border-t border-gray-100",children:["El plazo legal para la revisi\xf3n de reembolso es de ",45," d\xedas corridos"]})]})}var ep=v(51279),em=v(35882),ef=v(35115),eh=v(3510);let eg={diagnosis:"Diagn\xf3stico",prescription:"Receta",receipt:"Boleta",appealed:"Apelaci\xf3n","exam-prescription":"Orden de examen","extra-documents":"Documento extra","vaccination-card":"Carnet de vacunaci\xf3n","medical-discharge":"Alta m\xe9dica","external-adjuster-report":"Informe ajustador externo","medical-history":"Ficha cl\xednica","exam-results":"Resultados de examen","cacttus-medical-report":"Informe m\xe9dico Cacttus",anamnesis:"Anamnesis",budget:"Presupuesto"};function ClaimDocumentsList(m){let{documents:g}=m,[v,x]=(0,T.useState)(null),handleDocumentClick=m=>{let g=m.document_url;if(g){if((0,eh.hU)(g)){x(m);return}window.open(g,"_blank")}};return(0,E.jsxs)("div",{className:"space-y-4",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:"Documentos del reembolso"}),(0,E.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Toca un documento para verlo en detalle"})]}),0===g.length?(0,E.jsxs)("div",{className:"bg-gray-50 rounded-xl p-8 flex flex-col items-center gap-3",children:[(0,E.jsx)(ep.Z,{className:"w-8 h-8 text-gray-400"}),(0,E.jsx)("p",{className:"text-sm text-gray-600 text-center",children:"No hay documentos disponibles"})]}):(0,E.jsx)("div",{className:"border border-gray-200 rounded-xl divide-y divide-gray-100 overflow-hidden",children:g.map(m=>{var g,v;return(0,E.jsxs)("button",{type:"button",onClick:()=>handleDocumentClick(m),disabled:!m.document_url,className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left bg-white hover:bg-gray-50 transition-colors disabled:cursor-not-allowed disabled:opacity-60",children:[(0,E.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,E.jsx)("div",{className:"w-10 h-10 bg-blue-50 rounded-lg flex items-center justify-center flex-shrink-0",children:(0,E.jsx)(ep.Z,{className:"w-5 h-5 text-blue-500"})}),(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("p",{className:"text-sm font-bold text-gray-900 truncate",children:m.document_name}),(0,E.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:m.document_url?(g=m.file_type)&&null!==(v=eg[g])&&void 0!==v?v:"Documento":"Documento no dis
6ponible"})]})]}),(0,E.jsx)(em.Z,{className:"w-5 h-5 text-gray-300 flex-shrink-0"})]},m.id)})}),(null==v?void 0:v.document_url)&&(0,E.jsx)(ef.Z,{isOpen:!0,onClose:()=>x(null),imageUrl:v.document_url,imageName:v.document_name})]})}function ProcessingView(m){var g;let{claim:v}=m,[x,k]=(0,T.useState)(!1),er=null===(g=v.last_claim_history)||void 0===g?void 0:g.comment;return(0,E.jsxs)("div",{className:"space-y-4",children:[(0,E.jsx)(et.z,{onClick:()=>k(!0),variant:"brand-outline",size:"full",children:"Ver documentos"}),er&&(0,E.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-4 shadow-sm flex items-start gap-2",children:[(0,E.jsx)(K.Z,{className:"w-4 h-4 text-gray-500 flex-shrink-0 mt-0.5"}),(0,E.jsx)("p",{className:"text-xs text-gray-500 whitespace-pre-line",children:er})]}),(0,E.jsx)(ClaimTimeline,{claim:v}),(0,E.jsxs)("p",{className:"text-sm text-gray-400 text-center",children:["Lee la ley de siniestros"," ",(0,E.jsx)("a",{href:"https://www.bcn.cl/leychile/navegar?idNorma=1074974",target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:text-blue-500",children:"aqu\xed."})]}),(0,E.jsx)(en.Vq,{open:x,onOpenChange:k,children:(0,E.jsxs)(en.cZ,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[(0,E.jsx)(en.fK,{children:(0,E.jsx)(en.$N,{className:"sr-only",children:"Documentos del reembolso"})}),(0,E.jsx)(ClaimDocumentsList,{documents:v.documents})]})})]})}var ev=v(19496);function deadlineFrom(m,g,v){let x=es()(m);if(!m||!x.isValid())throw Error("Invalid claim history date: ".concat(m));let k=es()(v);if(!k.isValid())throw Error("Invalid current date");let E=x.startOf("day").add(g,"day"),T=E.diff(k.startOf("day"),"day");return{deadline:E.format("DD/MM/YYYY"),daysRemaining:T,state:T>0?"open":0===T?"last_day":"expired"}}var ey=v(43335);function ClaimPaidMovementsCard(m){let{claim:g}=m,v=g.movements.filter(m=>m.is_paid);if(0===v.length)return null;let x=v.reduce((m,g)=>m+g.amount,0);return(0,E.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-4",children:[(0,E.jsx)("p",{className:"text-green-800 font-bold mb-1",children:"Pagos realizados"}),(0,E.jsxs)("p",{className:"text-green-600 text-sm",children:[v.length," ",1===v.length?"pago":"pagos"," • ",(0,ey.Ed)(x)]})]})}var eb=v(68945);function ClaimDiagnosisCard(m){var g,v;let{claim:x,pet:k}=m,T=null!==(v=null===(g=x.diagnosis)||void 0===g?void 0:g.name)&&void 0!==v?v:x.reason||"Sin diagn\xf3stico",K=eb.sY[(0,eb.n7)(x.category)],et=[null==k?void 0:k.name,null==k?void 0:k.breed,null==k?void 0:k.age_in_words].filter(Boolean).join(", ");return(0,E.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 shadow-sm",children:[(0,E.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,E.jsxs)("p",{className:"text-lg font-bold text-gray-900",children:["Dx: ",T]}),(0,E.jsx)("span",{className:"bg-blue-100 text-blue-600 text-xs font-bold uppercase px-2 py-1 rounded-full flex-shrink-0",children:K})]}),et&&(0,E.jsx)("p",{className:"text-sm text-gray-600 mb-1",children:et}),(0,E.jsxs)("p",{className:"text-sm text-gray-500",children:["Inicio del evento ",(0,er.mn)(x.event_date)]})]})}function ClaimStatusResume(m){let{claim:g}=m,v=g.last_claim_history,x=null==v?void 0:v.rejection_category_name,k=null==v?void 0:v.comment,T=null==v?void 0:v.report;return(0,E.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 shadow-sm space-y-4",children:[(0,E.jsx)("p",{className:"text-lg font-bold text-gray-900",children:function(m){switch(m){case"denied":return"No se otorgar\xe1 cobertura a tu reembolso";case"approved":return"Se otorgar\xe1 cobertura a tu reembolso";case"approved_under_deductible":return"Se otorgar\xe1 cobertura pero el gasto no supera el deducible";case"processing":return"Tu reembolso est\xe1 en proceso de liquidaci\xf3n";case null:return"Sin liquidaci\xf3n"}}(function(m){var g;if(function(m){let g=m.claim_breakdown;return!!g&&0!==g.length&&g.every(m=>!m.coverable||!m.justified)}(m))return"denied";let v=m.payable_amount;return null==v?"processing":v>0?"approved":(null!==(g=m.remaining_deductible)&&void 0!==g?g:0)>0?"approved_under_deductible":"denied"}(g))}),x&&(0,E.jsx)("div",{className:"bg-yellow-100 border border-yellow-300 rounded-lg p-4",children:(0,E.jsx)("p",{className:"text-sm text-yellow-800",children:x})}),k&&(0,E.jsx)("p",{className:"text-sm text-gray-600 whitespace-pre-line",children:k}),(0,E.jsx)("p",{className:"text-sm text-gray-600",children:"Te llegar\xe1 un correo con tu informe de liquidaci\xf3n."}),T&&(0,E.jsxs)("div",{className:"text-center space-y-2",children:[(0,E.jsx)("a",{href:T,target:"_blank",rel:"noreferrer",className:"text-blue-500 font-bold hover:text-blue-600",children:"Descargar informe completo"}),(0,E.jsx)("p",{className:"text-xs text-gray-500",children:"El documento est\xe1 protegido con una contrase\xf1a, que corresponde a tu RUT sin puntos, sin guion y sin d\xedgito verificador"})]})]})}var ex=v(66123);let e_=["settled","adjusted","paid","info_needed","appeal_response"];function ItemIcon(m){let{item:g,isSettled:v}=m;return v?g.coverable&&g.justified?(0,E.jsx)(ed.Z,{className:"w-4 h-4 text-green-500"}):(0,E.jsx)(ex.Z,{className:"w-4 h-4 text-pink-600"}):(0,E.jsx)(K.Z,{className:"w-4 h-4 text-gray-300"})}function rowValue(m){var g;if(null!==m.percentage)return"".concat(Math.round(100*m.percentage),"%");let v=null!==(g=m.amount)&&void 0!==g?g:0;return v<0?"-".concat((0,ey.Ed)(-v)):(0,ey.Ed)(v)}function ClaimSummaryRows(m){var g,v,x;let{claim:k}=m,T=function(m){if(!m)return[];let g={key:"total",label:"Total a reembolsar",amount:m.payable_amount,percentage:null};if(m.justified_amount<=0)return[g];let v=[{key:"justified",label:"Total justificado",amount:m.justified_amount,percentage:null}];m.applied_deductible>0&&v.push({key:"deductible",label:"Deducible",amount:-m.applied_deductible,percentage:null}),m.percentage_covered<1&&v.push({key:"percentage",label:"Porcentaje de cobertura",amount:null,percentage:m.percentage_covered});
6let x=m.coverage_cap;return null!=x&&x>0&&v.push({key:"cap",label:"Tope anual disponible",amount:x,percentage:null}),v.push(g),v}(k.settlement_summary),K=T.filter(m=>"total"!==m.key),et=T.find(m=>"total"===m.key),en=e_.includes(null!==(v=null===(g=k.last_claim_history)||void 0===g?void 0:g.status_key)&&void 0!==v?v:""),er=null!==(x=k.claim_breakdown)&&void 0!==x?x:[];return(0,E.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-4 shadow-sm",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between text-sm font-bold text-gray-900",children:[(0,E.jsx)("span",{children:"Prestaci\xf3n"}),(0,E.jsx)("span",{className:"pr-6",children:"Monto"})]}),(0,E.jsx)("div",{className:"pb-3 border-b border-gray-200",children:er.map(m=>(0,E.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2 text-sm",children:[(0,E.jsxs)("div",{className:"flex items-center gap-4 min-w-0",children:[(0,E.jsx)("span",{className:"text-gray-700 flex-shrink-0 w-4",children:m.quantity}),(0,E.jsx)("span",{className:"text-gray-700 truncate",children:m.item_detail||m.item})]}),(0,E.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,E.jsx)("span",{className:"text-gray-900",children:(0,ey.Ed)(m.total)}),(0,E.jsx)(ItemIcon,{item:m,isSettled:en})]})]},m.id))}),K.length>0&&(0,E.jsx)("div",{className:"pb-3 border-b border-gray-200",children:K.map(m=>(0,E.jsxs)("div",{className:"mt-3 flex items-center justify-between text-sm text-gray-500",children:[(0,E.jsx)("span",{children:m.label}),(0,E.jsx)("span",{className:"pr-6",children:rowValue(m)})]},m.key))}),et&&(0,E.jsxs)("div",{className:"mt-3 flex items-center justify-between text-sm font-bold text-gray-900",children:[(0,E.jsx)("span",{children:et.label}),(0,E.jsx)("span",{className:"pr-6",children:rowValue(et)})]})]})}var ew=v(28416);function ContactSupportButton(m){let{onClick:g,variant:v="brand"}=m;return(0,E.jsx)(et.z,{onClick:g,variant:v,size:"full",iconLeft:(0,E.jsx)(ew.Z,{className:"w-4 h-4"}),children:"Contactar soporte"})}
6function AdjustedView(m){let{claim:g,pet:v,now:x,onAccept:k,onAppeal:T,onContactSupport:K,isLoading:en}=m,er=(0,eh.vM)(g),ei=!er&&(0,eh.sh)(g);return(0,E.jsxs)("div",{className:"space-y-4",children:[(0,E.jsx)("h4",{className:"text-lg font-bold text-gray-900",children:"Informe de liquidaci\xf3n"}),(0,E.jsx)(ClaimPaidMovementsCard,{claim:g}),(0,E.jsx)(ClaimDiagnosisCard,{claim:g,pet:v}),(0,E.jsx)(ClaimStatusResume,{claim:g}),(0,E.jsx)(ev.bZ,{className:"border-amber-200 bg-amber-50",children:(0,E.jsx)(ev.X,{className:"text-amber-800",children:"Si est\xe1s de acuerdo con la liquidaci\xf3n, ac\xe9ptala para poder procesar tu pago"})}),(0,E.jsx)(ClaimSummaryRows,{claim:g}),(0,E.jsxs)("div",{className:"space-y-2 pt-2",children:[(0,E.jsx)(et.z,{onClick:k,disabled:en,loading:en,variant:"brand",size:"full",children:"Aceptar liquidaci\xf3n"}),er&&(0,E.jsx)(ContactSupportButton,{onClick:K,variant:"brand-outline"}),ei&&(0,E.jsx)(et.z,{onClick:T,disabled:en,variant:"brand-outline",size:"full",children:"Objetar liquidaci\xf3n"}),(0,E.jsx)("p",{className:"text-xs text-gray-500 text-center",children:function(m,g){var v;let x=null===(v=m.last_claim_history)||void 0===v?void 0:v.created_at;if(!x)throw Error("Claim ".concat(m.id," is adjusted without a history date"));return function(m){switch(m.state){case"open":return"Tienes hasta el ".concat(m.deadline," para objetar la resoluci\xf3n.");case"last_day":return"\xa1Este es el \xfaltimo d\xeda para objetar la resoluci\xf3n!";case"expired":return"El plazo para objetar venci\xf3 el ".concat(m.deadline,".")}}(deadlineFrom(x,10,g))}(g,x)})]})]})}var eS=v(48260),eC=v(19167),ek=v(28836),eE=v(14016);function groupInfoNeededDocuments(m){let g=m.filter(m=>0===m.next_document_ids.length);return{pending:g.filter(m=>m.has_issues),received:g.filter(m=>!m.has_issues)}}function infoNeededBannerKind(m,g){return groupInfoNeededDocuments(m).pending.length>0?"pending":m.some(m=>null!==m.created_at&&es()(m.created_at).isAfter(g))?"ready":"missing"}var ej=v(93227),eN=v(69405);let eR={cacttus_medical_report:"Informe m\xe9dico Cacttus",external_adjuster_report:"Informe liquidador externo","medical-discharge":"Ficha alta m\xe9dica","medical-history":"Historial m\xe9dico",anamnesis:"Anamnesis","exam-results":"Resultados de examen",budget:"Presupuesto",receipt:"Boleta",diagnosis:"Motivo de consulta","vaccination-card":"Carnet de vacunaci\xf3n","extra-documents":"Documentos extra","exam-prescription":"Orden m\xe9dica",appealed:"Documento de apelaci\xf3n",prescription:"Receta"};function getDocumentTypeName(m){return m&&eR[m]||"Documento"}let eI={kind:"additional",fileTypeCode:"extra-documents"};function ActionBanner(m){let{title:g,body:v,actionLabel:x,onAction:k}=m;return(0,E.jsxs)("div",{"data-testid":"info-needed-action-banner",className:"bg-pink-50 border-2 border-pink-300 rounded-2xl shadow-md px-5 py-4 space-y-3",children:[(0,E.jsxs)("div",{className:"flex items-start gap-3",children:[(0,E.jsx)(ej.Z,{className:"w-6 h-6 text-pink-500 flex-shrink-0"}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-base font-bold text-pink-700",children:g}),(0,E.jsx)("p",{className:"text-sm text-pink-600",children:v})]})]}),(0,E.jsx)(et.z,{"data-testid":"info-needed-action-button",variant:"brand-destructive",size:"full",onClick:k,children:x})]})}function InfoNeededView(m){var g,v;let{claim:x,now:k,isSent:en,onSent:er,onAcknowledgeSent:ei,onClaimChanged:es}=m,[el,ec]=(0,T.useState)(null),[eu,ep]=(0,T.useState)(null),[em,eg]=(0,T.useState)(!1),[ev,ey]=(0,T.useState)(!1),[ex,e_]=(0,T.useState)(null),ew=(0,ek.st)(),eR=(0,T.useRef)(null),toClaimDocument=m=>{var g;return{id:m.id,document:m.document_url,document_name:m.document_name,file_description:null!==(g=m.file_type)&&void 0!==g?g:"",has_issues:m.has_issues,issue_comment:m.issue_comment,next_document:m.next_document_ids}},{pending:eP,received:eT}=(0,T.useMemo)(()=>{let m=groupInfoNeededDocuments(x.documents);return{pending:m.pending.map(toClaimDocument),received:m.received.map(toClaimDocument)}},[x.documents]);if(en)return(0,E.jsxs)("div",{"data-testid":"info-needed-sent",className:"flex flex-col items-center gap-4 py-10 text-center",children:[(0,E.jsx)(ed.Z,{className:"w-16 h-16 text-green-500"}),(0,E.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:"Recibimos tus antecedentes"}),(0,E.jsx)("p",{className:"text-sm text-gray-500 max-w-xs",children:"Tus documentos est\xe1n en revisi\xf3n. Te avisaremos cuando tengamos novedades."}),(0,E.jsx)(et.z,{variant:"brand",size:"full",onClick:()=>void ei(),children:"Entendido"})]});let eO=function(m){var g;let v=null===(g=m.last_claim_history)||void 0===g?void 0:g.created_at;if(!v)throw Error("Claim ".concat(m.id," is info_needed without a history date"));return v}(x),eA=function(m){switch(m.state){case"open":return"Tienes hasta el ".concat(m.deadline," para subir la informaci\xf3n faltante.");case"last_day":return"\xa1Este es el \xfaltimo d\xeda para subir la informaci\xf3n faltante!";case"expired":return"El plazo para subir la informaci\xf3n venci\xf3 el ".concat(m.deadline,".")}}(deadlineFrom(eO,40,k)),eM=infoNeededBannerKind(x.documents,eO),eD="ready"===infoNeededBannerKind(x.documents,eO),eL=null===(g=x.last_claim_history)||void 0===g?void 0:g.comment,handleSubmitDocuments=async()=>{ey(!0),e_(null);try{await ew.mutateAsync({claimId:x.id,statusKey:"processing"}),er()}catch(m){e_((0,eE.EV)(m,"No pudimos enviar tus antecedentes. Intenta de nuevo.").message)}finally{ey(!1)}},handleDocumentClick=m=>{if(m.has_issues){ec({kind:"new-version",document:m});return}if(m.document){if((0,eh.hU)(m.document)){ep(m);return}window.open(m.document,"_blank")}},renderDocumentCard=m=>(0,E.jsxs)("button",{type:"button",onClick:()=>handleDocumentClick(m),className:"w-full flex items-center gap-3 p-4 rounded-xl border shadow-sm text-left transition-colors ".concat(m.has_issues?"border-yellow-200 bg-yellow-50 hover:bg-yellow-100":"border-blue-100 bg-blue-50 hover:bg-blue-100"),children:[(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("p",{className:"text-base font-medium truncate ".concat(m.has_issues?"text-gray-900":"text-blue-800"),children:getDocumentTypeName(m.file_description)}),m.has_issues?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("p",{className:"text-sm text-yellow-600 mt-1",children:"Se solicita subir m\xe1s informaci\xf3n"}),(0,E.jsx)("p",{className:"text-sm text-yellow-600 font-bold",children:"Toca para ver detalles →"})]}):(0,E.jsx)("p",{className:"text-sm text-blue-600 mt-1",children:"Documento subido correctamente"})]}),m.has_issues?(0,E.jsx)("span",{className:"w-7 h-7 rounded-full bg-yellow-500 text-white text-xs font-bold flex items-center justify-center flex-shrink-0",children:"!"}):(0,E.jsx)(ed.Z,{className:"w-6 h-6 text-blue-600 flex-shrink-0"})]},m.id);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"space-y-4",children:["pending"===eM&&(0,E.jsx)(ActionBanner,{title:"Acci\xf3n requerida: faltan documentos",body:1===(v=eP.length)?"Tienes 1 documento pendiente":"Tienes ".concat(v," documentos pendientes"),actionLabel:1===eP.length?"Subir documento":"Ver documentos faltantes",onAction:()=>{var m;let[g]=eP;if(1===eP.length&&g){ec({kind:"new-version",document:g});return}null===(m=eR.current)||void 0===m||m.scrollIntoView({behavior:"smooth",block:"start"})}}),"missing"===eM&&(0,E.jsx)(ActionBanner,{title:"Acci\xf3n requerida: falta un documento",body:"Revisa lo que te pide el agente en los comentarios y s\xfabelo aqu\xed.",actionLabel:"Subir documento",onAction:()=>ec(eI)}),(0,E.jsxs)("div",{className:"space-y-3",children:[(0,E.jsxs)("div",{className:"bg-white border border-gray-100 rounded-2xl shadow-sm px-5 py-4 flex items-center gap-3",children:[(0,E.jsx)(K.Z,{className:"w-5 h-5 text-gray-500 flex-shrink-0"}),(0,E.jsx)("p",{className:"text-sm text-gray-600",children:"En promedio nos toma 20 d\xedas procesar tu caso."})]}),(0,E.jsxs)("div",{className:"bg-white border border-gray-100 rounded-2xl shadow-sm px-5 py-4 flex items-center gap-3",children:[(0,E.jsx)(eN.Z,{className:"w-5 h-5 text-blue-600 flex-shrink-0"}),(0,E.jsxs)("p",{className:"text-sm text-gray-600",children:["El plazo legal para la revisi\xf3n de reembolso es de ",45," d\xedas corridos"]})]})]}),(0,E.jsxs)("div",{className:"bg-blue-100 border border-blue-500 rounded-xl p-4",children:[(0,E.jsxs)("div",{className:"flex items-start gap-2 mb-3",children:[(0,E.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-50 flex items-center justify-center flex-shrink-0",children:(0,E.jsx)(ej.Z,{className:"w-5 h-5 text-blue-600"})}),(0,E.jsx)("p",{className:"text-base font-bold text-blue-900 pt-1",children:"\xa1Necesitamos tu ayuda! Faltan antecedentes"})]}),(0,E.jsxs)("div",{className:"pl-10 space-y-2",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-sm font-bold text-gray-600",children:"Plazo para subir informaci\xf3n:"}),(0,E.jsx)("p",{className:"text-sm text-gray-500",children:eA})]}),eL&&(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-sm font-bold text-gray-600",children:"Comentarios:"}),(0,E.jsx)("p",{className:"text-sm text-gray-500 leading-relaxed whitespace-pre-line",children:eL})]})]})]}),0===eP.length&&0===eT.length&&(0,E.jsx)("p",{className:"text-sm italic text-gray-500 text-center",children:"No hay documentos asociados a este reclamo."}),eP.length>0&&(0,E.jsxs)("div",{ref:eR,"data-testid":"info-needed-pending-section",className:"space-y-3",children:[(0,E.jsx)("h3",{className:"text-sm font-bold text-pink-600",children:"Pendientes"}),eP.map(renderDocumentCard)]}),eT.length>0&&(0,E.jsxs)("div",{"data-testid":"info-needed-received-section",className:"space-y-3",children:[(0,E.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:"Adjuntos recibidos"}),eT.map(renderDocumentCard)]}),(0,E.jsx)(et.z,{"data-testid":"info-needed-add-document",variant:"brand-outline",size:"full",onClick:()=>ec(eI),children:"Subir otro documento"}),ex&&(0,E.jsx)("p",{className:"text-sm text-red-600",children:ex}),eD&&(0,E.jsx)("p",{"data-testid":"info-needed-ready-to-send",className:"text-sm font-bold text-blue-800 bg-blue-50 border border-blue-200 rounded-xl px-4 py-3 text-center",children:"Ya adjuntaste los documentos. Ahora debes enviar los antecedentes para que podamos revisarlos."}),(0,E.jsx)(et.z,{"data-testid":"info-needed-submit",variant:"brand",onClick:()=>void handleSubmitDocuments(),disabled:ev||!eD,loading:ev,size:"full",children:"Enviar antecedentes"}),(0,E.jsx)(ClaimTimeline,{claim:x}),(0,E.jsxs)("p",{className:"text-sm text-gray-500 text-center max-w-xs mx-auto",children:["Si tienes m\xe1s dudas"," ",(0,E.jsx)("button",{type:"button",onClick:()=>eg(!0),className:"text-blue-500 hover:text-blue-600",children:"revisa aqu\xed"})," ","los documentos necesarios para reembolsar."]})]}),el&&(0,E.jsx)(eS.eh,{isOpen:!0,onClose:()=>ec(null),target:el,claimId:x.id,onSuccess:()=>{ec(null),es()}}),(null==eu?void 0:eu.document)&&(0,E.jsx)(ef.Z,{isOpen:!0,onClose:()=>ep(null),imageUrl:eu.document,imageName:eu.document_name||getDocumentTypeName(eu.file_description)}),(0,E.jsx)(eC.Z,{isOpen:em,onClose:()=>eg(!1),category:(0,eb.n7)(x.category)})]})}var eP=v(7313);function PaymentErrorView(m){let{claim:g,bankAccountForm:v}=m;return"bank_account_error"===(0,eh.Dr)(g)?(0,E.jsxs)("div",{className:"space-y-4",children:[(0,E.jsxs)(ev.bZ,{className:"border-amber-200 bg-amber-50",children:[(0,E.jsx)(eP.Z,{className:"h-4 w-4 !text-amber-600"}),(0,E.jsx)(ev.Cd,{className:"text-amber-900",children:"Hubo un error con el pago"}),(0,E.jsx)(ev.X,{className:"text-amber-800 mt-1",children:"Revisa que todos los datos est\xe9n escritos correctamente y que la cuenta ingresada est\xe9 asociada a tu RUT."})]}),v]}):(0,E.jsxs)(ev.bZ,{className:"border-blue-200 bg-blue-50",children:[(0,E.jsx)(K.Z,{className:"h-4 w-4 !text-blue-500"}),(0,E.jsx)(ev.Cd,{className:"text-blue-900",children:"Tu pago est\xe1 en proceso"}),(0,E.jsx)(ev.X,{className:"text-blue-800 mt-1",children:"Tu pago se realizar\xe1 en los pr\xf3ximos 7 d\xedas h\xe1biles. No te preocupes, estamos trabajando para procesarlo a la brevedad."})]})}
6function AppealResponseView(m){var g;let{claim:v,onAccept:x,onContactSupport:k,isLoading:T}=m,K=null===(g=v.last_claim_history)||void 0===g?void 0:g.comment;return(0,E.jsxs)("div",{className:"space-y-4",children:[K&&(0,E.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4",children:[(0,E.jsx)("p",{className:"text-sm font-bold text-gray-900 mb-2",children:"Comentario"}),(0,E.jsx)("p",{className:"text-sm text-gray-700 whitespace-pre-line",children:K})]}),v.needs_re_adjusting?(0,E.jsxs)(ev.bZ,{className:"border-blue-200 bg-blue-50",children:[(0,E.jsx)(ev.Cd,{className:"text-blue-900",children:"Estamos revisando tu impugnaci\xf3n"}),(0,E.jsx)(ev.X,{className:"text-blue-800 mt-1",children:"Estamos liquidando nuevamente con la nueva resoluci\xf3n. Te notificaremos cuando est\xe9 lista. Recuerda que por normativa solo puedes realizar una impugnaci\xf3n."})]}):(0,E.jsxs)(ev.bZ,{className:"border-blue-200 bg-blue-50",children:[(0,E.jsx)(ev.Cd,{className:"text-blue-900",children:"Hemos respondido a tu impugnaci\xf3n"}),(0,E.jsx)(ev.X,{className:"text-blue-800 mt-1",children:"Por normativa, solo puedes realizar una impugnaci\xf3n por siniestro. Para continuar debes aceptar la liquidaci\xf3n."})]}),v.needs_re_adjusting?(0,E.jsx)(ContactSupportButton,{onClick:k}):(0,E.jsxs)("div",{className:"space-y-2 pt-2",children:[(0,E.jsx)(ContactSupportButton,{onClick:k,variant:"brand-outline"}),(0,E.jsx)(et.z,{onClick:x,disabled:T,loading:T,variant:"brand",size:"full",children:"Aceptar liquidaci\xf3n"})]})]})}var eT=v(39097),eO=v.n(eT),eA=v(69494),eM=v(27350),eD=v(13346);function ClaimInviteButton(m){let{referrerCode:g}=m,[v,x]=(0,T.useState)(!1);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(et.z,{onClick:()=>x(!0),variant:"brand",size:"full",iconLeft:(0,E.jsx)(eA.Z,{className:"w-4 h-4"}),children:"\xa1Invita y gana!"}),(0,E.jsx)(en.Vq,{open:v,onOpenChange:x,children:(0,E.jsxs)(en.cZ,{className:"sm:max-w-md",children:[(0,E.jsx)(en.fK,{children:(0,E.jsx)(en.$N,{className:"sr-only",children:"\xa1Invita y gana!"})}),(0,E.jsx)(eM.n,{user:{referrer_code:g}}),(0,E.jsx)(et.z,{asChild:!0,variant:"brand-link",className:"mt-6 self-center",children:(0,E.jsx)(eO(),{href:eD.Z.profile.index("invite"),onClick:()=>x(!1),children:"\xbfQu\xe9 beneficios puedo ganar?"})})]})})]})}function ApprovedView(m){let{claim:g,referrerCode:v}=m;return(0,E.jsxs)("div",{className:"space-y-6",children:[(0,E.jsx)(ClaimSummaryRows,{claim:g}),v&&(0,E.jsx)(ClaimInviteButton,{referrerCode:v})]})}function ClosedView(){return(0,E.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-6 shadow-sm flex flex-col items-center",children:[(0,E.jsx)(ed.Z,{className:"w-12 h-12 text-gray-400"}),(0,E.jsx)("p",{className:"mt-4 text-xl font-bold text-gray-900 text-center",children:"Caso cerrado"})]})}function DeniedView(m){let{claim:g,onContactSupport:v}=m,x=g.last_claim_history,k=null==x?void 0:x.rejection_category_name;return(0,E.jsxs)("div",{className:"space-y-4",children:[(0,E.jsx)("div",{className:"bg-gray-100 border border-gray-200 rounded-xl p-4",children:(0,E.jsxs)("div",{className:"flex items-start gap-3",children:[(0,E.jsx)(eP.Z,{className:"w-5 h-5 text-gray-500 mt-0.5 flex-shrink-0"}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-gray-800 font-medium",children:"Reembolso no procedente"}),k&&(0,E.jsxs)("p",{className:"text-gray-600 text-sm mt-1",children:["Motivo: ",k]})]})]})}),(null==x?void 0:x.comment)&&(0,E.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4",children:[(0,E.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-1",children:"Detalle"}),(0,E.jsx)("p",{className:"text-sm text-gray-600 whitespace-pre-line",children:x.comment})]}),(0,E.jsx)("div",{className:"bg-blue-50 border border-blue-100 rounded-xl p-4 text-center",children:(0,E.jsx)("p",{className:"text-sm text-blue-700",children:"Si crees que esto es un error, contacta a nuestro equipo de soporte."})}),(0,E.jsx)(ContactSupportButton,{onClick:v})]})}var eL=v(63955),eF=v(6342),eZ=v(68093),eB=v(4028),e$=v(25766),eU=v(68344);let ez=["Esta es tu \xfanica opci\xf3n para objetar","Tienes 10 d\xedas h\xe1biles para realizar la objeci\xf3n","Lo vamos a revisar en 5 d\xedas h\xe1biles","Fundamenta tus respuestas","Adjunta nuevos documentos que respalden tu objeci\xf3n (si los tienes)*"],eV="Hubo un problema enviando tu objeci\xf3n. Int\xe9ntalo nuevamente.";function AppealView(m){let{claim:g,onSubmit:v,onCancel:x,isLoading:k}=m,[K,er]=(0,T.useState)(!0),[ei,es]=(0,T.useState)([]),[el,ec]=(0,T.useState)(null),[em,ef]=(0,T.useState)(!1),[eh,eg]=(0,T.useState)(!1),[ev,ey]=(0,T.useState)(!1),[eb,e_]=(0,T.useState)(null),ew=(0,T.useRef)(0),eS=(0,ek.Mg)(),eC=(0,ek.uf)(),ej=(0,ek.Qd)(),{register:eN,handleSubmit:eR,getValues:eI,formState:{errors:eP}}=(0,eL.cI)({mode:"onTouched",defaultValues:{comment:""}}),eT=eh||k,handleRemoveFile=m=>{es(g=>g.filter(g=>g.key!==m))},uploadDocument=async(m,v)=>{let{url:x,fields:k,s3_key:E}=await eS.mutateAsync({claimId:g.id,fileName:m.name});await eC.mutateAsync({url:x,fields:k,file:m});let T=await ej.mutateAsync({claimId:g.id,fileTypeCode:"appealed",documentKey:E,documentName:"Documento apelaci\xf3n #".concat(v)});return T.id},uploadPendingDocuments=async()=>{let m=[];for(let g of ei){if(null!==g.documentId){m.push(g.documentId);continue}let v=await uploadDocument(g.file,m.length+1);es(m=>m.map(m=>m.key===g.key?{...m,documentId:v}:m)),m.push(v)}return m},sendAppeal=async()=>{eg(!0);try{let m=await uploadPendingDocuments();await v(eI("comment"),m),ef(!1),ey(!0)}catch(m){ef(!1),e_(m instanceof eU.o?(0,eE.EV)(m,eV).message:eV)}finally{eg(!1)}}
6,handleSuccessClose=()=>{ey(!1),x()};return K?(0,E.jsxs)("div",{className:"space-y-4",children:[(0,E.jsx)("h4",{className:"text-lg font-bold text-gray-900",children:"Antes de objetar"}),(0,E.jsx)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 shadow-sm",children:(0,E.jsx)("ul",{className:"space-y-5",children:ez.map(m=>(0,E.jsxs)("li",{className:"flex items-start gap-3",children:[(0,E.jsx)(eF.Z,{className:"w-5 h-5 text-blue-500 flex-shrink-0 mt-0.5"}),(0,E.jsx)("span",{className:"text-gray-700",children:m})]},m))})}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(et.z,{onClick:()=>er(!1),variant:"brand",size:"full",children:"Entendido, seguir con objeci\xf3n"}),(0,E.jsx)(et.z,{onClick:x,variant:"brand-outline",size:"full",children:"Cancelar"})]})]}):(0,E.jsxs)("div",{className:"space-y-4",children:[(0,E.jsx)("h4",{className:"text-lg font-bold text-gray-900",children:"Ingresa tu objeci\xf3n"}),(0,E.jsx)(ClaimStatusResume,{claim:g}),(0,E.jsxs)("div",{children:[(0,E.jsx)("input",{type:"file",id:"appeal-file-input",className:"hidden",onChange:m=>{var g;let v=null===(g=m.target.files)||void 0===g?void 0:g[0];if(m.target.value="",!v)return;if(v.size>10485760){ec("El archivo es demasiado grande. M\xe1ximo 10MB.");return}ec(null);let x=ew.current;ew.current+=1,es(m=>[...m,{key:x,file:v,documentId:null}])},accept:"image/*,.pdf",disabled:eT}),(0,E.jsx)(et.z,{asChild:!0,variant:"brand-outline",size:"full",children:(0,E.jsxs)("label",{htmlFor:"appeal-file-input",className:(0,eu.cn)("cursor-pointer",eT&&"pointer-events-none opacity-50"),children:[(0,E.jsx)(eZ.Z,{className:"w-4 h-4"}),"Subir documentos"]})}),el&&(0,E.jsx)("p",{className:"text-sm text-destructive mt-2",children:el}),ei.length>0&&(0,E.jsx)("div",{className:"mt-3 space-y-2",children:ei.map(m=>(0,E.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,E.jsx)(ep.Z,{className:"w-5 h-5 text-gray-400 flex-shrink-0"}),(0,E.jsx)("span",{className:"text-sm text-gray-700 truncate",children:m.file.name})]}),(0,E.jsx)(et.z,{type:"button",variant:"ghost",size:"icon",onClick:()=>handleRemoveFile(m.key),disabled:eT,"aria-label":"Quitar documento",children:(0,E.jsx)(eB.Z,{className:"w-4 h-4 text-gray-500"})})]},m.key))})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)(e$.g,{...eN("comment",{validate:m=>m.trim().length>0||"D\xe9janos un comentario para entender mejor tu caso y motivo de apelaci\xf3n"}),placeholder:"Escribe un comentario que nos ayude a entender tu objeci\xf3n",className:"min-h-32 rounded-xl bg-white p-4",disabled:eT}),eP.comment&&(0,E.jsx)("p",{className:"text-sm text-pink-600 mt-2",children:eP.comment.message})]}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(et.z,{variant:"brand",onClick:()=>void eR(()=>ef(!0))(),disabled:eT,size:"full",children:"Enviar objeci\xf3n"}),(0,E.jsx)(et.z,{onClick:x,disabled:eT,variant:"brand-outline",size:"full",children:"Cancelar"})]}),(0,E.jsx)(en.Vq,{open:em,onOpenChange:m=>!eh&&ef(m),children:(0,E.jsxs)(en.cZ,{className:"sm:max-w-sm",hideCloseButton:eh,children:[(0,E.jsxs)(en.fK,{children:[(0,E.jsx)(en.$N,{className:"text-center",children:"\xbfConfirmas el env\xedo de tu objeci\xf3n?"}),(0,E.jsx)(en.Be,{className:"text-center",children:"Esta es tu \xfanica oportunidad para objetar. Una vez enviada, no podr\xe1s modificar tu objeci\xf3n."})]}),(0,E.jsxs)("div",{className:"space-y-2 mt-2",children:[(0,E.jsx)(et.z,{onClick:()=>void sendAppeal(),loading:eh,disabled:eh,variant:"brand",size:"full",children:"S\xed, enviar objeci\xf3n"}),(0,E.jsx)(et.z,{onClick:()=>ef(!1),disabled:eh,variant:"brand-outline",size:"full",children:"Cancelar"})]})]})}),(0,E.jsx)(en.Vq,{open:ev,onOpenChange:m=>!m&&handleSuccessClose(),children:(0,E.jsxs)(en.cZ,{className:"sm:max-w-sm",children:[(0,E.jsx)(en.fK,{children:(0,E.jsx)(en.$N,{className:"sr-only",children:"Objeci\xf3n enviada"})}),(0,E.jsxs)("div",{className:"text-center py-4",children:[(0,E.jsx)("div",{className:"w-20 h-20 bg-green-50 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,E.jsx)(ed.Z,{className:"w-12 h-12 text-green-500"})}),(0,E.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"\xa1Objeci\xf3n enviada!"}),(0,E.jsx)("p",{className:"text-gray-600 mb-4",children:"Tu objeci\xf3n ha sido envi
6ada correctamente. La revisaremos en los pr\xf3ximos 5 d\xedas h\xe1biles."}),(0,E.jsx)("p",{className:"text-gray-500 text-sm mb-6",children:"Te notificaremos cuando tengamos una respuesta."}),(0,E.jsx)(et.z,{onClick:handleSuccessClose,variant:"brand",size:"full",children:"Entendido"})]})]})}),(0,E.jsx)(en.Vq,{open:null!==eb,onOpenChange:m=>!m&&e_(null),children:(0,E.jsxs)(en.cZ,{className:"sm:max-w-sm",children:[(0,E.jsx)(en.fK,{children:(0,E.jsx)(en.$N,{className:"sr-only",children:"Error al enviar objeci\xf3n"})}),(0,E.jsxs)("div",{className:"text-center py-4",children:[(0,E.jsx)("div",{className:"w-20 h-20 bg-red-50 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,E.jsx)(ex.Z,{className:"w-12 h-12 text-red-500"})}),(0,E.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"Error al enviar"}),(0,E.jsx)("p",{className:"text-gray-600 mb-6",children:eb}),(0,E.jsx)(et.z,{onClick:()=>e_(null),variant:"brand",size:"full",children:"Entendido"})]})]})})]})}function ClaimDetailContent(m){let{claim:g,pet:v,actions:x,bankAccountForm:k,referrerCode:K,isProcessing:et,isAppealSubmitting:en,now:er=new Date}=m,[ei,es]=(0,T.useState)(!1),[el,ec]=(0,T.useState)(!1);if(ei)return(0,E.jsx)(AppealView,{claim:g,onSubmit:x.onSubmitAppeal,onCancel:()=>es(!1),isLoading:en});let acknowledgeInfoNeededSent=async()=>{await x.onClaimChanged(),ec(!1)};if(el||"info_needed"===claimViewKindFor(g))return(0,E.jsx)(InfoNeededView,{claim:g,now:er,isSent:el,onSent:()=>ec(!0),onAcknowledgeSent:acknowledgeInfoNeededSent,onClaimChanged:x.onClaimChanged});switch(claimViewKindFor(g)){case"adjusted":return(0,E.jsx)(AdjustedView,{claim:g,pet:v,n
6ow:er,onAccept:x.onAcceptSettlement,onAppeal:()=>es(!0),onContactSupport:x.onContactSupport,isLoading:et});case"payment_error":return(0,E.jsx)(PaymentErrorView,{claim:g,bankAccountForm:k});case"appeal_response":return(0,E.jsx)(AppealResponseView,{claim:g,onAccept:x.onAcceptSettlement,onContactSupport:x.onContactSupport,isLoading:et});case"approved":return(0,E.jsx)(ApprovedView,{claim:g,referrerCode:K});case"closed":return(0,E.jsx)(ClosedView,{});case"denied":return(0,E.jsx)(DeniedView,{claim:g,onContactSupport:x.onContactSupport});case"processing":return(0,E.jsx)(ProcessingView,{claim:g})}}},76741:function(m,g,v){"use strict";v.d(g,{Z:function(){return ClaimHeader}});var x=v(52322);v(2784);var k=v(96577),E=v.n(k),T=v(25987),K=v(37903),et=v(68945),en=v(3510);function ClaimHeader(m){var g,v;let{claim:k,pet:er}=m,ei=(0,en.iQ)(null===(g=k.last_claim_history)||void 0===g?void 0:g.status_key,k.payable_amount),es=ei.Icon,el=(0,et.n7)(null!==(v=k.category)&&void 0!==v?v:0),ec=en.gO[el];return(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsxs)("div",{className:"flex items-start gap-4",children:[(0,x.jsx)("div",{className:"w-14 h-14 rounded-xl bg-blue-50 flex items-center justify-center flex-shrink-0",children:(0,x.jsx)(E(),{src:ec,alt:et.sY[el],width:32,height:32})}),(0,x.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,x.jsx)("p",{className:"text-sm text-gray-500",children:null==er?void 0:er.name}),(0,x.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:k.claim_int?"Siniestro #".concat(k.claim_int):"Reembolso"}),k.reason&&(0,x.jsx)("p",{className:"text-sm text-gray-600 truncate",children:k.reason})]})]}),(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsxs)("div",{className:(0,T.cn)("px-3 py-1.5 rounded-full flex items-center gap-1.5",ei.bgColor),children:[(0,x.jsx)(es,{className:(0,T.cn)("w-4 h-4",ei.color)}),(0,x.jsx)("span",{className:(0,T.cn)("text-sm font-medium",ei.color),children:ei.label})]}),(0,x.jsxs)("div",{className:"text-right",children:[(0,x.jsx)("p",{className:"text-xs text-gray-400",children:"Fecha evento"}),(0,x.jsx)("p",{className:"text-sm font-medium text-gray-700",children:(0,K.mn)(k.event_date)})]})]})]})}},48260:function(m,g,v){"use strict";v.d(g,{i_:function(){return SuccessModal},bT:function(){return TransferringModal},eh:function(){return UploadDocumentModal}});var x=v(52322),k=v(2784),E=v(2504),T=v(84355),K=v(93829);function TransferringModal(m){let{transferState:g,onDelayedConfirm:v}=m,k="delayed"===g;return(0,x.jsx)(T.Vq,{open:"idle"!==g,onOpenChange:m=>!m&&k&&v(),children:(0,x.jsxs)(T.cZ,{className:"sm:max-w-sm",hideCloseButton:!k,children:[(0,x.jsxs)(T.fK,{className:"items-center text-center pt-4",children:[(0,x.jsx)("div",{className:"w-16 h-16 bg-blue-50 rounded-full flex items-center justify-center mb-4",children:(0,x.jsx)(E.Z,{className:"w-8 h-8 text-blue-500"})}),(0,x.jsx)(T.$N,{className:"text-xl text-center",children:k?"Tu pago est\xe1 en proceso":"Transfiriendo a tu cuenta"}),(0,x.jsx)(T.Be,{className:"text-center",children:k?"Tu pago se realizar\xe1 en los pr\xf3ximos 7 d\xedas h\xe1biles. No te preocupes, estamos trabajando para procesarlo a la brevedad.":"Estamos procesando tu reembolso, esto puede tardar unos segundos."})]}),k?(0,x.jsx)(K.z,{onClick:v,variant:"brand",size:"full",className:"mt-2",children:"Entendido"}):(0,x.jsx)("div",{className:"py-4",children:(0,x.jsx)("div",{className:"w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto"})})]})})}var et=v(39097),en=v.n(et),er=v(43335),ei=v(13346);function SuccessModal(m){let{isOpen:g,onClose:v,amount:k,petName:E}=m;return(0,x.jsx)(T.Vq,{open:g,onOpenChange:m=>!m&&v(),children:(0,x.jsxs)(T.cZ,{className:"sm:max-w-sm",children:[(0,x.jsx)(T.fK,{children:(0,x.jsx)(T.$N,{className:"text-xl text-center pt-6",children:"El reembolso de ".concat(E," fue aprobado \uD83C\uDF89")})}),(0,x.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,x.jsxs)("div",{className:"mt-6 w-full bg-white shadow-lg rounded-lg flex flex-col items-center py-6",children:[(0,x.jsx)("p",{className:"text-xl font-bold",children:"Te ahorraste"}),(0,x.jsx)("p",{className:"mt-4 bg-pink-600 text-white text-4xl font-bold py-2.5 px-5 rounded-full",children:(0,er.Ed)(k)}),(0,x.jsx)("p",{className:"mt-3 text-xl font-bold",children:"en gastos veterinarios"})]}),(0,x.jsx)("p",{className:"mt-6 w-full bg-blue-200 py-3 px-5 rounded-lg text-sm font-bold",children:"\xa1Comparte Cacttus y gana una cuota gratis!"}),(0,x.jsx)(K.z,{asChild:!0,variant:"brand",size:"full",className:"mt-4",children:(0,x.jsx)(en(),{href:ei.Z.profile.index("invite"),onClick:v,children:"Compartir y ganar"})}),(0,x.jsx)(K.z,{onClick:v,variant:"brand-outline",size:"full",className:"mt-3",children:"Entendido"})]})]})})}var es=v(28836),el=v(26991),ec=v(14016),eu=v(35115),ed=v(38681),ep=v(97501),em=v(51279),ef=v(28115),eh=v(90708),eg=v(4028),ev=v(68093);let ey={cacttus_medical_report:"Informe m\xe9dico Cacttus",external_adjuster_report:"Informe liquidador externo","medical-discharge":"Ficha alta m\xe9dica","medical-history":"Historial m\xe9dico",anamnesis:"Anamnesis","exam-results":"Resultados de examen",budget:"Presupuesto",receipt:"Boleta",diagnosis:"Motivo de consulta","vaccination-card":"Carnet de vacunaci\xf3n","extra-documents":"Documentos extra","exam-prescription":"Orden m\xe9dica",appealed:"Documento de apelaci\xf3n",prescription:"Receta"};function isImageFile(m){return m.type.startsWith("image/")}
6function UploadDocumentModal(m){var g;let{isOpen:v,onClose:E,target:et,claimId:en,onSuccess:er}=m,[ei,eb]=(0,k.useState)(null),[ex,e_]=(0,k.useState)(null),[ew,eS]=(0,k.useState)("idle"),[eC,ek]=(0,k.useState)(null),[eE,ej]=(0,k.useState)("upload"),eN=(0,k.useRef)(null),eR=(0,es.Mg)(),eI=(0,es.uf)(),eP=(0,es.Qd)(),{refetch:eT}=(0,el.e$)(),eO="new-version"===et.kind?et.document:null,eA="new-version"===et.kind?et.document.file_description||"extra-documents":et.fileTypeCode,eM=eO?eO.document_name||(g=eO.file_description)&&ey[g]||"Documento":"Subir documento",eD=null==eO?void 0:eO.document,eL=!!eD&&function(m){let g=m.toLowerCase();return[".jpg",".jpeg",".png",".gif",".webp",".heic"].some(m=>g.includes(m))}(eD),eF=(0,k.useCallback)(m=>{var g;let v=null===(g=m.target.files)||void 0===g?void 0:g[0];if(v){if(v.size>10485760){ek("El archivo es demasiado grande. M\xe1ximo 10MB.");return}if(eb(v),ek(null),isImageFile(v)){let m=URL.createObjectURL(v);e_(m)}else e_(null)}},[]),eZ=(0,k.useCallback)(m=>{m.preventDefault();let g=m.dataTransfer.files[0];if(g){if(g.size>10485760){ek("El archivo es demasiado grande. M\xe1ximo 10MB.");return}if(eb(g),ek(null),isImageFile(g)){let m=URL.createObjectURL(g);e_(m)}else e_(null)}},[]),eB=(0,k.useCallback)(m=>{m.preventDefault()},[]),e$=(0,k.useCallback)(()=>{ex&&URL.revokeObjectURL(ex),eb(null),e_(null)},[ex]),handleUpload=async()=>{if(ei){eS("uploading"),ek(null);try{let m=ei.name.split(".").pop()||"pdf",g=Date.now(),v=eO?"new_version_".concat(eO.id):"additional",x="claim_documents/".concat(en,"/").concat(v,"_").concat(g,".").concat(m),k=await eR.mutateAsync({claimId:en,fileName:x});await eI.mutateAsync({url:k.url,fields:k.fields,file:ei}),await eP.mutateAsync({claimId:en,fileTypeCode:eA,documentKey:k.s3_key||k.fields.key,previousDocumentId:null==eO?void 0:eO.id}),await eT(),eS("success"),setTimeout(()=>{er(),eU()},1200)}catch(m){eS("error"),ek((0,ec.EV)(m,"No pudimos subir el documento. Int\xe9ntalo nuevamente.").message)}}},eU=(0,k.useCallback)(()=>{"uploading"!==ew&&(e$(),eS("idle"),ek(null),ej("upload"),E())},[ew,e$,E]);return"success"===ew?(0,x.jsx)(T.Vq,{open:v,children:(0,x.jsx)(T.cZ,{className:"sm:max-w-sm",hideCloseButton:!0,children:(0,x.jsxs)("div",{className:"text-center py-6",children:[(0,x.jsx)(ed.Z,{className:"w-12 h-12 text-green-500 mx-auto mb-3"}),(0,x.jsx)("p",{className:"text-lg font-semibold text-gray-900",children:"Listo"})]})})}):"uploading"===ew?(0,x.jsx)(T.Vq,{open:v,children:(0,x.jsx)(T.cZ,{className:"sm:max-w-sm",hideCloseButton:!0,children:(0,x.jsxs)("div",{className:"text-center py-6",children:[(0,x.jsx)(ep.Z,{className:"w-10 h-10 text-gray-400 mx-auto mb-3 animate-spin"}),(0,x.jsx)("p",{className:"text-gray-600",children:"Subiendo..."})]})})}):"preview-current"===eE&&eD&&eL?(0,x.jsx)(eu.Z,{isOpen:!0,onClose:()=>ej("upload"),imageUrl:eD,imageName:eM}):"preview-new"===eE&&ex?(0,x.jsx)(eu.Z,{isOpen:!0,onClose:()=>ej("upload"),imageUrl:ex,imageName:(null==ei?void 0:ei.name)||"Nuevo documento"}):(0,x.jsx)(T.Vq,{open:v,onOpenChange:m=>!m&&eU(),children:(0,x.jsxs)(T.cZ,{className:"sm:max-w-md",children:[(0,x.jsx)(T.fK,{children:(0,x.jsx)(T.$N,{children:eM})}),(0,x.jsxs)("div",{className:"space-y-4",children:[(null==eO?void 0:eO.issue_comment)&&(0,x.jsx)("div",{className:"bg-amber-50 border border-amber-100 rounded-lg p-3",children:(0,x.jsx)("p",{className:"text-sm text-amber-800",children:eO.issue_comment})}),eD&&(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase mb-2",children:"Documento actual"}),(0,x.jsxs)("button",{onClick:()=>{eD&&(eL?ej("preview-current"):window.open(eD,"_blank"))},className:"w-full border border-gray-200 rounded-xl p-3 flex items-center gap-3 hover:bg-gray-50 transition-colors text-left",children:[(0,x.jsx)("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center flex-shrink-0 overflow-hidden",children:eL?(0,x.jsx)("img",{src:eD,alt:"",className:"w-full h-full object-cover"}):(0,x.jsx)(em.Z,{className:"w-6 h-6 text-gray-400"})}),(0,x.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,x.jsx)("p",{className:"text-sm text-gray-700 truncate",children:(null==eO?void 0:eO.document_name)||"Documento"}),!eL&&(0,x.jsx)("p",{className:"text-xs text-blue-600",children:"Abrir documento"})]}),eL?(0,x.jsx)(ef.Z,{className:"w-5 h-5 text-gray-400"}):(0,x.jsx)(eh.Z,{className:"w-5 h-5 text-gray-400"})]})]}),(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase mb-2",children:"Nuevo documento"}),ei?(0,x.jsx)("div",{className:"border border-gray-200 rounded-xl p-3",children:(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[ex?(0,x.jsx)("button",{onClick:()=>ej("preview-new"),className:"w-12 h-12 rounded-lg overflow-hidden flex-shrink-0 hover:opacity-80 transition-opacity",children:(0,x.jsx)("img",{src:ex,alt:"Preview",className:"w-full h-full object-cover"})}):(0,x.jsx)("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center flex-shrink-0",children:(0,x.jsx)(em.Z,{className:"w-6 h-6 text-gray-400"})}),(0,x.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,x.jsx)("p",{className:"text-sm text-gray-700 truncate",children:ei.name}),(0,x.jsxs)("p",{className:"text-xs text-gray-500",children:[(ei.size/1024/1024).toFixed(2)," MB"]})]}),(0,x.jsx)("button",{onClick:e$,className:"p-1 hover:bg-gray-100 rounded",children:(0,x.jsx)(eg.Z,{className:"w-4 h-4 text-gray-400"})})]})}):(0,x.jsxs)("div",{className:"border-2 border-dashed border-gray-200 rounded-xl p-6 text-center hover:border-gray-300 transition-colors cursor-pointer",onClick:()=>{var m;return null===(m=eN.current)||void 0===m?void 0:m.click()},onDrop:eZ,onDragOver:eB,children:[(0,x.jsx)("input",{ref:eN,type:"file",accept:".pdf,.jpg,.jpeg,.png,.heic",onChange:eF,className:"hidden"}),(0,x.jsx)(ev.Z,{className:"w-10 h-10 text-gray-300 mx-auto mb-2"}),(0,x.jsx)("p",{className:"text-sm text-gray-600",children:"Arrastra o selecciona"}),(0,x.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"PDF, JPG, PNG \xb7 M\xe1x 10MB"})]})]}),eC&&(0,x.jsx)("p",{className:"text-sm text-red-600 text-center",children:eC}),(0,x.jsxs)("div",{className:"flex gap-3",children:[(0,x.jsx)(K.z,{onClick:eU,variant:"brand-outline",size:"full",children:"Cancelar"}),"error"===ew?(0,x.jsx)(K.z,{onClick:()=>{eS("idle"),ek(null)},variant:"brand",size:"full",children:"Reintentar"}):(0,x.jsx)(K.z,{variant:"brand",onClick:()=>void handleUpload(),disabled:!ei,size:"full",children:"Subir"})]})]})]})})}},3510:function(m,g,v){"use strict";v.d(g,{Dr:function(){return paymentErrorViewFor},eX:function(){return hasUnpaidMovements},gO:function(){return ei},hU:function(){return isImageUrl},iQ:function(){return getStatusConfig},sh:function(){return hasDeniedItems},vM:function(){return hasExceededMaximumAppeals},zH:function(){return transferOutcomeFor}});
6var x=v(90206),k=v(87078),E=v(93227),T=v(51279),K=v(2504),et=v(38681),en=v(7313),er=v(85530);let ei={accident:"/static/icons/claims/broken-bone.svg",sickness:"/static/icons/claims/measure-device.svg","complementary-therapy":"/static/icons/claims/lotus-flower.svg","preventive-vaccines":"/static/icons/claims/syringe.svg","preventive-exams":"/static/icons/claims/sample-tube.svg","preventive-consultation":"/static/icons/claims/dog-frame.svg","preventive-chip-installation":"/static/icons/claims/chip.svg","preventive-teleconsultation":"/static/icons/claims/laptop.svg",preventive:"/static/icons/claims/syringe.svg",liability:"/static/icons/claims/dog-jaw.svg"},es={neutral:{color:"text-blue-600",bgColor:"bg-blue-50",borderColor:"border-blue-200",Icon:k.Z},info:{color:"text-blue-600",bgColor:"bg-blue-50",borderColor:"border-blue-200",Icon:k.Z},warning:{color:"text-amber-600",bgColor:"bg-amber-50",borderColor:"border-amber-200",Icon:k.Z},review:{color:"text-pink-600",bgColor:"bg-pink-50",borderColor:"border-pink-200",Icon:E.Z},attention:{color:"text-pink-600",bgColor:"bg-pink-50",borderColor:"border-pink-200",Icon:T.Z},waiting:{color:"text-blue-600",bgColor:"bg-blue-50",borderColor:"border-blue-200",Icon:K.Z},success:{color:"text-green-600",bgColor:"bg-green-50",borderColor:"border-green-200",Icon:et.Z},danger:{color:"text-red-600",bgColor:"bg-red-50",borderColor:"border-red-200",Icon:en.Z},rejected:{color:"text-gray-600",bgColor:"bg-gray-100",borderColor:"border-gray-200",Icon:en.Z},response:{color:"text-pink-600",bgColor:"bg-pink-50",borderColor:"border-pink-200",Icon:er.Z}};function getStatusConfig(m,g){let v=(0,x.e6)(m,g);return{label:v.label,...es[v.tone]}}function hasExceededMaximumAppeals(m){var g;let v=null!==(g=m.claim_history)&&void 0!==g?g:[],x=v.filter(m=>"appealed"===m.status_key).length;return x>=1}function hasDeniedItems(m){var g,v;return null!==(v=null===(g=m.claim_breakdown)||void 0===g?void 0:g.some(m=>!m.justified||!m.coverable))&&void 0!==v&&v}let el=["error_creditor_account_not_found","error_creditor_account_detail_mismatch"];function paymentErrorViewFor(m){let g=m.movements.find(m=>!m.is_paid);return g&&el.includes(g.last_payment_status_key)?"bank_account_error":"payment_in_process"}function hasUnpaidMovements(m){return m.movements.some(m=>!m.is_paid)}function transferOutcomeFor(m,g){return"paid"===m.status_key?"paid":"payment_error"===m.status_key&&m.id!==g?"payment_error":"transferring"}let ec=[".jpg",".jpeg",".png",".gif",".webp",".heic"];function isImageUrl(m){let g=m.toLowerCase();return ec.some(m=>g.includes(m))}},10298:function(m,g,v){"use strict";v.d(g,{Z:function(){return BenefitsBox}});var x=v(52322);function BenefitsBox(){return(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"font-bold text-lg",children:"\xbfC\xf3mo funciona el programa de referidos?"}),(0,x.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,x.jsxs)("div",{className:"p-6 bg-blue-50 rounded-lg",children:[(0,x.jsx)("div",{className:"font-bold mb-2",children:"Lo que ganas t\xfa"}),(0,x.jsx)("p",{children:"Por cada amigo que invites y mantenga su p\xf3liza activa por 3 meses, recibir\xe1s una cuota gratis en tu p\xf3liza. \xa1Entre m\xe1s amigos invites, m\xe1s cuotas gratis puedes ganar!"})]}),(0,x.jsxs)("div",{className:"p-6 bg-pink-50 rounded-lg",children:[(0,x.jsx)("div",{className:"font-bold mb-2",children:"Lo que ganan tus amigos"}),(0,x.jsx)("p",{children:"Tus amigos tambi\xe9n ganan: recibir\xe1n una cuota gratis al momento de renovar sus p\xf3lizas."})]}),(0,x.jsxs)("div",{className:"p-6 bg-yellow-50 rounded-lg",children:[(0,x.jsx)("div",{className:"font-bold mb-2",children:"\xa1Importante!"}),(0,x.jsx)("p",{children:"Puedes invitar amigos en cualquier momento y ganar cuotas gratis por cada uno que contrate. Tus amigos tendr\xe1n 30 d\xedas desde su primera p\xf3liza para asegurar a todas sus mascotas y que cada una cuente como referido. \xa1Es el momento perfecto para que aseguren a toda la familia peluda!"}),(0,x.jsxs)("p",{className:"mt-3",children:["Este beneficio ",(0,x.jsx)("span",{className:"font-bold",children:"no es acumulable"})," con c\xf3digos promocionales. Si al momento de contratar se ingresa un c\xf3digo de descuento, este ",(0,x.jsx)("span",{className:"font-bold",children:"reemplazar\xe1"})," el beneficio de referido. El c\xf3digo se puede quitar en cualquier momento para mantener el beneficio."]})]})]})]})}v(2784)},18128:function(m,g,v){"use strict";v.d(g,{Z:function(){return LinkCopy}
6});var x=v(52322),k=v(2784),E=v(72282),T=v(93829),K=v(85547);function LinkCopy(m){let{showCopied:g,activateShowCopied:v}=function(){let[m,g]=(0,k.useState)(!1);return{showCopied:m,activateShowCopied:function(){let m=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;g(!0),setTimeout(()=>g(!1),m)}}}();return(0,x.jsxs)("div",{className:"flex items-center mt-4 w-full",children:[(0,x.jsx)("div",{className:"border border-neutral-200 rounded-full py-2.5 px-4 truncate bg-white",children:(0,K.Z)(m.referrerCode,m.referralSource)}),(0,x.jsx)(E.CopyToClipboard,{text:(0,K.Z)(m.referrerCode,m.referralSource),onCopy:()=>{var g;v(),null===(g=m.onCopy)||void 0===g||g.call(m)},children:(0,x.jsx)(T.z,{variant:"brand",className:"ml-3",children:g?"\xa1Copiado!":"Copiar"})})]})}},96984:function(m,g,v){"use strict";v.d(g,{Z:function(){return WhatsappInvite}});var x=v(52322);v(2784);var k=v(93829),E=v(88649),T=v(85547);function WhatsappInvite(m){let g="Cacttus es un seguro para tu mascota, te reembolsan los gastos veterinarios en caso de accidente y enfermedad.\n\nReembolsan: ex\xe1menes, hospitalizaciones, cirug\xedas \xa1y hasta medicamentos!\n\n".concat((0,T.Z)(m.referrerCode,m.referralSource));return(0,x.jsx)("a",{href:"https://wa.me/send?text=".concat(encodeURIComponent(g)),target:"_blank",rel:"noreferrer",onClick:()=>{var g;return null===(g=m.onShare)||void 0===g?void 0:g.call(m)},children:(0,x.jsx)(k.z,{variant:"brand",className:"bg-green-500 text-white w-full mt-6 justify-center",iconLeft:(0,x.jsx)(E.Z,{className:"h-6 w-6 text-white"}),children:"Invitar por Whatsapp"})})}},85547:function(m,g,v){"use strict";v.d(g,{Z:function(){return getReferralUrl}});var x=v(11168);function getReferralUrl(m,g){return"".concat(x.Qi,"?referral=").concat(m,"&referral_source=").concat(g)}},69503:function(m,g,v){"use strict";v.d(g,{R:function(){return SEOHead}});var x=v(52322);v(2784);var k=v(97729),E=v.n(k),T=v(5632),K=v(11168);function SEOHead(m){let{title:g,description:v,canonicalUrl:k,keywords:et,ogImage:en,ogType:er="website",noIndex:ei=!1,includeSiteMetadata:es=!1}=m,el=(0,T.useRouter)(),ec=function(m){let g=m.split("?")[0].split("#")[0];return function(m){let g=m.startsWith("/")?m:"/".concat(m),v=g.split("?")[0].split("#")[0];return"".concat(K._O).concat(v)}(g)}(el.asPath),eu=k||ec,ed=en?function(m){if(/^https?:\/\//.test(m))return m;let g=m.startsWith("/")?m:"/".concat(m);return"".concat(K._O).concat(g)}(en):void 0;return(0,x.jsxs)(E(),{children:[es&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("meta",{charSet:"utf-8"}),(0,x.jsx)("link",{rel:"icon",href:"/static/cactus.png"}),(0,x.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,x.jsx)("meta",{name:"theme-color",content:"#000000"}),(0,x.jsx)("link",{rel:"apple-touch-icon",href:"/static/cactus.png"}),(0,x.jsx)("meta",{name:"facebook-domain-verification",content:"jxggrsbu1modftv1hhmr2af3r7yukz"}),(0,x.jsx)("meta",{name:"google-site-verification",content:"oYkjQsYUGUwYlYNdtyLsneHAXk3fdMbxa4MCqZygRvY"}),(0,x.jsx)("link",{rel:"manifest",href:"/static/manifest.json"})]}),g&&(0,x.jsx)("title",{children:g},"title"),v&&(0,x.jsx)("meta",{name:"description",content:v},"description"),et&&(0,x.jsx)("meta",{name:"keywords",content:et},"keywords"),(0,x.jsx)("link",{rel:"canonical",href:eu},"canonical"),g&&(0,x.jsx)("meta",{property:"og:title",content:g},"og:title"),v&&(0,x.jsx)("meta",{property:"og:description",content:v},"og:description"),(0,x.jsx)("meta",{property:"og:url",content:eu},"og:url"),(0,x.jsx)("meta",{property:"og:type",content:er},"og:type"),(0,x.jsx)("meta",{property:"og:site_name",content:"Cacttus"},"og:site_name"),ed&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("meta",{property:"og:image",content:ed},"og:image"),(0,x.jsx)("meta",{property:"og:image:type",content:"image/jpg"},"og:image:type"),(0,x.jsx)("meta",{property:"og:image:width",content:"1200"},"og:image:width"),(0,x.jsx)("meta",{property:"og:image:height",content:"627"},"og:image:height")]}),(0,x.jsx)("meta",{name:"twitter:card",content:"summary_large_image"},"twitter:card"),g&&(0,x.jsx)("meta",{name:"twitter:title",content:g},"twitter:title"),v&&(0,x.jsx)("meta",{name:"twitter:description",content:v},"twitter:description"),ed&&(0,x.jsx)("meta",{name:"twitter:image",content:ed},"twitter:image"),ei&&(0,x.jsx)("meta",{name:"robots",content:"noindex,nofollow"},"robots")]})}},77588:function(m,g,v){"use strict";v.d(g,{Z:function(){return AddressForm}});var x=v(52322),k=v(2784),E=v(63955),T=v(14016),K=v(47994),et=v(49759),en=v(93829),er=v(53538),ei=v(44994),es=v(13346);let el=er.Ry({description:er.Z_(),place_id:er.Z_(),structured_formatting:er.Ry({main_text:er.Z_(),secondary_text:er.Z_().optional()})}),ec=er.Ry({predictions:er.IX(el),status:er.Km(["OK","ZERO_RESULTS"])}),eu=er.Ry({address_components:er.IX(er.Ry({long_name:er.Z_(),types:er.IX(er.Z_())})),formatted_address:er.Z_(),geometry:er.Ry({location:er.Ry({lat:er.Rx(),lng:er.Rx()})}),place_id:er.Z_(),utc_offset_minutes:er.Rx()}),ed=er.Ry({result:eu,status:er.i0("OK")});async function autocompleteGooglePlaces(m,g){let{data:v}=await (0,ei.h)(ec,{method:"GET",params:{input:m},signal:g,url:es.Z.user.googlePlaces.autocomplete()},{failSilently:!1});return v.predictions}async function getGooglePlaceDetails(m){let{data:g}=await (0,ei.h)(ed,{method:"GET",params:{placeId:m},url:es.Z.user.googlePlaces.details()},{failSilently:!1});return g.result}let ep={route:"street",street_number:"number",administrative_area_level_3:"comuna",administrative_area_level_2:"city",administrative_area_level_1:"region",country:"country"},em=k.memo(m=>{let{onPlaceChanged:g,showAdditional:v,onSearchInputChange:E,existingAddress:T}=m,[K,en]=(0,k.useState)(T||""),[er,ei]=(0,k.useState)([]),[es,el]=(0,k.useState)(!1),[ec,eu]=(0,k.useState)(!1),[ed,ep]=(0,k.useState)(null);(0,k.useEffect)(()=>
6{if(!es)return;let m=K.trim();if(m.length<3){eu(!1),ei([]),ep(null);return}let g=new AbortController,v=setTimeout(()=>{eu(!0),ep(null),autocompleteGooglePlaces(m,g.signal).then(ei).catch(()=>{g.signal.aborted||(ei([]),ep("No se pudieron cargar las sugerencias. Intenta nuevamente."))}).finally(()=>{g.signal.aborted||eu(!1)})},300);return()=>{clearTimeout(v),g.abort()}},[es,K]);let handleSelect=async m=>{en(m.description),el(!1),ei([]),eu(!0),ep(null);try{let v=await getGooglePlaceDetails(m.place_id);g(v)}catch(m){ep("No se pudo cargar el detalle de la direcci\xf3n. Intenta nuevamente.")}finally{eu(!1)}};return(0,x.jsx)("div",{className:"flex flex-col md:flex-row items-center justify-center my-2 w-full",children:(0,x.jsxs)("div",{className:"relative w-full",children:[(0,x.jsxs)("div",{className:"flex flex-col",children:[(0,x.jsx)("label",{htmlFor:"search",className:"font-bold text-sm mb-2",children:"Direcci\xf3n"}),(0,x.jsx)("input",{id:"search",value:K,onChange:m=>{en(m.target.value),el(!0),E(m.target.value)},onBlur:v,className:"rounded-lg border-2 border-gray-200 hover:border-gray-600 focus:border-gray-600 outline-none p-4 transition-all w-full bg-white",placeholder:T||"Tu direcci\xf3n"}),ec&&(0,x.jsx)(et.Z,{className:"absolute right-4 top-11 animate-spin w-5 h-5"})]}),(0,x.jsx)("ul",{className:"absolute w-full flex flex-col bg-gray-100 rounded-lg shadow-lg overflow-hidden z-10",children:er.map(m=>{let{structured_formatting:{main_text:g,secondary_text:v}}=m;return(0,x.jsxs)("li",{className:"w-full bg-white hover:bg-blue-500 hover:text-white hover:cursor-pointer p-4",onClick:()=>void handleSelect(m),children:[(0,x.jsx)("strong",{children:g})," ",v&&(0,x.jsx)("small",{children:v})]},m.place_id)})}),ed&&(0,x.jsx)("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:ed})]})})});function AddressForm(m){let{initialAddress:g,onSubmit:v,onCancel:er,loading:ei=!1,mode:es,submitText:el,cancelText:ec="Cancelar",showCancelButton:eu=!0,className:ed=""}=m,[ef,eh]=(0,k.useState)(g||{}),[eg,ev]=(0,k.useState)({}),[ey,eb]=(0,k.useState)(!1),[ex,e_]=(0,k.useState)(!!g),[ew,eS]=(0,k.useState)(null);(0,k.useEffect)(()=>{g&&(eh(g),eb(!0),e_(!0))},[g]);let{register:eC,handleSubmit:ek}=(0,E.cI)({mode:"onBlur",defaultValues:{depto:(null==g?void 0:g.additional_info)||""}}),isAddressValid=m=>!!m&&!!(m.street&&m.number&&m.comuna&&m.country),handleFormSubmit=async m=>{if(eS(null),!ex){eS("Selecciona una direcci\xf3n de la lista de sugerencias.");return}try{if(isAddressValid({...ef,...eg})){let g={...ef,...eg,additional_info:m.depto};await v(g)}else eb(!0)}catch(m){eS((0,T.EV)(m,"No se pudo guardar la direcci\xf3n. Por favor, intenta nuevamente.").message)}},eE=null==g?void 0:g.formatted_address;return(0,x.jsx)("div",{className:"flex flex-col rounded-xl ".concat(ed),children:(0,x.jsxs)("form",{onSubmit:ek(m=>void handleFormSubmit(m)),children:[(0,x.jsx)(em,{onPlaceChanged:m=>{let g={};m.address_components&&(m.address_components.forEach(m=>{let v=m.types[0];if(v){let x=ep[v];if(!x)return;g[x]=m.long_name}}),g.formatted_address=m.formatted_address,g.utc_offset_minutes=m.utc_offset_minutes,g.place_id_google_maps=m.place_id,g.lat=m.geometry.location.lat,g.lng=m.geometry.location.lng),eh(g),e_(!0)},showAdditional:()=>eb(!0),onSearchInputChange:()=>e_(!1),existingAddress:eE}),ef&&ey&&Object.entries({street:{label:"Calle",placeholder:"Pedro de Valdivia "},number:{label:"N\xba de Calle",placeholder:"3017"},comuna:{label:"Comuna",placeholder:"Providencia"}}).map((m,g)=>{let[v,k]=m;return void 0===ef[v]?(0,x.jsxs)("div",{className:"flex flex-col",children:[(0,x.jsx)("label",{htmlFor:v,className:"font-bold text-sm mb-2",children:k.label}),(0,x.jsx)(K.I,{id:v,placeholder:k.placeholder,autoComplete:"off",className:"h-auto rounded-lg border-2 border-gray-200 hover:border-gray-600 focus:border-gray-600 focus-visible:ring-0 shadow-none p-4 transition-all",value:eg[v]||"",onChange:m=>{let{target:{value:g}}=m,x={...eg};x[v]=g,ev(x)}})]},g):(0,x.jsx)("p",{},g)}),(0,x.jsxs)("div",{className:"flex flex-col",children:[(0,x.jsx)("label",{htmlFor:"depto",className:"font-bold text-sm mb-2",children:"N\xba de Departamento"}),(0,x.jsx)(K.I,{id:"depto",type:"text",placeholder:(null==g?void 0:g.additional_info)||"124",autoComplete:"off",className:"h-auto rounded-lg border-2 border-gray-200 hover:border-gray-600 focus:border-gray-600 focus-visible:ring-0 shadow-none p-4 transition-all",...eC("depto")})]}),ew&&(0,x.jsx)("div",{className:"mt-4 text-center text-red-700 bg-red-100 border border-red-500 p-3 rounded-lg",children:ew}),(0,x.jsx)("div",{className:"mt-6 flex justify-center gap-4",children:ei?(0,x.jsx)("div",{className:"flex justify-center py-4",children:(0,x.jsx)(et.Z,{className:"animate-spin w-8 h-8"})}):(0,x.jsxs)(x.Fragment,{children:[eu&&er&&(0,x.jsx)(en.z,{variant:"brand-outline",size:"full",onClick:er,type:"button",children:ec}),(0,x.jsx)(en.z,{variant:"brand",size:"full",disabled:!isAddressValid({...ef,...eg})||!ex,type:"submit",children:el||("create"===es?"Crear":"Guardar")})]})})]})})}em.displayName="GooglePlacesSearch"},65544:function(m,g,v){"use strict";v.d(g,{c:function(){return EmailInputWithVerification}});var x=v(52322),k=v(2784),E=v(46262),T=v(16573),K=v(93227),et=v(30581),en=v(69567);function EmailInputWithVerification(m){let{value:g,onChange:v,onVerified:er,placeholder:ei="Ingresa tu email",label:es="Email",disabled:el=!1,className:ec="",verified:eu=!1}=m,[ed,ep]=(0,k.useState)(!1),[em,ef]=(0,k.useState)(g),[eh,eg]=(0,k.useState)(!1),{isModalOpen:ev,pendingEmail:ey,error:eb,isLoading:ex,requestVerification:e_,verifyCode:ew,closeModal:eS}=function(){let{onSuccess:m,onError:g}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[v,x]=(0,k.useState)(!1),[E,T]=(0,k.useState)(""),[K,en]=(0,k.useState)(""),er=(0,et.X)(),ei=(0,et.q)(),requestVerification=async m=>{en(""),T(m);try{await er.mutateAsync({new_email:m}),x(!0)}catch(v){let m=v instanceof Error?v.message:"Error al solicitar verificaci\xf3n";en(m),null==g||g(m)}},verifyCode=async v=>{en("");try{await ei.mutateAsync({new_email:E,verification_code:v}),null==m||m(E)}catch(v){let m=v instanceof Error?v.message:"Error al verificar c\xf3digo";throw en(m),null==g||g(m),v}};return{isModalOpen:v,pendingEmail:E,error:K,isLoading:er.isLoading||ei.isLoading,requestVerification,verifyCode,closeModal:()=>{x(!1),T(""),en("")}}}({onSuccess:m=>{v(m),eg(!0),ep(!1),er&&er(m)},onError:m=>{console.error("Email verification error:",m)}}),handleSave=async()=>
6{if(em===g){ep(!1);return}em&&em!==g&&await e_(em)},handleCancel=()=>{ep(!1),ef(g),eg(!1)};return ed?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"space-y-2 ".concat(ec),children:[es&&(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:es}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)("input",{type:"email",value:em,onChange:m=>ef(m.target.value),onKeyDown:m=>{"Enter"===m.key?(m.preventDefault(),handleSave()):"Escape"===m.key&&handleCancel()},placeholder:ei,className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",autoFocus:!0}),eb&&(0,x.jsxs)("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg flex items-center space-x-2",children:[(0,x.jsx)(K.Z,{className:"h-4 w-4 text-red-500 flex-shrink-0"}),(0,x.jsx)("p",{className:"text-sm text-red-700",children:eb})]}),(0,x.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,x.jsx)("button",{onClick:()=>{handleSave()},disabled:!em||ex,className:"px-3 py-1 bg-blue-500 text-white text-sm font-medium rounded-lg hover:bg-blue-600 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:ex?"Enviando...":"Guardar"}),(0,x.jsx)("button",{onClick:handleCancel,disabled:ex,className:"px-3 py-1 text-gray-600 hover:text-gray-800 transition-colors disabled:opacity-50",type:"button",children:"Cancelar"})]})]})]}),(0,x.jsx)(en.c,{isOpen:ev,onClose:eS,onSuccess:m=>{v(m),eg(!0),ep(!1),null==er||er(m)},type:"email",value:ey,onVerify:ew,isLoading:ex,error:eb})]}):(0,x.jsxs)("div",{className:"space-y-2 ".concat(ec),children:[es&&(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:es}),(0,x.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,x.jsx)("div",{className:"flex-1 p-3 bg-gray-50 border border-gray-200 rounded-lg",children:(0,x.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,x.jsx)("span",{className:"text-gray-900",children:g||"No especificado"}),(eu||eh)&&(0,x.jsx)(E.Z,{className:"h-4 w-4 text-green-500"})]})}),!el&&(0,x.jsx)("button",{onClick:()=>{ep(!0),ef(g),eg(!1)},className:"p-2 text-gray-400 hover:text-gray-600 transition-colors",type:"button",children:(0,x.jsx)(T.Z,{className:"h-4 w-4"})})]})]})}},42818:function(m,g,v){"use strict";v.d(g,{I:function(){return PhoneInputWithVerification}});var x=v(52322),k=v(2784),E=v(46262),T=v(16573),K=v(93227),et=v(56507),en=v(69567),er=v(3467);function PhoneInputWithVerification(m){let{value:g,onChange:v,onVerified:ei,label:es="Tel\xe9fono",disabled:el=!1,className:ec="",verified:eu=!1}=m,[ed,ep]=(0,k.useState)(!1),[em,ef]=(0,k.useState)(g),[eh,eg]=(0,k.useState)(!1),{isModalOpen:ev,pendingPhone:ey,error:eb,isLoading:ex,requestVerification:e_,verifyCode:ew,closeModal:eS}=function(){let{onSuccess:m,onError:g}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[v,x]=(0,k.useState)(!1),[E,T]=(0,k.useState)(""),[K,en]=(0,k.useState)(""),er=(0,et.G)(),ei=(0,et.E)(),requestVerification=async m=>{en(""),T(m);try{await er.mutateAsync({new_phone:m}),x(!0)}catch(v){let m=v instanceof Error?v.message:"Error al solicitar verificaci\xf3n";en(m),g&&g(m)}},verifyCode=async v=>{en("");try{await ei.mutateAsync({new_phone:E,verification_code:v}),null==m||m(E)}catch(v){let m=v instanceof Error?v.message:"Error al verificar c\xf3digo";throw en(m),null==g||g(m),v}};return{isModalOpen:v,pendingPhone:E,error:K,isLoading:er.isLoading||ei.isLoading,requestVerification,verifyCode,closeModal:()=>{x(!1),T(""),en("")}}}({onSuccess:m=>{v(m),eg(!0),ep(!1),ei&&ei(m)},onError:m=>{console.error("Phone verification error:",m)}}),handleSave=async()=>{if(em===g){ep(!1);return}em&&em!==g&&await e_(em)},handleCancel=()=>{ep(!1),ef(g),eg(!1)};return ed?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"space-y-2 ".concat(ec),children:[es&&(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:es}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500 text-sm",children:"+56"}),(0,x.jsx)("input",{type:"tel",value:em,onChange:m=>{let g=m.target.value.replace(/\D/g,"");ef(g)},onKeyDown:m=>{"Enter"===m.key?(m.preventDefault(),handleSave()):"Escape"===m.key&&handleCancel()},placeholder:"9 1234 5678",className:"w-full pl-12 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",autoF
6ocus:!0,maxLength:9})]}),eb&&(0,x.jsxs)("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg flex items-center space-x-2",children:[(0,x.jsx)(K.Z,{className:"h-4 w-4 text-red-500 flex-shrink-0"}),(0,x.jsx)("p",{className:"text-sm text-red-700",children:eb})]}),(0,x.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,x.jsx)("button",{onClick:()=>{handleSave()},disabled:!em||9!==em.length||ex,className:"px-3 py-1 bg-blue-500 text-white text-sm font-medium rounded-lg hover:bg-blue-600 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:ex?"Enviando...":"Guardar"}),(0,x.jsx)("button",{onClick:handleCancel,disabled:ex,className:"px-3 py-1 text-gray-600 hover:text-gray-800 transition-colors disabled:opacity-50",type:"button",children:"Cancelar"})]}),em&&9!==em.length&&(0,x.jsx)("p",{className:"text-xs text-gray-500",children:"El tel\xe9fono debe tener 9 d\xedgitos"})]})]}),(0,x.jsx)(en.c,{isOpen:ev,onClose:eS,onSuccess:m=>{v(m),eg(!0),ep(!1),null==ei||ei(m)},type:"phone",value:ey,onVerify:ew,isLoading:ex,error:eb})]}):(0,x.jsxs)("div",{className:"space-y-2 ".concat(ec),children:[es&&(0,x.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:es}),(0,x.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,x.jsx)("div",{className:"flex-1 p-3 bg-gray-50 border border-gray-200 rounded-lg",children:(0,x.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,x.jsx)("span",{className:"text-gray-900",children:(0,er.CN)(g)}),(eu||eh)&&(0,x.jsx)(E.Z,{className:"h-4 w-4 text-green-500"})]})}),!el&&(0,x.jsx)("button",{onClick:()=>{ep(!0),ef(g),eg(!1)},className:"p-2 text-gray-400 hover:text-gray-600 transition-colors",type:"button",children:(0,x.jsx)(T.Z,{className:"h-4 w-4"})})]})]})}},48328:function(m,g,v){"use strict";v.d(g,{Z:function(){return Banner}});var x=v(52322);v(2784);var k=v(25987),E=v(69405),T=v(7313),K=v(93227),et=v(38681);let en={info:{bg:"bg-blue-50",border:"border-blue-100",icon:"text-blue-500",title:"text-gray-800",text:"text-gray-600"},warning:{bg:"bg-amber-50",border:"border-amber-200",icon:"text-amber-500",title:"text-amber-900",text:"text-amber-700"},error:{bg:"bg-red-50",border:"border-red-200",icon:"text-red-500",title:"text-red-900",text:"text-red-700"},success:{bg:"bg-emerald-50",border:"border-emerald-200",icon:"text-emerald-500",title:"text-emerald-900",text:"text-emerald-700"},required:{bg:"bg-pink-50",border:"border-pink-200",icon:"text-pink-500",title:"text-pink-800",text:"text-pink-600"}},er={info:E.Z,warning:T.Z,error:K.Z,success:et.Z,required:K.Z};function Banner(m){let{variant:g="info",title:v,description:E,className:T,action:K,secondaryAction:et}=m,ei=en[g],es=er[g];return(0,x.jsx)("div",{className:(0,k.cn)("p-3 rounded-xl border",ei.bg,ei.border,T),children:(0,x.jsxs)("div",{className:"flex items-start gap-2",children:[(0,x.jsx)(es,{className:(0,k.cn)("w-5 h-5 flex-shrink-0 mt-0.5",ei.icon)}),(0,x.jsxs)("div",{className:"flex-1 min-w-0",children:[v&&(0,x.jsx)("p",{className:(0,k.cn)("text-sm font-medium mb-0.5",ei.title),children:v}),(0,x.jsx)("p",{className:(0,k.cn)("text-xs leading-relaxed",ei.text),children:E}),(K||et)&&(0,x.jsxs)("div",{className:"flex items-center gap-4 mt-2",children:[K&&(0,x.jsx)("button",{onClick:K.onClick,className:(0,k.cn)("text-xs font-semibold hover:underline",ei.icon),children:K.label}),et&&(0,x.jsx)("button",{onClick:et.onClick,className:(0,k.cn)("text-xs font-semibold hover:underline",ei.text),children:et.label})]})]})]})})}},35115:function(m,g,v){"use strict";v.d(g,{Z:function(){return ImagePreviewModal}});var x=v(52322),k=v(2784),E=v(4028),T=v(48618),K=v(28115),et=v(79654);function ImagePreviewModal(m){let{isOpen:g,onClose:v,imageUrl:en,imageName:er="Imagen",onDelete:ei,deleteLabel:es="Eliminar"}=m,[el,ec]=(0,k.useState)(1),[eu,ed]=(0,k.useState)({x:0,y:0}),[ep,em]=(0,k.useState)(!1),[ef,eh]=(0,k.useState)({x:0,y:0}),eg=(0,k.useCallback)(()=>{ec(1),ed({x:0,y:0}),em(!1)},[]),ev=(0,k.useCallback)(()=>{eg(),v()},[v,eg]),ey=(0,k.useCallback)(()=>{ec(m=>Math.min(m+.5,4))},[]),eb=(0,k.useCallback)(()=>{ec(m=>{let g=Math.max(m-.5,.5);return 1===g&&ed({x:0,y:0}),g})},[]),ex=(0,k.useCallback)(m=>{el>1&&(m.preventDefault(),em(!0),eh({x:m.clientX-eu.x,y:m.clientY-eu.y}))},[el,eu]),e_=(0,k.useCallback)(m=>{ep&&el>1&&ed({x:m.clientX-ef.x,y:m.clientY-ef.y})},[ep,el,ef]),ew=(0,k.useCallback)(()=>{em(!1)},[]),eS=(0,k.useCallback)(()=>{ei&&(ei(),ev())},[ei,ev]);return g?(0,x.jsxs)("div",{className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center",onClick:ev,children:[(0,x.jsx)("button",{onClick:ev,className:"absolute top-4 right-4 z-20 p-2 bg-white rounded-full shadow-lg hover:bg-gray-100 transition-colors",children:(0,x.jsx)(E.Z,{className:"w-6 h-6 text-gray-700"})}),(0,x.jsxs)("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-20 flex items-center gap-2 bg-white/90 backdrop-blur rounded-full px-3 py-1.5 shadow-lg",children:[(0,x.jsx)("button",{onClick:m=>{m.stopPropagation(),eb()},className:"p-1.5 hover:bg-gray-200 rounded-full transition-colors disabled:opacity-50",disabled:el<=.5,children:(0,x.jsx)(T.Z,{className:"w-5 h-5 text-gray-700"})}),(0,x.jsxs)("span",{className:"text-sm font-medium text-gray-700 min-w-[3rem] text-center",children:[Math.round(100*el),"%"]}),(0,x.jsx)("button",{onClick:m=>{m.stopPropagation(),ey()},className:"p-1.5 hover:bg-gray-200 rounded-full transition-colors disabled:opacity-50",disabled:el>=4,children:(0,x.jsx)(K.Z,{className:"w-5 h-5 text-gray-700"})})]}),(0,x.jsx)("div",{className:"relative w-full h-full flex items-center justify-center overflow-hidden",onMouseDown:ex,onMouseMove:e_,onMouseUp:e
6w,onMouseLeave:ew,onClick:m=>m.stopPropagation(),style:{cursor:el>1?ep?"grabbing":"grab":"default"},children:(0,x.jsx)("img",{src:en,alt:er,className:"max-w-full max-h-[85vh] object-contain rounded-lg select-none",style:{transform:"scale(".concat(el,") translate(").concat(eu.x/el,"px, ").concat(eu.y/el,"px)"),transition:ep?"none":"transform 0.2s ease-out"},draggable:!1})}),(0,x.jsxs)("div",{className:"absolute bottom-6 left-0 right-0 flex justify-center gap-3 z-20",children:[(0,x.jsx)("button",{onClick:m=>{m.stopPropagation(),ev()},className:"px-4 py-2 bg-white text-gray-700 text-sm font-medium rounded-lg hover:bg-gray-100 transition-colors shadow-lg",children:"Cerrar"}),ei&&(0,x.jsxs)("button",{onClick:m=>{m.stopPropagation(),eS()},className:"px-4 py-2 bg-red-500 text-white text-sm font-medium rounded-lg hover:bg-red-600 transition-colors flex items-center gap-2 shadow-lg",children:[(0,x.jsx)(et.Z,{className:"w-4 h-4"}),es]})]})]}):null}},70333:function(m,g,v){"use strict";v.d(g,{o:function(){return QueryStatus}});var x=v(52322);v(2784);var k=v(49759),E=v(25987),T=v(93829),K=v(68344),et=v(89644);function QueryStatus(m){let{isLoading:g,isError:v,error:en,refetch:er,className:ei,fullPageSize:es,data:el,loadingMessage:ec,errorMessage:eu,errorDescription:ed,children:ep}=m;if(g)return es?(0,x.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,x.jsx)(k.Z,{className:"animate-spin w-16 h-16"})}):(0,x.jsxs)("div",{className:(0,E.cn)("flex flex-col items-center justify-center",ei),children:[(0,x.jsx)(k.Z,{className:"animate-spin w-6 h-6"}),ec&&(0,x.jsx)("p",{className:"text-gray-600 mt-2",children:ec})]});if(v){let m=function(m){let g;if(!m)return{message:"Ocurri\xf3 un error",description:"Verifica que la informaci\xf3n sea correcta o intenta nuevamente."};switch(m instanceof K.o?g=m.statusCode:m instanceof et.AxiosError&&m.response&&(g=m.response.status),g){case 404:return{statusCode:404,message:"Recurso no encontrado",description:"El recurso que buscas no existe o fue eliminado."};case 403:return{statusCode:403,message:"Sin permisos",description:"No tienes permiso para acceder a este recurso."};case 401:return{statusCode:401,message:"Sesi\xf3n expirada",description:"Tu sesi\xf3n ha expirado. Por favor, inicia sesi\xf3n nuevamente."};case 500:case 502:case 503:case 504:return{statusCode:g,message:"Error del servidor",description:"Hubo un problema en el servidor. Por favor, intenta m\xe1s tarde."};default:{let v=m instanceof Error?m.message:void 0;return{statusCode:g,message:v||"Ocurri\xf3 un error",description:"Verifica que la informaci\xf3n sea correcta o intenta nuevamente."}}}}(en),g=eu||m.message,v=ed||m.description;return(0,x.jsx)("div",{className:(0,E.cn)("flex flex-col items-center justify-center",es?"min-h-[400px]":"py-6",ei),children:(0,x.jsxs)("div",{className:"text-center max-w-md px-6",children:[(0,x.jsx)("div",{className:"mb-3",children:(0,x.jsx)("svg",{className:"mx-auto h-10 w-10 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,x.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,x.jsx)("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:g}),(0,x.jsx)("p",{className:"text-sm text-gray-500 mb-4",children:v}),er&&(0,x.jsx)(T.z,{variant:"brand",onClick:()=>er(),className:"mx-auto",children:"Reintentar"})]})})}return void 0!==ep?el?(0,x.jsx)(x.Fragment,{children:ep}):(0,x.jsx)("div",{className:(0,E.cn)("flex flex-col items-center justify-center py-12",ei),children:(0,x.jsx)("p",{className:"text-gray-500",children:"No hay datos disponibles"})}):null}},19496:function(m,g,v){"use strict";v.d(g,{Cd:function(){return en},X:function(){return er},bZ:function(){return et}});var x=v(52322),k=v(2784),E=v(10929),T=v(25987);let K=(0,E.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-admin-warning/40 bg-admin-warning/10 text-admin-foreground [&>svg]:text-admin-warning"}},defaultVariants:{variant:"default"}}),et=k.forwardRef((m,g)=>{let{className:v,variant:k,...E}=m;return(0,x.jsx)("div",{ref:g,role:"alert",className:(0,T.cn)(K({variant:k}),v),...E})});et.displayName="Alert";let en=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)("h5",{ref:g,className:(0,T.cn)("mb-1 font-medium leading-none tracking-tight",v),...k})});en.displayName="AlertTitle";let er=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)("div",{ref:g,className:(0,T.cn)("text-sm [&_p]:leading-relaxed",v),...k})});er.displayName="AlertDescription"},87779:function(m,g,v){"use strict";v.d(g,{C:function(){return Badge}});var x=v(52322);v(2784);var k=v(10929),E=v(25987);let T=(0,k.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",warning:"border-transparent bg-admin-warning text-admin-warning-foreground hover:bg-admin-warning/80",success:"border-transparent bg-admin-success text-admin-success-foreground hover:bg-admin-success/80",error:"border-transparent bg-admin-error text-admin-error-foreground hover:bg-admin-error/80",info:"border-transparent bg-admin-info text-admin-info-foreground hover:bg-admin-info/80",muted:"border-transparent bg-admin-muted text-admin-muted-foreground",critical:"border-transparent bg-admin-critical text-admin-critical-foreground hover:bg-admin-critical/80","warning-subtle":"border-transparent bg-admin-warning/15 text-admin-warning font-medium","success-subtle":"border-transparent bg-admin-success/15 text-admin-success font-medium","error-subtle":"border-transparent bg-admin-error/15 text-admin-error font-medium","info-subtle":"border-transparent bg-admin-info/15 text-admin-info font-medium","critical-subtle":"border-transparent bg-admin-critical/15 text-admin-critical font-medium","muted-subtle":"border-transparent bg-admin-muted/50 text-admin-muted-foreground font-medium"}},defaultVariants:{variant:"default"}});function Badge(m){let{className:g,variant:v,...k}=m;return(0,x.jsx)("div",{className:(0,E.cn)(T({variant:v}),g),...k})}},93829:function(m,g,v){"use strict";v.d(g,{z:function(){return ec},d:function(){return el}});var x=v(52322),k=v(2784),E=v.t(k,2);function setRef(m,g){if("function"==typeof m)return m(g);null!=m&&(m.current=g)}var T=Symbol.for("react.lazy"),K=E[" use ".trim().toString()];function isLazyComponent(m){var g;return null!=m&&"object"==typeof m&&"$$typeof"in m&&m.$$typeof===T&&"_payload"in m&&"object"==typeof(g=m._payload)&&null!==g&&"then"in g}var et=function(m){let g=function(m){let g=k.forwardRef((m,g)=>{let{children:v,...x}=m;if(isLazyComponent(v)&&"function"==typeof K&&(v=K(v._payload)),k.isValidElement(v)){var E;let m,T;let K=(E=v,(m=Object.getOwnPropertyDescriptor(E.props,"ref")?.get)&&"isReactWarning"in m&&m.isReactWarning?E.ref:(m=Object.getOwnPropertyDescriptor(E,"ref")?.get)&&"isReactWarning"in m&&m.isReactWarning?E.props.ref:E.props.ref||E.ref),et=function(m,g){let v={...g};for(let x in g){let k=m[x],E=g[x],T=/^on[A-Z]/.test(x);T?k&&E?v[x]=(...m)=>{let g=E(...m);return k(...m),g}:k&&(v[x]=k):"style"===x?v[x]={...k,...E}
6:"className"===x&&(v[x]=[k,E].filter(Boolean).join(" "))}return{...m,...v}}(x,v.props);return v.type!==k.Fragment&&(et.ref=g?function(...m){return g=>{let v=!1,x=m.map(m=>{let x=setRef(m,g);return v||"function"!=typeof x||(v=!0),x});if(v)return()=>{for(let g=0;g<x.length;g++){let v=x[g];"function"==typeof v?v():setRef(m[g],null)}}}}(g,K):K),k.cloneElement(v,et)}return k.Children.count(v)>1?k.Children.only(null):null});return g.displayName=`${m}.SlotClone`,g}(m),v=k.forwardRef((m,v)=>{let{children:E,...T}=m;isLazyComponent(E)&&"function"==typeof K&&(E=K(E._payload));let et=k.Children.toArray(E),en=et.find(isSlottable);if(en){let m=en.props.children,E=et.map(g=>g!==en?g:k.Children.count(m)>1?k.Children.only(null):k.isValidElement(m)?m.props.children:null);return(0,x.jsx)(g,{...T,ref:v,children:k.isValidElement(m)?k.cloneElement(m,void 0,E):null})}return(0,x.jsx)(g,{...T,ref:v,children:E})});return v.displayName=`${m}.Slot`,v}("Slot"),en=Symbol("radix.slottable");function isSlottable(m){return k.isValidElement(m)&&"function"==typeof m.type&&"__radixId"in m.type&&m.type.__radixId===en}var er=v(10929),ei=v(49759),es=v(25987);let el=(0,er.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90","destructive-outline":"border border-destructive text-destructive bg-background shadow-sm hover:bg-destructive/10",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",brand:"bg-blue-500 text-white hover:bg-blue-600 rounded-full font-bold disabled:bg-neutral-100 disabled:text-neutral-300 disabled:opacity-100","brand-destructive":"bg-pink-600 text-white hover:bg-pink-700 rounded-full font-bold disabled:bg-neutral-100 disabled:text-neutral-300 disabled:opacity-100","brand-outline":"border border-blue-500 text-blue-500 bg-transparent hover:bg-blue-50 rounded-full font-bold disabled:bg-neutral-100 disabled:text-neutral-300 disabled:border-neutral-100 disabled:opacity-100","brand-destructive-outline":"border border-pink-600 text-pink-600 bg-transparent hover:bg-pink-50 rounded-full font-bold disabled:bg-neutral-100 disabled:text-neutral-300 disabled:border-neutral-100 disabled:opacity-100","brand-link":"text-blue-500 underline underline-offset-[6px] hover:text-blue-600 font-bold disabled:text-neutral-300 disabled:opacity-100","muted-link":"text-neutral-500 underline underline-offset-[6px] hover:text-neutral-600 font-bold disabled:text-neutral-300 disabled:opacity-100","brand-destructive-link":"text-pink-600 underline underline-offset-[6px] hover:text-pink-700 font-bold disabled:text-neutral-300 disabled:opacity-100","brand-ghost":"text-blue-500 hover:text-blue-600 font-bold disabled:text-neutral-300 disabled:opacity-100","brand-destructive-ghost":"text-pink-600 hover:text-pink-700 font-bold disabled:text-neutral-300 disabled:opacity-100"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"h-10 px-8",icon:"h-9 w-9",full:"w-full py-2.5"}},defaultVariants:{variant:"default",size:"default"}}),ec=k.forwardRef((m,g)=>{let{className:v,variant:k,size:E,asChild:T=!1,loading:K,onClick:en,children:er,iconLeft:ec,iconRight:eu,...ed}=m,ep=T?et:"button";if(T)return(0,x.jsx)(ep,{className:(0,es.cn)(el({variant:k,size:E,className:v})),ref:g,onClick:en,...ed,children:er});let em=(0,x.jsxs)(x.Fragment,{children:[ec,er,eu]});return(0,x.jsxs)(ep,{className:(0,es.cn)(el({variant:k,size:E,className:v}),K&&"relative"),ref:g,onClick:K?void 0:en,...ed,children:[K&&(0,x.jsx)("span",{className:"absolute inset-0 flex items-center justify-center",children:(0,x.jsx)(ei.Z,{className:"!size-5 animate-spin"})}),K?(0,x.jsx)("span",{className:"invisible",children:em}):em]})});ec.displayName="Button"},74263:function(m,g,v){"use strict";v.d(g,{X:function(){return eb}});var x=v(52322),k=v(2784),E=v(62656),T=v(92211),K=v(17998),et=v(81057),en=v(35019),er=v(79616),ei=v(72714),es=Object.defineProperty,__name=(m,g)=>es(m,"name",{value:g,configurable:!0}),el="Checkbox",[ec,eu]=(0,T.b)(el),[ed,ep]=ec(el);
6function CheckboxProvider(m){let{__scopeCheckbox:g,checked:v,children:E,defaultChecked:T,disabled:K,form:en,name:er,onCheckedChange:ei,required:es,value:ec="on",internal_do_not_use_render:eu}=m,[ep,em]=(0,et.T)({prop:v,defaultProp:T??!1,onChange:ei,caller:el}),[ef,eh]=k.useState(null),[eg,ev]=k.useState(null),ey=k.useRef(!1),[eb,ex]=k.useReducer(m=>m+1,0),e_=!ef||!!en||!!ef.closest("form"),ew={checked:ep,disabled:K,setChecked:em,control:ef,setControl:eh,name:er,form:en,value:ec,hasConsumerStoppedPropagationRef:ey,userInteractionCount:eb,onUserInteraction:ex,required:es,defaultChecked:!isIndeterminate(T)&&T,isFormControl:e_,bubbleInput:eg,setBubbleInput:ev};return(0,x.jsx)(ed,{scope:g,...ew,children:isFunction(eu)?eu(ew):E})}__name(CheckboxProvider,"CheckboxProvider");var em=k.forwardRef(__name(function({__scopeCheckbox:m,onKeyDown:g,onClick:v,...T},et){let{control:en,value:er,disabled:es,checked:el,required:ec,setControl:eu,setChecked:ed,hasConsumerStoppedPropagationRef:em,onUserInteraction:ef,isFormControl:eh,bubbleInput:eg}=ep("CheckboxTrigger",m),ev=(0,E.e)(et,eu),ey=k.useRef(el);return k.useEffect(()=>{let m=en?.form;if(m){let g=__name(()=>ed(ey.current),"reset");return m.addEventListener("reset",g),()=>m.removeEventListener("reset",g)}},[en,ed]),(0,x.jsx)(ei.WV.button,{type:"button",role:"checkbox","aria-checked":isIndeterminate(el)?"mixed":el,"aria-required":ec,"data-state":getState(el),"data-disabled":es?"":void 0,disabled:es,value:er,...T,ref:ev,onKeyDown:(0,K.Mj)(g,m=>{"Enter"===m.key&&m.preventDefault()}),onClick:(0,K.Mj)(v,m=>{ef(),ed(m=>!!isIndeterminate(m)||!m),eg&&eh&&(em.current=m.isPropagationStopped(),em.current||m.stopPropagation())})})},"CheckboxTrigger")),ef=k.forwardRef(__name(function(m,g){let{__scopeCheckbox:v,name:k,checked:E,defaultChecked:T,required:K,disabled:et,value:en,onCheckedChange:er,form:ei,...es}=m;return(0,x.jsx)(CheckboxProvider,{__scopeCheckbox:v,checked:E,defaultChecked:T,disabled:et,required:K,onCheckedChange:er,name:k,form:ei,value:en,internal_do_not_use_render:({isFormControl:m})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(em,{...es,ref:g,__scopeCheckbox:v}),m&&(0,x.jsx)(eg,{__scopeCheckbox:v})]})})},"Checkbox")),eh=k.forwardRef(__name(function(m,g){let{__scopeCheckbox:v,forceMount:k,...E}=m,T=ep("CheckboxIndicator",v);return(0,x.jsx)(er.z,{present:k||isIndeterminate(T.checked)||!0===T.checked,children:(0,x.jsx)(ei.WV.span,{"data-state":getState(T.checked),"data-disabled":T.disabled?"":void 0,...E,ref:g,style:{pointerEvents:"none",...m.style}})})},"CheckboxIndicator")),eg=k.forwardRef(__name(function({__scopeCheckbox:m,onClick:g,...v},T){let{control:et,hasConsumerStoppedPropagationRef:er,userInteractionCount:es,checked:el,defaultChecked:ec,required:eu,disabled:ed,name:em,value:ef,form:eh,bubbleInput:eg,setBubbleInput:ev}=ep("CheckboxBubbleInput",m),ey=(0,E.e)(T,ev),eb=(0,en.t)(et),ex=k.useRef(!1),e_=k.useRef(el),ew=k.useRef(es);k.useEffect(()=>{if(!eg)return;let m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked"),v=g.set,x=es!==ew.current;ew.current=es;let k=e_.current!==el;e_.current=el;let E=!(x&&er.current);if(k&&v){ex.current=!x;let m=new Event("click",{bubbles:E});eg.indeterminate=isIndeterminate(el),v.call(eg,!isIndeterminate(el)&&el),eg.dispatchEvent(m),ex.current=!1}},[eg,el,er,es]);let eS=k.useRef(!isIndeterminate(el)&&el);return(0,x.jsx)(ei.WV.input,{type:"checkbox","aria-hidden":!0,defaultChecked:ec??eS.current,required:eu,disabled:ed,name:em,value:ef,form:eh,...v,tabIndex:-1,ref:ey,onClick:(0,K.Mj)(g,m=>{ex.current&&m.stopPropagation()}),style:{...v.style,...eb,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function isFunction(m){return"function"==typeof m}function isIndeterminate(m){return"indeterminate"===m}function getState(m){return isIndeterminate(m)?"indeterminate":m?"checked":"unchecked"}__name(isFunction,"isFunction"),__name(isIndeterminate,"isIndeterminate"),__name(getState,"getState");var ev=v(6342),ey=v(25987);let eb=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(ef,{ref:g,className:(0,ey.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",v),...k,children:(0,x.jsx)(eh,{className:(0,ey.cn)("flex items-center justify-center text-current"),children:(0,x.jsx)(ev.Z,{className:"h-4 w-4"})})})});
6eb.displayName=ef.displayName},36479:function(m,g,v){"use strict";v.d(g,{zF:function(){return eb},Fw:function(){return e_},wy:function(){return ex}});var x=v(2784),k=v(17998),E=v(92211),T=v(81057),K=v(61644),et=v(62656),en=v(72714),er=v(79616),ei=v(23372),es=v(52322),el=Object.defineProperty,__name=(m,g)=>el(m,"name",{value:g,configurable:!0}),ec="Collapsible",[eu,ed]=(0,E.b)(ec),[ep,em]=eu(ec),ef=x.forwardRef(__name(function(m,g){let{__scopeCollapsible:v,open:k,defaultOpen:E,disabled:K,onOpenChange:et,...er}=m,[el,eu]=(0,T.T)({prop:k,defaultProp:E??!1,onChange:et,caller:ec});return(0,es.jsx)(ep,{scope:v,disabled:K,contentId:(0,ei.M)(),open:el,onOpenToggle:x.useCallback(()=>eu(m=>!m),[eu]),children:(0,es.jsx)(en.WV.div,{"data-state":getState(el),"data-disabled":K?"":void 0,...er,ref:g})})},"Collapsible")),eh=x.forwardRef(__name(function(m,g){let{__scopeCollapsible:v,...x}=m,E=em("CollapsibleTrigger",v);return(0,es.jsx)(en.WV.button,{type:"button","aria-controls":E.open?E.contentId:void 0,"aria-expanded":E.open||!1,"data-state":getState(E.open),"data-disabled":E.disabled?"":void 0,disabled:E.disabled,...x,ref:g,onClick:(0,k.Mj)(m.onClick,E.onOpenToggle)})},"CollapsibleTrigger")),eg="CollapsibleContent",ev=x.forwardRef(__name(function(m,g){let{forceMount:v,...x}=m,k=em(eg,m.__scopeCollapsible);return(0,es.jsx)(er.z,{present:v||k.open,children:({present:m})=>(0,es.jsx)(ey,{...x,ref:g,present:m})})},"CollapsibleContent")),ey=x.forwardRef(__name(function(m,g){let{__scopeCollapsible:v,present:k,children:E,...T}=m,er=em(eg,v),[ei,el]=x.useState(k),ec=x.useRef(null),eu=(0,et.e)(g,ec),ed=x.useRef(0),ep=ed.current,ef=x.useRef(0),eh=ef.current,ev=er.open||ei,ey=x.useRef(ev),eb=x.useRef(void 0);return x.useEffect(()=>{let m=requestAnimationFrame(()=>ey.current=!1);return()=>cancelAnimationFrame(m)},[]),(0,K.b)(()=>{let m=ec.current;if(m){eb.current=eb.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";let g=m.getBoundingClientRect();ed.current=g.height,ef.current=g.width,ey.current||(m.style.transitionDuration=eb.current.transitionDuration,m.style.animationName=eb.current.animationName),el(k)}},[er.open,k]),(0,es.jsx)(en.WV.div,{"data-state":getState(er.open),"data-disabled":er.disabled?"":void 0,id:er.contentId,hidden:!ev,...T,ref:eu,style:{"--radix-collapsible-content-height":ep?`${ep}px`:void 0,"--radix-collapsible-content-width":eh?`${eh}px`:void 0,...m.style},children:ev&&E})},"CollapsibleContentImpl"));function getState(m){return m?"open":"closed"}__name(getState,"getState");let eb=ef,ex=eh,e_=ev},81171:function(m,g,v){"use strict";v.d(g,{Z:function(){return Combobox}});var x=v(52322),k=v(2784),E=v(25987),T=v(65323),K=v(5116),et=v(26025);function Combobox(m){let[g,v]=(0,k.useState)(!1),[en,er]=(0,k.useState)(""),ei=(0,k.useRef)(null),es=(0,k.useRef)(null),el=(0,k.useRef)(null),ec=(0,T.s)(el),eu=""===en?m.options:m.options.filter(m=>m.label.toLowerCase().includes(en.toLowerCase())),ed=(()=>{var g;if(void 0===m.selectedValue||null===m.selectedValue)return"";let v=m.options.find(g=>g.value===m.selectedValue);return null!==(g=null==v?void 0:v.label)&&void 0!==g?g:""})(),handleSelect=g=>{let x=m.options.find(m=>String(m.value)===g);x&&m.setSelectedValue(x.value),er(""),v(!1)};return(0,x.jsx)("div",{className:"relative",ref:el,children:(0,x.jsxs)(et.J2,{open:g,onOpenChange:m=>{v(m),m||er("")},children:[(0,x.jsx)(et.tW,{asChild:!0,children:(0,x.jsx)("input",{ref:ei,type:"text",value:g?en:ed,onChange:m=>{er(m.target.value),g||v(!0)},onFocus:()=>{er(""),v(!0)},placeholder:m.placeholder,className:(0,E.cn)("w-full border pl-4 py-2.5 placeholder:text-neutral-300 rounded-md",m.inputClassName,m.isError?"border-pink-600":"border-gray-300"),autoComplete:"off"})}),(0,x.jsx)(et.yk,{ref:es,container:ec,className:"p-0 w-[--radix-popover-trigger-width]",onOpenAutoFocus:m=>m.preventDefault(),onInteractOutside:m=>{m.target===ei.current&&m.preventDefault()},children:(0,x.jsx)(K.mY,{shouldFilter:!1,children:(0,x.jsx)(K.e8,{children:0===eu.length?(0,x.jsx)(K.rb,{children:"Sin resultados."}):(0,x.jsx)(K.fu,{children:eu.map(m=>(0,x.jsx)(K.di,{value:String(m.value),onSelect:handleSelect,onMouseDown:m=>m.preventDefault(),className:"cursor-pointer",children:(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{children:m.label}),m.description&&(0,x.jsx)("div",{className:"text-xs mt-0.5 text-muted-foreground",children:m.description})]})},String(m.value)))})})})})]})})}},5116:function(m,g,v){"use strict";v.d(g,{mY:function(){return eM},m5:function(){return CommandDialog},rb:function(){return eF},fu:function(){return eZ},sZ:function(){return eD},di:function(){return e$},e8:function(){return eL},Oc:function(){return CommandShortcut}});var x=v(52322),k=v(2784),E=v.t(k,2),T=/[\\\/_+.#"@\[\(\{&]/,K=/[\\\/_+.#"@\[\(\{&]/g,et=/[\s-]/,en=/[\s-]/g;function D(m){return m.toLowerCase().replace(en," ")}var er=v(11915);function setRef(m,g){if("function"==typeof m)return m(g);null!=m&&(m.current=g)}function composeRefs(...m){return g=>{let v=!1,x=m.map(m=>{let x=setRef(m,g);return v||"function"!=typeof x||(v=!0),x});if(v)return()=>{for(let g=0;g<x.length;g++){let v=x[g];"function"==typeof v?v():setRef(m[g],null)}}}}v(28316);var ei=Symbol.for("react.lazy"),es=E[" use ".trim().toString()];function isLazyComponent(m){var g;return null!=m&&"object"==typeof m&&"$$typeof"in m&&m.$$typeof===ei&&"_payload"in m&&"object"==typeof(g=m._payload)&&null!==g&&"then"in g}var el=Symbol("radix.slottable");function isSlottable(m){return k.isValidElement(m)&&"function"==typeof m.type&&"__radixId"in m.type&&m.type.__radixId===el}var ec=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((m,g)=>{let v=function(m){let g=function(m){let g=k.forwardRef((m,g)=>{let{children:v,...x}=m;if(isLazyComponent(v)&&"function"==typeof es&&(v=es(v._payload)),k.isValidElement(v)){var E;let m,T;let K=(E=v,(m=Object.getOwnPropertyDescriptor(E.props,"ref")?.get)&&"isReactWarning"in m&&m.isReactWarning?E.ref:(m=Object.getOwnPropertyDescriptor(E,"ref")?.get)&&"isReactWarning"in m&&m.isReactWarning?E.props.ref:E.props.ref||E.ref),et=function(m,g){let v={...g};for(let x in g){let k=m[x],E=g[x],T=/^on[A-Z]/.test(x);T?k&&E?v[x]=(...m)=>{let g=E(...m);return k(...m),g}:k&&(v[x]=k):"style"===x?v[x]={...k,...E}
6:"className"===x&&(v[x]=[k,E].filter(Boolean).join(" "))}return{...m,...v}}(x,v.props);return v.type!==k.Fragment&&(et.ref=g?composeRefs(g,K):K),k.cloneElement(v,et)}return k.Children.count(v)>1?k.Children.only(null):null});return g.displayName=`${m}.SlotClone`,g}(m),v=k.forwardRef((m,v)=>{let{children:E,...T}=m;isLazyComponent(E)&&"function"==typeof es&&(E=es(E._payload));let K=k.Children.toArray(E),et=K.find(isSlottable);if(et){let m=et.props.children,E=K.map(g=>g!==et?g:k.Children.count(m)>1?k.Children.only(null):k.isValidElement(m)?m.props.children:null);return(0,x.jsx)(g,{...T,ref:v,children:k.isValidElement(m)?k.cloneElement(m,void 0,E):null})}return(0,x.jsx)(g,{...T,ref:v,children:E})});return v.displayName=`${m}.Slot`,v}(`Primitive.${g}`),E=k.forwardRef((m,k)=>{let{asChild:E,...T}=m,K=E?v:g;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,x.jsx)(K,{...T,ref:k})});return E.displayName=`Primitive.${g}`,{...m,[g]:E}},{}),eu=globalThis?.document?k.useLayoutEffect:()=>{},ed=E[" useId ".trim().toString()]||(()=>void 0),ep=0;function useId(m){let[g,v]=k.useState(ed());return eu(()=>{m||v(m=>m??String(ep++))},[m]),m||(g?`radix-${g}`:"")}var em='[cmdk-group=""]',ef='[cmdk-group-items=""]',eh='[cmdk-item=""]',eg=`${eh}:not([aria-disabled="true"])`,ev="cmdk-item-select",ey="data-value",Re=(m,g,v)=>{var x;return x=m,function G(m,g,v,x,k,E,er){if(E===g.length)return k===m.length?1:.99;var ei=`${k},${E}`;if(void 0!==er[ei])return er[ei];for(var es,el,ec,eu,ed=x.charAt(E),ep=v.indexOf(ed,k),em=0;ep>=0;)(es=G(m,g,v,x,ep+1,E+1,er))>em&&(ep===k?es*=1:T.test(m.charAt(ep-1))?(es*=.8,(ec=m.slice(k,ep-1).match(K))&&k>0&&(es*=Math.pow(.999,ec.length))):et.test(m.charAt(ep-1))?(es*=.9,(eu=m.slice(k,ep-1).match(en))&&k>0&&(es*=Math.pow(.999,eu.length))):(es*=.17,k>0&&(es*=Math.pow(.999,ep-k))),m.charAt(ep)!==g.charAt(E)&&(es*=.9999)),(es<.1&&v.charAt(ep-1)===x.charAt(E+1)||x.charAt(E+1)===x.charAt(E)&&v.charAt(ep-1)!==x.charAt(E))&&.1*(el=G(m,g,v,x,ep+1,E+2,er))>es&&(es=.1*el),es>em&&(em=es),ep=v.indexOf(ed,ep+1);return er[ei]=em,em}(x=v&&v.length>0?`${x+" "+v.join(" ")}`:x,g,D(x),D(g),0,0,{})},eb=k.createContext(void 0),dist_K=()=>k.useContext(eb),ex=k.createContext(void 0),ee=()=>k.useContext(ex),e_=k.createContext(void 0),ew=k.forwardRef((m,g)=>{let v=L(()=>{var g,v;return{search:"",value:null!=(v=null!=(g=m.value)?g:m.defaultValue)?v:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),x=L(()=>new Set),E=L(()=>new Map),T=L(()=>new Map),K=L(()=>new Set),et=pe(m),{label:en,children:er,value:ei,onValueChange:es,filter:el,shouldFilter:eu,loop:ed,disablePointerSelection:ep=!1,vimBindings:e_=!0,...ew}=m,eS=useId(),eC=useId(),ek=useId(),eE=k.useRef(null),ej=ke();eI(()=>{if(void 0!==ei){let m=ei.trim();v.current.value=m,eN.emit()}},[ei]),eI(()=>{ej(6,ne)},[]);let eN=k.useMemo(()=>({subscribe:m=>(K.current.add(m),()=>K.current.delete(m)),snapshot:()=>v.current,setState:(m,g,x)=>{var k,E,T,K;if(!Object.is(v.current[m],g)){if(v.current[m]=g,"search"===m)J(),z(),ej(1,W);else if("value"===m){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let m=document.getElementById(ek);m?m.focus():null==(k=document.getElementById(eS))||k.focus()}if(ej(7,()=>{var m;v.current.selectedItemId=null==(m=M())?void 0:m.id,eN.emit()}),x||ej(5,ne),(null==(E=et.current)?void 0:E.value)!==void 0){let m=null!=g?g:"";null==(K=(T=et.current).onValueChange)||K.call(T,m);return}}eN.emit()}},emit:()=>{K.current.forEach(m=>m())}}),[]),eR=k.useMemo(()=>({value:(m,g,x)=>{var k;g!==(null==(k=T.current.get(m))?void 0:k.value)&&(T.current.set(m,{value:g,keywords:x}),v.current.filtered.items.set(m,te(g,x)),ej(2,()=>{z(),eN.emit()}))},item:(m,g)=>(x.current.add(m),g&&(E.current.has(g)?E.current.get(g).add(m):E.current.set(g,new Set([m]))),ej(3,()=>{J(),z(),v.current.value||W(),eN.emit()}),()=>{T.current.delete(m),x.current.delete(m),v.current.filtered.items.delete(m);let g=M();ej(4,()=>{J(),(null==g?void 0:g.getAttribute("id"))===m&&W(),eN.emit()})}),group:m=>(E.current.has(m)||E.current.set(m,new Set),()=>{T.current.delete(m),E.current.delete(m)}),filter:()=>et.current.shouldFilter,label:en||m["aria-label"],getDisablePointerSelection:()=>et.current.disablePointerSelection,listId:eS,inputId:ek,labelId:eC,listInnerRef:eE}),[]);function te(m,g){var x,k;let E=null!=(k=null==(x=et.current)?void 0:x.filter)?k:Re;return m?E(m,v.current.search,g):0}function z(){if(!v.current.search||!1===et.current.shouldFilter)return;let m=v.current.filtered.items,g=[];v.current.filtered.groups.forEach(v=>{let x=E.current.get(v),k=0;x.forEach(g=>{k=Math.max(m.get(g),k)}
6),g.push([v,k])});let x=eE.current;V().sort((g,v)=>{var x,k;let E=g.getAttribute("id"),T=v.getAttribute("id");return(null!=(x=m.get(T))?x:0)-(null!=(k=m.get(E))?k:0)}).forEach(m=>{let g=m.closest(ef);g?g.appendChild(m.parentElement===g?m:m.closest(`${ef} > *`)):x.appendChild(m.parentElement===x?m:m.closest(`${ef} > *`))}),g.sort((m,g)=>g[1]-m[1]).forEach(m=>{var g;let v=null==(g=eE.current)?void 0:g.querySelector(`${em}[${ey}="${encodeURIComponent(m[0])}"]`);null==v||v.parentElement.appendChild(v)})}function W(){let m=V().find(m=>"true"!==m.getAttribute("aria-disabled")),g=null==m?void 0:m.getAttribute(ey);eN.setState("value",g||void 0)}function J(){var m,g,k,K;if(!v.current.search||!1===et.current.shouldFilter){v.current.filtered.count=x.current.size;return}v.current.filtered.groups=new Set;let en=0;for(let E of x.current){let x=te(null!=(g=null==(m=T.current.get(E))?void 0:m.value)?g:"",null!=(K=null==(k=T.current.get(E))?void 0:k.keywords)?K:[]);v.current.filtered.items.set(E,x),x>0&&en++}for(let[m,g]of E.current)for(let x of g)if(v.current.filtered.items.get(x)>0){v.current.filtered.groups.add(m);break}v.current.filtered.count=en}function ne(){var m,g,v;let x=M();x&&((null==(m=x.parentElement)?void 0:m.firstChild)===x&&(null==(v=null==(g=x.closest(em))?void 0:g.querySelector('[cmdk-group-heading=""]'))||v.scrollIntoView({block:"nearest"})),x.scrollIntoView({block:"nearest"}))}function M(){var m;return null==(m=eE.current)?void 0:m.querySelector(`${eh}[aria-selected="true"]`)}function V(){var m;return Array.from((null==(m=eE.current)?void 0:m.querySelectorAll(eg))||[])}function X(m){let g=V()[m];g&&eN.setState("value",g.getAttribute(ey))}function Q(m){var g;let v=M(),x=V(),k=x.findIndex(m=>m===v),E=x[k+m];null!=(g=et.current)&&g.loop&&(E=k+m<0?x[x.length-1]:k+m===x.length?x[0]:x[k+m]),E&&eN.setState("value",E.getAttribute(ey))}function re(m){let g=M(),v=null==g?void 0:g.closest(em),x;for(;v&&!x;)x=null==(v=m>0?function(m,g){let v=m.nextElementSibling;for(;v;){if(v.matches(g))return v;v=v.nextElementSibling}}(v,em):function(m,g){let v=m.previousElementSibling;for(;v;){if(v.matches(g))return v;v=v.previousElementSibling}}(v,em))?void 0:v.querySelector(eg);x?eN.setState("value",x.getAttribute(ey)):Q(m)}let oe=()=>X(V().length-1),ie=m=>{m.preventDefault(),m.metaKey?oe():m.altKey?re(1):Q(1)},se=m=>{m.preventDefault(),m.metaKey?X(0):m.altKey?re(-1):Q(-1)};return k.createElement(ec.div,{ref:g,tabIndex:-1,...ew,"cmdk-root":"",onKeyDown:m=>{var g;null==(g=ew.onKeyDown)||g.call(ew,m);let v=m.nativeEvent.isComposing||229===m.keyCode;if(!(m.defaultPrevented||v))switch(m.key){case"n":case"j":e_&&m.ctrlKey&&ie(m);break;case"ArrowDown":ie(m);break;case"p":case"k":e_&&m.ctrlKey&&se(m);break;case"ArrowUp":se(m);break;case"Home":m.preventDefault(),X(0);break;case"End":m.preventDefault(),oe();break;case"Enter":{m.preventDefault();let g=M();if(g){let m=new Event(ev);g.dispatchEvent(m)}}}}},k.createElement("label",{"cmdk-label":"",htmlFor:eR.inputId,id:eR.labelId,style:eP},en),dist_B(m,m=>k.createElement(ex.Provider,{value:eN},k.createElement(eb.Provider,{value:eR},m))))}),eS=k.forwardRef((m,g)=>{var v,x;let E=useId(),T=k.useRef(null),K=k.useContext(e_),et=dist_K(),en=pe(m),er=null!=(x=null==(v=en.current)?void 0:v.forceMount)?x:null==K?void 0:K.forceMount;eI(()=>{if(!er)return et.item(E,null==K?void 0:K.id)},[er]);let ei=ve(E,T,[m.value,m.children,T],m.keywords),es=ee(),el=P(m=>m.value&&m.value===ei.current),eu=P(m=>!!er||!1===et.filter()||!m.search||m.filtered.items.get(E)>0);function C(){var m,g;S(),null==(g=(m=en.current).onSelect)||g.call(m,ei.current)}function S(){es.setState("value",ei.current,!0)}if(k.useEffect(()=>{let g=T.current;if(!(!g||m.disabled))return g.addEventListener(ev,C),()=>g.removeEventListener(ev,C)},[eu,m.onSelect,m.disabled]),!eu)return null;let{disabled:ed,value:ep,onSelect:em,forceMount:ef,keywords:eh,...eg}=m;return k.createElement(ec.div,{ref:composeRefs(T,g),...eg,id:E,"cmdk-item":"",role:"option","aria-disabled":!!ed,"aria-selected":!!el,"data-disabled":!!ed,"data-selected":!!el,onPointerMove:ed||et.getDisablePointerSelection()?void 0:S,onClick:ed?void 0:C},m.children)}),eC=k.forwardRef((m,g)=>{let{heading:v,children:x,forceMount:E,...T}=m,K=useId(),et=k.useRef(null),en=k.useRef(null),er=useId(),ei=dist_K(),es=P(m=>!!E||!1===ei.filter()||!m.search||m.filtered.groups.has(K));eI(()=>ei.group(K),[]),ve(K,et,[m.value,m.heading,en]);let el=k.useMemo(()=>({id:K,forceMount:E}),[E]);return k.createElement(ec.div,{ref:composeRefs(et,g),...T,"cmdk-group":"",role:"presentation",hidden:!es||void 0},v&&k.createElement("div",{ref:en,"cmdk-group-heading":"","aria-hidden":!0,id:er},v),dist_B(m,m=>k.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":v?er:void 0},k.createElement(e_.Provider,{value:el},m))))}),ek=k.forwardRef((m,g)=>{let{alwaysRender:v,...x}=m,E=k.useRef(null),T=P(m=>!m.search);return v||T?k.createElement(ec.div,{ref:composeRefs(E,g),...x,"cmdk-separator":"",role:"separator"}):null}),eE=k.forwardRef((m,g)=>{let{onValueChange:v,...x}=m,E=null!=m.value,T=ee(),K=P(m=>m.search),et=P(m=>m.selectedItemId),en=dist_K();return k.useEffect(()=>{null!=m.value&&T.setState("search",m.value)},[m.value]),k.createElement(ec.input,{ref:g,...x,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":en.listId,"aria-labelledby":en.labelId,"aria-activedescendant":et,id:en.inputId,type:"text",value:E?m.value:K,onChange:m=>{E||T.setState("search",m.target.value),null==v||v(m.target.value)}})}),ej=k.forwardRef((m,g)=>{let{children:v,label:x="Suggestions",...E}=m,T=k.useRef(null),K=k.useRef(null),et=P(m=>m.selectedItemId),en=dist_K();return k.useEffect(()=>{if(K.current&&T.current){let m=K.current,g=T.current,v,x=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let v=m.offsetHeight;g.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(v),x.unobserve(m)}}},[]),k.createElement(ec.div,{ref:composeRefs(T,g),...E,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":et,"aria-label":x,id:en.listId},dist_B(m,m=>k.createElement("div",{ref:composeRefs(K,en.listInnerRef),"cmdk-list-sizer":""},m)))}),eN=k.forwardRef((m,g)=>
6{let{open:v,onOpenChange:x,overlayClassName:E,contentClassName:T,container:K,...et}=m;return k.createElement(er.fC,{open:v,onOpenChange:x},k.createElement(er.h_,{container:K},k.createElement(er.aV,{"cmdk-overlay":"",className:E}),k.createElement(er.VY,{"aria-label":m.label,"cmdk-dialog":"",className:T},k.createElement(ew,{ref:g,...et}))))}),eR=Object.assign(ew,{List:ej,Item:eS,Input:eE,Group:eC,Separator:ek,Dialog:eN,Empty:k.forwardRef((m,g)=>P(m=>0===m.filtered.count)?k.createElement(ec.div,{ref:g,...m,"cmdk-empty":"",role:"presentation"}):null),Loading:k.forwardRef((m,g)=>{let{progress:v,children:x,label:E="Loading...",...T}=m;return k.createElement(ec.div,{ref:g,...T,"cmdk-loading":"",role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":100,"aria-label":E},dist_B(m,m=>k.createElement("div",{"aria-hidden":!0},m)))})});function pe(m){let g=k.useRef(m);return eI(()=>{g.current=m}),g}var eI="undefined"==typeof window?k.useEffect:k.useLayoutEffect;function L(m){let g=k.useRef();return void 0===g.current&&(g.current=m()),g}function P(m){let g=ee(),n=()=>m(g.snapshot());return k.useSyncExternalStore(g.subscribe,n,n)}function ve(m,g,v,x=[]){let E=k.useRef(),T=dist_K();return eI(()=>{var k;let K=(()=>{var m;for(let g of v){if("string"==typeof g)return g.trim();if("object"==typeof g&&"current"in g)return g.current?null==(m=g.current.textContent)?void 0:m.trim():E.current}})(),et=x.map(m=>m.trim());T.value(m,K,et),null==(k=g.current)||k.setAttribute(ey,K),E.current=K}),E}var ke=()=>{let[m,g]=k.useState(),v=L(()=>new Map);return eI(()=>{v.current.forEach(m=>m()),v.current=new Map},[m]),(m,x)=>{v.current.set(m,x),g({})}};function dist_B({asChild:m,children:g},v){let x;return m&&k.isValidElement(g)?k.cloneElement("function"==typeof(x=g.type)?x(g.props):"render"in x?x.render(g.props):g,{ref:g.ref},v(g.props.children)):v(g)}var eP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},eT=v(51804),eO=v(25987),eA=v(84355);let eM=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eR,{ref:g,className:(0,eO.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",v),...k})});eM.displayName=eR.displayName;let CommandDialog=m=>{let{children:g,className:v,shouldFilter:k,...E}=m;return(0,x.jsx)(eA.Vq,{...E,children:(0,x.jsxs)(eA.cZ,{className:(0,eO.cn)("overflow-hidden !border-none !p-0 !gap-0 !outline-none shadow-3xl sm:max-w-[640px]",v),children:[(0,x.jsx)(eA.$N,{className:"sr-only",children:"Buscar paginas y cambiar tema"}),(0,x.jsx)(eA.Be,{className:"sr-only",children:"Busca paginas de administracion o cambia el tema de la aplicacion"}),(0,x.jsx)(eM,{shouldFilter:k,className:"[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:g})]})})},eD=k.forwardRef((m,g)=>{let{className:v,chip:k,...E}=m;return(0,x.jsxs)("div",{className:"flex items-center border-b border-border/40 px-4 py-1 [&:has(input:focus)]:outline-none","cmdk-input-wrapper":"",children:[k?(0,x.jsxs)("span",{className:"mr-2 flex shrink-0 items-center gap-1.5 rounded-full bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary",children:[k.label,(0,x.jsx)("button",{type:"button",onClick:k.onRemove,className:"rounded-full p-0.5 transition-colors hover:bg-primary/20",children:(0,x.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:(0,x.jsx)("path",{d:"M2.5 2.5L7.5 7.5M7.5 2.5L2.5 7.5"})})})]}):(0,x.jsx)(eT.Z,{className:"mr-3 h-5 w-5 shrink-0 text-muted-foreground/40"}),(0,x.jsx)(eR.Input,{ref:g,className:(0,eO.cn)("flex h-11 w-full bg-transparent text-sm !outline-none !border-none !ring-0 !shadow-none focus:!outline-none focus:!border-none focus:!ring-0 focus:!shadow-none focus-visible:!outline-none focus-visible:!ring-0 placeholder:text-muted-foreground/40 disabled:cursor-not-allowed disabled:opacity-50",v),...E})]})});eD.displayName=eR.Input.displayName;let eL=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eR.List,{ref:g,className:(0,eO.cn)("max-h-[400px] overflow-y-auto overflow-x-hidden",v),...k})});eL.displayName=eR.List.displayName;let eF=k.forwardRef((m,g)=>(0,x.jsx)(eR.Empty,{ref:g,className:"py-6 text-center text-sm",...m}));eF.displayName=eR.Empty.displayName;let eZ=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eR.Group,{ref:g,className:(0,eO.cn)("overflow-hidden px-2 py-1.5 text-foreground [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:pb-1.5 [&_[cmdk-group-heading]]:pt-3 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground
6/60",v),...k})});eZ.displayName=eR.Group.displayName;let eB=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eR.Separator,{ref:g,className:(0,eO.cn)("-mx-1 h-px bg-border",v),...k})});eB.displayName=eR.Separator.displayName;let e$=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eR.Item,{ref:g,className:(0,eO.cn)("relative flex cursor-default gap-2 select-none items-center rounded-lg px-3 py-2.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent/50 data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",v),...k})});e$.displayName=eR.Item.displayName;let CommandShortcut=m=>{let{className:g,...v}=m;return(0,x.jsx)("span",{className:(0,eO.cn)("ml-auto text-xs tracking-widest text-muted-foreground",g),...v})};CommandShortcut.displayName="CommandShortcut"},84355:function(m,g,v){"use strict";v.d(g,{$N:function(){return ed},Be:function(){return ep},GG:function(){return es},Vq:function(){return en},cN:function(){return DialogFooter},cZ:function(){return eu},fK:function(){return DialogHeader},hg:function(){return er}});var x=v(52322),k=v(2784),E=v(11915),T=v(4028),K=v(25987),et=v(82819);let en=E.fC,er=E.xz,ei=E.h_,es=E.x8,el=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(E.aV,{ref:g,className:(0,K.cn)("fixed inset-0 z-50 bg-gray-500/75 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",v),...k})});el.displayName=E.aV.displayName;let ec={default:"fixed left-[50%] top-[50%] z-50 grid w-full max-w-4xl translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",bottom:"fixed z-50 grid w-full bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bottom-0 left-0 max-h-[87%] rounded-t-lg overflow-y-auto sm:left-[50%] sm:top-[50%] sm:bottom-auto sm:translate-x-[-50%] sm:translate-y-[-50%] sm:max-w-4xl sm:max-h-full sm:rounded-lg data-[state=closed]:slide-out-to-bottom sm:data-[state=closed]:slide-out-to-left-1/2 sm:data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-bottom sm:data-[state=open]:slide-in-from-left-1/2 sm:data-[state=open]:slide-in-from-top-[48%]",fullHeight:"fixed left-[50%] top-[50%] z-50 grid w-full max-w-4xl translate-x-[-50%] translate-y-[-50%] bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",fullScreen:"fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] mx-3 bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]"},eu=k.forwardRef((m,g)=>{let{className:v,children:en,hideCloseButton:er,variant:es="default",...eu}=m;return k.useEffect(()=>((0,et.D)("update",{hide_default_launcher:!0}),()=>{(0,et.D)("update",{hide_default_launcher:!1})}),[]),(0,x.jsxs)(ei,{children:[(0,x.jsx)(el,{}),(0,x.jsxs)(E.VY,{ref:g,className:(0,K.cn)(ec[es],v),...eu,children:[en,!er&&(0,x.jsxs)(E.x8,{className:"absolute right-4 top-4 roun
6ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,x.jsx)(T.Z,{className:"h-4 w-4"}),(0,x.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});eu.displayName=E.VY.displayName;let DialogHeader=m=>{let{className:g,...v}=m;return(0,x.jsx)("div",{className:(0,K.cn)("flex flex-col space-y-1.5 text-center sm:text-left",g),...v})};DialogHeader.displayName="DialogHeader";let DialogFooter=m=>{let{className:g,...v}=m;return(0,x.jsx)("div",{className:(0,K.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",g),...v})};DialogFooter.displayName="DialogFooter";let ed=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(E.Dx,{ref:g,className:(0,K.cn)("text-lg font-semibold leading-none tracking-tight",v),...k})});ed.displayName=E.Dx.displayName;let ep=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(E.dk,{ref:g,className:(0,K.cn)("text-sm text-muted-foreground",v),...k})});ep.displayName=E.dk.displayName},64771:function(m,g,v){"use strict";v.d(g,{Z:function(){return DropdownSelect}});var x=v(52322);v(2784);var k=v(25987),E=v(11440),T=v(20463),K=v(68471);function DropdownSelect(m){let g=m.options.find(g=>g.value===m.selectedValue);if(void 0!==m.selectedValue&&void 0===g)return(0,T.Tb)(Error("selectedValue ".concat(m.selectedValue," is not in options"))),m.setSelectedValue(m.options[0].value),(0,x.jsx)(x.Fragment,{});let v=m.size||"small";return(0,x.jsx)("div",{className:(0,k.cn)("relative",m.containerClassName),children:(0,x.jsxs)(K.Ph,{value:void 0!==m.selectedValue?String(m.selectedValue):void 0,onValueChange:g=>{let v=m.options.find(m=>String(m.value)===g);v&&m.setSelectedValue(v.value)},disabled:m.disabled,children:[(0,x.jsx)(K.i4,{className:(0,k.cn)(m.disabled?"bg-gray-200":"bg-white","relative flex items-center w-full cursor-default rounded-md border text-left shadow-sm focus-visible:border-blue-500 focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-500 sm:text-sm h-auto",function(m){switch(m){case"medium":return"px-4 py-2.5";case"small":return"py-2 px-3"}}(v),m.buttonClassName,m.isError?"border-pink-600":"border-gray-300"),children:(0,x.jsxs)("div",{className:"flex items-center truncate",children:[m.isOptionChecked?(0,x.jsx)(E.Z,{className:"w-5 h-5 mr-2"}):"",(0,x.jsx)(K.ki,{placeholder:m.placeholder})]})}),(0,x.jsx)(K.Bw,{className:(0,k.cn)("max-h-60 max-w-[90vw]",m.listClassName),children:m.options.map(m=>(0,x.jsx)(K.Ql,{value:String(m.value),children:m.label},String(m.value)))})]})})}},6660:function(m,g,v){"use strict";v.d(g,{Z:function(){return FormCheckbox}});var x=v(52322),k=v(2784),E=v(74263),T=v(5289);function FormCheckbox(m){let g=(0,k.useId)();return(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"relative flex items-center cursor-pointer",children:[(0,x.jsx)("div",{className:"flex h-5 items-center",children:(0,x.jsx)(E.X,{id:g,className:"border-neutral-300 shadow-none data-[state=checked]:bg-blue-500 data-[state=checked]:border-blue-500 data-[state=checked]:text-white focus-visible:ring-blue-500 cursor-pointer",checked:m.isChecked,onCheckedChange:g=>m.setIsChecked(!0===g)})}),m.label&&(0,x.jsx)("div",{className:"ml-2",children:(0,x.jsx)(T._,{htmlFor:g,className:"cursor-pointer font-normal",children:m.label})})]}),m.errorMessage&&(0,x.jsx)("div",{className:"text-pink-600 text-sm mt-1",children:m.errorMessage})]})}},45447:function(m,g,v){"use strict";v.d(g,{Z:function(){return FormInput}});var x=v(52322);v(2784);var k=v(25987),E=v(47994);function FormInput(m){var g;let v;let T=null!==(g=m.theme)&&void 0!==g?g:"rounded";switch(T){case"rounded":v="rounded-full";break;case"square":v="rounded"}return(0,x.jsxs)("div",{className:(0,k.cn)("relative",m.className),children:[(0,x.jsx)(E.I,{className:(0,k.cn)("h-auto w-full pl-4 py-2.5 shadow-none placeholder:text-neutral-300",m.disabled?"bg-gray-100":"",m.isError||m.errorMessage?"border-pink-600 focus-visible:ring-pink-600":"border-neutral-200",m.iconRight?"pr-12":"pr-4",v,m.inputClassName),placeholder:m.placeholder,disabled:m.disabled,...m.inputProps}),(0,x.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-4",children:m.iconRight}),m.errorMessage&&(0,x.jsx)("div",{className:"text-pink-600 mt-1 text-sm",children:m.errorMessage})]})}},47994:function(m,g,v){"use strict";v.d(g,{I:function(){return T}});var x=v(52322),k=v(2784),E=v(25987);let T=k.forwardRef((m,g)=>{let{className:v,type:k,...T}=m;return(0,x.jsx)("input",{type:k,className:(0,E.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",v),ref:g,...T})});T.displayName="Input"},5289:function(m,g,v){"use strict";v.d(g,{_:function(){return ei}});var x=v(52322),k=v(2784),E=v(72714),T=Object.defineProperty,K=k.forwardRef(T(function(m,g){return(0,x.jsx)(E.WV.label,{...m,ref:g,onMouseDown:g=>{let v=g.target;v.closest("button, input, select, textarea")||(m.onMouseDown?.(g),!g.defaultPrevented&&g.detail>1&&g.preventDefault())}})},"name",{value:"Label",configurable:!0})),et=v(10929),en=v(25987);let er=(0,et.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ei=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(K,{ref:g,className:(0,en.cn)(er(),v),...k})});ei.displayName=K.displayName},26025:function(m,g,v){"use strict";v.d(g,{J2:function(){return eD},tW:function(){return eF},yk:function(){return eZ},xo:function(){return eL}});var x=v(52322),k=v(2784),E=v(17998),T=v(62656),K=v(92211),et=v(1352),en=v(11861),er=v(22426),ei=v(23372),es=v(66489),el=v(78773),ec=v(79616),eu=v(72714),ed=v(49815),ep=v(81057),em=v(49732),ef=v(88965),eh=Object.defineProperty,__name=(m,g)=>eh(m,"name",{value:g,configurable:!0}),eg="Popover",[ev,ey]=(0,K.b)(eg,[es.D7]),eb=(0,es.D7)(),[ex,e_]=ev(eg),ew=__name(m=>{let{__scopePopover:g,children:v,open:E,defaultOpen:T,onOpenChange:K,modal:et=!1}=m,en=eb(g),er=k.useRef(null),[el,ec]=k.useState(!1),[eu,ed]=(0,ep.T)({prop:E,defaultProp:T??!1,onChange:K,caller:eg});return(0,x.jsx)(es.fC,{...en,children:(0,x.jsx)(ex,{scope:g,contentId:(0,ei.M)(),triggerRef:er,open:eu,onOpenChange:ed,onOpenToggle:k.useCallback(()=>ed(m=>!m),[ed]),hasCustomAnchor:el,onCustomAnchorAdd:k.useCallback(()=>ec(!0),[]),onCustomAnchorRemove:k.useCallback(()=>ec(!1),[]),modal:et,children:v})})},"Popover"),eS=k.forwardRef(__name(function(m,g){let{__scopePopover:v,...E}=m,T=e_("PopoverAnchor",v),K=eb(v),{onCustomAnchorAdd:et,onCustomAnchorRemove:en}=T;return k.useEffect(()=>(et(),()=>en()),[et,en]),(0,x.jsx)(es.ee,{...K,...E,ref:g})},"PopoverAnchor")),eC=k.forwardRef(__name(function(m,g){let{__scopePopover:v,...k}=m,K=e_("PopoverTrigger",v),et=eb(v),en=(0,T.e)(g,K.triggerRef),er=(0,x.jsx)(eu.WV.button,{type:"button","aria-haspopup":"dialog","aria-expanded":K.open,"aria-controls":K.open?K.contentId:void 0,"data-state":getState(K.open
6),...k,ref:en,onClick:(0,E.Mj)(m.onClick,K.onOpenToggle)});return K.hasCustomAnchor?er:(0,x.jsx)(es.ee,{asChild:!0,...et,children:er})},"PopoverTrigger")),ek="PopoverPortal",[eE,ej]=ev(ek,{forceMount:void 0}),eN=__name(m=>{let{__scopePopover:g,forceMount:v,children:k,container:E}=m,T=e_(ek,g);return(0,x.jsx)(eE,{scope:g,forceMount:v,children:(0,x.jsx)(ec.z,{present:v||T.open,children:(0,x.jsx)(el.h,{asChild:!0,container:E,children:k})})})},"PopoverPortal"),eR="PopoverContent",eI=k.forwardRef(__name(function(m,g){let v=ej(eR,m.__scopePopover),{forceMount:k=v.forceMount,...E}=m,T=e_(eR,m.__scopePopover);return(0,x.jsx)(ec.z,{present:k||T.open,children:T.modal?(0,x.jsx)(eT,{...E,ref:g}):(0,x.jsx)(eO,{...E,ref:g})})},"PopoverContent")),eP=(0,ed.Z8)("PopoverContent.RemoveScroll"),eT=k.forwardRef(__name(function(m,g){let v=e_(eR,m.__scopePopover),K=k.useRef(null),et=(0,T.e)(g,K),en=k.useRef(!1);return k.useEffect(()=>{let m=K.current;if(m)return(0,em.Ry)(m)},[]),(0,x.jsx)(ef.Z,{as:eP,allowPinchZoom:!0,children:(0,x.jsx)(eA,{...m,ref:et,trapFocus:v.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,E.Mj)(m.onCloseAutoFocus,m=>{m.preventDefault(),en.current||v.triggerRef.current?.focus()}),onPointerDownOutside:(0,E.Mj)(m.onPointerDownOutside,m=>{let g=m.detail.originalEvent,v=0===g.button&&!0===g.ctrlKey,x=2===g.button||v;en.current=x},{checkForDefaultPrevented:!1}),onFocusOutside:(0,E.Mj)(m.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),eO=k.forwardRef(__name(function(m,g){let v=e_(eR,m.__scopePopover),E=k.useRef(!1),T=k.useRef(!1);return(0,x.jsx)(eA,{...m,ref:g,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:g=>{m.onCloseAutoFocus?.(g),g.defaultPrevented||(E.current||v.triggerRef.current?.focus(),g.preventDefault()),E.current=!1,T.current=!1},onInteractOutside:g=>{m.onInteractOutside?.(g),g.defaultPrevented||(E.current=!0,"pointerdown"!==g.detail.originalEvent.type||(T.current=!0));let x=g.target,k=v.triggerRef.current?.contains(x);k&&g.preventDefault(),"focusin"===g.detail.originalEvent.type&&T.current&&g.preventDefault()}})},"PopoverContentNonModal")),eA=k.forwardRef(__name(function(m,g){let{__scopePopover:v,trapFocus:k,onOpenAutoFocus:E,onCloseAutoFocus:T,disableOutsidePointerEvents:K,onEscapeKeyDown:ei,onPointerDownOutside:el,onFocusOutside:ec,onInteractOutside:eu,...ed}=m,ep=e_(eR,v),em=eb(v);return(0,en.EW)(),(0,x.jsx)(er.M,{asChild:!0,loop:!0,trapped:k,onMountAutoFocus:E,onUnmountAutoFocus:T,children:(0,x.jsx)(et.XB,{asChild:!0,disableOutsidePointerEvents:K,onInteractOutside:eu,onEscapeKeyDown:ei,onPointerDownOutside:el,onFocusOutside:ec,onDismiss:()=>ep.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,x.jsx)(es.VY,{"data-state":getState(ep.open),role:"dialog",id:ep.contentId,...em,...ed,ref:g,style:{...ed.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function getState(m){return m?"open":"closed"}__name(getState,"getState");var eM=v(25987);let eD=ew,eL=eC,eF=eS,eZ=k.forwardRef((m,g)=>{let{className:v,align:k="center",sideOffset:E=4,container:T,...K}=m;return(0,x.jsx)(eN,{container:T,children:(0,x.jsx)(eI,{ref:g,align:k,sideOffset:E,className:(0,eM.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",v),...K})})});eZ.displayName=eI.displayName},68471:function(m,g,v){"use strict";v.d(g,{Ph:function(){return tv},Bw:function(){return tS},DI:function(){return ty},Ql:function(){return tk},n5:function(){return tC},i4:function(){return tx},ki:function(){return tb}});var x=v(52322),k=v(2784),E=v(28316),T=v(80106),K=v(17998),et=v(62172),en=v(62656),er=v(92211),ei=v(59241),es=v(1352),el=v(11861),ec=v(22426),eu=v(23372),ed=v(66489),ep=v(78773),em=v(79616),ef=v(72714),eh=v(49815),eg=v(27757),ev=v(81057),ey=v(61644);function usePrevious(m){let g=k.useRef({value:m,previous:m});return k.useMemo(()=>(g.current.value!==m&&(g.current.previous=g.current.value,g.current.value=m),g.current.previous),[m])}(0,Object.defineProperty)(usePrevious,"name",{value:"usePrevious",configurable:!0});var eb=v(89785),ex=v(49732),e_=v(88965),ew=Object.defineProperty,dist_name=(m,g)=>ew(m,"name",{value:g,configurable:!0}),eS=[" ","Enter","ArrowUp","ArrowDown"],eC=[" ","Enter"],ek="Select",[eE,ej,eN]=(0,et.B)(ek),[eR,eI]=(0,er.b)(ek,[eN,ed.D7]),eP=(0,ed.D7)(),[eT,eO]=eR(ek),[eA,eM]=eR(ek);function SelectProvider(m){let{__scopeSelect:g,children:v,open:E,defaultOpen:T,onOpenChange:K,value:et,defaultValue:en,onValueChange:er,dir:es,name:el,autoComplete:ec,disabled:ep,required:em,form:ef,internal_do_not_use_render:eh}=m,eg=eP(g),[ey,eb]=k.useState(null),[ex,e_]=k.useState(null),[ew,eS]=k.useState(!1),eC=(0,ei.gm)(es),[ej,eN]=(0,ev.T)({prop:E,defaultProp:T??!1,onChange:K,caller:ek}),[eR,eI]=(0,ev.T)({prop:et,defaultProp:en,onChange:er,caller:ek}),eO=k.useRef(null),eM=k.useRef(eR);k.useEffect(()=>{let m=ef?ey?.ownerDocument.getElementById(ef):ey?.form;if(m instanceof HTMLFormElement){let g=dist_name(()=>eI(eM.current),"reset");return m.addEventListener("reset",g),()=>m.removeEventListener("reset",g)}},[ef,ey,eI]);let eD=!ey||!!ef||!!ey.closest("form"),[eL,eF]=k.useState(new Set),eZ=(0,eu.M)(),eB=Array.from(eL).map(m=>m.props.value).join(";"),e$=k.useCallback(m=>{eF(g=>new Set(g).add(m))},[]),eU=k.useCallback(m=>{eF(g=>{let v=new Set(g);return v.delete(m),v})},[]),ez={required:em,trigger:ey,onTriggerChange:eb,valueNode:ex,onValueNodeChange:e_,valueNodeHasChildren:ew,onValueNodeHasChildrenChange:eS,contentId:eZ,value:eR,onValueChange:eI,open:ej,onOpenChange:eN,dir:eC,triggerPointerDownPosRef:eO,disabled:ep,name:el,autoComplete:ec,form:ef,nativeOptions:eL,nativeSelectKey:eB,isFormControl:eD};return(0,x.jsx)(ed.fC,{...eg,children:(0,x.jsx)(eT,{scope:g,...ez,children:(0,x.jsx)(eE.Provider,{scope:g,children:(0,x.jsx)(eA,{scope:g,onNativeOptionAdd:e$,onNativeOptionRemove:eU,children:isFunction(eh)?eh(ez):v})})})})}dist_name(SelectProvider,"SelectProvider");var eD=dist_name(m=>{let{__scopeSelect:g,children:v,...k}=m;return(0,x.jsx)(SelectProvider,{__scopeSelect:g,...k,internal_do_not_use_render:({isFormControl:m})=>(0,x.jsxs)(x.Fragment,{children:[v,m?(0,x.jsx)(tp,{__scopeSelect:g}):null]})})},"Select"),eL=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,disabled:E=!1,...T}=m,et=eP(v),er=eO("SelectTrigger",v),ei=er.disabled||E,es=(0,en.e)(g,er.onTriggerChange),el=ej(v),ec=k.useRef("touch"),[eu,ep,em]=useTypeaheadSearch(m=>{let g=el().filter(m=>!m.disabled),v=g.find(m=>m.value===er.value),x=findNextItem(g,m,v);void 0!==x&&er.onValueChange(x.value)}),eh=dist_name(m=>{ei||(er.onOpenChange(!0),em()),m&&(er.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return(0,x.jsx)(ed.ee,{asChild:!0,...et,children:(0,x.jsx)(ef.WV.button,{type:"button",role:"combobox","aria-controls":er.open?er.contentId:void 0,"aria-expanded":er.open,"aria-required":er.required,"aria-autocomplete":"none",dir:er.dir,"data-state":er.open?"open":"closed",disabled:ei,"data-disabled":ei?"":void 0,"data-placeholder":shouldShowPlaceholder(er.value)?"":void 0,...T,ref:es,onClick:(0,K.Mj)(T.onClick,m=>
6{m.currentTarget.focus(),"mouse"!==ec.current&&eh(m)}),onPointerDown:(0,K.Mj)(T.onPointerDown,m=>{ec.current=m.pointerType;let g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),0===m.button&&!1===m.ctrlKey&&"mouse"===m.pointerType&&(eh(m),m.preventDefault())}),onKeyDown:(0,K.Mj)(T.onKeyDown,m=>{let g=""!==eu.current,v=m.ctrlKey||m.altKey||m.metaKey;v||1!==m.key.length||ep(m.key),(!g||" "!==m.key)&&eS.includes(m.key)&&(eh(),m.preventDefault())})})})},"SelectTrigger")),eF=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,className:E,style:T,children:K,placeholder:et="",...er}=m,ei=eO("SelectValue",v),{onValueNodeHasChildrenChange:es}=ei,el=void 0!==K,ec=(0,en.e)(g,ei.onValueNodeChange);(0,ey.b)(()=>{es(el)},[es,el]);let eu=shouldShowPlaceholder(ei.value);return(0,x.jsx)(ef.WV.span,{...er,asChild:!eu&&er.asChild,ref:ec,style:{pointerEvents:"none"},children:(0,x.jsx)(k.Fragment,{children:eu?et:K},eu?"placeholder":"value")})},"SelectValue")),eZ=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,children:k,...E}=m;return(0,x.jsx)(ef.WV.span,{"aria-hidden":!0,...E,ref:g,children:k||"▼"})},"SelectIcon")),[eB,e$]=eR("SelectPortal",{forceMount:void 0}),eU=dist_name(m=>{let{__scopeSelect:g,forceMount:v,...k}=m;return(0,x.jsx)(eB,{scope:m.__scopeSelect,forceMount:v,children:(0,x.jsx)(ep.h,{asChild:!0,...k})})},"SelectPortal"),ez="SelectContent",eV=k.forwardRef(dist_name(function(m,g){let v=e$(ez,m.__scopeSelect),{forceMount:E=v.forceMount,...T}=m,K=eO(ez,m.__scopeSelect),[et,en]=k.useState();return(0,ey.b)(()=>{en(new DocumentFragment)},[]),(0,x.jsx)(em.z,{present:E||K.open,children:({present:m})=>m?(0,x.jsx)(eG,{...T,ref:g}):(0,x.jsx)(eq,{...T,fragment:et})})},"SelectContent")),eq=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,children:k,fragment:T}=m;return T?E.createPortal((0,x.jsx)(eH,{scope:v,children:(0,x.jsx)(eE.Slot,{scope:v,children:(0,x.jsx)("div",{ref:g,children:k})})}),T):null},"SelectContentFragment")),[eH,eW]=eR(ez),eK=(0,eh.Z8)("SelectContent.RemoveScroll"),eG=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v}=m,{position:E="item-aligned",onCloseAutoFocus:T,onEscapeKeyDown:et,onPointerDownOutside:er,side:ei,sideOffset:eu,align:ed,alignOffset:ep,arrowPadding:em,collisionBoundary:ef,collisionPadding:eh,sticky:eg,hideWhenDetached:ev,avoidCollisions:ey,...eb}=m,ew=eO(ez,v),[eS,eC]=k.useState(null),[ek,eE]=k.useState(null),eN=(0,en.e)(g,eC),[eR,eI]=k.useState(null),[eP,eT]=k.useState(null),eA=ej(v),[eM,eD]=k.useState(!1),eL=k.useRef(!1);k.useEffect(()=>{if(eS)return(0,ex.Ry)(eS)},[eS]),(0,el.EW)();let eF=k.useCallback(m=>{let[g,...v]=eA().map(m=>m.ref.current),[x]=v.slice(-1),k=document.activeElement;for(let v of m)if(v===k||(v?.scrollIntoView({block:"nearest"}),v===g&&ek&&(ek.scrollTop=0),v===x&&ek&&(ek.scrollTop=ek.scrollHeight),v?.focus(),document.activeElement!==k))return},[eA,ek]),eZ=k.useCallback(()=>eF([eR,eS]),[eF,eR,eS]);k.useEffect(()=>{eM&&eZ()},[eM,eZ]);let{onOpenChange:eB,triggerPointerDownPosRef:e$}=ew;k.useEffect(()=>{if(eS){let m={x:0,y:0},g=dist_name(g=>{m={x:Math.abs(Math.round(g.pageX)-(e$.current?.x??0)),y:Math.abs(Math.round(g.pageY)-(e$.current?.y??0))}},"handlePointerMove"),v=dist_name(v=>{m.x<=10&&m.y<=10?v.preventDefault():v.composedPath().includes(eS)||eB(!1),document.removeEventListener("pointermove",g),e$.current=null},"handlePointerUp");return null!==e$.current&&(document.addEventListener("pointermove",g),document.addEventListener("pointerup",v,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",v,{capture:!0})}}},[eS,eB,e$]),k.useEffect(()=>{let m=dist_name(()=>eB(!1),"close");return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[eB]);let[eU,eV]=useTypeaheadSearch(m=>{let g=eA().filter(m=>!m.disabled),v=g.find(m=>m.ref.current===document.activeElement),x=findNextItem(g,m,v);x&&setTimeout(()=>x.ref.current?.focus())}),eq=k.useCallback((m,g,v)=>{let x=!eL.current&&!v,k=void 0!==ew.value&&ew.value===g;(k||x)&&(eI(m),x&&(eL.current=!0))},[ew.value]),eW=k.useCallback(()=>eS?.focus(),[eS]),eG=k.useCallback((m,g,v)=>{let x=!eL.current&&!v,k=void 0!==ew.value&&ew.value===g;(k||x)&&eT(m)},[ew.value]),eX="popper"===E?eY:eQ,eJ=eX===eY?{side:ei,sideOffset:eu,align:ed,alignOffset:ep,arrowPadding:em,collisionBoundary:ef,collisionPadding:eh,sticky:eg,hideWhenDetached:ev,avoidCollisions:ey}:{};return(0,x.jsx)(eH,{scope:v,content:eS,viewport:ek,onViewportChange:eE,itemRefCallback:eq,selectedItem:eR,onItemLeave:eW,itemTextRefCallback:eG,focusSelectedItem:eZ,selectedItemText:eP,position:E,isPositioned:eM,searchRef:eU,children:(0,x.jsx)(e_.Z,{as:eK,allowPinchZoom:!0,children:(0,x.jsx)(ec.M,{asChild:!0,trapped:ew.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:(0,K.Mj)(T,m=>{ew.trigger?.focus({preventScroll:!0}),m.preventDefault()}),children:(0,x.jsx)(es.XB,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:et,onPointerDownOutside:er,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>ew.onOpenChange(!1),children:(0,x.jsx)(eX,{role:"listbox",id:ew.contentId,"data-state":ew.open?"open":"closed",dir:ew.dir,onContextMenu:m=>m.preventDefault(),...eb,...eJ,onPlaced:()=>eD(!0),ref:eN,style:{display:"flex",flexDirection:"column",outline:"none",...eb.style},onKeyDown:(0,K.Mj)(eb.onKeyDown,m=>{let g=m.ctrlKey||m.altKey||m.metaKey;if("Tab"===m.key&&m.preventDefault(),g||1!==m.key.length||eV(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let g=eA().filter(m=>!m.disabled),v=g.map(m=>m.ref.current);
6if(["ArrowUp","End"].includes(m.key)&&(v=v.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){let g=m.target,x=v.indexOf(g);v=v.slice(x+1)}setTimeout(()=>eF(v)),m.preventDefault()}})})})})})})},"SelectContentImpl")),eQ=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,onPlaced:E,...K}=m,et=eO(ez,v),er=eW(ez,v),[ei,es]=k.useState(null),[el,ec]=k.useState(null),eu=(0,en.e)(g,ec),ed=ej(v),ep=k.useRef(!1),em=k.useRef(!0),{viewport:eh,selectedItem:eg,selectedItemText:ev,focusSelectedItem:eb}=er,ex=k.useCallback(()=>{if(et.trigger&&et.valueNode&&ei&&el&&eh&&eg&&ev){let m=et.trigger.getBoundingClientRect(),g=el.getBoundingClientRect(),v=et.valueNode.getBoundingClientRect(),x=ev.getBoundingClientRect();if("rtl"!==et.dir){let k=x.left-g.left,E=v.left-k,K=m.left-E,et=m.width+K,en=Math.max(et,g.width),er=window.innerWidth-10,es=(0,T.u)(E,[10,Math.max(10,er-en)]);ei.style.minWidth=et+"px",ei.style.left=es+"px"}else{let k=g.right-x.right,E=window.innerWidth-v.right-k,K=window.innerWidth-m.right-E,et=m.width+K,en=Math.max(et,g.width),er=window.innerWidth-10,es=(0,T.u)(E,[10,Math.max(10,er-en)]);ei.style.minWidth=et+"px",ei.style.right=es+"px"}let k=ed(),K=window.innerHeight-20,en=eh.scrollHeight,er=window.getComputedStyle(el),es=parseInt(er.borderTopWidth,10),ec=parseInt(er.paddingTop,10),eu=parseInt(er.borderBottomWidth,10),em=parseInt(er.paddingBottom,10),ef=es+ec+en+em+eu,ey=Math.min(5*eg.offsetHeight,ef),eb=window.getComputedStyle(eh),ex=parseInt(eb.paddingTop,10),e_=parseInt(eb.paddingBottom,10),ew=m.top+m.height/2-10,eS=eg.offsetHeight/2,eC=eg.offsetTop+eS,ek=es+ec+eC;if(ek<=ew){let m=k.length>0&&eg===k[k.length-1].ref.current;ei.style.bottom="0px";let g=el.clientHeight-eh.offsetTop-eh.offsetHeight,v=Math.max(K-ew,eS+(m?e_:0)+g+eu);ei.style.height=ek+v+"px"}else{let m=k.length>0&&eg===k[0].ref.current;ei.style.top="0px";let g=Math.max(ew,es+eh.offsetTop+(m?ex:0)+eS);ei.style.height=g+(ef-ek)+"px",eh.scrollTop=ek-ew+eh.offsetTop}ei.style.margin="10px 0",ei.style.minHeight=ey+"px",ei.style.maxHeight=K+"px",E?.(),requestAnimationFrame(()=>ep.current=!0)}},[ed,et.trigger,et.valueNode,ei,el,eh,eg,ev,et.dir,E]);(0,ey.b)(()=>ex(),[ex]);let[e_,ew]=k.useState();(0,ey.b)(()=>{el&&ew(window.getComputedStyle(el).zIndex)},[el]);let eS=k.useCallback(m=>{m&&!0===em.current&&(ex(),eb?.(),em.current=!1)},[ex,eb]);return(0,x.jsx)(eX,{scope:v,contentWrapper:ei,shouldExpandOnScrollRef:ep,onScrollButtonChange:eS,children:(0,x.jsx)("div",{ref:es,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:e_},children:(0,x.jsx)(ef.WV.div,{...K,ref:eu,style:{boxSizing:"border-box",maxHeight:"100%",...K.style}})})})},"SelectItemAlignedPosition")),eY=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,align:k="start",collisionPadding:E=10,...T}=m,K=eP(v);return(0,x.jsx)(ed.VY,{...K,...T,ref:g,align:k,collisionPadding:E,style:{boxSizing:"border-box",...T.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[eX,eJ]=eR(ez,{}),e0="SelectViewport",e1=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,nonce:E,...T}=m,et=eW(e0,v),er=eJ(e0,v),ei=(0,en.e)(g,et.onViewportChange),es=k.useRef(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:E}),(0,x.jsx)(eE.Slot,{scope:v,children:(0,x.jsx)(ef.WV.div,{"data-radix-select-viewport":"",role:"presentation",...T,ref:ei,style:{position:"relative",flex:1,overflow:"hidden auto",...T.style},onScroll:(0,K.Mj)(T.onScroll,m=>{let g=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:x}=er;if(x?.current&&v){let m=Math.abs(es.current-g.scrollTop);if(m>0){let x=window.innerHeight-20,k=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),T=Math.max(k,E);if(T<x){let k=T+m,E=Math.min(x,k),K=k-E;v.style.height=E+"px","0px"===v.style.bottom&&(g.scrollTop=K>0?K:0,v.style.justifyContent="flex-end")}}}es.current=g.scrollTop})})})]})},"SelectViewport")),[e2,e3]=eR("SelectGroup"),e5=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,...k}=m,E=(0,eu.M)();return(0,x.jsx)(e2,{scope:v,id:E,children:(0,x.jsx)(ef.WV.div,{role:"group","aria-labelledby":E,...k,ref:g})})},"SelectGroup")),e4=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,...k}=m,E=e3("SelectLabel",v);return(0,x.jsx)(ef.WV.div,{id:E.id,...k,ref:g})},"SelectLabel")),e6="SelectItem",[e7,e8]=eR(e6),e9=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,value:E,disabled:T=!1,textValue:et,...er}=m,ei=eO(e6,v),es=eW(e6,v),el=ei.value===E,[ec,ed]=k.useState(et??""),[ep,em]=k.useState(!1),eh=(0,eg.W)(m=>es.itemRefCallback?.(m,E,T)),ev=(0,en.e)(g,eh),ey=(0,eu.M)(),eb=k.useRef("touch"),ex=dist_name(()=>{T||(ei.onValueChange(E),ei.onOpenChange(!1))},"handleSelect");return(0,x.jsx)(e7,{scope:v,value:E,disabled:T,textId:ey,isSelected:el,onItemTextChange:k.useCallback(m=>{ed(g=>g||(m?.textContent??"").trim())},[]),children:(0,x.jsx)(eE.ItemSlot,{scope:v,value:E,disabled:T,textValue:ec,children:(0,x.jsx)(ef.WV.div,{role:"option","aria-labelledby":ey,"data-highlighted":ep?"":void 0,"aria-selected":el&&ep,"data-state":el?"checked":"unchecked","aria-disabled":T||void 0,"data-disabled":T?"":void 0,tabIndex:T?void 0:-1,...er,ref:ev,onFocus:(0,K.Mj)(er.onFocus,()=>em(!0)),onBlur:(0,K.Mj)(er.onBlur,()=>
6em(!1)),onClick:(0,K.Mj)(er.onClick,()=>{"mouse"!==eb.current&&ex()}),onPointerUp:(0,K.Mj)(er.onPointerUp,()=>{"mouse"===eb.current&&ex()}),onPointerDown:(0,K.Mj)(er.onPointerDown,m=>{eb.current=m.pointerType}),onPointerMove:(0,K.Mj)(er.onPointerMove,m=>{eb.current=m.pointerType,T?es.onItemLeave?.():"mouse"===eb.current&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,K.Mj)(er.onPointerLeave,m=>{m.currentTarget===document.activeElement&&es.onItemLeave?.()}),onKeyDown:(0,K.Mj)(er.onKeyDown,m=>{if(T||m.target!==m.currentTarget)return;let g=es.searchRef?.current!=="";g&&" "===m.key||(eC.includes(m.key)&&ex()," "===m.key&&m.preventDefault())})})})})},"SelectItem")),tt="SelectItemText",tn=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,className:T,style:K,...et}=m,er=eO(tt,v),ei=eW(tt,v),es=e8(tt,v),el=eM(tt,v),[ec,eu]=k.useState(null),ed=(0,eg.W)(m=>ei.itemTextRefCallback?.(m,es.value,es.disabled)),ep=(0,en.e)(g,eu,es.onItemTextChange,ed),em=ec?.textContent,eh=k.useMemo(()=>(0,x.jsx)("option",{value:es.value,disabled:es.disabled,children:em},es.value),[es.disabled,es.value,em]),{onNativeOptionAdd:ev,onNativeOptionRemove:eb}=el;return(0,ey.b)(()=>(ev(eh),()=>eb(eh)),[ev,eb,eh]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ef.WV.span,{id:es.textId,...et,ref:ep}),es.isSelected&&er.valueNode&&!er.valueNodeHasChildren&&!shouldShowPlaceholder(er.value)?E.createPortal(et.children,er.valueNode):null]})},"SelectItemText")),tr=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,...k}=m,E=e8("SelectItemIndicator",v);return E.isSelected?(0,x.jsx)(ef.WV.span,{"aria-hidden":!0,...k,ref:g}):null},"SelectItemIndicator")),ts="SelectScrollUpButton",to=k.forwardRef(dist_name(function(m,g){let v=eW(ts,m.__scopeSelect),E=eJ(ts,m.__scopeSelect),[T,K]=k.useState(!1),et=(0,en.e)(g,E.onScrollButtonChange);return(0,ey.b)(()=>{if(v.viewport&&v.isPositioned){let handleScroll2=function(){let g=m.scrollTop>0;K(g)};dist_name(handleScroll2,"handleScroll");let m=v.viewport;return handleScroll2(),m.addEventListener("scroll",handleScroll2),()=>m.removeEventListener("scroll",handleScroll2)}},[v.viewport,v.isPositioned]),T?(0,x.jsx)(tu,{...m,ref:et,onAutoScroll:()=>{let{viewport:m,selectedItem:g}=v;m&&g&&(m.scrollTop=m.scrollTop-g.offsetHeight)}}):null},"SelectScrollUpButton")),tl="SelectScrollDownButton",tc=k.forwardRef(dist_name(function(m,g){let v=eW(tl,m.__scopeSelect),E=eJ(tl,m.__scopeSelect),[T,K]=k.useState(!1),et=(0,en.e)(g,E.onScrollButtonChange);return(0,ey.b)(()=>{if(v.viewport&&v.isPositioned){let handleScroll2=function(){let g=m.scrollHeight-m.clientHeight,v=Math.ceil(m.scrollTop)<g;K(v)};dist_name(handleScroll2,"handleScroll");let m=v.viewport;return handleScroll2(),m.addEventListener("scroll",handleScroll2),()=>m.removeEventListener("scroll",handleScroll2)}},[v.viewport,v.isPositioned]),T?(0,x.jsx)(tu,{...m,ref:et,onAutoScroll:()=>{let{viewport:m,selectedItem:g}=v;m&&g&&(m.scrollTop=m.scrollTop+g.offsetHeight)}}):null},"SelectScrollDownButton")),tu=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,onAutoScroll:E,...T}=m,et=eW("SelectScrollButton",v),en=k.useRef(null),er=ej(v),ei=k.useCallback(()=>{null!==en.current&&(window.clearInterval(en.current),en.current=null)},[]);return k.useEffect(()=>()=>ei(),[ei]),(0,ey.b)(()=>{let m=er().find(m=>m.ref.current===document.activeElement);m?.ref.current?.scrollIntoView({block:"nearest"})},[er]),(0,x.jsx)(ef.WV.div,{"aria-hidden":!0,...T,ref:g,style:{flexShrink:0,...T.style},onPointerDown:(0,K.Mj)(T.onPointerDown,()=>{null===en.current&&(en.current=window.setInterval(E,50))}),onPointerMove:(0,K.Mj)(T.onPointerMove,()=>{et.onItemLeave?.(),null===en.current&&(en.current=window.setInterval(E,50))}),onPointerLeave:(0,K.Mj)(T.onPointerLeave,()=>{ei()})})},"SelectScrollButtonImpl")),td=k.forwardRef(dist_name(function(m,g){let{__scopeSelect:v,...k}=m;return(0,x.jsx)(ef.WV.div,{"aria-hidden":!0,...k,ref:g})},"SelectSeparator")),tp=k.forwardRef(dist_name(function({__scopeSelect:m,...g},v){let E=eO("SelectBubbleInput",m),{value:T,onValueChange:K,required:et,disabled:er,name:ei,autoComplete:es,form:el}=E,{nativeOptions:ec,nativeSelectKey:eu}=E,ed=k.useRef(null),ep=(0,en.e)(v,ed),em=T??"",eh=usePrevious(em),eg=Array.from(ec).some(m=>(m.props.value??"")==="");return k.useEffect(()=>{let m=ed.current;if(!m)return;let g=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(g,"value"),x=v.set;if(eh!==em&&x){let g=new Event("change",{bubbles:!0});x.call(m,em),m.dispatchEvent(g)}},[eh,em]),(0,x.jsxs)(ef.WV.select,{"aria-hidden":!0,required:et,tabIndex:-1,name:ei,autoComplete:es,disabled:er,form:el,onChange:m=>K(m.target.value),...g,style:{...eb.C2,...g.style},ref:ep,defaultValue:em,children:[shouldShowPlaceholder(T)&&!eg?(0,x.jsx)("option",{value:""}):null,Array.from(ec)]},eu)},"SelectBubbleInput"));function isFunction(m){return"function"==typeof m}function shouldShowPlaceholder(m){return""===m||void 0===m}function useTypeaheadSearch(m){let g=(0,eg.W)(m),v=k.useRef(""),x=k.useRef(0),E=k.useCallback(m=>{let k=v.current+m;g(k),dist_name(function updateSearch(m){v.current=m,window.clearTimeout(x.current),""!==m&&(x.current=window.setTimeout(()=>updateSearch(""),1e3))},"updateSearch")(k)},[g]),T=k.useCallback(()=>{v.current="",window.clearTimeout(x.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(x.current),[]),[v,E,T]}function findNextItem(m,g,v){let x=g.length>1&&Array.from(g).every(m=>m===g[0]),k=x?g[0]:g,E=v?m.indexOf(v):-1,T=wrapArray(m,Math.max(E,0)),K=1===k.length;K&&(T=T.filter(m=>m!==v));let et=T.find(m=>m.textValue.toLowerCase().startsWith(k.toLowerCase()));return et!==v?et:void 0}function wrapArray(m,g){return m.map((v,x)=>m[(g+x)%m.length])}dist_name(isFunction,"isFunction"),dist_name(shouldShowPlaceholder,"shouldShowPlaceholder"),dist_name(useTypeaheadSearch,"useTypeaheadSearch"),dist_name(findNextItem,"findNextItem"),dist_name(wrapArray,"wrapArray");var tm=v(84713),tf=v(31519),th=v(6342),tg=v(25987);let tv=eD,ty=e5,tb=eF,tx=k.forwardRef((m,g)=>{let{className:v,children:k,...E}=m;return(0,x.jsxs)(eL,{ref:g,className:(0,tg.cn)("flex h-9 w-full rounded-lg items-center justify-between whitespace-nowrap border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",v),...E,children:[k,(0,x.jsx)(eZ,{asChild:!0,children:(0,x.jsx)(tm.Z,{className:"h-4 w-4 opacity-50"})})]})});tx.displayName=eL.displayName;let t_=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(to,{ref:g,className:(0,tg.cn)("flex cursor-default items-center justify-center py-1",v),...k,children:(0,x.jsx)(tf.Z,{className:"h-4 w-4"})})});t_.displayName=to.displayName;let tw=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(tc,{ref:g,className:(0,tg.cn)("flex cursor-default items-center justify-center py-1",v),...k,children:(0,x.jsx)(tm.Z,{className:"h-4 w-4"})})});tw.displayName=tc.displayName;let tS=k.forwardRef((m,g)=>{let{className:v,children:k,position:E="popper",...T}=m;return(0,x.jsx)(eU,{children:(0,x.jsxs)(eV,{ref:g,className:(0,tg.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
6de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===E&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",v),position:E,...T,children:[(0,x.jsx)(t_,{}),(0,x.jsx)(e1,{className:(0,tg.cn)("p-1","popper"===E&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:k}),(0,x.jsx)(tw,{})]})})});tS.displayName=eV.displayName;let tC=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(e4,{ref:g,className:(0,tg.cn)("px-2 py-1.5 text-sm font-semibold",v),...k})});tC.displayName=e4.displayName;let tk=k.forwardRef((m,g)=>{let{className:v,children:k,...E}=m;return(0,x.jsxs)(e9,{ref:g,className:(0,tg.cn)("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",v),...E,children:[(0,x.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,x.jsx)(tr,{children:(0,x.jsx)(th.Z,{className:"h-4 w-4"})})}),(0,x.jsx)(tn,{children:k})]})});tk.displayName=e9.displayName;let tE=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(td,{ref:g,className:(0,tg.cn)("-mx-1 my-1 h-px bg-muted",v),...k})});tE.displayName=td.displayName},77152:function(m,g,v){"use strict";v.d(g,{Ei:function(){return eu},FF:function(){return SheetFooter},Tu:function(){return SheetHeader},bC:function(){return ec},ue:function(){return el},yo:function(){return en}});var x=v(52322),k=v(2784),E=v(11915),T=v(10929),K=v(4028),et=v(25987);let en=E.fC;E.xz,E.x8;let er=E.h_,ei=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(E.aV,{className:(0,et.cn)("fixed inset-0 z-50 bg-gray-500/75 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",v),...k,ref:g})});ei.displayName=E.aV.displayName;let es=(0,T.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-screen max-w-md border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),el=k.forwardRef((m,g)=>{let{side:v="right",className:k,children:T,...en}=m;return(0,x.jsxs)(er,{children:[(0,x.jsx)(ei,{}),(0,x.jsxs)(E.VY,{ref:g,className:(0,et.cn)(es({side:v}),k),...en,children:[(0,x.jsxs)(E.x8,{className:"absolute right-4 top-4 roun
6ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,x.jsx)(K.Z,{className:"h-4 w-4"}),(0,x.jsx)("span",{className:"sr-only",children:"Close"})]}),T]})]})});el.displayName=E.VY.displayName;let SheetHeader=m=>{let{className:g,...v}=m;return(0,x.jsx)("div",{className:(0,et.cn)("flex flex-col space-y-2 text-center sm:text-left",g),...v})};SheetHeader.displayName="SheetHeader";let SheetFooter=m=>{let{className:g,...v}=m;return(0,x.jsx)("div",{className:(0,et.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",g),...v})};SheetFooter.displayName="SheetFooter";let ec=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(E.Dx,{ref:g,className:(0,et.cn)("text-lg font-semibold text-foreground",v),...k})});ec.displayName=E.Dx.displayName;let eu=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(E.dk,{ref:g,className:(0,et.cn)("text-sm text-muted-foreground",v),...k})});eu.displayName=E.dk.displayName},25766:function(m,g,v){"use strict";v.d(g,{g:function(){return T}});var x=v(52322),k=v(2784),E=v(25987);let T=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)("textarea",{className:(0,E.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",v),ref:g,...k})});T.displayName="Textarea"},91734:function(m,g,v){"use strict";v.d(g,{FN:function(){return eQ},gD:function(){return eY},sA:function(){return eX},lj:function(){return e0},VW:function(){return eW},Mi:function(){return eJ},_i:function(){return eK}});var x=v(52322),k=v(2784),E=v(28316),T=v(17998),K=v(62656),et=v(62172),en=v(92211),er=v(1352),ei=v(78773),es=v(79616),el=v(72714),ec=v(27757),eu=v(81057),ed=v(61644),ep=v(89785),em=Object.defineProperty,__name=(m,g)=>em(m,"name",{value:g,configurable:!0}),ef="ToastProvider",[eh,eg,ev]=(0,et.B)("Toast"),[ey,eb]=(0,en.b)("Toast",[ev]),[ex,e_]=ey(ef),ew=__name(m=>{let{__scopeToast:g,label:v="Notification",duration:E=5e3,swipeDirection:T="right",swipeThreshold:K=50,announcerContainer:et,children:en}=m,[er,ei]=k.useState(null),[es,el]=k.useState(0),ec=k.useRef(!1);return v.trim()||console.error(`Invalid prop \`label\` supplied to \`${ef}\`. Expected non-empty \`string\`.`),(0,x.jsx)(eh.Provider,{scope:g,children:(0,x.jsx)(ex,{scope:g,label:v,duration:E,swipeDirection:T,swipeThreshold:K,toastCount:es,viewport:er,onViewportChange:ei,onToastAdd:k.useCallback(()=>el(m=>m+1),[]),onToastRemove:k.useCallback(()=>el(m=>m-1),[]),isClosePausedRef:ec,announcerContainer:et,children:en})})},"ToastProvider"),eS=["F8"],eC="toast.viewportPause",ek="toast.viewportResume",eE=k.forwardRef(__name(function(m,g){let{__scopeToast:v,hotkey:E=eS,label:T="Notifications ({hotkey})",...et}=m,en=e_("ToastViewport",v),ei=eg(v),es=k.useRef(null),ec=k.useRef(null),eu=k.useRef(null),ed=k.useRef(null),ep=(0,K.e)(g,ed,en.onViewportChange),em=E.join("+").replace(/Key/g,"").replace(/Digit/g,""),ef=en.toastCount>0;k.useEffect(()=>{let m=__name(m=>{let g=0!==E.length&&E.every(g=>m[g]||m.code===g);g&&ed.current?.focus()},"handleKeyDown");return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[E]),k.useEffect(()=>{let m=es.current,g=ed.current;if(ef&&m&&g){let v=__name(()=>{if(!en.isClosePausedRef.current){let m=new CustomEvent(eC);g.dispatchEvent(m),en.isClosePausedRef.current=!0}},"handlePause"),x=__name(()=>{if(en.isClosePausedRef.current){let m=new CustomEvent(ek);g.dispatchEvent(m),en.isClosePausedRef.current=!1}},"handleResume"),k=__name(g=>{let v=!m.contains(g.relatedTarget);v&&x()},"handleFocusOutResume"),E=__name(()=>{let g=m.contains(document.activeElement);g||x()},"handlePointerLeaveResume");return m.addEventListener("focusin",v),m.addEventListener("focusout",k),m.addEventListener("pointermove",v),m.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{m.removeEventListener("focusin",v),m.removeEventListener("focusout",k),m.removeEventListener("pointermove",v),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[ef,en.isClosePausedRef]);let ev=k.useCallback(({tabbingDirection:m})=>{let g=ei(),v=g.map(g=>{let v=g.ref.current,x=[v,...getTabbableCandidates(v)];return"forwards"===m?x:x.reverse()});return("forwards"===m?v.reverse():v).flat()},[ei]);return k.useEffect(()=>{let m=ed.current;if(m){let g=__name(g=>{let v=g.altKey||g.ctrlKey||g.metaKey,x="Tab"===g.key&&!v;
6if(x){let v=document.activeElement,x=g.shiftKey,k=g.target===m;if(k&&x){ec.current?.focus();return}let E=ev({tabbingDirection:x?"backwards":"forwards"}),T=E.findIndex(m=>m===v);focusFirst(E.slice(T+1))?g.preventDefault():x?ec.current?.focus():eu.current?.focus()}},"handleKeyDown");return m.addEventListener("keydown",g),()=>m.removeEventListener("keydown",g)}},[ei,ev]),(0,x.jsxs)(er.I0,{ref:es,role:"region","aria-label":T.replace("{hotkey}",em),tabIndex:-1,style:{pointerEvents:ef?void 0:"none"},children:[ef&&(0,x.jsx)(ej,{ref:ec,onFocusFromOutsideViewport:()=>{let m=ev({tabbingDirection:"forwards"});focusFirst(m)}}),(0,x.jsx)(eh.Slot,{scope:v,children:(0,x.jsx)(el.WV.ol,{tabIndex:-1,...et,ref:ep})}),ef&&(0,x.jsx)(ej,{ref:eu,onFocusFromOutsideViewport:()=>{let m=ev({tabbingDirection:"backwards"});focusFirst(m)}})]})},"ToastViewport")),ej=k.forwardRef(__name(function(m,g){let{__scopeToast:v,onFocusFromOutsideViewport:k,...E}=m,T=e_("ToastFocusProxy",v);return(0,x.jsx)(ep.TX,{tabIndex:0,...E,ref:g,style:{position:"fixed"},onFocus:m=>{let g=m.relatedTarget,v=!T.viewport?.contains(g);v&&k()}})},"ToastFocusProxy")),eN="Toast",eR=k.forwardRef(__name(function(m,g){let{forceMount:v,open:k,defaultOpen:E,onOpenChange:K,...et}=m,[en,er]=(0,eu.T)({prop:k,defaultProp:E??!0,onChange:K,caller:eN});return(0,x.jsx)(es.z,{present:v||en,children:(0,x.jsx)(eT,{open:en,...et,ref:g,onClose:()=>er(!1),onPause:(0,ec.W)(m.onPause),onResume:(0,ec.W)(m.onResume),onSwipeStart:(0,T.Mj)(m.onSwipeStart,m=>{m.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:(0,T.Mj)(m.onSwipeMove,m=>{let{x:g,y:v}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","move"),m.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${g}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${v}px`)}),onSwipeCancel:(0,T.Mj)(m.onSwipeCancel,m=>{m.currentTarget.setAttribute("data-swipe","cancel"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:(0,T.Mj)(m.onSwipeEnd,m=>{let{x:g,y:v}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","end"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${g}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${v}px`),er(!1)})})})},"Toast")),[eI,eP]=ey(eN,{onClose(){}}),eT=k.forwardRef(__name(function(m,g){let{__scopeToast:v,type:et="foreground",duration:en,open:ei,onClose:es,onEscapeKeyDown:eu,onPause:ed,onResume:ep,onSwipeStart:em,onSwipeMove:ef,onSwipeCancel:ev,onSwipeEnd:ey,...eb}=m,ex=e_(eN,v),ew=eg(v),[eS,eE]=k.useState(null),ej=(0,K.e)(g,eE),eR=k.useRef(null),eP=k.useRef(null),eT=en||ex.duration,eA=k.useRef(0),eM=k.useRef(eT),eD=k.useRef(0),{onToastAdd:eL,onToastRemove:eF}=ex,eB=(0,ec.W)(()=>{let m=eS?.contains(document.activeElement);m&&ex.viewport?.focus(),es()}),e$=k.useCallback(m=>{m&&m!==1/0&&(window.clearTimeout(eD.current),eA.current=new Date().getTime(),eD.current=window.setTimeout(eB,m))},[eB]);k.useEffect(()=>{let m=ex.viewport;if(m){let g=__name(()=>{e$(eM.current),ep?.()},"handleResume"),v=__name(()=>{let m=new Date().getTime()-eA.current;eM.current=eM.current-m,window.clearTimeout(eD.current),ed?.()},"handlePause");return m.addEventListener(eC,v),m.addEventListener(ek,g),()=>{m.removeEventListener(eC,v),m.removeEventListener(ek,g)}}},[ex.viewport,eT,ed,ep,e$]),k.useEffect(()=>{ei&&!ex.isClosePausedRef.current&&e$(eT)},[ei,eT,ex.isClosePausedRef,e$]),k.useEffect(()=>()=>{window.clearTimeout(eD.current)},[]),k.useEffect(()=>(eL(),()=>eF()),[eL,eF]);let eU=k.useMemo(()=>eS?getAnnounceTextContent(eS):null,[eS]);return ex.viewport?(0,x.jsxs)(x.Fragment,{children:[eU&&(0,x.jsx)(eO,{__scopeToast:v,role:"status","aria-live":"foreground"===et?"assertive":"polite",children:eU}),(0,x.jsx)(eI,{scope:v,onClose:eB,children:E.createPortal((0,x.jsx)(eh.ItemSlot,{scope:v,children:(0,x.jsx)(er.fC,{asChild:!0,onEscapeKeyDown:(0,T.Mj)(eu,m=>{let g=ew().some(g=>g.ref.current?.contains(m.target));g||eB()}),children:(0,x.jsx)(el.WV.li,{tabIndex:0,"data-state":ei?"open":"closed","data-swipe-direction":ex.swipeDirection,...eb,ref:ej,style:{userSelect:"none",touchAction:"none",...m.style},onKeyDown:(0,T.Mj)(m.onKeyDown,m=>{"Escape"!==m.key||(eu?.(m.nativeEvent),m.nativeEvent.defaultPrevented||eB())}),onPointerDown:(0,T.Mj)(m.onPointerDown,m=>{0===m.button&&(eR.current={x:m.clientX,y:m.clientY})}),onPointerMove:(0,T.Mj)(m.onPointerMove,m=>{if(!eR.current)return;let g=m.clientX-eR.current.x,v=m.clientY-eR.current.y,x=!!eP.current,k=["left","right"].includes(ex.swipeDirection),E=["left","up"].includes(ex.swipeDirection)?Math.min:Math.max,T=k?E(0,g):0,K=k?0:E(0,v),et="touch"===m.pointerType?10:2,en={x:T,y:K},er={originalEvent:m,delta:en};x?(eP.current=en,handleAndDispatchCustomEvent("toast.swipeMove",ef,er,{discrete:!1})):eZ(en,ex.swipeDirection,et)?(eP.current=en,handleAndDispatchCustomEvent("toast.swipeStart",em,er,{discrete:!1}),m.target.setPointerCapture(m.pointerId)):(Math.abs(g)>et||Math.abs(v)>et)&&(eR.current=null)}),onPointerUp:(0,T.Mj)(m.onPointerUp,m=>{let g=eP.current,v=m.target;if(v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),eP.current=null,eR.current=null,g){let v=m.currentTarget,x={originalEvent:m,delta:g};eZ(g,ex.swipeDirection,ex.swipeThreshold)?handleAndDispatchCustomEvent("toast.swipeEnd",ey,x,{discrete:!0}):handleAndDispatchCustomEvent("toast.swipeCancel",ev,x,{discrete:!0}),v.addEventListener("click",m=>m.preventDefault(),{once:!0})}})})})}),ex.viewport)})]}):null},"ToastImpl")),eO=__name(m=>{let{__scopeToast:g,children:v,...E}=m,T=e_(eN,g),[K,et]=k.useState(!1),[en,er]=k.useState(!1);return useNextFrame(()=>et(!0)),k.useEffect(()=>{let m=window.setTimeout(()=>er(!0),1e3);return()=>window.clearTimeout(m)},[]),en?null:(0,x.jsx)(ei.h,{asChild:!0,container:T.announcerContainer||void 0,children:(0,x.jsx)(ep.TX,{...E,children:K&&(0,x.jsxs)(x.Fragment,{children:[T.label," ",v]})})})},"ToastAnnounce"),eA=k.forwardRef(__name(function(m,g){let{__scopeToast:v,...k}=m;return(0,x.jsx)(el.WV.div,{...k,ref:g})},"ToastTitle")),eM=k.forwardRef(__name(function(m,g){let{__scopeToast:v,...k}=m;return(0,x.jsx)(el.WV.div,{...k,ref:g})},"ToastDescription")),eD=k.forwardRef(__name(function(m,g){let{altText:v,...k}=m;return v.trim()?(0,x.jsx)(eF,{altText:v,asChild:!0,children:(0,x.jsx)(eL,{...k,ref:g})}):(console.error("Invalid prop `altText` supplied to `ToastAction`. Expected non-empty `string`."),null)},"ToastAction")),eL=k.forwardRef(__name(function(m,g){let{__scopeToast:v,...k}=m,E=eP("ToastClose",v);return(0,x.jsx)(eF,{asChild:!0,children:(0,x.jsx)(el.WV.button,{type:"button",...k,ref:g,onClick:(0,T.Mj)(m.onClick,E.onClose)})})},"ToastClose")),eF=k.forwardRef(__name(function(m,g){let{__scopeToast:v,altText:k,...E}=m;return(0,x.jsx)(el.WV.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":k||void 0,...E,ref:g})},"ToastAnnounceExclude"));function getAnnounceTextContent(m){let g=[],v=Array.from(m.childNodes);return v.forEach(m=>
6{if(m.nodeType===m.TEXT_NODE&&m.textContent&&g.push(m.textContent),isHTMLElement(m)){let v=m.ariaHidden||m.hidden||"none"===m.style.display,x=""===m.dataset.radixToastAnnounceExclude;if(!v){if(x){let v=m.dataset.radixToastAnnounceAlt;v&&g.push(v)}else g.push(...getAnnounceTextContent(m))}}}),g}function handleAndDispatchCustomEvent(m,g,v,{discrete:x}){let k=v.originalEvent.currentTarget,E=new CustomEvent(m,{bubbles:!0,cancelable:!0,detail:v});g&&k.addEventListener(m,g,{once:!0}),x?(0,el.jH)(k,E):k.dispatchEvent(E)}__name(getAnnounceTextContent,"getAnnounceTextContent"),__name(handleAndDispatchCustomEvent,"handleAndDispatchCustomEvent");var eZ=__name((m,g,v=0)=>{let x=Math.abs(m.x),k=Math.abs(m.y),E=x>k;return"left"===g||"right"===g?E&&x>v:!E&&k>v},"isDeltaInDirection");function useNextFrame(m=()=>{}){let g=(0,ec.W)(m);(0,ed.b)(()=>{let m=0,v=0;return m=window.requestAnimationFrame(()=>v=window.requestAnimationFrame(g)),()=>{window.cancelAnimationFrame(m),window.cancelAnimationFrame(v)}},[g])}function isHTMLElement(m){return m.nodeType===m.ELEMENT_NODE}function getTabbableCandidates(m){let g=[],v=document.createTreeWalker(m,NodeFilter.SHOW_ELEMENT,{acceptNode:__name(m=>{let g="INPUT"===m.tagName&&"hidden"===m.type;return m.disabled||m.hidden||g?NodeFilter.FILTER_SKIP:m.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;v.nextNode();)g.push(v.currentNode);return g}function focusFirst(m){let g=document.activeElement;return m.some(m=>m===g||(m.focus(),document.activeElement!==g))}__name(useNextFrame,"useNextFrame"),__name(isHTMLElement,"isHTMLElement"),__name(getTabbableCandidates,"getTabbableCandidates"),__name(focusFirst,"focusFirst");var eB=v(10929),e$=v(38681),eU=v(66123),ez=v(93227),eV=v(69405),eq=v(4028),eH=v(25987);let eW=ew,eK=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eE,{ref:g,className:(0,eH.cn)("fixed top-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse gap-3 p-4 sm:top-auto sm:bottom-0 sm:right-0 sm:flex-col md:max-w-[400px]",v),...k})});eK.displayName=eE.displayName;let eG=(0,eB.j)("group pointer-events-auto relative flex w-full items-start gap-3 overflow-hidden rounded-lg border border-admin-border border-l-[3px] bg-admin-card text-admin-card-foreground p-4 pr-10 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border-l-admin-info",success:"border-l-admin-success",destructive:"border-l-admin-error",warning:"border-l-admin-warning",info:"border-l-admin-info"}},defaultVariants:{variant:"default"}}),ToastIcon=m=>{let{variant:g}=m;switch(g){case"success":return(0,x.jsx)(e$.Z,{className:"h-5 w-5 flex-shrink-0 text-admin-success"});case"destructive":return(0,x.jsx)(eU.Z,{className:"h-5 w-5 flex-shrink-0 text-admin-error"});case"warning":return(0,x.jsx)(ez.Z,{className:"h-5 w-5 flex-shrink-0 text-admin-warning"});default:return(0,x.jsx)(eV.Z,{className:"h-5 w-5 flex-shrink-0 text-admin-info"})}},eQ=k.forwardRef((m,g)=>{let{className:v,variant:k,children:E,...T}=m;return(0,x.jsxs)(eR,{ref:g,className:(0,eH.cn)(eG({variant:k}),v),...T,children:[(0,x.jsx)(ToastIcon,{variant:k}),(0,x.jsx)("div",{className:"flex-1 min-w-0 py-0.5",children:E})]})});eQ.displayName=eR.displayName;let eY=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eD,{ref:g,className:(0,eH.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-admin-border bg-transparent px-4 text-xs font-semibold text-admin-foreground transition-colors hover:bg-admin-accent focus:outline-none focus:ring-2 focus:ring-admin-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",v),...k})});eY.displayName=eD.displayName;let eX=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eL,{ref:g,className:(0,eH.cn)("absolute right-3 top-3 rounded-sm p-1 text-admin-muted-foreground opacity-70 transition-opacity hover:text-admin-foreground hover:opacity-100 focus:opacity-100 focus:outline-none",v),"toast-close":"",...k,children:(0,x.jsx)(eq.Z,{className:"h-4 w-4"})})});eX.displayName=eL.displayName;let eJ=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eA,{ref:g,className:(0,eH.cn)("text-sm font-semibold",v),...k})});eJ.displayName=eA.displayName;let e0=k.forwardRef((m,g)=>{let{className:v,...k}=m;return(0,x.jsx)(eM,{ref:g,className:(0,eH.cn)("text-sm text-admin-muted-foreground leading-relaxed mt-0.5",v),...k})});e0.displayName=eM.displayName},4165:function(m,g,v){"use strict";v.d(g,{x:function(){return Toaster}});var x=v(52322),k=v(676),E=v(91734);v(2784);let getDefaultTitle=m=>{switch(m){case"success":return"\xc9xito";case"destructive":return"Ups, algo sali\xf3 mal";case"warning":return"Ten en cuenta";case"info":return"Para tu informaci\xf3n";default:return"Notificaci\xf3n"}};function Toaster(){let{toasts:m}=(0,k.pm)();return(0,x.jsxs)(E.VW,{children:[m.map(function(m){let{id:g,title:v,description:k,action:T,variant:K,...et}=m,en=v||getDefaultTitle(K);return(0,x.jsxs)(E.FN,{variant:K,...et,children:[(0,x.jsxs)("div",{className:"grid gap-0.5",children:[(0,x.jsx)(E.Mi,{children:en}),k&&(0,x.jsx)(E.lj,{children:k})]}),T,(0,x.jsx)(E.sA,{})]},g)}),(0,x.jsx)(E._i,{})]})}},46443:function(m,g,v){"use strict";v.d(g,{u:function(){return eF},_v:function(){return eB},pn:function(){return eL},aJ:function(){return eZ}});var x=v(52322),k=v(2784),E=v(17998),T=v(62656),K=v(92211),et=v(1352),en=v(23372),er=v(66489),ei=v(78773),es=v(79616),el=v(72714),ec=v(49815),eu=v(81057),ed=v(61644),ep=v(89785),em=Object.defineProperty,__name=(m,g)=>em(m,"name",{value:g,configurable:!0}
6),[ef,eh]=(0,K.b)("Tooltip",[er.D7]),eg=(0,er.D7)(),ev="tooltip.open",[ey,eb]=ef("TooltipProvider"),ex=__name(m=>{let{__scopeTooltip:g,delayDuration:v=700,skipDelayDuration:E=300,disableHoverableContent:T=!1,children:K}=m,et=k.useRef(!0),en=k.useRef(!1),er=k.useRef(0);return k.useEffect(()=>{let m=er.current;return()=>window.clearTimeout(m)},[]),(0,x.jsx)(ey,{scope:g,isOpenDelayedRef:et,delayDuration:v,onOpen:k.useCallback(()=>{E<=0||(window.clearTimeout(er.current),et.current=!1)},[E]),onClose:k.useCallback(()=>{E<=0||(window.clearTimeout(er.current),er.current=window.setTimeout(()=>et.current=!0,E))},[E]),isPointerInTransitRef:en,onPointerInTransitChange:k.useCallback(m=>{en.current=m},[]),disableHoverableContent:T,children:K})},"TooltipProvider"),e_="Tooltip",[ew,eS]=ef(e_),eC=__name(m=>{let{__scopeTooltip:g,children:v,open:E,defaultOpen:T,onOpenChange:K,disableHoverableContent:et,delayDuration:ei}=m,es=eb(e_,m.__scopeTooltip),el=eg(g),[ec,ed]=k.useState(null),[ep,em]=k.useState(void 0),ef=(0,en.M)(),eh=k.useRef(0),ey=et??es.disableHoverableContent,ex=ei??es.delayDuration,eS=k.useRef(!1),[eC,ek]=(0,eu.T)({prop:E,defaultProp:T??!1,onChange:__name(m=>{m?(es.onOpen(),document.dispatchEvent(new CustomEvent(ev))):es.onClose(),K?.(m)},"onChange"),caller:e_}),eE=k.useMemo(()=>eC?eS.current?"delayed-open":"instant-open":"closed",[eC]),ej=k.useCallback(()=>{window.clearTimeout(eh.current),eh.current=0,eS.current=!1,ek(!0)},[ek]),eN=k.useCallback(()=>{window.clearTimeout(eh.current),eh.current=0,ek(!1)},[ek]),eR=k.useCallback(()=>{window.clearTimeout(eh.current),eh.current=window.setTimeout(()=>{eS.current=!0,ek(!0),eh.current=0},ex)},[ex,ek]);k.useEffect(()=>()=>{eh.current&&(window.clearTimeout(eh.current),eh.current=0)},[]);let eI=ep??ef;return(0,x.jsx)(er.fC,{...el,children:(0,x.jsx)(ew,{scope:g,contentId:eI,setContentId:em,open:eC,stateAttribute:eE,trigger:ec,onTriggerChange:ed,onTriggerEnter:k.useCallback(()=>{es.isOpenDelayedRef.current?eR():ej()},[es.isOpenDelayedRef,eR,ej]),onTriggerLeave:k.useCallback(()=>{ey?eN():(window.clearTimeout(eh.current),eh.current=0)},[eN,ey]),onOpen:ej,onClose:eN,disableHoverableContent:ey,children:v})})},"Tooltip"),ek="TooltipTrigger",eE=k.forwardRef(__name(function(m,g){let{__scopeTooltip:v,...K}=m,et=eS(ek,v),en=eb(ek,v),ei=eg(v),es=k.useRef(null),ec=(0,T.e)(g,es,et.onTriggerChange),eu=k.useRef(!1),ed=k.useRef(!1),ep=k.useCallback(()=>eu.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",ep),[ep]),(0,x.jsx)(er.ee,{asChild:!0,...ei,children:(0,x.jsx)(el.WV.button,{"aria-describedby":et.open?et.contentId:void 0,"data-state":et.stateAttribute,...K,ref:ec,onPointerMove:(0,E.Mj)(m.onPointerMove,m=>{"touch"===m.pointerType||ed.current||en.isPointerInTransitRef.current||(et.onTriggerEnter(),ed.current=!0)}),onPointerLeave:(0,E.Mj)(m.onPointerLeave,()=>{et.onTriggerLeave(),ed.current=!1}),onPointerDown:(0,E.Mj)(m.onPointerDown,()=>{et.open&&et.onClose(),eu.current=!0,document.addEventListener("pointerup",ep,{once:!0})}),onFocus:(0,E.Mj)(m.onFocus,()=>{eu.current||et.onOpen()}),onBlur:(0,E.Mj)(m.onBlur,et.onClose),onClick:(0,E.Mj)(m.onClick,et.onClose)})})},"TooltipTrigger")),ej="TooltipPortal",[eN,eR]=ef(ej,{forceMount:void 0}),eI=__name(m=>{let{__scopeTooltip:g,forceMount:v,children:k,container:E}=m,T=eS(ej,g);return(0,x.jsx)(eN,{scope:g,forceMount:v,children:(0,x.jsx)(es.z,{present:v||T.open,children:(0,x.jsx)(ei.h,{asChild:!0,container:E,children:k})})})},"TooltipPortal"),eP="TooltipContent",eT=k.forwardRef(__name(function(m,g){let v=eR(eP,m.__scopeTooltip),{forceMount:k=v.forceMount,side:E="top",...T}=m,K=eS(eP,m.__scopeTooltip);return(0,x.jsx)(es.z,{present:k||K.open,children:K.disableHoverableContent?(0,x.jsx)(eM,{side:E,...T,ref:g}):(0,x.jsx)(eO,{side:E,...T,ref:g})})},"TooltipContent")),eO=k.forwardRef(__name(function(m,g){let v=eS(eP,m.__scopeTooltip),E=eb(eP,m.__scopeTooltip),K=k.useRef(null),et=(0,T.e)(g,K),[en,er]=k.useState(null),{trigger:ei,onClose:es}=v,el=K.current,{onPointerInTransitChange:ec}=E,eu=k.useCallback(()=>{er(null),ec(!1)},[ec]),ed=k.useCallback((m,g)=>{let v=m.currentTarget,x={x:m.clientX,y:m.clientY},k=getExitSideFromRect(x,v.getBoundingClientRect()),E=getPaddedExitPoints(x,k),T=getPointsFromRect(g.getBoundingClientRect()),K=getHull([...E,...T]);er(K),ec(!0)},[ec]);return k.useEffect(()=>()=>eu(),[eu]),k.useEffect(()=>{if(ei&&el){let m=__name(m=>ed(m,el),"handleTriggerLeave"),g=__name(m=>ed(m,ei),"handleContentLeave");return ei.addEventListener("pointerleave",m),el.addEventListener("pointerleave",g),()=>{ei.removeEventListener("pointerleave",m),el.removeEventListener("pointerleave",g)}}}
6,[ei,el,ed,eu]),k.useEffect(()=>{if(en){let m=__name(m=>{let g=m.target,v={x:m.clientX,y:m.clientY},x=ei?.contains(g)||el?.contains(g),k=!isPointInPolygon(v,en);x?eu():k&&(eu(),es())},"handleTrackPointerGrace");return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[ei,el,en,es,eu]),(0,x.jsx)(eM,{...m,ref:et})},"TooltipContentHoverable")),eA=(0,ec.sA)("TooltipContent"),eM=k.forwardRef(__name(function(m,g){let{__scopeTooltip:v,children:E,"aria-label":T,id:K,onEscapeKeyDown:en,onPointerDownOutside:ei,...es}=m,el=eS(eP,v),ec=eg(v),{onClose:eu}=el;k.useEffect(()=>(document.addEventListener(ev,eu),()=>document.removeEventListener(ev,eu)),[eu]),k.useEffect(()=>{if(el.trigger){let m=__name(m=>{m.target instanceof Node&&m.target.contains(el.trigger)&&eu()},"handleScroll");return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[el.trigger,eu]);let{setContentId:em}=el;return(0,ed.b)(()=>(em(K),()=>{em(void 0)}),[K,em]),(0,x.jsx)(et.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:en,onPointerDownOutside:ei,onFocusOutside:m=>m.preventDefault(),onDismiss:eu,children:(0,x.jsxs)(er.VY,{"data-state":el.stateAttribute,role:T?void 0:"tooltip",id:T?void 0:el.contentId,...ec,...es,ref:g,style:{...es.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,x.jsx)(eA,{children:E}),T?(0,x.jsx)(ep.fC,{id:el.contentId,role:"tooltip",children:T}):null]})})},"TooltipContentImpl"));function getExitSideFromRect(m,g){let v=Math.abs(g.top-m.y),x=Math.abs(g.bottom-m.y),k=Math.abs(g.right-m.x),E=Math.abs(g.left-m.x);switch(Math.min(v,x,k,E)){case E:return"left";case k:return"right";case v:return"top";case x:return"bottom";default:throw Error("unreachable")}}function getPaddedExitPoints(m,g,v=5){let x=[];switch(g){case"top":x.push({x:m.x-v,y:m.y+v},{x:m.x+v,y:m.y+v});break;case"bottom":x.push({x:m.x-v,y:m.y-v},{x:m.x+v,y:m.y-v});break;case"left":x.push({x:m.x+v,y:m.y-v},{x:m.x+v,y:m.y+v});break;case"right":x.push({x:m.x-v,y:m.y-v},{x:m.x-v,y:m.y+v})}return x}function getPointsFromRect(m){let{top:g,right:v,bottom:x,left:k}=m;return[{x:k,y:g},{x:v,y:g},{x:v,y:x},{x:k,y:x}]}function isPointInPolygon(m,g){let{x:v,y:x}=m,k=!1;for(let m=0,E=g.length-1;m<g.length;E=m++){let T=g[m],K=g[E],et=T.x,en=T.y,er=K.x,ei=K.y,es=en>x!=ei>x&&v<(er-et)*(x-en)/(ei-en)+et;es&&(k=!k)}return k}function getHull(m){let g=m.slice();return g.sort((m,g)=>m.x<g.x?-1:m.x>g.x?1:m.y<g.y?-1:m.y>g.y?1:0),getHullPresorted(g)}function getHullPresorted(m){if(m.length<=1)return m.slice();let g=[];for(let v=0;v<m.length;v++){let x=m[v];for(;g.length>=2;){let m=g[g.length-1],v=g[g.length-2];if((m.x-v.x)*(x.y-v.y)>=(m.y-v.y)*(x.x-v.x))g.pop();else break}g.push(x)}g.pop();let v=[];for(let g=m.length-1;g>=0;g--){let x=m[g];for(;v.length>=2;){let m=v[v.length-1],g=v[v.length-2];if((m.x-g.x)*(x.y-g.y)>=(m.y-g.y)*(x.x-g.x))v.pop();else break}v.push(x)}return(v.pop(),1===g.length&&1===v.length&&g[0].x===v[0].x&&g[0].y===v[0].y)?g:g.concat(v)}__name(getExitSideFromRect,"getExitSideFromRect"),__name(getPaddedExitPoints,"getPaddedExitPoints"),__name(getPointsFromRect,"getPointsFromRect"),__name(isPointInPolygon,"isPointInPolygon"),__name(getHull,"getHull"),__name(getHullPresorted,"getHullPresorted");var eD=v(25987);let eL=ex,eF=eC,eZ=eE,eB=k.forwardRef((m,g)=>{let{className:v,sideOffset:k=4,...E}=m;return(0,x.jsx)(eI,{children:(0,x.jsx)(eT,{ref:g,sideOffset:k,className:(0,eD.cn)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
6de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",v),...E})})});eB.displayName=eT.displayName},9869:function(m,g,v){"use strict";v.d(g,{Ly:function(){return getAccountTypeName},Pp:function(){return k},TX:function(){return x},XC:function(){return getBankName}});let x=[{value:1,label:"BANCO DE CHILE"},{value:9,label:"BANCO INTERNACIONAL"},{value:12,label:"BANCO DEL ESTADO DE CHILE"},{value:14,label:"SCOTIABANK"},{value:16,label:"BANCO DE CREDITO E INVERSIONES"},{value:17,label:"BANCO DO BRASIL S.A"},{value:28,label:"BANCO BICE"},{value:31,label:"HSBC BANK"},{value:37,label:"BANCO SANTANDER-CHILE"},{value:39,label:"ITA\xda CORPBANCA"},{value:41,label:"JP MORGAN CHASE BANK, N. A."},{value:45,label:"MUFG Bank, Ltd."},{value:49,label:"BANCO SECURITY"},{value:51,label:"BANCO FALABELLA"},{value:53,label:"BANCO RIPLEY"},{value:55,label:"BANCO CONSORCIO"},{value:59,label:"BANCO BTG PACTUAL CHILE"},{value:60,label:"CHINA CONSTRUCTION BANK, AGENCIA EN CHILE"},{value:61,label:"BANK OF CHINA, AGENCIA EN CHILE"},{value:504,label:"SCOTIABANK AZUL"},{value:672,label:"COOPEUCH"},{value:729,label:"PREPAGO LOS HEROES"},{value:730,label:"TENPO PREPAGO"},{value:732,label:"TAPP CAJA LOS ANDES"},{value:875,label:"MERCADO PAGO"}],k=[{value:0,label:"Cuenta Corriente"},{value:1,label:"Cuenta Vista"},{value:2,label:"Cuenta Ahorro"}];function getBankName(m){let g=x.find(g=>g.value===m);return(null==g?void 0:g.label)||"Banco desconocido"}function getAccountTypeName(m){let g=k.find(g=>g.value===m);return(null==g?void 0:g.label)||"Tipo de cuenta desconocido"}},68945:function(m,g,v){"use strict";v.d(g,{Ve:function(){return isPreventiveCategory},Yi:function(){return E},_m:function(){return getCategoryNumber},eD:function(){return x},n7:function(){return getCategoryString},og:function(){return T},pv:function(){return requiresSeverityStep},sY:function(){return k},xT:function(){return isClaimBlocking}});let x={0:"preventive",1:"accident",2:"sickness",3:"preventive-exams",4:"preventive-vaccines",5:"preventive-consultation",6:"preventive-chip-installation",7:"preventive-teleconsultation",8:"complementary-therapy",9:"liability"},k={preventive:"Preventivo",accident:"Accidente",sickness:"Enfermedad","preventive-exams":"Ex\xe1menes preventivos","preventive-vaccines":"Vacunas preventivas","preventive-consultation":"Consulta preventiva","preventive-chip-installation":"Instalaci\xf3n de chip","preventive-teleconsultation":"Teleconsulta","complementary-therapy":"Terapia complementaria",liability:"Responsabilidad civil"},E={preventive:"Gastos preventivos generales",accident:"Tu mascota tuvo un accidente",sickness:"Tu mascota est\xe1 enferma","preventive-exams":"Ex\xe1menes de rutina","preventive-vaccines":"Vacunaci\xf3n anual","preventive-consultation":"Consulta de control","preventive-chip-installation":"Instalaci\xf3n de microchip","preventive-teleconsultation":"Consulta online","complementary-therapy":"Terapias adicionales de recuperaci\xf3n",liability:"Da\xf1os causados a terceros"},T=[{value:"better",label:"Mejorando"},{value:"same",label:"Sin cambios"},{value:"worse",label:"Cr\xedtico/Peor"},{value:"deceased",label:"Falleci\xf3"}];function getCategoryString(m){return x[m]||"preventive"}function getCategoryNumber(m){let g=Object.entries(x).find(g=>{let[,v]=g;return v===m});return g?Number(g[0]):0}let K=["processing","processing_delayed","info_needed","further_investigation"];function isClaimBlocking(m){return!!m&&K.includes(m)}function requiresSeverityStep(m){return["accident","sickness","complementary-therapy"].includes(m)}function isPreventiveCategory(m){return m.startsWith("preventive")||"preventive"===m}},37228:function(m,g,v){"use strict";v.d(g,{JD:function(){return mapPredictedTypeToDocumentType},Q4:function(){return getRequirementsForCategory}});let x={type:"receipt",label:"Boleta o factura",description:"Documento que comprueba el pago realizado en la cl\xednica veterinaria."},k={type:"budget",label:"Presupuesto",description:"Documento del veterinario con el detalle de cada prestaci\xf3n y su precio.",conditionalNote:'Obligatorio si tu boleta es voucher o no tiene el detalle \xedtem por \xedtem. Ej: si dice "Vacuna + Consulta = $30.000", necesitas el presupuesto que desglose cada precio.'},E={type:"diagnosis",label:"Informe cl\xednico",description:"Documento firmado por tu veterinario que explica el diagn\xf3stico, tratamiento realizado y estado de tu mascota."},T={type:"prescription",label:"Receta m\xe9dica",description:"Receta con los medicamentos indicados por el veterinario. Solo si compraste medicamentos."},K={type:"exam-results",label:"Resultados de ex\xe1menes",description:"Los resultados de los ex\xe1menes realizados (sangre, orina, ecograf\xeda, rayos X, etc.)."},et={type:"exam-prescription",label:"Orden de ex\xe1menes",description:"Documento donde el veterinario indica qu\xe9 ex\xe1menes se deben realizar."},en={type:"vaccination-card",label:"Carnet de vacunaci\xf3n",description:"Registro actualizado con las vacunas aplicadas a tu mascota."};function getRequirementsForCategory(m){switch(m){case"accident":return{required:[x,E],optional:[k,et,K,T]};case"sickness":return{required:[x,E],expected:[T],optional:[k,et,K]};case"complementary-therapy":return{required:[x,E],optional:[k,T]};case"preventive-exams":return{required:[x],optional:[k,et,K]};case"preventive-vaccines":return{required:[x],optional:[k,en]};case"preventive-consultation":case"preventive-teleconsultation":case"preventive-chip-installation":case"liability":case"preventive":return{required:[x],optional:[k]}}}function mapPredictedTypeToDocumentType(m){return({receipt:"receipt",budget:"budget",diagnosis:"diagnosis",prescription:"prescription",exam:"exam-results","exam-results":"exam-results","exam-prescription":"exam-prescription","vaccination-card":"vaccination-card",other:"extra-documents"})[m]||null}},11168:function(m,g,v){"use strict";function throwIfUndefined(m){if(void 0===m)throw Error("Value is undefined");return m}v.d(g,{H7:function(){return E},Qi:function(){return T},Qy:function(){return x},_O:function(){return et},pv:function(){return k},yx:function(){return K}});let x="login_rut",k="https://play.google.com/store/apps/details?id=cl.cacttus.app",E="https://apps.apple.com/cl/app/cacttus/id1607175656",T=throwIfUndefined("https://cacttus.cl"),K=throwIfUndefined("https://api.cacttus.cl"),et=throwIfUndefined("https://cacttus.cl");parseFloat(throwIfUndefined("0.19")),parseFloat(throwIfUndefined("1.27")),parseFloat(throwIfUndefined("6.5")),parseFloat(throwIfUndefined("1.59")),function(){let m=new URL(K);m.protocol="https:"===m.protocol?"wss:":"ws:",m.toString()}()},52320:function(m,g,v){"use strict";v.d(g,{$$:function(){return getAvailableDeductibles},Ag:function(){return T},Ov:function(){return getPlanById},QO:function(){return getQuoterPlansForDeductible},e8:function(){return E},oQ:function(){return getPlansByIds},pf:function(){return resolvePlanTitle},qL:function(){return getPlanTitleByPackageName},uF:function(){return getPolicyPlanLabel},uI:function(){return k},ud:function(){return x}});let x={vaccines:1,exams:1.3,consultations:.89,teleconsultations:.2,chip:.4}
6,k={deductible:3.2,amountCovered:40,liability:50,billPercentage:1,plans:[{id:"base+accidents+illnesses",title:"Accidentes y Enfermedades",description:"Cobertura para accidentes y enfermedades",illnesses:!0,preventivePackage:!1,features:[{name:"Accidentes",included:!0},{name:"Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1}]},{id:"base+accidents+illnesses+preventive",title:"Accidentes y Enfermedades + Preventivo",description:"Cobertura completa para tu mascota",illnesses:!0,preventivePackage:!0,features:[{name:"Accidentes",included:!0},{name:"Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0}]}]},E={deductible:3.2,amountCovered:40,liability:50,billPercentage:1,plans:[{id:"base+accidents+preventive",title:"Accidentes + Preventivo",description:"Cobertura para accidentes y cuidados preventivos",illnesses:!1,preventivePackage:!0,features:[{name:"Accidentes",included:!0},{name:"Enfermedades",included:!1},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"base+accidents+illnesses",title:"Accidentes y Enfermedades",description:"Cobertura para accidentes y enfermedades",illnesses:!0,preventivePackage:!1,features:[{name:"Accidentes",included:!0},{name:"Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"base+accidents+illnesses+preventive",title:"Accidentes y Enfermedades + Preventivo",description:"Cobertura completa para tu mascota",illnesses:!0,preventivePackage:!0,features:[{name:"Accidentes",included:!0},{name:"Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]}]},T={plans:[{id:"mini_deductible_0",title:"Plan Mini",description:"Cobertura esencial para arrancar con accidentes y enfermedades desde el d\xeda uno",deductible:0,amountCovered:20,liability:50,billPercentage:.6,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"0 UF",included:!0},{name:"Tope anual",value:"20 UF",included:!0},{name:"Cobertura",value:"60%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"mini_preventive_deductible_0",title:"Plan Mini",description:"Cobertura esencial con vacunas y chequeos incluidos para partir al d\xeda",deductible:0,amountCovered:20,liability:50,billPercentage:.6,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"0 UF",included:!0},{name:"Tope anual",value:"20 UF",included:!0},{name:"Cobertura",value:"60%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"care_preventive_deductible_0",title:"Plan Care",description:"Plan integral con urgencias enfermedades y chequeos de rutina siempre listos",deductible:0,amountCovered:40,liability:50,billPercentage:.7,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"0 UF",included:!0},{name:"Tope anual",value:"40 UF",included:!0},{name:"Cobertura",value:"70%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"care_deductible_0",title:"Plan Care",description:"Protecci\xf3n equilibrada para urgencias y enfermedades cuando m\xe1s lo necesitas",deductible:0,amountCovered:40,liability:50,billPercentage:.7,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"0 UF",included:!0},{name:"Tope anual",value:"40 UF",included:!0},{name:"Cobertura",value:"70%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"care_plus_deductible_0",title:"Plan Care+",description:"Experiencia premium con urgencias enfermedades y terapias complementarias sin sorpresas",deductible:0,amountCovered:80,liability:50,billPercentage:.9,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"0 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"90%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Tratamientos Complementarios",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"care_plus_preventive_deductible_0",title:"Plan Care+",description:"M\xe1xima protecci\xf3n con todo cubierto desde urgencias hasta cuidados preventivos",deductible:0,amountCovered:80,liability:
650,billPercentage:.9,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"0 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"90%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"mini_deductible_2",title:"Plan Mini",description:"Cobertura esencial pensada para cuidar el bolsillo sin soltar accidentes ni enfermedades",deductible:2,amountCovered:20,liability:50,billPercentage:.6,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"2 UF",included:!0},{name:"Tope anual",value:"20 UF",included:!0},{name:"Cobertura",value:"60%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"mini_preventive_deductible_2",title:"Plan Mini",description:"Cobertura esencial con vacunas y chequeos incluidos para mantener todo cubierto a buen precio",deductible:2,amountCovered:20,liability:50,billPercentage:.6,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"2 UF",included:!0},{name:"Tope anual",value:"20 UF",included:!0},{name:"Cobertura",value:"60%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"care_preventive_deductible_2",title:"Plan Care",description:"Favorito del hogar con urgencias enfermedades y chequeos rutinarios a costo amigable",deductible:2,amountCovered:40,liability:50,billPercentage:.7,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"2 UF",included:!0},{name:"Tope anual",value:"40 UF",included:!0},{name:"Cobertura",value:"70%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"care_deductible_2",title:"Plan Care",description:"Protecci\xf3n balanceada con urgencias y enfermedades a precio justo",deductible:2,amountCovered:40,liability:50,billPercentage:.7,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"2 UF",included:!0},{name:"Tope anual",value:"40 UF",included:!0},{name:"Cobertura",value:"70%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"care_plus_deductible_2",title:"Plan Care+",description:"Premium accesible con urgencias enfermedades y terapias complementarias disponibles",deductible:2,amountCovered:80,liability:50,billPercentage:.9,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"2 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"90%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Tratamientos Complementarios",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"care_plus_preventive_deductible_2",title:"Plan Care+",description:"Premium accesible con todo cubierto incluidos cuidados preventivos para mayor tranquilidad",deductible:2,amountCovered:80,liability:50,billPercentage:.9,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"2 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"90%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"mini_deductible_4",title:"Plan Mini",description:"Cobertura b\xe1sica muy accesible para accidentes y enfermedades sin complicaciones",deductible:4,amountCovered:20,liability:50,billPercentage:.6,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"4 UF",included:!0},{name:"Tope anual",value:"20 UF",included:!0},{name:"Cobertura",value:"60%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"mini_preventive_deductible_4",title:"Plan Mini",description:"Cobertura b\xe1sica con vacunas y chequeos para invertir inteligente sin gastar de m\xe1s",deductible:4,amountCovered:20,liability:
650,billPercentage:.6,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"4 UF",included:!0},{name:"Tope anual",value:"20 UF",included:!0},{name:"Cobertura",value:"60%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"care_preventive_deductible_4",title:"Plan Care",description:"Cobertura completa accesible con urgencias enfermedades y chequeos coordinados",deductible:4,amountCovered:40,liability:50,billPercentage:.7,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"4 UF",included:!0},{name:"Tope anual",value:"40 UF",included:!0},{name:"Cobertura",value:"70%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"care_deductible_4",title:"Plan Care",description:"Protecci\xf3n s\xf3lida y accesible para urgencias y enfermedades del d\xeda a d\xeda",deductible:4,amountCovered:40,liability:50,billPercentage:.7,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"4 UF",included:!0},{name:"Tope anual",value:"40 UF",included:!0},{name:"Cobertura",value:"70%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"care_plus_deductible_4",title:"Plan Care+",description:"Premium conveniente con urgencias enfermedades y terapias complementarias al mejor precio",deductible:4,amountCovered:80,liability:50,billPercentage:.9,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"4 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"90%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Tratamientos Complementarios",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"care_plus_preventive_deductible_4",title:"Plan Care+",description:"Premium conveniente que suma cuidados preventivos para no dejar nada afuera",deductible:4,amountCovered:80,liability:50,billPercentage:.9,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"4 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"90%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"catastrophic_deductible_6",title:"Plan Catastr\xf3fico 6 UF",description:"Red de seguridad total que responde al cien por ciento en emergencias grandes",deductible:6,amountCovered:80,liability:50,billPercentage:1,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"6 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"100%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"catastrophic_preventive_deductible_6",title:"Plan Catastr\xf3fico 6 UF",description:"Red de seguridad total que adem\xe1s suma vacunas y chequeos para paz completa",deductible:6,amountCovered:80,liability:50,billPercentage:1,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"6 UF",included:!0},{name:"Tope anual",value:"80 UF",included:!0},{name:"Cobertura",value:"100%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"catastrophic_deductible_12",title:"Plan Catastr\xf3fico 12 UF",description:"Escudo extremo pensado para lo realmente grave con cobertura total garantizada",deductible:12,amountCovered:120,liability:50,billPercentage:1,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"12 UF",included:!0},{name:"Tope anual",value:"120 UF",included:!0},{name:"Cobertura",value:"100%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"catastrophic_preventive_deductible_12",title:"Plan Catastr\xf3fico 12 UF",description:"Escudo extremo con cobertura total m\xe1s vacunas y chequeos para guardar la calma",deductible:12,amountCovered:120,liability:
650,billPercentage:1,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"12 UF",included:!0},{name:"Tope anual",value:"120 UF",included:!0},{name:"Cobertura",value:"100%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]},{id:"catastrophic_deductible_20",title:"Plan Catastr\xf3fico 20 UF",description:"Protecci\xf3n catastr\xf3fica que cubre al cien por ciento cuando llega lo impensado",deductible:20,amountCovered:120,liability:50,billPercentage:1,illnesses:!0,preventivePackage:!1,features:[{name:"Deducible anual",value:"20 UF",included:!0},{name:"Tope anual",value:"120 UF",included:!0},{name:"Cobertura",value:"100%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!1},{name:"Responsabilidad Civil",included:!0}]},{id:"catastrophic_preventive_deductible_20",title:"Plan Catastr\xf3fico 20 UF",description:"Protecci\xf3n catastr\xf3fica con cobertura total m\xe1s vacunas y chequeos para cualquier escenario",deductible:20,amountCovered:120,liability:50,billPercentage:1,illnesses:!0,preventivePackage:!0,features:[{name:"Deducible anual",value:"20 UF",included:!0},{name:"Tope anual",value:"120 UF",included:!0},{name:"Cobertura",value:"100%",included:!0},{name:"Accidentes y Enfermedades",included:!0},{name:"Cuidados Preventivos",included:!0},{name:"Responsabilidad Civil",included:!0}]}]},getPlanById=m=>{let g=T.plans.find(g=>g.id===m);if(!g)throw Error('Plan con ID "'.concat(m,'" no encontrado. IDs disponibles: ').concat(T.plans.map(m=>m.id).join(", ")));return g},getPlansByIds=m=>m.map(m=>getPlanById(m)),getPlanTitleByPackageName=m=>{var g,v,x;if(!m)return null;let K=null!==(v=null!==(g=T.plans.find(g=>g.id===m))&&void 0!==g?g:E.plans.find(g=>g.id===m))&&void 0!==v?v:k.plans.find(g=>g.id===m);return null!==(x=null==K?void 0:K.title)&&void 0!==x?x:null},K=/\s+\d+(?:[.,]\d+)?\s*UF$/,formatDeductibleUf=m=>"".concat(m.toLocaleString("es-CL",{maximumFractionDigits:2})," UF"),getPolicyPlanLabel=m=>{if(!m)return null;let g=getPlanTitleByPackageName(m.package_name);if(!g)return null;let v=m.health_item,x=(null==v?void 0:v.is_annual_deductible)?v.deductible:null,k=null===x?g:g.replace(K,""),E=m.has_preventive_package&&!k.includes("Preventivo")?"".concat(k," Preventivo"):k;return null===x?E:"".concat(E," — Deducible ").concat(formatDeductibleUf(x))},getAvailableDeductibles=()=>{let m=T.plans.map(m=>m.deductible).filter(m=>void 0!==m);return Array.from(new Set(m)).sort((m,g)=>m-g)},getQuoterPlansForDeductible=m=>{let g=[],v=T.plans.find(g=>g.deductible===m&&g.title.includes("Mini")&&!g.preventivePackage),x=T.plans.find(g=>g.deductible===m&&g.title.includes("Mini")&&g.preventivePackage);v&&x&&g.push({planType:"mini",title:"Plan Mini",basePlan:v,preventivePlan:x,preventiveSupported:!0,preventiveRequired:!1});let k=T.plans.find(g=>g.deductible===m&&g.title.includes("Care")&&!g.title.includes("Care+")&&!g.preventivePackage),E=T.plans.find(g=>g.deductible===m&&g.title.includes("Care")&&!g.title.includes("Care+")&&g.preventivePackage);k&&E&&g.push({planType:"care",title:"Plan Care",basePlan:k,preventivePlan:E,preventiveSupported:!0,preventiveRequired:!1});let K=T.plans.find(g=>g.deductible===m&&g.title.includes("Care+")&&!g.preventivePackage),et=T.plans.find(g=>g.deductible===m&&g.title.includes("Care+")&&g.preventivePackage);if(K&&et&&g.push({planType:"care_plus",title:"Plan Care+",basePlan:K,preventivePlan:et,preventiveSupported:!0,preventiveRequired:!1}),6===m||12===m||20===m){let v=T.plans.find(g=>g.deductible===m&&g.title.includes("Catastr\xf3fico")&&!g.preventivePackage&&"catastrophic"!==g.id),x=T.plans.find(g=>g.deductible===m&&g.title.includes("Catastr\xf3fico")&&g.preventivePackage&&"catastrophic_preventive"!==g.id);v&&x&&g.push({planType:"catastrophic",title:"Plan Catastr\xf3fico",basePlan:v,preventivePlan:x,preventiveSupported:!0,preventiveRequired:!1})}return g},resolvePlanTitle=(m,g)=>{var v,x;if(!m||!g)return null!==(v=null==m?void 0:m.replace(/\+/g," + "))&&void 0!==v?v:"N/A";let K=4===g?k.plans:5===g?E.plans:7===g?T.plans:[],et=K.find(g=>g.id===m);return null!==(x=null==et?void 0:et.title)&&void 0!==x?x:m.replace(/\+/g," + ")}},8041:function(m,g,v){"use strict";v.d(g,{U:function(){return T}});var x=v(11168);let k="".concat(x.yx,"/api/v2/admin/fraud"),E="".concat(x.yx,"/api/v2/admin/insurance/claims"),T={claims:{clear:m=>"".concat(k,"/claims/").concat(m,"/clear/"),confirmation:m=>"".concat(E,"/").concat(m,"/fraud-confirmation/"),detail:m=>"".concat(k,"/claims/").concat(m,"/"),evaluate:m=>"".concat(k,"/claims/").concat(m,"/evaluate/"),flag:m=>"".concat(k,"/claims/").concat(m,"/flag/"),signals:m=>"".concat(k,"/claims/").concat(m,"/signals/")},marks:{create:()=>"".concat(k,"/marks/"),detail:m=>"".concat(k,"/marks/").concat(m,"/"),level:m=>"".concat(k,"/marks/").concat(m,"/level/"),list:()=>"".concat(k,"/marks/"),remove:m=>"".concat(k,"/marks/").concat(m,"/remove/")},queue:()=>"".concat(k,"/queue/"),reasons:{create:()=>"".concat(k,"/reasons/"),list:()=>"".concat(k,"/reasons/")},signals:{dismiss:m=>"".concat(k,"/signals/").concat(m,"/dismiss/")},summary:()=>"".concat(k,"/summary/")}},96669:function(m,g,v){"use strict";function withFilters(m,g){return void 0===g?m:[...m,g]}v.d(g,{Y:function(){return x}});let x={all:()=>["fraud"],claim:m=>["fraud","claim",m],claimDetail:m=>["fraud","claim",m,"detail"],claimSignals:m=>["fraud","claim",m,"signals"],mark:m=>["fraud","mark",m],marks:m=>withFilters(["fraud","marks"],m),queue:m=>withFilters(["fraud","queue"],m),reasons:m=>withFilters(["fraud","reasons"],m),summary:m=>withFilters(["fraud","summary"],m)}},67618:function(m,g,v){"use strict";v.d(g,{Z:function(){return WithAuth}});var x=v(52322),k=v(2784),E=v(28151),T=v(11168),K=v(63955),et=v(25987),en=v(13980);function _classCallCheck(m,g){if(!(m instanceof g))throw TypeError("Cannot call a class as a function")}function _defineProperties(m,g){for(var v=0;v<g.length;v++){var x=g[v];
6x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,x.key,x)}}function _createClass(m,g,v){return g&&_defineProperties(m.prototype,g),v&&_defineProperties(m,v),m}function _inherits(m,g){if("function"!=typeof g&&null!==g)throw TypeError("Super expression must either be null or a function");m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),g&&_setPrototypeOf(m,g)}function _getPrototypeOf(m){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)})(m)}function _setPrototypeOf(m,g){return(_setPrototypeOf=Object.setPrototypeOf||function(m,g){return m.__proto__=g,m})(m,g)}function _createSuper(m){var g=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(m){return!1}}();return function(){var v,x,k=_getPrototypeOf(m);if(g){var E=_getPrototypeOf(this).constructor;x=Reflect.construct(k,arguments,E)}else x=k.apply(this,arguments);return(v=x)&&("object"==typeof v||"function"==typeof v)?v:function(m){if(void 0===m)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return m}(this)}}function _arrayLikeToArray(m,g){(null==g||g>m.length)&&(g=m.length);for(var v=0,x=Array(g);v<g;v++)x[v]=m[v];return x}function zeroPad(m){var g,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,x=String(m);if(0===v)return x;var k=x.match(/(.*?)([0-9]+)(.*)/),E=k?k[1]:"",T=k?k[3]:"",K=k?k[2]:x,et=K.length>=v?K:(((function(m){if(Array.isArray(m))return _arrayLikeToArray(m)})(g=Array(v))||function(m){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(m))return Array.from(m)}(g)||function(m,g){if(m){if("string"==typeof m)return _arrayLikeToArray(m,g);var v=Object.prototype.toString.call(m).slice(8,-1);if("Object"===v&&m.constructor&&(v=m.constructor.name),"Map"===v||"Set"===v)return Array.from(m);if("Arguments"===v||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v))return _arrayLikeToArray(m,g)}}(g)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(){return"0"}).join("")+K).slice(-1*v);return"".concat(E).concat(et).concat(T)}var er={daysInHours:!1,zeroPadTime:2},ei=function(m){_inherits(Countdown,m);var g=_createSuper(Countdown);function Countdown(){var m;return _classCallCheck(this,Countdown),m=g.apply(this,arguments),m.state={count:m.props.count||3},m.startCountdown=function(){m.interval=window.setInterval(function(){0==m.state.count-1?(m.stopCountdown(),m.props.onComplete&&m.props.onComplete()):m.setState(function(m){return{count:m.count-1}})},1e3)},m.stopCountdown=function(){clearInterval(m.interval)},m.addTime=function(g){m.stopCountdown(),m.setState(function(m){return{count:m.count+g}},m.startCountdown)},m}return _createClass(Countdown,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?(0,k.cloneElement)(this.props.children,{count:this.state.count}):null}}]),Countdown}(k.Component);ei.propTypes={count:en.number,children:en.element,onComplete:en.func};var es=function(m){_inherits(Countdown$1,m);var g=_createSuper(Countdown$1);function Countdown$1(m){var v;if(_classCallCheck(this,Countdown$1),(v=g.call(this,m)).mounted=!1,v.initialTimestamp=v.calcOffsetStartTimestamp(),v.offsetStartTimestamp=v.props.autoStart?0:v.initialTimestamp,v.offsetTime=0,v.legacyMode=!1,v.legacyCountdownRef=null,v.tick=function(){var m=v.calcTimeDelta(),g=m.completed&&!v.props.overtime?void 0:v.props.onTick;v.setTimeDeltaState(m,void 0,g)},v.setLegacyCountdownRef=function(m){v.legacyCountdownRef=m},v.start=function(){if(!v.isStarted()){var m=v.offsetStartTimestamp;v.offsetStartTimestamp=0,v.offsetTime+=m?v.calcOffsetStartTimestamp()-m:0;var g=v.calcTimeDelta();v.setTimeDeltaState(g,"STARTED",v.props.onStart),v.props.controlled||g.completed&&!v.props.overt
6ime||(v.clearTimer(),v.interval=window.setInterval(v.tick,v.props.intervalDelay))}},v.pause=function(){v.isPaused()||(v.clearTimer(),v.offsetStartTimestamp=v.calcOffsetStartTimestamp(),v.setTimeDeltaState(v.state.timeDelta,"PAUSED",v.props.onPause))},v.stop=function(){v.isStopped()||(v.clearTimer(),v.offsetStartTimestamp=v.calcOffsetStartTimestamp(),v.offsetTime=v.offsetStartTimestamp-v.initialTimestamp,v.setTimeDeltaState(v.calcTimeDelta(),"STOPPED",v.props.onStop))},v.isStarted=function(){return v.isStatus("STARTED")},v.isPaused=function(){return v.isStatus("PAUSED")},v.isStopped=function(){return v.isStatus("STOPPED")},v.isCompleted=function(){return v.isStatus("COMPLETED")},m.date){var x=v.calcTimeDelta();v.state={timeDelta:x,status:x.completed?"COMPLETED":"STOPPED"}}else v.legacyMode=!0;return v}return _createClass(Countdown$1,[{key:"componentDidMount",value:function(){!this.legacyMode&&(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(m){this.legacyMode||this.props.date===m.date||(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var m=this.props,g=m.date,v=m.now,x=m.precision,k=m.controlled,E=m.overtime;return function(m){var g,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},x=v.now,k=void 0===x?Date.now:x,E=v.precision,T=v.controlled,K=v.offsetTime,et=v.overtime;g="string"==typeof m?new Date(m).getTime():m instanceof Date?m.getTime():m,T||(g+=void 0===K?0:K);var en=T?g:g-k(),er=Math.min(20,Math.max(0,void 0===E?0:E)),ei=Math.round(1e3*parseFloat(((et?en:Math.max(0,en))/1e3).toFixed(er))),es=Math.abs(ei)/1e3;return{total:ei,days:Math.floor(es/86400),hours:Math.floor(es/3600%24),minutes:Math.floor(es/60%60),seconds:Math.floor(es%60),milliseconds:Number((es%1*1e3).toFixed()),completed:ei<=0}}(g,{now:v,precision:x,controlled:k,offsetTime:this.offsetTime,overtime:E})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(m){this.legacyCountdownRef.addTime(m)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(m){return this.state.status===m}},{key:"setTimeDeltaState",value:function(m,g,v){var x=this;if(this.mounted){var k=m.completed&&!this.state.timeDelta.completed,E=m.completed&&"STARTED"===g;return k&&!this.props.overtime&&this.clearTimer(),this.setState(function(v){var k=g||v.status;return m.completed&&!x.props.overtime?k="COMPLETED":g||"COMPLETED"!==k||(k="STOPPED"),{timeDelta:m,status:k}},function(){v&&v(x.state.timeDelta),x.props.onComplete&&(k||E)&&x.props.onComplete(m,E)})}}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var m,g,v,x,k,E,T,K,et,en,ei,es=this.props,el=es.daysInHours,ec=es.zeroPadTime,eu=es.zeroPadDays,ed=this.state.timeDelta;return Object.assign(Object.assign({},ed),{api:this.getApi(),props:this.props,formatted:(m=ed.days,g=ed.hours,v=ed.minutes,x=ed.seconds,E=(k=Object.assign(Object.assign({},er),{daysInHours:el,zeroPadTime:ec,zeroPadDays:eu})).daysInHours,T=k.zeroPadTime,et=void 0===(K=k.zeroPadDays)?T:K,en=Math.min(2,T),ei=E?zeroPad(g+24*m,T):zeroPad(g,en),{days:E?"":zeroPad(m,et),hours:ei,minutes:zeroPad(v,en),seconds:zeroPad(x,en)})})}},{key:"render",value:function(){if(this.legacyMode){var m=this.props,g=m.count,v=m.children,x=m.onComplete;return(0,k.createElement)(ei,{ref:this.setLegacyCountdownRef,count:g,onComplete:x},v)}var E=this.props,T=E.className,K=E.overtime,et=E.children,en=E.renderer,er=this.getRenderProps();if(en)return en(er);if(et&&this.state.timeDelta.completed&&!K)return(0,k.cloneElement)(et,{countdown:er});var es=er.formatted,el=es.days,ec=es.hours,eu=es.minutes,ed=es.seconds;return(0,k.createElement)("span",{className:T},er.total<0?"-":"",el,el?":":"",ec,":",eu,":",ed)}}]),Countdown$1}(k.Component);es.defaultProps=Object.assign(Object.assign({},er),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0}),es.propTypes={date:(0,en.oneOfType)([(0,en.instanceOf)(Date),en.string,en.number]),daysInHours:en.bool,zeroPadTime:en.number,zeroPadDays:en.number,controlled:en.bool,intervalDelay:en.number,precision:en.number,autoStart:en.bool,overtime:en.bool,className:en.string,children:en.element,renderer:en.func,now:en.func,onMount:en.func,onStart:en.func,onPause:en.func,onStop:en.func,onTick:en.func,onComplete:en.func};var el=v(44607),ec=v(20463),eu=v(14016),ed=v(45447),ep=v(93829),em=v(38421),ef=v.n(em),eh=v(13346),eg=v(49759),ev=v(77546),ey=v(65817),eb=v(62350),ex=v(44994),e_=v(53538),ew=v(68717);let eS=e_.Ry({anonymized_phone:e_.Z_().nullable(),anonymized_email:e_.Z_()}).passthrough(),useGetByRut=()=>(0,eb.D)(async m=>{try{let{data:g}=await (0,ex.h)(eS,{method:"get",url:"".concat(ew.O.NEXT_PUBLIC_BASE_URL,"/api/users/by-rut/").concat(m.replace(/[.-]/g,""))});return g}catch(m){throw(0,eu.rj)(m),m}});var eC=v(5632),ek=v(3101),eE=v(84631),ej=v(3176),eN=v(6660),eR=v(53328);let ErrorMessage=m=>(0,x.jsxs)("div",{className:(0,et.cn)("flex flex-row self-center",m.className),children:[(0,x.jsx)(ev.Z,{className:"text-pink-700 w-4 h-4 mr-1 mt-0.5 shrink-0"}),(0,x.jsx)("p",{className:"text-pink-700 text-sm",children:m.message})]}
6),AskForSignUp=m=>{let g=(0,eC.useRouter)(),v=(0,ey.i)(),[E,et]=(0,k.useState)(!1),en=(0,k.useRef)(null),er=eE.ZP.object({isTcAccepted:eE.ZP.boolean().refine(m=>!0===m,{message:"Debes aceptar los T\xe9rminos y Condiciones"})}),{handleSubmit:ei,control:es}=(0,K.cI)({resolver:m=>{var g;let v=er.safeParse(m);if(v.success)return{values:v.data,errors:{}};let x=null!==(g=v.error.issues)&&void 0!==g?g:[],k=x.reduce((m,g)=>{let v=g.path.join(".");return m[v]={type:g.code,message:g.message},m},{});return{values:{},errors:k}},mode:"onTouched",defaultValues:{isTcAccepted:!0}});async function onSubmit(){var x,k,E,K;try{let K="";ew.O.NEXT_PUBLIC_BYPASS_CAPTCHA||(K=null!==(E=await (null===(x=en.current)||void 0===x?void 0:x.executeAsync()))&&void 0!==E?E:"",null===(k=en.current)||void 0===k||k.reset(),await new Promise(m=>setTimeout(m,100))),et(!0);let er=await v.mutateAsync({rut:m.rut,captcha:K}),ei=er.success&&!er.userNotFound,es=eR.w.getState().updateOnboarding;es({rut:m.rut,requiresLogin:ei}),localStorage.setItem(T.Qy,m.rut),g.push(eh.Z.pet.new.userInfo())}catch(m){(0,ec.Tb)(m),null===(K=en.current)||void 0===K||K.reset()}finally{et(!1)}}return(0,x.jsxs)("form",{onSubmit:ei(onSubmit),className:"flex flex-col items-center justify-center px-6 md:px-32",children:[!ew.O.NEXT_PUBLIC_BYPASS_CAPTCHA&&(0,x.jsx)(ej.Z,{ref:en,size:"invisible",sitekey:ew.O.NEXT_PUBLIC_RECAPTCHA_KEY}),(0,x.jsx)("div",{className:"mt-6 md:mt-9",children:(0,x.jsx)(ef(),{src:"/static/images/warning-lines.svg",height:72,width:72,className:"mt-6"})}),(0,x.jsx)("div",{className:"mt-6 text-neutral-500 text-center",children:"No tenemos registrado este RUT"}),(0,x.jsx)("div",{className:"mt-4 font-bold text-xl text-center",children:"\xbfQuieres continuar y crear una sesi\xf3n nueva?"}),(0,x.jsx)("div",{className:"mt-6 px-6 py-2.5 w-full border border-neutral-200 rounded bg-neutral-50 text-neutral-500",children:m.rut}),(0,x.jsx)("div",{className:"mt-6 w-full",children:(0,x.jsx)(K.Qr,{control:es,name:"isTcAccepted",render:m=>{let{field:{onChange:g,value:v},fieldState:{error:k}}=m;return(0,x.jsx)(eN.Z,{label:(0,x.jsxs)("span",{className:"text-gray-500 text-sm",children:["Acepto los ",(0,x.jsx)("a",{href:"/terms",target:"_blank",rel:"noreferrer",className:"underline",children:"T\xe9rminos y Condiciones"})]}),isChecked:v,setIsChecked:g,errorMessage:null==k?void 0:k.message})}})}),(0,x.jsx)(ep.z,{variant:"brand",loading:E,size:"full",className:"mt-9",type:"submit",children:"Continuar"}),(0,x.jsx)(ep.z,{size:"sm",className:"mt-6 self-center md:mb-9",variant:"muted-link",onClick:()=>m.setOpen(!1),children:"Cambiar RUT"})]})},EmailForm=m=>{var g;let v=eE.ZP.object({rut:eE.ZP.string().refine(m=>(0,ek.validate)(m),{message:"El RUT no es v\xe1lido"}).transform(m=>m.replace(/[.-]/g,""))}),E=(0,k.useRef)(null),[T,et]=(0,k.useState)(!1),[en,er]=(0,k.useState)(!1),[ei,es]=(0,k.useState)(null),onSubmit=async g=>{var v,x,k,T;let K="";ew.O.NEXT_PUBLIC_BYPASS_CAPTCHA||(K=null!==(k=await (null===(v=E.current)||void 0===v?void 0:v.executeAsync()))&&void 0!==k?k:"",null===(x=E.current)||void 0===x||x.reset(),await new Promise(m=>setTimeout(m,100))),et(!0),es(null);try{let v=await m.requestNewToken(g.rut,K);er(!v)}catch(m){(0,ec.Tb)(m),es("Hubo un error al generar el c\xf3digo. Intenta nuevamente"),null===(T=E.current)||void 0===T||T.reset()}finally{et(!1)}},{register:el,handleSubmit:eu,formState:{errors:em},watch:ef,setValue:eh}=(0,K.cI)({resolver:m=>{var g;let x=v.safeParse(m);if(x.success)return{values:x.data,errors:{}};let k=null!==(g=x.error.issues)&&void 0!==g?g:[],E=k.reduce((m,g)=>{let v=g.path.join(".");return m[v]={type:g.code,message:g.message},m},{});return{values:{},errors:E}},mode:"onTouched"}),{rut:eg}=ef();return en?(0,x.jsx)(AskForSignUp,{rut:eg,setOpen:er}):(0,x.jsxs)("form",{onSubmit:eu(onSubmit),className:"flex flex-col px-6 md:px-12",children:[!ew.O.NEXT_PUBLIC_BYPASS_CAPTCHA&&(0,x.jsx)(ej.Z,{ref:E,size:"invisible",sitekey:ew.O.NEXT_PUBLIC_RECAPTCHA_KEY}),(0,x.jsx)("div",{className:"text-xl md:text-2xl font-bold text-center mt-6 md:mt-9",children:"\xa1Hola, qu\xe9 bueno verte de nuevo!"}),(0,x.jsx)("div",{className:"mt-4 text-neutral-500 text-center",children:"Para ingresar digita tu RUT"}),(0,x.jsx)("div",{className:"mt-9",children:(0,x.jsx)(ed.Z,{theme:"square",placeholder:"Tu RUT",inputProps:el
6("rut",{onChange:m=>{let g=m.target.value;g.length>1&&eh("rut",(0,ek.format)(g))}}),inputClassName:"focus:border-blue-500 outline-none",isError:!!em.rut||!!ei})}),ei&&(0,x.jsx)(ErrorMessage,{message:ei,className:"mt-2"}),(null==em?void 0:null===(g=em.rut)||void 0===g?void 0:g.message)&&(0,x.jsx)(ErrorMessage,{message:em.rut.message,className:"mt-2"}),(0,x.jsx)(ep.z,{variant:"brand",type:"submit",disabled:T,className:"hidden md:block self-center my-9",children:"Continuar"}),(0,x.jsx)(ep.z,{variant:"brand",type:"submit",disabled:T,className:"block md:hidden mt-9",size:"full",children:"Continuar"})]})};function useRequestNewTokenButton(m){let[g,v]=(0,k.useState)(Date.now()),[E,T]=(0,k.useState)(!1),[K,et]=(0,k.useState)(!1),refreshToken=async()=>{if(E)try{await m.requestNewToken(),T(!1),v(Date.now()),et(!0)}catch(m){(0,ec.Tb)(m)}},sendNewTokenText=()=>E?(0,x.jsx)("span",{children:m.buttonText}):(0,x.jsxs)("span",{className:"flex relative",children:[(0,x.jsxs)("p",{children:[m.buttonText," en"]}),(0,x.jsx)("div",{className:"absolute inset-y-0 -right-7",children:(0,x.jsx)(es,{date:g+6e4,intervalDelay:0,precision:0,renderer:m=>(0,x.jsx)("div",{children:m.total/1e3}),onComplete:()=>T(!0)})})]});return{RequestNewTokenButton:()=>(0,x.jsx)(ep.z,{variant:"brand",onClick:()=>void refreshToken(),size:"full",disabled:!E,children:sendNewTokenText()}),showSpamWarning:K}}let PasswordForm=m=>{let[g,v]=(0,k.useState)(),E=(0,k.useRef)(null),[T,en]=(0,k.useState)(!1),er=useGetByRut(),[ei,es]=(0,k.useState)(),[ec,ed]=(0,k.useState)(),[em,ef]=(0,k.useState)(!1),eh=(0,ey.i)(),{RequestNewTokenButton:eb,showSpamWarning:ex}=useRequestNewTokenButton({buttonText:"Pedir nuevo c\xf3digo",rut:m.rut,getNewCodeMutation:eh,requestNewToken:async()=>{let g="";if(!ew.O.NEXT_PUBLIC_BYPASS_CAPTCHA){let m=document.querySelector('textarea[name="g-recaptcha-response"]');g=(null==m?void 0:m.value)||""}await m.requestNewToken(m.rut,g,!1),ef(!1)}}),{RequestNewTokenButton:e_,showSpamWarning:eS}=useRequestNewTokenButton({buttonText:"Pedir c\xf3digo por SMS",rut:m.rut,getNewCodeMutation:eh,requestNewToken:async()=>{let g="";if(!ew.O.NEXT_PUBLIC_BYPASS_CAPTCHA){let m=document.querySelector('textarea[name="g-recaptcha-response"]');g=(null==m?void 0:m.value)||""}await m.requestNewToken(m.rut,g,!0),ef(!0)}});async function onMount(){try{let g=await er.mutateAsync(m.rut);g&&(es(g.anonymized_phone),ed(g.anonymized_email))}catch(m){(0,eu.rj)(m)}}(0,k.useEffect)(()=>{onMount()},[]),(0,k.useEffect)(()=>{g&&6===g.length&&eC(onSubmit)()},[g]);let onSubmit=async()=>{if(g){en(!0);try{await m.tryLogin(g)}finally{en(!1)}}};(0,k.useEffect)(()=>{(null==E?void 0:E.current)!==null&&E.current.querySelectorAll("input").forEach(m=>{m.setAttribute("style","")})},[E]);let{handleSubmit:eC}=(0,K.cI)({mode:"onBlur"});return(0,x.jsxs)("div",{className:"flex flex-col px-6 md:px-[90px]",children:[(0,x.jsx)("div",{className:"text-xl md:text-2xl font-bold text-center mt-6 md:mt-9",children:"Ingresa el c\xf3digo de verificaci\xf3n"}),(0,x.jsxs)("div",{className:"text-center mt-6",children:["Ingresa el c\xf3digo que te mandamos reci\xe9n al correo ",(0,x.jsx)("span",{className:"text-blue-500",children:ec}),em?(0,x.jsxs)(x.Fragment,{children:[" y por SMS al ",ei?(0,x.jsx)("span",{className:"text-blue-500",children:ei}):"tel\xe9fono asociado a tu cuenta"]}):null]}),(0,x.jsx)("div",{className:"flex flex-row items-center justify-center w-full mt-9",children:(0,x.jsxs)("div",{ref:E,className:"relative flex flex-row items-center justify-center",children:[(0,x.jsx)(el.Z,{value:g,onChange:v,numInputs:6,containerStyle:"flex items-center justify-center gap-2",inputStyle:(0,et.cn)("w-full w-[38px] h-[38px] text-center font-bold rounded-lg border border-neutral-200 focus:border-2 focus:border-blue-500 outline-none transition-border duration-75",{"bg-neutral-100 text-neutral-300 border-neutral-100 cursor-not-allowed":T}),isDisabled:T,isInputNum:!0,shouldAutoFocus:!0}),T&&(0,x.jsx)("div",{className:"absolute flex items-center justify-center -right-6",children:(0,x.jsx)(eg.Z,{className:"animate-spin w-4 h-4 text-blue-500"})})]})}),(0,x.jsx)("div",{className:"mt-9",children:(0,x.jsx)(eb,{})}),(0,x.jsx)("div",{className:"mt-2",children:(0,x.jsx)(e_,{})}),(ex||eS)&&(0,x.jsxs)("div",{className:"flex flex-row items-center bg-pink-100 mt-6 rounded-md px-4 py-2.5 self-center",children:[(0,x.jsx)(ev.Z,{className:"text-pink-700 w-4 h-4 mr-1"}),(0,x.jsx)("p",{className:"text-pink-700 text-sm",children:"Recuerda revisar tu correo no deseado"})]}),(0,x.jsx)(ep.z,{variant:"muted-link",onClick:m.changeRut,size:"sm",className:"my-6",children:"Cambiar RUT"})]})};
6var eI=v(56427),eP=v(39776),eT=v(676),eO=v(59350),login=()=>{let[m,g]=(0,k.useState)(),[v,K]=(0,k.useState)(!1),{mutateAsync:et}=(0,eI.f)(),en=(0,eO.Cr)(),{refetch:er}=(0,eP.a)(),ei=(0,ey.i)();(0,k.useEffect)(()=>{K(!0);let m=localStorage.getItem(T.Qy)||void 0;g(m),K(!1)},[]);let tryLogin=async g=>{try{await et({rut:m,password:g}),localStorage.removeItem(T.Qy);let{data:x}=await er();if(x){var v;(0,E.$A)(x.id,{national_id:x.rut,email:x.email,firstName:x.first_name,lastName:x.last_name,phone:x.phone,birthdate:x.birthdate,address:null===(v=x.address)||void 0===v?void 0:v.formatted_address,status:x.paying_user?"Cliente":"Cotizante"}),await en()}}catch(g){let{message:m}=(0,eu.EV)(g,"Hubo un error al hacer login. Por favor intenta nuevamente");throw eT.Am.error(m),g}},requestNewToken=async function(m,v){let x=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let k=await ei.mutateAsync({rut:m,captcha:v,sendSms:x});if(k.success)return g(m),localStorage.setItem(T.Qy,m),!0;if(k.userNotFound)return!1;return k.error&&eT.Am.error(k.error),!1}catch(m){return localStorage.removeItem(T.Qy),!1}};return(0,x.jsx)("div",{className:"flex-auto flex justify-center items-center",children:(0,x.jsx)("div",{className:"flex flex-col w-full md:max-w-xl md:bg-white md:shadow-3xl md:rounded-lg md:mt-20",children:v?(0,x.jsx)("div",{className:"flex items-center justify-center mt-20",children:(0,x.jsx)(eg.Z,{className:"animate-spin w-16 h-16"})}):m?(0,x.jsx)(PasswordForm,{tryLogin:tryLogin,changeRut:()=>{g(void 0),localStorage.removeItem(T.Qy)},requestNewToken:requestNewToken,rut:m}):(0,x.jsx)(EmailForm,{requestNewToken:requestNewToken})})})},eA=v(43889),eM=v(81075),WithAuth=function(m){let Auth=g=>{let v=(0,eM.f)(),k=(0,eA.t)(m=>!!m.token);return v?k?(0,x.jsx)(m,{...g}):(0,x.jsx)(login,{}):null};return m.getInitialProps&&(Auth.getInitialProps=g=>m.getInitialProps?m.getInitialProps(g):{}),Auth}},43335:function(m,g,v){"use strict";function formatRut(m){if(m){let g=m.replace(/[.-]/g,"");if(1===g.length)return g;let v=g.length,x=g[v-1],k=g.slice(0,v-1),E=parseInt(k).toLocaleString("es-CL");return E+"-"+x}return""}function capitalizeFirstLetter(m){return m?m.charAt(0).toUpperCase()+m.slice(1):""}v.d(g,{BC:function(){return parseBackendDate},Ed:function(){return formatToCLP},Ju:function(){return changePriceToUf},UZ:function(){return getPetStringAge},cD:function(){return formatToUF},fm:function(){return capitalizeFirstLetter},hC:function(){return roundPriceValue},r2:function(){return FormattedUserAddress},t2:function(){return formatRut},xL:function(){return IsPetOverAge}}),v(52322),v(2784);let FormattedUserAddress=m=>{if(m)return m.additional_info?"".concat(m.street," ").concat(m.number,", depto/casa ").concat(m.additional_info,", ").concat(m.comuna,", ").concat(m.country):"".concat(m.street," ").concat(m.number,", ").concat(m.comuna,", ").concat(m.country)};function formatToCLP(m){let g="";if(null!=m){let v=Math.round(m);g="$".concat(v.toLocaleString("es-CL"))}else g="";return g}function formatToUF(m){return null!=m?"".concat(m.toLocaleString("es-CL",{minimumFractionDigits:4,maximumFractionDigits:4})," UF"):""}function getPetStringAge(m){let g=new Date,v="";return m.getYear()<g.getYear()?1==(v=-((m.getYear()-g.getYear())*1))?v.toString()+" a\xf1o":v.toString()+" a\xf1os":1==(v=-((m.getMonth()-g.getMonth())*1))?v.toString()+" mes":v.toString()+" meses"}g.ZP=formatToCLP;let IsPetOverAge=m=>{let g=new Date(m),v=new Date,x=(v.getTime()-g.getTime())/2592e6;return{oldEnough:x>=3}};function changePriceToUf(m,g,v){let x=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,k=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"annual",E=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,T=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"up",K=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,et=k&&"annual"!==k?m/12:m;if(E>0&&(et*=1-E),g)return"".concat(Math.round((et+Number.EPSILON)*100)/100," UF").replace(".",",");{let m=Math.max(Math.round(et*v/x)*x-K,0);return"up"===T?formatToCLP(m):formatToCLP(m-x)}}function roundPriceValue(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up",x=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,k=Math.max(Math.ceil(m/g)*g-x,0);return"up"===v?k:k-g}function parseBackendDate(m){return new Date(m.includes("T")?m:m+"T12:00:00")}},676:function(m,g,v){"use strict";v.d(g,{Am:function(){return toast},pm:function(){return useToast}});var x=v(2784);let k=0,E=new Map,addToRemoveQueue=m=>{if(E.has(m))return;let g=setTimeout(()=>{E.delete(m),dispatch({type:"REMOVE_TOAST",toastId:m})},5e3);E.set(m,g)},reducer=(m,g)=>{switch(g.type){case"ADD_TOAST":return{...m,toasts:[g.toast,...m.toasts].slice(0,3)};case"UPDATE_TOAST":return{...m,toasts:m.toasts.map(m=>m.id===g.toast.id?{...m,...g.toast}:m)};case"DISMISS_TOAST":{let{toastId:v}=g;
6return v?addToRemoveQueue(v):m.toasts.forEach(m=>{addToRemoveQueue(m.id)}),{...m,toasts:m.toasts.map(m=>m.id===v||void 0===v?{...m,open:!1}:m)}}case"REMOVE_TOAST":if(void 0===g.toastId)return{...m,toasts:[]};return{...m,toasts:m.toasts.filter(m=>m.id!==g.toastId)}}},T=[],K={toasts:[]};function dispatch(m){K=reducer(K,m),T.forEach(m=>{m(K)})}function toast(m){let{...g}=m,v=(k=(k+1)%Number.MAX_SAFE_INTEGER).toString(),dismiss=()=>dispatch({type:"DISMISS_TOAST",toastId:v});return dispatch({type:"ADD_TOAST",toast:{...g,id:v,open:!0,onOpenChange:m=>{m||dismiss()}}}),{id:v,dismiss,update:m=>dispatch({type:"UPDATE_TOAST",toast:{...m,id:v}})}}function useToast(){let[m,g]=x.useState(K);return x.useEffect(()=>(T.push(g),()=>{let m=T.indexOf(g);m>-1&&T.splice(m,1)}),[m]),{...m,toast,dismiss:m=>dispatch({type:"DISMISS_TOAST",toastId:m})}}toast.success=(m,g)=>toast({variant:"success",title:g||"\xc9xito",description:m}),toast.error=(m,g)=>toast({variant:"destructive",title:g||"Error",description:m}),toast.warning=(m,g)=>toast({variant:"warning",title:g||"Atenci\xf3n",description:m}),toast.info=(m,g)=>toast({variant:"info",title:g||"Informaci\xf3n",description:m})},65323:function(m,g,v){"use strict";v.d(g,{s:function(){return useDialogPortalContainer}});var x=v(2784);function useDialogPortalContainer(m){let[g,v]=(0,x.useState)(void 0);return(0,x.useEffect)(()=>{var g;let x=m.current;x&&v(null!==(g=x.closest('[role="dialog"], [role="alertdialog"]'))&&void 0!==g?g:void 0)},[m]),g}},81075:function(m,g,v){"use strict";v.d(g,{f:function(){return useHasMounted}});var x=v(2784);function useHasMounted(){let[m,g]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{g(!0)},[]),m}},78233:function(m,g,v){"use strict";v.d(g,{$M:function(){return useMercadoPagoSdk},I_:function(){return useMercadoPagoInit},PU:function(){return reinjectDeviceFingerprint}});var x=v(2784),k=v(6323),E=v(68717);let T="https://www.mercadopago.com/v2/security.js",K=!1;function preloadDeviceFingerprint(){var m;if("undefined"==typeof document||document.querySelector('script[src^="'.concat(T,'"]')))return;let g=document.createElement("script");g.src=T,g.setAttribute("view","checkout"),(null!==(m=document.head)&&void 0!==m?m:document.body).appendChild(g)}function reinjectDeviceFingerprint(){var m;"undefined"!=typeof document&&(null===(m=document.querySelector('script[src^="'.concat(T,'"]')))||void 0===m||m.remove(),preloadDeviceFingerprint())}function useMercadoPagoInit(){(0,x.useEffect)(()=>{K||(K=!0,(0,k.R6)(E.O.NEXT_PUBLIC_MERCADO_PAGO_PUBLIC_KEY),preloadDeviceFingerprint())},[])}let et=null;function useMercadoPagoSdk(m){let[g,v]=(0,x.useState)(()=>window.MercadoPago?"ready":"loading"),[k,E]=(0,x.useState)(0);(0,x.useEffect)(()=>{if(!m)return;if(window.MercadoPago){v("ready");return}let g=!1;v("loading");let loadSdk=async()=>{try{await (window.MercadoPago?Promise.resolve():(et||(et=new Promise((m,g)=>{var v;if(window.MercadoPago){m();return}let x=document.createElement("script");x.src="https://sdk.mercadopago.com/js/v2",x.async=!0,x.addEventListener("load",()=>{window.MercadoPago?m():(x.remove(),g(Error("MercadoPago.js carg\xf3 pero window.MercadoPago no est\xe1 disponible")))}),x.addEventListener("error",()=>{x.remove(),g(Error("Failed to load MercadoPago.js"))}),(null!==(v=document.head)&&void 0!==v?v:document.body).appendChild(x)}).catch(m=>{throw et=null,m})),et)),g||v("ready")}catch(m){g||v("error")}};return loadSdk(),()=>{g=!0}},[m,k]);let T=(0,x.useCallback)(()=>{E(m=>m+1)},[]);return{status:g,retry:T}}},35151:function(m,g,v){"use strict";var x=v(20463),k=v(89644),E=v.n(k),T=v(11168),K=v(43889);let et=E().create({baseURL:T.yx}),en=!1;function ensureHeaders(m){return m.headers||(m.headers={}),m.headers}function handleAuthenticationFailure(){en||(en=!0,setTimeout(()=>{K.t.getState().logout(),en=!1},100))}et.interceptors.request.use(function(m){let g=function(m){let g=K.t.getState().token,v=ensureHeaders(m);return g?v.Authorization="Bearer ".concat(g):delete v.Authorization,m}(m),v=function(m){let g=ensureHeaders(m);return g["Client-Url"]=window.location.href,m}(g),k=function(m){let g=ensureHeaders(m),v=(0,x.uu)();return v["sentry-trace"]&&(g["sentry-trace"]=v["sentry-trace"]),v.baggage&&(g.baggage=v.baggage),m}(v),E=ensureHeaders(k);return E.Accept="application/json",k},function(m){return Promise.reject(m)}),et.interceptors.response.use(function(m){return 401===m.status&&((0,x.Tb)(Error("This should not happen")),handleAuthenticationFailure()),m},function(m){var g;return E().isAxiosError(m)&&(null===(g=m.response)||void 0===g?void 0:g.status)===401&&handleAuthenticationFailure(),Promise.reject(m)}),g.Z=et},37903:function(m,g,v){"use strict";v.d(g,{$j:function(){return formatMonthDay},AV:function(){return yearsSince},GJ:function(){return isDayjsValue},KD:function(){return formatAge},O5:function(){return daysSince},OT:function(){return getDaysRemaining},Pb:function(){return formatMonthYear},QN:function(){return formatDistanceToNow},QS:function(){return formatCompactDate},TT:function(){return formatDateLong},W4:function(){return dateAddDays},WG:function(){return toCalendarDate},X$:function(){return toDateKey},YM:function(){return todayInChile},YX:function(){return nowIso},YY:function(){return formatMonthYearLong},eW:function(){return dateKeyAddDays},hp:function(){return fromCalendarDate},k7:function(){return formatDayMonth},mn:function(){return formatDateShort},mr:function(){return formatTime},n4:function(){return formatDateWithWeekday},nc:function(){return formatDaysRemaining},o0:function(){return formatDateTime},p6:function(){return formatDate},u9:function(){return getNextMonthPeriod},vX:function(){return parseDateInput},wG:function(){return parseDateTime}});var x=v(27484),k=v.n(x),E=v(70178),T=v.n(E),K=v(29387),et=v.n(K),en=v(84110),er=v.n(en);v(67763),k().locale("es"),k().extend(T()),k().extend(et()),k().extend(er());let ei="America/Santiago",isDateOnly=m=>/^\d{4}-\d{2}-\d{2}$/.test(m);function formatDate(m){return m?m instanceof Date?k()(m).tz(ei).format("DD/MM/YYYY"):isDateOnly(m)?k()(m).format("DD/MM/YYYY"):k()(m).tz(ei).format("DD/MM/YYYY"):"-"}function formatDateLong(m){return m?m instanceof Date?k()(m).tz(ei).format("D [de] MMMM [de] YYYY"):isDateOnly(m)?k()(m).format("D [de] MMMM [de] YYYY"):k()(m).tz(ei).format("D [de] MMMM [de] YYYY"):"-"}function formatDateWithWeekday(m){return m?m instanceof Date?k()(m).tz(ei).format("dddd D [de] MMMM, YYYY"):isDateOnly(m)?k()(m).format("dddd D [de] MMMM, YYYY"):k()(m).tz(ei).format("dddd D [de] MMMM, YYYY"):"-"}function formatDayMonth(m){return m?"string"==typeof m&&isDateOnly(m)?k()(m).format("D/M"):k()(m).tz(ei).format("D/M"):"-"}function formatDateTime(m){return m?k()(m).tz(ei).format("DD/MM/YYYY HH:mm"):"-"}function nowIso(){return k()().toISOString()}function formatDistanceToNow(m){return m?k()(m).tz(ei).fromNow():"-"}function formatAge(m){if(!m)return"-";let g=k()().diff(k()(m),"day");return g>=1?"".concat(g," d"):"".concat(Math.max(0,k()().diff(k()(m),"hour"))," h")}function daysSince(m){return m?k()().diff(k()(m),"day"):null}function parseDateTime(m){let g=k()(m);if(!g.isValid())throw Error("Invalid datetime: ".concat(m));return g.toDate()}function formatMonthDay(m){return m?"string"==typeof m&&isDateOnly(m)?k()(m).locale("es").format("MMM D, YYYY"):k()(m).tz(ei).locale("es").format("MMM D, YYYY"):"-"}function formatMonthYear(m){return m?"string"==typeof m&&isDateOnly(m)?k()(m).locale("es").format("MMM YYYY"):k()(m).tz(ei).locale("es").format("MMM YYYY"):"-"}function formatTime(m){return m?k()(m).tz(ei).format("HH:mm"):"-"}function formatCompactDate(m){return m?k()(m,"YYYYMMDD").format("DD/MM/YYYY"):"-"}function getDaysRemaining(m){if(!m)return null;let g=isDateOnly(m)?k()(m):k()(m).tz(ei),v=k()().tz(ei).startOf("day");return g.startOf("day").diff(v,"day")}function formatDateShort(m){return m?m instanceof Date?k()(m).tz(ei).format("D MMM YYYY"):isDateOnly(m)?k()(m).format("D MMM YYYY"):k()(m).tz(ei).format("D MMM YYYY"):"-"}function formatMonthYearLong(m){if(!m)return"-";let g="string"==typeof m&&isDateOnly(m)?k()(m):k()(m).tz(ei),v=g.format("MMMM YYYY");return v.charAt(0).toUpperCase()+v.slice(1)}function toDateKey(m){return m?"string"==typeof m&&isDateOnly(m)?m:k()(m).tz(ei).format("YYYY-MM-DD"):"-"}function toCalendarDate(m){if(!m)return;let g=toDateKey(m);if("-"===g)return;let[v,x,k]=g.split("-");if(v&&x&&k)return new Date(Number(v),Number(x)-1,Number(k))}function fromCalendarDate(m){return m?k()(m).format("YYYY-MM-DD"):""}function dateAddDays(m,g){return m?k()(m).add(g,"day").toISOString():""}function todayInChile(){return k()().tz(ei).format("YYYY-MM-DD")}function getNextMonthPeriod(){let m=arguments.length>0&&void 0!==arguments[0]?arguments[0]:todayInChile(),g=k()(m).add(1,"month");return{year:g.year(),month:g.month()+1}}function dateKeyAddDays(m,g){return isDateOnly(m)?k()(m).add(g,"day").format("YYYY-MM-DD"):m}let es=new Map([["ene",1],["enero",1],["feb",2],["febrero",2],["mar",3],["marzo",3],["abr",4],["abril",4],["may",5],["mayo",5],["jun",6],["junio",6],["jul",7],["julio",7],["ago",8],["agosto",8],["sep",9],["sept",9],["septiembre",9],["setiembre",9],["oct",10],["octubre",10],["nov",11],["noviembre",11],["dic",12],["diciembre",12]]);function expandTwoDigitYear(m){return m<100?2e3+m:m}function buildDateOnly(m,g,v){if(m<1e3||m>9999||g<1||g>12||v<1||v>31)return null;let x=new Date(Date.UTC(m,g-1,v));return x.getUTCFullYear()!==m||x.getUTCMonth()+1!==g||x.getUTCDate()!==v?null:"".concat(String(m).padStart(4,"0"),"-").concat(String(g).padStart(2,"0"),"-").concat(String(v).padStart(2,"0"))}function parseDateInput(m){if(!m)return null;let g=m.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ");
6if(!g)return null;let v=Number(todayInChile().slice(0,4)),x=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/.exec(g);if(x)return buildDateOnly(Number(x[1]),Number(x[2]),Number(x[3]));let k=/^(\d{1,2})[-/.](\d{1,2})(?:[-/.](\d{2}|\d{4}))?$/.exec(g);if(k){let m=Number(k[1]),g=Number(k[2]),x=k[3]?expandTwoDigitYear(Number(k[3])):v;return buildDateOnly(x,g,m)}let E=/^(\d{1,2})(?:\s+de)?\s+([a-z]+)(?:\s+(?:de\s+)?(\d{2}|\d{4}))?$/.exec(g);if(E){var T;let m=es.get(null!==(T=E[2])&&void 0!==T?T:"");if(!m)return null;let g=Number(E[1]),x=E[3]?expandTwoDigitYear(Number(E[3])):v;return buildDateOnly(x,m,g)}return null}function formatDaysRemaining(m){if(m>30){let g=Math.floor(m/30),v=m%30;return 0===v?"".concat(g," ").concat(1===g?"mes":"meses"):"".concat(g," ").concat(1===g?"mes":"meses"," y ").concat(v," ").concat(1===v?"d\xeda":"d\xedas")}if(m>1)return"".concat(m," d\xedas");if(1===m)return"1 d\xeda";if(0===m)return"hoy";let g=Math.abs(m);return"hace ".concat(g," ").concat(1===g?"d\xeda":"d\xedas")}function isDayjsValue(m){return k().isDayjs(m)}function yearsSince(m){if(!m)return;let g=k()(m);if(g.isValid())return k()().diff(g,"year")}},14016:function(m,g,v){"use strict";v.d(g,{EV:function(){return extractErrorForToast},TZ:function(){return et},Tc:function(){return shouldReportToSentry},rY:function(){return getErrorStatusCode},rj:function(){return reportErrorIfNeeded},zG:function(){return handleApiError}});var x=v(89644),k=v(20463),E=v(82799),T=v(68344),K=v(50202);let et=["ERR_CANCELED","ECONNABORTED","ERR_NETWORK"],en=[401,403,404];function isClientError(m){return m>=400&&m<500}function shouldReportToSentry(m){if(m instanceof T.o)return!m.isExpected;if(m instanceof x.AxiosError){var g;let v=null===(g=m.response)||void 0===g?void 0:g.status;return v?!en.includes(v)&&(!!isClientError(v)||v>=500):void 0===m.code||!et.includes(m.code)}return E.jm,!0}function reportErrorIfNeeded(m,g){shouldReportToSentry(m)&&(0,k.Tb)(m,g)}function getErrorStatusCode(m){if(m instanceof x.AxiosError){var g;return null===(g=m.response)||void 0===g?void 0:g.status}}function handleApiError(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Hubo un error inesperado. Por favor, intenta nuevamente.";if(m instanceof x.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=K.Dq.safeParse(v);if(x.success){let v=isClientError(g);throw v||reportErrorIfNeeded(m,{context:"handleApiError",errorType:x.data.type,details:x.data.details}),new T.o(x.data.message,{statusCode:g,code:x.data.type,details:x.data.details,isExpected:v})}let k=K.Fb.safeParse(v);if(k.success){let v=isClientError(g);throw v||reportErrorIfNeeded(m,{context:"handleApiError.legacyMessage"}),new T.o(k.data.message,{statusCode:g,isExpected:v})}if("object"==typeof v&&null!==v&&"error"in v&&"string"==typeof v.error){let x=v.error,k=isClientError(g);throw k||reportErrorIfNeeded(m,{context:"handleApiError.legacyError"}),new T.o(x,{statusCode:g,isExpected:k})}let E=function(m){var g;let v=null===(g=m.response)||void 0===g?void 0:g.status;switch(v){case 400:return"Los datos enviados no son v\xe1lidos.";case 401:return"Tu sesi\xf3n ha expirado. Por favor, inicia sesi\xf3n nuevamente.";case 403:return"No tienes permisos para realizar esta acci\xf3n.";case 404:return"El recurso solicitado no existe.";case 409:return"Hubo un conflicto con los datos. Por favor, intenta nuevamente.";case 422:return"Los datos enviados no pudieron ser procesados.";case 500:return"Hubo un error en el servidor. Por favor, intenta m\xe1s tarde.";case 502:return"El servidor no est\xe1 disponible. Por favor, intenta m\xe1s tarde.";case 503:return"El servicio no est\xe1 disponible temporalmente.";case 504:return"El servidor tard\xf3 demasiado en responder.";default:return null}}(m);if(E){let v=isClientError(g);throw v||reportErrorIfNeeded(m,{context:"handleApiError.httpFallback"}),new T.o(E,{statusCode:g,isExpected:v})}}throw reportErrorIfNeeded(m,{context:"handleApiError.unknown"}),new T.o(g)}function extractErrorForToast(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Hubo un error inesperado. Por favor, intenta nuevamente.",v=g,x="";if(m instanceof Error&&(v=m.message||g,m.details&&Object.keys(m.details).length>0)){let g=JSON.stringify(m.details,null,2);x="\n\nDetalles: ".concat(g)}return{message:v,details:x}}},80593:function(m,g,v){"use strict";function openDeferredTab(){let m=window.open("","_blank");return m&&(m.opener=null),{navigateTo:g=>{if(m&&!m.closed){m.location.href=g;return}window.open(g,"_blank","noopener,noreferrer")},close:()=>{m&&!m.closed&&m.close()}}}v.d(g,{K:function(){return openDeferredTab}})},3467:function(m,g,v){"use strict";function formatPhone(m){if(!m&&0!==m)return"-";let g=String(m).replace(/\D/g,"");return 9===g.length?"+56 ".concat(g[0]," ").concat(g.slice(1,5)," ").concat(g.slice(5)):"+56 ".concat(g)}function isValidPhone(m){if(!m)return!1;let g=String(m).replace(/\D/g,"");return 9===g.length&&g.startsWith("9")}function formatPhoneInput(m){let g=m.replace(/\D/g,"");if(0===g.length)return"";
6let v=[g.slice(0,1),g.slice(1,5),g.slice(5,9)].filter(Boolean);return v.join(" ")}function unformatPhoneInput(m){return m.replace(/\D/g,"")}v.d(g,{CN:function(){return formatPhone},kj:function(){return isValidPhone},nw:function(){return formatPhoneInput},qe:function(){return unformatPhoneInput}})},25987:function(m,g,v){"use strict";v.d(g,{cn:function(){return cn}});var x=v(40489);let concatArrays=(m,g)=>{let v=Array(m.length+g.length);for(let g=0;g<m.length;g++)v[g]=m[g];for(let x=0;x<g.length;x++)v[m.length+x]=g[x];return v},createClassValidatorObject=(m,g)=>({classGroupId:m,validator:g}),createClassPartObject=(m=new Map,g=null,v)=>({nextPart:m,validators:g,classGroupId:v}),k=[],createClassGroupUtils=m=>{let g=createClassMap(m),{conflictingClassGroups:v,conflictingClassGroupModifiers:x}=m;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return getGroupIdForArbitraryProperty(m);let v=m.split("-"),x=""===v[0]&&v.length>1?1:0;return getGroupRecursive(v,x,g)},getConflictingClassGroupIds:(m,g)=>{if(g){let g=x[m],E=v[m];return g?E?concatArrays(E,g):g:E||k}return v[m]||k}}},getGroupRecursive=(m,g,v)=>{let x=m.length-g;if(0===x)return v.classGroupId;let k=m[g],E=v.nextPart.get(k);if(E){let v=getGroupRecursive(m,g+1,E);if(v)return v}let T=v.validators;if(null===T)return;let K=0===g?m.join("-"):m.slice(g).join("-"),et=T.length;for(let m=0;m<et;m++){let g=T[m];if(g.validator(K))return g.classGroupId}},getGroupIdForArbitraryProperty=m=>-1===m.slice(1,-1).indexOf(":")?void 0:(()=>{let g=m.slice(1,-1),v=g.indexOf(":"),x=g.slice(0,v);return x?"arbitrary.."+x:void 0})(),createClassMap=m=>{let{theme:g,classGroups:v}=m;return processClassGroups(v,g)},processClassGroups=(m,g)=>{let v=createClassPartObject();for(let x in m){let k=m[x];processClassesRecursively(k,v,x,g)}return v},processClassesRecursively=(m,g,v,x)=>{let k=m.length;for(let E=0;E<k;E++){let k=m[E];processClassDefinition(k,g,v,x)}},processClassDefinition=(m,g,v,x)=>{if("string"==typeof m){processStringDefinition(m,g,v);return}if("function"==typeof m){processFunctionDefinition(m,g,v,x);return}processObjectDefinition(m,g,v,x)},processStringDefinition=(m,g,v)=>{let x=""===m?g:getPart(g,m);x.classGroupId=v},processFunctionDefinition=(m,g,v,x)=>{if(isThemeGetter(m)){processClassesRecursively(m(x),g,v,x);return}null===g.validators&&(g.validators=[]),g.validators.push(createClassValidatorObject(v,m))},processObjectDefinition=(m,g,v,x)=>{let k=Object.entries(m),E=k.length;for(let m=0;m<E;m++){let[E,T]=k[m];processClassesRecursively(T,getPart(g,E),v,x)}},getPart=(m,g)=>{let v=m,x=g.split("-"),k=x.length;for(let m=0;m<k;m++){let g=x[m],k=v.nextPart.get(g);k||(k=createClassPartObject(),v.nextPart.set(g,k)),v=k}return v},isThemeGetter=m=>"isThemeGetter"in m&&!0===m.isThemeGetter,createLruCache=m=>{if(m<1)return{get:()=>void 0,set:()=>{}};let g=0,v=Object.create(null),x=Object.create(null),update=(k,E)=>{v[k]=E,++g>m&&(g=0,x=v,v=Object.create(null))};return{get(m){let g=v[m];return void 0!==g?g:void 0!==(g=x[m])?(update(m,g),g):void 0},set(m,g){m in v?v[m]=g:update(m,g)}}},E=[],createResultObject=(m,g,v,x,k)=>({modifiers:m,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:x,isExternal:k}),createParseClassName=m=>{let{prefix:g,experimentalParseClassName:v}=m,parseClassName=m=>{let g;let v=[],x=0,k=0,E=0,T=m.length;for(let K=0;K<T;K++){let T=m[K];if(0===x&&0===k){if(":"===T){v.push(m.slice(E,K)),E=K+1;continue}if("/"===T){g=K;continue}}"["===T?x++:"]"===T?x--:"("===T?k++:")"===T&&k--}let K=0===v.length?m:m.slice(E),et=K,en=!1;K.endsWith("!")?(et=K.slice(0,-1),en=!0):K.startsWith("!")&&(et=K.slice(1),en=!0);let er=g&&g>E?g-E:void 0;return createResultObject(v,en,et,er)};if(g){let m=g+":",v=parseClassName;parseClassName=g=>g.startsWith(m)?v(g.slice(m.length)):createResultObject(E,!1,g,void 0,!0)}if(v){let m=parseClassName;parseClassName=g=>v({className:g,parseClassName:m})}return parseClassName},createSortModifiers=m=>{let g=new Map;return m.orderSensitiveModifiers.forEach((m,v)=>{g.set(m,1e6+v)}),m=>{let v=[],x=[];for(let k=0;k<m.length;k++){let E=m[k],T="["===E[0],K=g.has(E);T||K?(x.length>0&&(x.sort(),v.push(...x),x=[]),v.push(E)):x.push(E)}return x.length>0&&(x.sort(),v.push(...x)),v}}
6,createConfigUtils=m=>({cache:createLruCache(m.cacheSize),parseClassName:createParseClassName(m),sortModifiers:createSortModifiers(m),postfixLookupClassGroupIds:createPostfixLookupClassGroupIds(m),...createClassGroupUtils(m)}),createPostfixLookupClassGroupIds=m=>{let g=Object.create(null),v=m.postfixLookupClassGroups;if(v)for(let m=0;m<v.length;m++)g[v[m]]=!0;return g},T=/\s+/,mergeClassList=(m,g)=>{let{parseClassName:v,getClassGroupId:x,getConflictingClassGroupIds:k,sortModifiers:E,postfixLookupClassGroupIds:K}=g,et=[],en=m.trim().split(T),er="";for(let m=en.length-1;m>=0;m-=1){let g;let T=en[m],{isExternal:ei,modifiers:es,hasImportantModifier:el,baseClassName:ec,maybePostfixModifierPosition:eu}=v(T);if(ei){er=T+(er.length>0?" "+er:er);continue}let ed=!!eu;if(ed){let m=ec.substring(0,eu);g=x(m);let v=g&&K[g]?x(ec):void 0;v&&v!==g&&(g=v,ed=!1)}else g=x(ec);if(!g){if(!ed||!(g=x(ec))){er=T+(er.length>0?" "+er:er);continue}ed=!1}let ep=0===es.length?"":1===es.length?es[0]:E(es).join(":"),em=el?ep+"!":ep,ef=em+g;if(et.indexOf(ef)>-1)continue;et.push(ef);let eh=k(g,ed);for(let m=0;m<eh.length;++m){let g=eh[m];
6et.push(em+g)}er=T+(er.length>0?" "+er:er)}return er},twJoin=(...m)=>{let g,v,x=0,k="";for(;x<m.length;)(g=m[x++])&&(v=toValue(g))&&(k&&(k+=" "),k+=v);return k},toValue=m=>{let g;if("string"==typeof m)return m;let v="";for(let x=0;x<m.length;x++)m[x]&&(g=toValue(m[x]))&&(v&&(v+=" "),v+=g);return v},K=[],fromTheme=m=>{let themeGetter=g=>g[m]||K;return themeGetter.isThemeGetter=!0,themeGetter},et=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,en=/^\((?:(\w[\w-]*):)?(.+)\)$/i,er=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ei=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,es=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,el=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ec=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=m=>er.test(m),isNumber=m=>!!m&&!Number.isNaN(Number(m)),isInteger=m=>!!m&&Number.isInteger(Number(m)),isPercent=m=>m.endsWith("%")&&isNumber(m.slice(0,-1)),isTshirtSize=m=>ei.test(m),isAny=()=>!0,isLengthOnly=m=>es.test(m)&&!el.test(m),isNever=()=>!1,isShadow=m=>ec.test(m),isImage=m=>eu.test(m),isAnyNonArbitrary=m=>!isArbitraryValue(m)&&!isArbitraryVariable(m),isNamedContainerQuery=m=>m.startsWith("@container")&&("/"===m[10]&&void 0!==m[11]||"s"===m[11]&&void 0!==m[16]&&m.startsWith("-size/",10)||"n"===m[11]&&void 0!==m[18]&&m.startsWith("-normal/",10)),isArbitrarySize=m=>getIsArbitraryValue(m,isLabelSize,isNever),isArbitraryValue=m=>et.test(m),isArbitraryLength=m=>getIsArbitraryValue(m,isLabelLength,isLengthOnly),isArbitraryNumber=m=>getIsArbitraryValue(m,isLabelNumber,isNumber),isArbitraryWeight=m=>getIsArbitraryValue(m,isLabelWeight,isAny),isArbitraryFamilyName=m=>getIsArbitraryValue(m,isLabelFamilyName,isNever),isArbitraryPosition=m=>getIsArbitraryValue(m,isLabelPosition,isNever),isArbitraryImage=m=>getIsArbitraryValue(m,isLabelImage,isImage),isArbitraryShadow=m=>getIsArbitraryValue(m,isLabelShadow,isShadow),isArbitraryVariable=m=>en.test(m),isArbitraryVariableLength=m=>getIsArbitraryVariable(m,isLabelLength),isArbitraryVariableFamilyName=m=>getIsArbitraryVariable(m,isLabelFamilyName),isArbitraryVariablePosition=m=>getIsArbitraryVariable(m,isLabelPosition),isArbitraryVariableSize=m=>getIsArbitraryVariable(m,isLabelSize),isArbitraryVariableImage=m=>getIsArbitraryVariable(m,isLabelImage),isArbitraryVariableShadow=m=>getIsArbitraryVariable(m,isLabelShadow,!0),isArbitraryVariableWeight=m=>getIsArbitraryVariable(m,isLabelWeight,!0),getIsArbitraryValue=(m,g,v)=>{let x=et.exec(m);return!!x&&(x[1]?g(x[1]):v(x[2]))},getIsArbitraryVariable=(m,g,v=!1)=>{let x=en.exec(m);return!!x&&(x[1]?g(x[1]):v)},isLabelPosition=m=>"position"===m||"percentage"===m,isLabelImage=m=>"image"===m||"url"===m,isLabelSize=m=>"length"===m||"size"===m||"bg-size"===m,isLabelLength=m=>"length"===m,isLabelNumber=m=>"number"===m,isLabelFamilyName=m=>"family-name"===m,isLabelWeight=m=>"number"===m||"weight"===m,isLabelShadow=m=>"shadow"===m,ed=(m=>{let g,v,x,k;let tailwindMerge=m=>{let k=v(m);if(k)return k;let E=mergeClassList(m,g);return x(m,E),E};return k=E=>{let T=[].reduce((m,g)=>g(m),m());return v=(g=createConfigUtils(T)).cache.get,x=g.cache.set,k=tailwindMerge,tailwindMerge(E)},(...m)=>k(twJoin(...m))})(()=>{let m=fromTheme("color"),g=fromTheme("font"),v=fromTheme("text"),x=fromTheme("font-weight"),k=fromTheme("tracking"),E=fromTheme("leading"),T=fromTheme("breakpoint"),K=fromTheme("container"),et=fromTheme("spacing"),en=fromTheme("radius"),er=fromTheme("shadow"),ei=fromTheme("inset-shadow"),es=fromTheme("text-shadow"),el=fromTheme("drop-shadow"),ec=fromTheme("blur"),eu=fromTheme("perspective"),ed=fromTheme("aspect"),ep=fromTheme("ease"),em=fromTheme("animate"),scaleBreak=()=>["auto","avoid","all","avoid-page","page","left","right","column"],scalePosition=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],scalePositionWithArbitrary=()=>[...scalePosition(),isArbitraryVariable,isArbitraryValue],scaleOverflow=()=>["auto","hidden","clip","visible","scroll"],scaleOverscroll=()=>
vendor: 9,668 bytes, line 6
6["auto","contain","none"],scaleUnambiguousSpacing=()=>[isArbitraryVariable,isArbitraryValue,et],scaleInset=()=>[isFraction,"full","auto",...scaleUnambiguousSpacing()],scaleGridTemplateColsRows=()=>[isInteger,"none","subgrid",isArbitraryVariable,isArbitraryValue],scaleGridColRowStartAndEnd=()=>["auto",{span:["full",isInteger,isArbitraryVariable,isArbitraryValue]},isInteger,isArbitraryVariable,isArbitraryValue],scaleGridColRowStartOrEnd=()=>[isInteger,"auto",isArbitraryVariable,isArbitraryValue],scaleGridAutoColsRows=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],scaleAlignPrimaryAxis=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],scaleAlignSecondaryAxis=()=>["start","end","center","stretch","center-safe","end-safe"],scaleMargin=()=>["auto",...scaleUnambiguousSpacing()],scaleSizing=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...scaleUnambiguousSpacing()],scaleSizingInline=()=>[isFraction,"screen","full","dvw","lvw","svw","min","max","fit",...scaleUnambiguousSpacing()],scaleSizingBlock=()=>[isFraction,"screen","full","lh","dvh","lvh","svh","min","max","fit",...scaleUnambiguousSpacing()],scaleColor=()=>[m,isArbitraryVariable,isArbitraryValue],scaleBgPosition=()=>[...scalePosition(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],scaleBgRepeat=()=>["no-repeat",{repeat:["","x","y","space","round"]}],scaleBgSize=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],scaleGradientStopPosition=()=>[isPercent,isArbitraryVariableLength,isArbitraryLength],scaleRadius=()=>["","none","full",en,isArbitraryVariable,isArbitraryValue],scaleBorderWidth=()=>["",isNumber,isArbitraryVariableLength,isArbitraryLength],scaleLineStyle=()=>["solid","dashed","dotted","double"],scaleBlendMode=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],scaleMaskImagePosition=()=>[isNumber,isPercent,isArbitraryVariablePosition,isArbitraryPosition],scaleBlur=()=>["","none",ec,isArbitraryVariable,isArbitraryValue],scaleRotate=()=>["none",isNumber,isArbitraryVariable,isArbitraryValue],scaleScale=()=>["none",isNumber,isArbitraryVariable,isArbitraryValue],scaleSkew=()=>[isNumber,isArbitraryVariable,isArbitraryValue],scaleTranslate=()=>[isFraction,"full",...scaleUnambiguousSpacing()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,ed]}],container:["container"],"container-type":[{"@container":["","normal","size",isArbitraryVariable,isArbitraryValue]}],"container-named":[isNamedContainerQuery],columns:[{columns:[isNumber,isArbitraryValue,isArbitraryVariable,K]}],"break-after":[{"break-after":scaleBreak()}],"break-before":[{"break-before":scaleBreak()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:scalePositionWithArbitrary()}],overflow:[{overflow:scaleOverflow()}],"overflow-x":[{"overflow-x":scaleOverflow()}],"overflow-y":[{"overflow-y":scaleOverflow()}],overscroll:[{overscroll:scaleOverscroll()}],"overscroll-x":[{"overscroll-x":scaleOverscroll()}],"overscroll-y":[{"overscroll-y":scaleOverscroll()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:scaleInset()}],"inset-x":[{"inset-x":scaleInset()}],"inset-y":[{"inset-y":scaleInset()}],start:[{"inset-s":scaleInset(),start:scaleInset()}],end:[{"inset-e":scaleInset(),end:scaleInset()}],"inset-bs":[{"inset-bs":scaleInset()}],"inset-be":[{"inset-be":scaleInset()}],top:[{top:scaleInset()}],right:[{right:scaleInset()}],bottom:[{bottom:scaleInset()}],left:[{left:scaleInset()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",K,...scaleUnambiguousSpacing()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":scaleGridTemplateColsRows()}],"col-start-end":[{col:scaleGridColRowStartAndEnd()}],"col-start":[{"col-start":scaleGridColRowStartOrEnd()}],"col-end":[{"col-end":scaleGridColRowStartOrEnd()}],"grid-rows":[{"grid-rows":scaleGridTemplateColsRows()}],"row-start-end":[{row:scaleGridColRowStartAndEnd()}],"row-start":[{"row-start":scaleGridColRowStartOrEnd()}],"row-end":[{"row-end":scaleGridColRowStartOrEnd()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":scaleGridAutoColsRows()}],"auto-rows":[{"auto-rows":scaleGridAutoColsRows()}],gap:[{gap:scaleUnambiguousSpacing()}],"gap-x":[{"gap-x":scaleUnambiguousSpacing()}],"gap-y":[{"gap-y":scaleUnambiguousSpacing()}],"justify-content":[{justify:[...scaleAlignPrimaryAxis(),"normal"]}],"justify-items":[{"justify-items":[...scaleAlignSecondaryAxis(),"normal"]}],"justify-self":[{"justify-self":["auto",...scaleAlignSecondaryAxis()]}],"align-content":[{content:["normal",...scaleAlignPrimaryAxis()]}],"align-items":[{items:[...scaleAlignSecondaryAxis(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...scaleAlignSecondaryAxis(),{baseline:["","last"]}]}],"place-content":[{"place-content":scaleAlignPrimaryAxis()}],"place-items":[{"place-items":[...scaleAlignSecondaryAxis(),"baseline"]}],"place-self":[{"place-self":["auto",...scaleAlignSecondaryAxis()]}],p:[{p:scaleUnambiguousSpacing()}],px:[{px:scaleUnambiguousSpacing()}],py:[{py:scaleUnambiguousSpacing()}],ps:[{ps:scaleUnambiguousSpacing()}],pe:[{pe:scaleUnambiguousSpacing()}],pbs:[{pbs:scaleUnambiguousSpacing()}],pbe:[{pbe:scaleUnambiguousSpacing()}],pt:[{pt:scaleUnambiguousSpacing()}],pr:[{pr:scaleUnambiguousSpacing()}],pb:[{pb:scaleUnambiguousSpacing()}],pl:[{pl:scaleUnambiguousSpacing()}],m:[{m:scaleMargin()}],mx:[{mx:scaleMargin()}],my:[{my:scaleMargin()}],ms:[{ms:scaleMargin()}],me:[{me:scaleMargin()}],mbs:[{mbs:scaleMargin()}],mbe:[{mbe:scaleMargin()}],mt:[{mt:scaleMargin()}],mr:[{mr:scaleMargin()}],mb:[{mb:scaleMargin()}],ml:[{ml:scaleMargin()}],"space-x":[{"space-x":scaleUnambiguousSpacing()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":scaleUnambiguousSpacing()}],"space-y-reverse":["space-y-reverse"],size:[{size:scaleSizing()}],"inline-size":[{inline:["auto",...scaleSizingInline()]}],"min-inline-size":[{"min-inline":["auto",...scaleSizingInline()]}],"max-inline-size":[{"max-inline":["none",...scaleSizingInline()]}],"block-size":[{block:["auto",...scaleSizingBlock()]}],"min-block-size":[{"min-block":["auto",...scaleSizingBlock()]}],"max-block-size":[{"max-block":["none",...scaleSizingBlock()]}],w:[{w:[K,"screen",...scaleSizing()]}],"min-w":[{"min-w":[K,"screen","none",...scaleSizing()]}],"max-w":[{"max-w":[K,"screen","none","prose",{screen:[T]},...scaleSizing()]}],h:[{h:["screen","lh",...scaleSizing()]}],"min-h":[{"min-h":["screen","lh","none",...scaleSizing()]}],"max-h":[{"max-h":["screen","lh",...scaleSizing()]}],"font-size":[{text:["base",v,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[x,isArbitraryVariableWeight,isArbitraryWeight]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryFamilyName,g]}],"font-features":[{"font-features":[isArbitraryValue]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[k,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber,"none",isArbitraryVariable,isArbitraryNumber]}
vendor: 14,751 bytes, line 6
6],leading:[{leading:[E,...scaleUnambiguousSpacing()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:scaleColor()}],"text-color":[{text:scaleColor()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...scaleLineStyle(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:scaleColor()}],"underline-offset":[{"underline-offset":[isNumber,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:scaleUnambiguousSpacing()}],"tab-size":[{tab:[isInteger,isArbitraryVariable,isArbitraryValue]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:scaleBgPosition()}],"bg-repeat":[{bg:scaleBgRepeat()}],"bg-size":[{bg:scaleBgSize()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:scaleColor()}],"gradient-from-pos":[{from:scaleGradientStopPosition()}],"gradient-via-pos":[{via:scaleGradientStopPosition()}],"gradient-to-pos":[{to:scaleGradientStopPosition()}],"gradient-from":[{from:scaleColor()}],"gradient-via":[{via:scaleColor()}],"gradient-to":[{to:scaleColor()}],rounded:[{rounded:scaleRadius()}],"rounded-s":[{"rounded-s":scaleRadius()}],"rounded-e":[{"rounded-e":scaleRadius()}],"rounded-t":[{"rounded-t":scaleRadius()}],"rounded-r":[{"rounded-r":scaleRadius()}],"rounded-b":[{"rounded-b":scaleRadius()}],"rounded-l":[{"rounded-l":scaleRadius()}],"rounded-ss":[{"rounded-ss":scaleRadius()}],"rounded-se":[{"rounded-se":scaleRadius()}],"rounded-ee":[{"rounded-ee":scaleRadius()}],"rounded-es":[{"rounded-es":scaleRadius()}],"rounded-tl":[{"rounded-tl":scaleRadius()}],"rounded-tr":[{"rounded-tr":scaleRadius()}],"rounded-br":[{"rounded-br":scaleRadius()}],"rounded-bl":[{"rounded-bl":scaleRadius()}],"border-w":[{border:scaleBorderWidth()}],"border-w-x":[{"border-x":scaleBorderWidth()}],"border-w-y":[{"border-y":scaleBorderWidth()}],"border-w-s":[{"border-s":scaleBorderWidth()}],"border-w-e":[{"border-e":scaleBorderWidth()}],"border-w-bs":[{"border-bs":scaleBorderWidth()}],"border-w-be":[{"border-be":scaleBorderWidth()}],"border-w-t":[{"border-t":scaleBorderWidth()}],"border-w-r":[{"border-r":scaleBorderWidth()}],"border-w-b":[{"border-b":scaleBorderWidth()}],"border-w-l":[{"border-l":scaleBorderWidth()}],"divide-x":[{"divide-x":scaleBorderWidth()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":scaleBorderWidth()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...scaleLineStyle(),"hidden","none"]}],"divide-style":[{divide:[...scaleLineStyle(),"hidden","none"]}],"border-color":[{border:scaleColor()}],"border-color-x":[{"border-x":scaleColor()}],"border-color-y":[{"border-y":scaleColor()}],"border-color-s":[{"border-s":scaleColor()}],"border-color-e":[{"border-e":scaleColor()}],"border-color-bs":[{"border-bs":scaleColor()}],"border-color-be":[{"border-be":scaleColor()}],"border-color-t":[{"border-t":scaleColor()}],"border-color-r":[{"border-r":scaleColor()}],"border-color-b":[{"border-b":scaleColor()}],"border-color-l":[{"border-l":scaleColor()}],"divide-color":[{divide:scaleColor()}],"outline-style":[{outline:[...scaleLineStyle(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:scaleColor()}],shadow:[{shadow:["","none",er,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:scaleColor()}],"inset-shadow":[{"inset-shadow":["none",ei,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":scaleColor()}],"ring-w":[{ring:scaleBorderWidth()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:scaleColor()}],"ring-offset-w":[{"ring-offset":[isNumber,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":scaleColor()}],"inset-ring-w":[{"inset-ring":scaleBorderWidth()}],"inset-ring-color":[{"inset-ring":scaleColor()}],"text-shadow":[{"text-shadow":["none",es,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":scaleColor()}],opacity:[{opacity:[isNumber,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...scaleBlendMode(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":scaleBlendMode()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[isNumber]}],"mask-image-linear-from-pos":[{"mask-linear-from":scaleMaskImagePosition()}],"mask-image-linear-to-pos":[{"mask-linear-to":scaleMaskImagePosition()}],"mask-image-linear-from-color":[{"mask-linear-from":scaleColor()}],"mask-image-linear-to-color":[{"mask-linear-to":scaleColor()}],"mask-image-t-from-pos":[{"mask-t-from":scaleMaskImagePosition()}],"mask-image-t-to-pos":[{"mask-t-to":scaleMaskImagePosition()}],"mask-image-t-from-color":[{"mask-t-from":scaleColor()}],"mask-image-t-to-color":[{"mask-t-to":scaleColor()}],"mask-image-r-from-pos":[{"mask-r-from":scaleMaskImagePosition()}],"mask-image-r-to-pos":[{"mask-r-to":scaleMaskImagePosition()}],"mask-image-r-from-color":[{"mask-r-from":scaleColor()}],"mask-image-r-to-color":[{"mask-r-to":scaleColor()}],"mask-image-b-from-pos":[{"mask-b-from":scaleMaskImagePosition()}],"mask-image-b-to-pos":[{"mask-b-to":scaleMaskImagePosition()}],"mask-image-b-from-color":[{"mask-b-from":scaleColor()}],"mask-image-b-to-color":[{"mask-b-to":scaleColor()}],"mask-image-l-from-pos":[{"mask-l-from":scaleMaskImagePosition()}],"mask-image-l-to-pos":[{"mask-l-to":scaleMaskImagePosition()}],"mask-image-l-from-color":[{"mask-l-from":scaleColor()}],"mask-image-l-to-color":[{"mask-l-to":scaleColor()}],"mask-image-x-from-pos":[{"mask-x-from":scaleMaskImagePosition()}],"mask-image-x-to-pos":[{"mask-x-to":scaleMaskImagePosition()}],"mask-image-x-from-color":[{"mask-x-from":scaleColor()}],"mask-image-x-to-color":[{"mask-x-to":scaleColor()}],"mask-image-y-from-pos":[{"mask-y-from":scaleMaskImagePosition()}],"mask-image-y-to-pos":[{"mask-y-to":scaleMaskImagePosition()}],"mask-image-y-from-color":[{"mask-y-from":scaleColor()}],"mask-image-y-to-color":[{"mask-y-to":scaleColor()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":scaleMaskImagePosition()}],"mask-image-radial-to-pos":[{"mask-radial-to":scaleMaskImagePosition()}],"mask-image-radial-from-color":[{"mask-radial-from":scaleColor()}],"mask-image-radial-to-color":[{"mask-radial-to":scaleColor()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":scalePosition()}],"mask-image-conic-pos":[{"mask-conic":[isNumber]}],"mask-image-conic-from-pos":[{"mask-conic-from":scaleMaskImagePosition()}],"mask-image-conic-to-pos":[{"mask-conic-to":scaleMaskImagePosition()}],"mask-image-conic-from-color":[{"mask-conic-from":scaleColor()}],"mask-image-conic-to-color":[{"mask-conic-to":scaleColor()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:scaleBgPosition()}],"mask-repeat":[{mask:scaleBgRepeat()}],"mask-size":[{mask:scaleBgSize()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:scaleBlur()}],brightness:[{brightness:[isNumber,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",el,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":scaleColor()}],grayscale:[{grayscale:["",isNumber,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":scaleBlur()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":scaleUnambiguousSpacing()}],"border-spacing-x":[{"border-spacing-x":scaleUnambiguousSpacing()}],"border-spacing-y":[{"border-spacing-y":scaleUnambiguousSpacing()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",ep,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",em,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[eu,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":scalePositionWithArbitrary()}],rotate:[{rotate:scaleRotate()}],"rotate-x":[{"rotate-x":scaleRotate()}],"rotate-y":[{"rotate-y":scaleRotate()}],"rotate-z":[{"rotate-z":scaleRotate()}],scale:[{scale:scaleScale()}],"scale-x":[{"scale-x":scaleScale()}],"scale-y":[{"scale-y":scaleScale()}],"scale-z":[{"scale-z":scaleScale()}],"scale-3d":["scale-3d"],skew:[{skew:scaleSkew()}],"skew-x":[{"skew-x":scaleSkew()}],"skew-y":[{"skew-y":scaleSkew()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:scalePositionWithArbitrary()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:scaleTranslate()}],"translate-x":[{"translate-x":scaleTranslate()}],"translate-y":[{"translate-y":scaleTranslate()}],"translate-z":[{"translate-z":scaleTranslate()}],"translate-none":["translate-none"],zoom:[{zoom:[isInteger,isArbitraryVariable,isArbitraryValue]}],accent:[{accent:scaleColor()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:scaleColor()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",isArbitraryVariable,isArbitraryValue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":scaleColor()}],"scrollbar-track-color":[{"scrollbar-track":scaleColor()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":scaleUnambiguousSpacing()}],"scroll-mx":[{"scroll-mx":scaleUnambiguousSpacing()}],"scroll-my":[{"scroll-my":scaleUnambiguousSpacing()}],"scroll-ms":[{"scroll-ms":scaleUnambiguousSpacing()}],"scroll-me":[{"scroll-me":scaleUnambiguousSpacing()}],"scroll-mbs":[{"scroll-mbs":scaleUnambiguousSpacing()}],"scroll-mbe":[{"scroll-mbe":scaleUnambiguousSpacing()}],"scroll-mt":[{"scroll-mt":scaleUnambiguousSpacing()}],"scroll-mr":[{"scroll-mr":scaleUnambiguousSpacing()}],"scroll-mb":[{"scroll-mb":scaleUnambiguousSpacing()}],"scroll-ml":[{"scroll-ml":scaleUnambiguousSpacing()}],"scroll-p":[{"scroll-p":scaleUnambiguousSpacing()}],"scroll-px":[{"scroll-px":scaleUnambiguousSpacing()}],"scroll-py":[{"scroll-py":scaleUnambiguousSpacing()}],"scroll-ps":[{"scroll-ps":scaleUnambiguousSpacing()}],"scroll-pe":[{"scroll-pe":scaleUnambiguousSpacing()}],"scroll-pbs":[{"scroll-pbs":scaleUnambiguousSpacing()}],"scroll-pbe":[{"scroll-pbe":scaleUnambiguousSpacing()}],"scroll-pt":[{"scroll-pt":scaleUnambiguousSpacing()}],"scroll-pr":[{"scroll-pr":scaleUnambiguousSpacing()}],"scroll-pb":[{"scroll-pb":scaleUnambiguousSpacing()}],"scroll-pl":[{"scroll-pl":scaleUnambiguousSpacing()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
6],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...scaleColor()]}],"stroke-w":[{stroke:[isNumber,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...scaleColor()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function cn(){for(var m=arguments.length,g=Array(m),v=0;v<m;v++)g[v]=arguments[v];return ed((0,x.W)(g))}},65817:function(m,g,v){"use strict";v.d(g,{i:function(){return useGetNewCode}});var x=v(62350),k=v(44994),E=v(53538),T=v(20463),K=v(89644),et=v(11168),en=v(13346);let er=E.Ry({error:E.Z_().optional(),code:E.G0([E.Km(["user_not_found"]),E.Rx()]).optional(),type:E.Z_().optional(),message:E.Z_().optional()}),useGetNewCode=()=>(0,x.D)(async m=>{let{rut:g,captcha:v,sendSms:x=!1}=m;try{return await (0,k.h)(E.Z_(),{method:"PUT",url:en.Z.auth.requestNewCode(),data:{rut:g,captcha:v,sendSms:x}}),{success:!0}}catch(g){localStorage.removeItem(et.Qy);let m="Hubo un error al generar el c\xf3digo. Intenta nuevamente";if(g instanceof K.AxiosError){var ei,es,el,ec;let v=er.safeParse(null===(ei=g.response)||void 0===ei?void 0:ei.data);if(v.success){if("user_not_found"===v.data.code||(null===(es=g.response)||void 0===es?void 0:es.status)===404&&"not_found"===v.data.type)return{success:!1,userNotFound:!0};v.data.error||v.data.message?m=null!==(ec=null!==(el=v.data.error)&&void 0!==el?el:v.data.message)&&void 0!==ec?ec:m:(0,T.Tb)(g)}else(0,T.Tb)(g)}else(0,T.Tb)(g);return{success:!1,error:m}}},{onError:m=>{(0,T.Tb)(m)}})},56427:function(m,g,v){"use strict";v.d(g,{f:function(){return useLogin}});var x=v(55830),k=v(62350),E=v(44994),T=v(14016),K=v(53538),et=v(68717),en=v(43889),er=v(39776),ei=v(41690);let es=K.Ry({access:K.Z_()}),useLogin=()=>{let m=(0,en.t)(m=>m.setToken),g=(0,x.NL)();return(0,k.D)(async m=>{if(m.accessToken)return{access:m.accessToken};try{let g=await (0,E.h)(es,{method:"post",url:"".concat(et.O.NEXT_PUBLIC_BASE_URL,"/api/v2/auth/otp-login/"),data:m});return g.data}catch(m){(0,T.zG)(m,"Hubo un error al hacer login. Por favor intenta nuevamente")}},{onSuccess:async v=>{m(v.access),await g.invalidateQueries(er.E);let x=(0,ei.nZ)();x.setTag("login","success"),x.setTag("transaction","userLogin")},onError:()=>{let m=(0,ei.nZ)();m.setTag("login","fail"),m.setTag("transaction","userLoginFail")}})}},28836:function(m,g,v){"use strict";v.d(g,{st:function(){return useAddClaimHistoryV2Mutation},P7:function(){return useCreateClaimV2Mutation},Qd:function(){return useCreateDocumentV2Mutation},mc:function(){return useDeleteClaimV2Mutation},Mg:function(){return useGenerateUploadUrlV2Mutation},kF:function(){return useLinkBudgetDocumentV2Mutation},ZX:function(){return useMarkClaimAsPaidManuallyMutation},Zw:function(){return useStartDocumentAnalysisV2Mutation},D5:function(){return useSubmitClaimV2Mutation},ST:function(){return useUpdateClaimV2Mutation},uf:function(){return useUploadToS3Mutation}});var x=v(55830),k=v(62350),E=v(89644),T=v.n(E),K=v(53538),et=v(14016),en=v(67669);let er=K.Ry({id:K.Rx(),name:K.Z_(),unit_price:K.Rx(),quantity:K.Rx(),total_price:K.Rx(),coverable:K.O7(),justified:K.O7(),category_name:K.Z_().nullable()}),ei=K.Ry({id:K.Rx(),document_name:K.Z_(),document_url:K.Z_().nullable(),file_type:K.Z_().nullable(),emission_date:K.Z_().nullable(),items:K.IX(er)}),es=K.Ry({id:K.Rx(),name:K.Z_()}),el=K.Ry({id:K.Z_(),policy_id:K.Z_(),category:K.Rx(),category_display:K.Z_(),reason:K.Z_(),status:K.Z_(),status_display:K.Z_(),event_date:K.Z_().nullable(),claim_date:K.Z_().nullable(),total_amount:K.Rx(),payable_amount:K.Rx(),is_paid:K.O7(),diagnosis:es.nullable(),documents:K.IX(ei),original_claim_id:K.Z_().nullable(),reimbursable_items:K.IX(K.Z_()
6),severity_level:K.Z_(),created_at:K.Z_(),updated_at:K.Z_().nullable()}),ec=K.Ry({id:K.Z_(),status:K.Z_(),message:K.Z_()});var eu=v(44994),ed=v(13346),ep=v(68344),em=v(20463);let ef=K.Ry({id:K.Rx(),status_key:K.Z_(),status_display:K.Z_(),comment:K.Z_().nullable(),created_at:K.Z_()});function useAddClaimHistoryV2Mutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{let{claimId:g,statusKey:v,comment:x}=m;try{let m=await (0,eu.h)(ef,{method:"POST",url:ed.Z.claims.v2.addHistory(g),data:{status_key:v,comment:x}});return m.data}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||"Error al actualizar el estado";throw new ep.o(x,{statusCode:g,code:null==v?void 0:v.type,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al actualizar el estado. Por favor, intenta nuevamente.")}},onSuccess:()=>{m.invalidateQueries({queryKey:en.a.policies.index()}),m.invalidateQueries({queryKey:["claims"]})}})}function useUploadToS3Mutation(){return(0,k.D)({mutationFn:async m=>{let{url:g,fields:v,file:x}=m;try{let m=new FormData;return Object.entries(v).forEach(g=>{let[v,x]=g;m.append(v,x)}),m.append("file",x),await T().post(g,m,{headers:{"Content-Type":"multipart/form-data"}}),{s3Key:v.key}}catch(m){throw(0,em.Tb)(m),Error("Error al subir el archivo.")}}})}function useCreateClaimV2Mutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{try{let g=await (0,eu.h)(el,{method:"POST",url:ed.Z.claims.v2.create(),data:{policy_id:m.policyId,category:m.category,reason:m.reason||"",event_date:m.eventDate,diagnosis_id:m.diagnosisId,original_claim_id:m.originalClaimId,reimbursable_items:m.reimbursableItems||[],severity_level:m.severityLevel||""}});return g.data}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||"Error al crear el reembolso";throw new ep.o(x,{statusCode:g,code:null==v?void 0:v.type,details:null==v?void 0:v.details,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al crear el reembolso. Por favor, intenta nuevamente.")}},onSuccess:()=>{m.invalidateQueries({queryKey:en.a.policies.index()}),m.invalidateQueries({queryKey:["claims"]})}})}function useSubmitClaimV2Mutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{try{let g=await (0,eu.h)(ec,{method:"POST",url:ed.Z.claims.v2.submit(m)});return g.data}catch(m){if(m instanceof E.AxiosError&&m.response){var g;let v=m.response.status,x=m.response.data,k=(null==x?void 0:x.message)||"Error al enviar el reembolso",E=(null==x?void 0:null===(g=x.details)||void 0===g?void 0:g.already_in_review)===!0;throw new ep.o(k,{statusCode:v,code:null==x?void 0:x.type,details:{...null==x?void 0:x.details,isAlreadyInReview:E},isExpected:v<500})}throw(0,et.rj)(m),new ep.o("Error al enviar el reembolso. Por favor, intenta nuevamente.")}},onSuccess:()=>{m.invalidateQueries({queryKey:en.a.policies.index()}),m.invalidateQueries({queryKey:["claims"]})}})}function useDeleteClaimV2Mutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{try{return await (0,eu.h)(K._4(),{method:"DELETE",url:ed.Z.claims.v2.delete(m)}),{success:!0}}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||"Error al eliminar el borrador";throw new ep.o(x,{statusCode:g,code:null==v?void 0:v.type,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al eliminar el borrador. Por favor, intenta nuevamente.")}},onSuccess:()=>{m.invalidateQueries({queryKey:en.a.policies.index()}),m.invalidateQueries({queryKey:["claims"]})}})}function useUpdateClaimV2Mutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{let{claimId:g,...v}=m;try{let m=await (0,eu.h)(el,{method:"PUT",url:ed.Z.claims.v2.update(g),data:{reason:v.reason,event_date:v.eventDate,diagnosis_id:v.diagnosisId,reimbursable_items:v.reimbursableItems,severity_level:v.severityLevel,video_description_key:v.videoDescriptionKey,written_declaration:v.writtenDeclaration}});return m.data}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||"Error al actualizar el reembolso";throw new ep.o(x,{statusCode:g,code:null==v?void 0:v.type,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al actualizar el reembolso. Por favor, intenta nuevamente.")}},onSuccess:()=>
6{m.invalidateQueries({queryKey:en.a.policies.index()}),m.invalidateQueries({queryKey:["claims"]})}})}let eh=K.Ry({url:K.Z_(),fields:K.IM(K.Z_()),s3_key:K.Z_()});function useGenerateUploadUrlV2Mutation(){return(0,k.D)({mutationFn:async m=>{let{claimId:g,fileName:v}=m;try{let m=await (0,eu.h)(eh,{method:"POST",url:ed.Z.claims.v2.documents.uploadUrl(g),data:{file_name:v}});return m.data}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data;throw new ep.o((null==v?void 0:v.message)||"Error al generar URL de subida",{statusCode:g,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al preparar la subida del archivo.")}}})}let eg=K.Ry({id:K.Rx(),claim_id:K.Z_(),document_name:K.Z_(),document_url:K.Z_().nullable(),document_number:K.Z_(),file_type:K.Z_().nullable(),emission_date:K.Z_().nullable(),total_amount:K.Rx().nullable(),has_issues:K.O7(),issue_comment:K.Z_(),is_edited_by_user:K.O7(),is_duplicate_receipt:K.O7().nullable(),bypass_ai_validation:K.O7(),ai_extracted_data:K.IM(K._4()).nullable(),items:K.IX(K.Ry({id:K.Rx(),name:K.Z_(),unit_price:K.Rx(),quantity:K.Rx(),total_price:K.Rx(),coverable:K.O7(),justified:K.O7(),category_name:K.Z_().nullable()})),previous_document_id:K.Rx().nullable(),next_document_ids:K.IX(K.Rx()),needs_budget:K.O7(),linked_budget_document_id:K.Rx().nullable()});function useCreateDocumentV2Mutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{let{claimId:g,...v}=m;try{var x;let m=await (0,eu.h)(eg,{method:"POST",url:ed.Z.claims.v2.documents.create(g),data:{file_type_code:v.fileTypeCode,document_key:v.documentKey,document_name:v.documentName||"Documento",document_number:v.documentNumber||"",clinic_id:v.clinicId,emission_date:v.emissionDate,total_amount:v.totalAmount,metadata:v.metadata||[],previous_document_id:v.previousDocumentId,needs_budget:null!==(x=v.needsBudget)&&void 0!==x&&x}});return m.data}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data;throw new ep.o((null==v?void 0:v.message)||"Error al guardar documento",{statusCode:g,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al guardar el documento.")}},onSuccess:()=>{m.invalidateQueries({queryKey:en.a.policies.index()}),m.invalidateQueries({queryKey:["claims"]})}})}function useLinkBudgetDocumentV2Mutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{let{claimId:g,documentId:v,budgetDocumentId:x}=m;try{let m=await (0,eu.h)(eg,{method:"PATCH",url:ed.Z.claims.v2.documents.linkBudget(g,v),data:{budget_document_id:x}});return m.data}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data;throw new ep.o((null==v?void 0:v.message)||"Error al vincular el presupuesto",{statusCode:g,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al vincular el presupuesto.")}},onSuccess:()=>{m.invalidateQueries({queryKey:["claims"]})}})}let ev=K.Ry({processing_id:K.Z_(),status:K.Km(["processing","completed","failed"]),global_validation_errors:K.IX(K.Z_()),documents:K.IX(K.IM(K._4()))});function useStartDocumentAnalysisV2Mutation(){return(0,k.D)({mutationFn:async m=>{let{claimId:g,documents:v}=m;try{let m=await (0,eu.h)(ev,{method:"POST",url:ed.Z.claims.v2.documents.analyze(g),data:{documents:v}});return m.data}catch(m){if(m instanceof E.AxiosError&&m.response){var x;let g=m.response.status,v=m.response.data,k=(null==v?void 0:v.message)||(null==v?void 0:null===(x=v.details)||void 0===x?void 0:x.error)||"Error al analizar documentos (".concat(g,")");throw new ep.o(k,{statusCode:g,code:null==v?void 0:v.type,details:null==v?void 0:v.details,isExpected:g<500})}if(m instanceof E.AxiosError&&!m.response)throw new ep.o("Error de conexi\xf3n al servidor. Verifica tu conexi\xf3n a internet.");throw(0,et.rj)(m),new ep.o("Error al analizar los documentos. Por favor, intenta nuevamente.")}}})}function useMarkClaimAsPaidManuallyMutation(){let m=(0,x.NL)();return(0,k.D)({mutationFn:async m=>{let{claimId:g,comment:v}=m;try{let m=await (0,eu.h)(K.Ry({message:K.Z_()}),{method:"POST",url:ed.Z.admin.claims.markAsPaidManually(g),data:{comment:v}});return m.data}catch(m){if(m instanceof E.AxiosError&&m.response){let g=m.response.status,v=m.response.data;throw new ep.o((null==v?void 0:v.message)||"Error al marcar como pagado",{statusCode:g,isExpected:g<500})}throw(0,et.rj)(m),new ep.o("Error al marcar como pagado. Por favor, intenta nuevamente.")}},onSuccess:()=>
6{m.invalidateQueries({queryKey:["claimSettlements"]}),m.invalidateQueries({queryKey:en.a.policies.index()}),m.invalidateQueries({queryKey:["claims"]})}})}},81937:function(m,g,v){"use strict";v.d(g,{$:function(){return sendMetaCapiEvent},s:function(){return trackMetaPageView}});var x=v(53538),k=v(44994),E=v(13346),T=v(20463),K=v(14016);let et=x.Ry({success:x.O7()}),en=new Set(["cacttus.cl","www.cacttus.cl","cacttus.com","www.cacttus.com"]);async function trackMetaPageView(m){if(en.has(window.location.hostname))try{await (0,k.h)(et,{method:"post",url:E.Z.tracking.metaPageView(),data:m})}catch(m){(0,T.Tb)(m,{silent:!0})}}let er={Lead:E.Z.tracking.metaLead,ViewContent:E.Z.tracking.metaViewContent,AddToCart:E.Z.tracking.metaAddToCart,InitiateCheckout:E.Z.tracking.metaInitiateCheckout,Purchase:E.Z.tracking.metaPurchase},ei=x.Ry({success:x.O7(),queued:x.O7().optional(),skipped:x.i0("not_configured").nullish()});function isStandardMetaCapiEvent(m){return Object.prototype.hasOwnProperty.call(er,m)}async function sendMetaCapiEvent(m,g){try{let v=await (0,k.h)(ei,{method:"post",url:isStandardMetaCapiEvent(m)?er[m]():E.Z.tracking.metaCustom(),data:isStandardMetaCapiEvent(m)?g:{...g,event_name:m}},{failSilently:!1});if(v.data.queued)return!0;if("not_configured"===v.data.skipped)return!1;if(!v.data.success)throw Error("Meta CAPI rejected ".concat(m));return!0}catch(g){return(0,K.Tc)(g)&&(0,T.Tb)(g,{silent:!0,tags:{meta_capi_event:m}}),!1}}},59350:function(m,g,v){"use strict";v.d(g,{Cr:function(){return useMergeQuoteFlowAssignments},IC:function(){return mergeQuoteFlowAssignments},jK:function(){return completeQuoteFlowAssignment}});var x=v(2784),k=v(55830),E=v(14016),T=v(67669),K=v(47793),et=v(44994),en=v(13346),er=v(37146),ei=v(43889);let es=null;async function runMerge(){let m=(0,er.Jp)();if(!m)return!1;try{await (0,et.h)(K.$j,{method:"post",url:en.Z.quoteFlow.mergeAssignments(),data:{anonymous_id:m}})}catch(m){return(0,E.rj)(m,{context:"quoteFlowAssignments.merge"}),!1}return(0,er.Q0)(),!0}function mergeQuoteFlowAssignments(){return es||(es=runMerge().finally(()=>{es=null}))}function useMergeQuoteFlowAssignments(){let m=(0,k.NL)();return(0,x.useCallback)(async()=>{let g=await mergeQuoteFlowAssignments();
6g&&await m.invalidateQueries(T.a.quoteFlowAssignments.all())},[m])}async function completeQuoteFlowAssignment(m){try{let g=await (0,et.h)(K.PV,{method:"post",url:en.Z.quoteFlow.completeAssignment(m),data:{anonymous_id:ei.t.getState().token?null:(0,er.ai)()}});return g.data}catch(m){return(0,E.zG)(m)}}},30581:function(m,g,v){"use strict";v.d(g,{X:function(){return useChangeEmailMutation},q:function(){return useVerifyEmailMutation}});var x=v(62350),k=v(53538),E=v(89644),T=v(44994),K=v(68344),et=v(14016),en=v(13346);let er=k.Ry({success:k.O7(),message:k.Z_()}),ei=k.Ry({success:k.O7(),message:k.Z_()}),es=k.Ry({message:k.Z_().optional(),detail:k.Z_().optional(),error:k.Z_().optional()}),el=k.Ry({message:k.Z_().optional(),detail:k.Z_().optional(),error:k.Z_().optional()}),useChangeEmailMutation=()=>(0,x.D)({mutationKey:["auth","change-email"],mutationFn:async m=>{try{let g=await (0,T.h)(er,{method:"POST",url:en.Z.auth.changeEmail(),data:m});return g.data}catch(m){if(m instanceof E.AxiosError&&m.response){if(400===m.response.status){let g=es.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"Error al solicitar cambio de email";throw new K.o(m)}}else if(409===m.response.status){let g=es.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"El email ya est\xe1 en uso";throw new K.o(m)}}}throw(0,et.rj)(m),new K.o("Error al solicitar cambio de email. Por favor, intenta nuevamente.")}}}),useVerifyEmailMutation=()=>(0,x.D)({mutationKey:["auth","verify-email"],mutationFn:async m=>{try{let g=await (0,T.h)(ei,{method:"POST",url:en.Z.auth.changeEmailVerify(),data:m});return g.data}catch(m){if(m instanceof E.AxiosError&&m.response){if(400===m.response.status){let g=el.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"Error al verificar el c\xf3digo";throw new K.o(m)}}else if(409===m.response.status){let g=el.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"C\xf3digo de verificaci\xf3n inv\xe1lido";throw new K.o(m)}}}throw(0,et.rj)(m),new K.o("Error al verificar el c\xf3digo. Por favor, intenta nuevamente.")}}})},56507:function(m,g,v){"use strict";v.d(g,{E:function(){return useVerifyPhoneMutation},G:function(){return useChangePhoneMutation}});var x=v(62350),k=v(53538),E=v(89644),T=v(44994),K=v(68344),et=v(14016),en=v(13346);let er=k.Ry({success:k.O7(),message:k.Z_()}),ei=k.Ry({success:k.O7(),message:k.Z_()}),es=k.Ry({message:k.Z_().optional(),detail:k.Z_().optional(),error:k.Z_().optional()}),el=k.Ry({message:k.Z_().optional(),detail:k.Z_().optional(),error:k.Z_().optional()}),useChangePhoneMutation=()=>(0,x.D)({mutationKey:["auth","change-phone"],mutationFn:async m=>{try{let g=await (0,T.h)(er,{method:"POST",url:en.Z.auth.changePhone(),data:m});return g.data}catch(m){if(m instanceof E.AxiosError&&m.response){if(400===m.response.status){let g=es.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"Error al solicitar cambio de tel\xe9fono";throw new K.o(m)}}else if(409===m.response.status){let g=es.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"El tel\xe9fono ya est\xe1 en uso";throw new K.o(m)}}}throw(0,et.rj)(m),new K.o("Error al solicitar cambio de tel\xe9fono. Por favor, intenta nuevamente.")}}}),useVerifyPhoneMutation=()=>(0,x.D)({mutationKey:["auth","verify-phone"],mutationFn:async m=>{try{let g=await (0,T.h)(ei,{method:"POST",url:en.Z.auth.changePhoneVerify(),data:m});return g.data}catch(m){if(m instanceof E.AxiosError&&m.response){if(400===m.response.status){let g=el.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"Error al verificar el c\xf3digo";throw new K.o(m)}}else if(409===m.response.status){let g=el.safeParse(m.response.data);if(g.success){let m=g.data.message||g.data.detail||g.data.error||"C\xf3digo de verificaci\xf3n inv\xe1lido";throw new K.o(m)}}}throw(0,et.rj)(m),new K.o("Error al verificar el c\xf3digo. Por favor, intenta nuevamente.")}}})},94973:function(m,g,v){"use strict";v.r(g),v.d(g,{default:function(){return _app}});var x,k,E,T,K,et,en,er=v(52322),ei=v(95715),es=v.n(ei),el=v(37108),ec=v.n(el),eu=v(2784);v(19178);var ed=v(39097),ep=v.n(ed),em=v(13346),ef=v(38421),eh=v.n(ef);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var hamburger_menu=function(m){return eu.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),x||(x=eu.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 5h18M3 12h18M3 19h18"})))};function chevron_left_extends(){return(chevron_left_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var chevron_left=function(m){return eu.createElement("svg",chevron_left_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),k||(k=eu.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"m15 6-6 6 6 6"})))};function profile_extends(){return(profile_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var profile=function(m){return eu.createElement("svg",profile_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),E||(E=eu.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M7 18v-1a5 5 0 0 1 5-5v0a5 5 0 0 1 5 5v1"})),T||(T=eu.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6"})),K||(K=eu.createElement("circle",{cx:12,cy:12,r:10,stroke:"currentColor",strokeWidth:1.5})))};function restart_extends(){return(restart_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var restart=function(m){return eu.createElement("svg",restart_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),et||(et=eu.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M2.112 13.5C2.835 18.311 6.987 22 12 22c5.523 0 10-4.477 10-10S17.523 2 12 2C7.9 2 4.375 4.468 2.832 8"})),en||(en=eu.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 8H2.6a.6.6 0 0 1-.6-.
66V3"})))},eg=v(93829),ev=v(43335),ey=v(99714),eb=v(25987),ex=v(5632),e_=v(84355),ew=v(43889),eS=v(39776),eC=v(53328),ek=v(37133),eE=v(81075),ej=v(42710),TheNav=function(m){var g,v;let x=(0,eE.f)(),{data:k}=(0,eS.a)(),E=(0,ew.t)(m=>m.token),T=(0,ew.t)(m=>m.logout),{data:K}=(0,ek.XD)(),[et,en]=(0,eu.useState)([]),[ei,es]=(0,eu.useState)(!1),[el,ec]=(0,eu.useState)(!1),ed=(0,ex.useRouter)(),{isOnboarding:ef,onboardingCanGoBack:eN,resetOnboarding:eR}=function(){let m=(0,ex.useRouter)(),g=(0,eC.w)(m=>m.resetOnboarding),v=m.pathname.includes(em.Z.pet.new.index()),x=m.pathname!==em.Z.pet.new.index();return{isOnboarding:v,onboardingCanGoBack:x,resetOnboarding:function(){g(),m.push(em.Z.pet.new.index())}}}();function handleLogout(){T(),window.location.href=em.Z.index()}(0,eu.useEffect)(()=>{K&&en(K.filter(m=>!m.has_policy))},[K]),(0,eu.useEffect)(()=>{"/profile"==ed.pathname?es(!0):es(!1)},[ed.pathname]);let eI=x&&E?"/profile?tab=policies":em.Z.index(),eP=x?k:void 0;return(0,er.jsxs)("div",{className:(0,eb.cn)("sticky top-0 z-20 bg-white shadow-4xl",m.className),children:[(0,er.jsxs)("div",{className:"flex relative md:hidden justify-between items-center px-4 py-4",children:[m.showBackButton||ef&&eN?(0,er.jsx)("button",{onClick:()=>ed.back(),className:"w-min",children:(0,er.jsx)(chevron_left,{className:"w-6"})}):(0,er.jsxs)(eu.Fragment,{children:[(0,er.jsx)("button",{className:"w-min",onClick:()=>ec(!0),children:(0,er.jsx)(hamburger_menu,{className:"w-6"})}),(0,er.jsx)(e_.Vq,{open:el,onOpenChange:m=>{m||ec(!1)},children:(0,er.jsx)(e_.cZ,{hideCloseButton:!0,variant:"fullHeight",children:(0,er.jsx)("div",{children:(0,er.jsx)(ey.MobileMenu,{user:eP,onLogoutClick:handleLogout,isNavBar:!0,onNavBarClose:()=>ec(!1)})})})})]}),ei&&et.length>0?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)("div",{className:"grow"}),(0,er.jsx)(eg.z,{className:"place-self-end",variant:"brand-destructive",iconRight:(0,er.jsx)(ej.Z,{className:"h-5 w-5"}),onClick:()=>{let m=et[0];if(m){if(m.last_coverage_bundle_id)ed.push(em.Z.frontend.quoteSummary(m.last_coverage_bundle_id));else{let m=eC.w.getState().resetOnboarding;m(),ed.push(em.Z.pet.new.index())}}},children:"Seguir cotizaci\xf3n"})]}):(0,er.jsx)(ep(),{href:eI,passHref:!0,legacyBehavior:!0,children:(0,er.jsx)("a",{className:"justify-self-center",children:(0,er.jsx)(eh(),{alt:"Cacttus",src:"/static/logo-cacttus-full.svg",className:"object-center",width:116,height:24})})}),m.showBackButton&&eP?(0,er.jsx)(ep(),{href:em.Z.profile.index(),legacyBehavior:!0,children:(0,er.jsx)("a",{className:"w-min",children:(0,er.jsx)(profile,{className:"w-6"})})}):ef?(0,er.jsx)("div",{onClick:()=>eR(),children:(0,er.jsx)(restart,{className:"w-6 text-neutral-500"})}):(0,er.jsx)("div",{className:"w-6"})]}),(0,er.jsxs)("div",{className:(0,eb.cn)("hidden sticky top-0 justify-between items-center px-24 py-4",{hidden:ei,"md:flex":!ei}),children:[(0,er.jsx)(ep(),{href:eI,passHref:!0,legacyBehavior:!0,children:(0,er.jsx)("a",{children:(0,er.jsx)(eh(),{alt:"Cacttus",src:"/static/logo-cacttus-full.svg",className:"object-center cursor-pointer self-center",width:136,height:28})})}),eP?(0,er.jsxs)("div",{className:"flex space-x-9",children:[(0,er.jsx)(ep(),{href:eI,legacyBehavior:!0,children:(0,er.jsxs)("a",{className:"flex items-center justify-center space-x-2 cursor-pointer",children:[(0,er.jsx)("span",{className:"rounded-full w-2.5 h-2.5 bg-teal-500"}),(0,er.jsx)("span",{className:"text-neutral-500",children:"".concat((0,ev.fm)(null!==(g=null==eP?void 0:eP.first_name)&&void 0!==g?g:void 0),"  ").concat((0,ev.fm)(null!==(v=null==eP?void 0:eP.last_name)&&void 0!==v?v:void 0))})]})}),(0,er.jsx)("button",{onClick:()=>handleLogout(),className:"text-neutral-500",children:"Cerrar sesi\xf3n"})]}):(0,er.jsxs)("div",{className:"flex space-x-9 items-center",children:[(0,er.jsx)(ep(),{href:"/blog",className:"text-neutral-500 flex items-center justify-center space-x-2",children:"Blog"}),(0,er.jsx)(ep(),{href:"/profile",legacyBehavior:!0,children:(0,er.jsx)("a",{className:"text-neutral-500 cursor-pointer",children:"Iniciar sesi\xf3n"})}),(0,er.jsx)(ep(),{href:em.Z.pet.new.index(),passHref:!0,children:(0,er.jsx)(eg.z,{variant:"brand",children:"Cotizar seguro"})})]})]})]})},eN=v(69503);function SiteMeta(){return(0,er.jsx)(eN.R,{title:"Cacttus | Seguros para mascotas con reembolsos ultrarr\xe1pidos",description:"Seguros justos para la vida moderna. Compra tu p\xf3liza en segundos y te ayudamos a cambiarte",ogImage:"/static/thumbnail.jpg",includeSiteMetadata:!0})}var eR=v(28151);function Layout(m){let{children:g,showBackButton:v,navBarClassName:x}=m,{data:k}=(0,eS.a)(),E=(0,ex.useRouter)();return(0,eu.useEffect)(()=>{k&&(0,eR.$A)(k.id)},[k]),(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(SiteMeta,{}),!("/chat/[userId]"===E.pathname||E.pathname.includes("onboarding")||E.pathname.startsWith("/admin"))&&(0,er.jsx)(TheNav,{className:x,showBackButton:v}),(0,er.jsx)("main",{children:g})]})}var eI=v(45847),eP=v.n(eI),eT=v(70490),eO=v(68717);function SiteScripts(){return(0,er.jsxs)(er.Fragment,{children:[eO.O.NEXT_PUBLIC_CUSTOMERIO_ANALYTICS_KEY&&(0,er.jsx)(eP(),{dangerouslySetInnerHTML:{__html:(()=>{let m={host:"analytics.cacttus.cl",apiKey:eO.O.NEXT_PUBLIC_CUSTOMERIO_ANALYTICS_KEY,ajsPath:'/v1/analytics-js/snippet/" + key + "/analytics.min.js',cdnURL:"https://analytics.cacttus.cl",integrations:{"Customer.io Data Pipelines":{apiHost:"analytics.cacttus.cl/v1",protocol:"https"}}};return eT.V(m)})()},id:"segmentScript"}),eO.O.NEXT_PUBLIC_TIKTOK_PIXEL_ID&&(0,er.jsx)(eP(),{id:"tiktok-pixel",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:'\n            !function (w, d, t) {\n              w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie","holdConsent","revokeConsent","grantConsent"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(\n              var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var r="https://analytics.tiktok.com/i18n/pixel/events.js",o=n&&n.partner;ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=r,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};n=document.createElement("script")\n              ;n.type="text/javascript",n.async=!0,n.src=r+"?sdkid="+e+"&lib="+t;e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(n,e)};\n\n\n              ttq.load(\''.concat(eO.O.NEXT_PUBLIC_TIKTOK_PIXEL_ID,"');\n              ttq.page();\n            }(window, document, 'ttq');")}}),eO.O.NEXT_PUBLIC_METRICOOL_HASH&&(0,er.jsx)(eP(),{id:"metricool",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:'\n              function loadScript(a){\n                var b=document.getElementsByTagName("head")[0],c=document.createElement("script");\n                c.type="text/javascript",c.src="https://tracker.metricool.com/resources/be.js",c.onreadystatechange=a,c.onload=a,b.appendChild(c)\n              }\n              loadScript(function(){if(typeof beTracker!=="undefined"){beTracker.t({hash:"'.concat(eO.O.NEXT_PUBLIC_METRICOOL_HASH,'"})}});\n            ')}})]})}var eA=v(32765),eM=v(83393),eD=v(5165),eL=v(55830);let Hydrate=({children:m,options:g,state:v})=>((function(m,g={}){let v=(0,eL.NL)({context:g.context}),x=eu.useRef(g);x.current=g,eu.useMemo(()=>{m&&function(m,g,v){if("object"!=typeof g||null===g)return;let x=m.getMutationCache(),k=m.getQueryCache(),E=g.mutations||[],T=g.queries||[];
6E.forEach(g=>{var k;x.build(m,{...null==v?void 0:null==(k=v.defaultOptions)?void 0:k.mutations,mutationKey:g.mutationKey},g.state)}),T.forEach(({queryKey:g,state:x,queryHash:E})=>{var T;let K=k.get(E);if(K){if(K.state.dataUpdatedAt<x.dataUpdatedAt){let{fetchStatus:m,...g}=x;K.setState(g)}return}k.build(m,{...null==v?void 0:null==(T=v.defaultOptions)?void 0:T.queries,queryKey:g,queryHash:E},{...x,fetchStatus:"idle"})})}(v,m,x.current)},[v,m])})(v,g),m);var eF=v(89644),eZ=v(14016),eB=v(68344),e$=v(20463);let ReactQueryDevtools=function(){return null};var eU=v(46443),ez=v(4165),eV=v(93542),initQueue=()=>{window.va||(window.va=function(...m){window.vaq||(window.vaq=[]),window.vaq.push(m)})};function isBrowser(){return"undefined"!=typeof window}function detectEnvironment(){return"production"}function isDevelopment(){return"development"===function(){let m=isBrowser()?window.vam:detectEnvironment();return m||"production"}()}function makeAbsolute(m){return m.startsWith("http://")||m.startsWith("https://")||m.startsWith("/")?m:`/${m}`}function Analytics(m){return(0,eu.useEffect)(()=>{var g;m.beforeSend&&(null==(g=window.va)||g.call(window,"beforeSend",m.beforeSend))},[m.beforeSend]),(0,eu.useEffect)(()=>{!function(m={debug:!0},g){var v;if(!isBrowser())return;let{beforeSend:x,src:k,dataset:E}=function(m,g){var v,x;let k=m;if(g)try{k={...null==(v=JSON.parse(g))?void 0:v.analytics,...m}}catch{}!function(m="auto"){if("auto"===m){window.vam=detectEnvironment();return}window.vam=m}(k.mode);let E={sdkn:"@vercel/analytics"+(k.framework?`/${k.framework}`:""),sdkv:"2.0.1"};return k.disableAutoTrack&&(E.disableAutoTrack="1"),k.viewEndpoint&&(E.viewEndpoint=makeAbsolute(k.viewEndpoint)),k.eventEndpoint&&(E.eventEndpoint=makeAbsolute(k.eventEndpoint)),k.sessionEndpoint&&(E.sessionEndpoint=makeAbsolute(k.sessionEndpoint)),isDevelopment()&&!1===k.debug&&(E.debug="false"),k.dsn&&(E.dsn=k.dsn),k.endpoint?E.endpoint=k.endpoint:k.basePath&&(E.endpoint=makeAbsolute(`${k.basePath}/insights`)),{beforeSend:k.beforeSend,src:(x=k).scriptSrc?makeAbsolute(x.scriptSrc):isDevelopment()?"https://va.vercel-scripts.com/v1/script.debug.js":x.basePath?makeAbsolute(`${x.basePath}/insights/script.js`):"/_vercel/insights/script.js",dataset:E}}(m,g);if(initQueue(),x&&(null==(v=window.va)||v.call(window,"beforeSend",x)),document.head.querySelector(`script[src*="${k}"]`))return;let T=document.createElement("script");for(let[m,g]of(T.src=k,Object.entries(E)))T.dataset[m]=g;T.defer=!0,T.onerror=()=>{let m=isDevelopment()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${k}. ${m}`)},document.head.appendChild(T)}({framework:m.framework||"react",basePath:m.basePath??function(){if(void 0!==eV&&void 0!==eV.env)return eV.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==m.route&&{disableAutoTrack:!0},...m},m.configString??function(){if(void 0!==eV&&void 0!==eV.env)return eV.env.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}())},[]),(0,eu.useEffect)(()=>{m.route&&m.path&&function({route:m,path:g}){var v;null==(v=window.va)||v.call(window,"pageview",{route:m,path:g})}({route:m.route,path:m.path})},[m.route,m.path]),null}var eq=v(82876),eH=v(93542),next_initQueue=()=>{window.si||(window.si=function(...m){(window.siq=window.siq||[]).push(m)})};function next_isDevelopment(){return false}function turnValueToRegExp(m){return RegExp(`/${m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function SpeedInsights(m){(0,eu.useEffect)(()=>{var g;m.beforeSend&&(null==(g=window.si)||g.call(window,"beforeSend",m.beforeSend))},[m.beforeSend]);let g=(0,eu.useRef)(null);return(0,eu.useEffect)(()=>{if(g.current)m.route&&g.current(m.route);else{let v=function(m={}){var g;if(!("undefined"!=typeof window)||null===m.route)return null;next_initQueue();let v=m.scriptSrc?m.scriptSrc:m.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":m.basePath?`${m.basePath}
6/speed-insights/script.js`:"/_vercel/speed-insights/script.js";if(document.head.querySelector(`script[src*="${v}"]`))return null;m.beforeSend&&(null==(g=window.si)||g.call(window,"beforeSend",m.beforeSend));let x=document.createElement("script");return x.src=v,x.defer=!0,x.dataset.sdkn="@vercel/speed-insights"+(m.framework?`/${m.framework}`:""),x.dataset.sdkv="1.3.1",m.sampleRate&&(x.dataset.sampleRate=m.sampleRate.toString()),m.route&&(x.dataset.route=m.route),m.endpoint?x.dataset.endpoint=m.endpoint:m.basePath&&(x.dataset.endpoint=`${m.basePath}/speed-insights/vitals`),m.dsn&&(x.dataset.dsn=m.dsn),x.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${v}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(x),{setRoute:m=>{x.dataset.route=m??void 0}}}({framework:m.framework??"react",basePath:m.basePath??function(){if(void 0!==eH&&void 0!==eH.env)return eH.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...m});v&&(g.current=v.setRoute)}},[m.route]),null}var useRoute=()=>{let m=(0,eq.useParams)(),g=(0,eq.useSearchParams)()||new URLSearchParams,v=(0,eq.usePathname)();if(!m)return null;let x=Object.keys(m).length?m:Object.fromEntries(g.entries());return function(m,g){if(!m||!g)return m;let v=m;try{let m=Object.entries(g);for(let[g,x]of m)if(!Array.isArray(x)){let m=turnValueToRegExp(x);m.test(v)&&(v=v.replace(m,`/[${g}]`))}for(let[g,x]of m)if(Array.isArray(x)){let m=turnValueToRegExp(x.join("/"));m.test(v)&&(v=v.replace(m,`/[...${g}]`))}return v}catch(g){return m}}(v,x)};function SpeedInsightsComponent(m){let g=useRoute();return eu.createElement(SpeedInsights,{route:g,...m,framework:"next",basePath:function(){if(void 0!==eH&&void 0!==eH.env)return eH.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}()})}function SpeedInsights2(m){return eu.createElement(eu.Suspense,{fallback:null},eu.createElement(SpeedInsightsComponent,{...m}))}var eW=v(38969);v(46904).DJ((m,g)=>"invalid_string"===m.code&&"email"===m.validation?{message:"Correo inv\xe1lido"}:"too_small"===m.code&&"string"===m.type&&1===m.minimum?{message:"Este campo no puede estar vac\xedo"}:"too_small"===m.code&&"string"===m.type&&m.minimum>1?{message:"Este campo debe tener al menos ".concat(m.minimum," caracteres")}:"invalid_type"===m.code&&"undefined"===m.received?{message:"Este campo es requerido"}:{message:(null==g?void 0:g.defaultError)||"Campo inv\xe1lido"});var eK=v(27484),eG=v.n(eK),eQ=v(70178),eY=v.n(eQ),eX=v(1646),eJ=v.n(eX),e0=v(29387),e1=v.n(e0);v(67763),eG().locale("es"),eG().extend(eY()),eG().extend(eJ()),eG().extend(e1());var e2=v(10638),e3=v(59705),e5=v(9374),e4=v(62350),e6=v(44994),e7=v(53538),e8=v(676);let e9=e7.Ry({owner:e7.Rx(),affiliate:e7.Rx(),referrer_code:e7.Z_(),first_name:e7.Z_(),last_name:e7.Z_()}).passthrough(),tt=e7.Ry({message:e7.Z_()}),useCreateReferral=()=>{let m=(0,eL.NL)();return(0,e4.D)(async m=>{let{data:g}=await (0,e6.h)(e9,{method:"post",url:em.Z.referral.ambassador(),data:{code:m}});return g},{onSuccess:g=>{e8.Am.success("Te invit\xf3 ".concat(g.first_name," ").concat(g.last_name," exitosamente a nuestro seguro"),"\xa1Bienvenido!"),m.invalidateQueries(eS.E)},onError:m=>{let g="Error al crear referido";if(m instanceof eF.AxiosError){var v;let x=tt.safeParse(null===(v=m.response)||void 0===v?void 0:v.data);x.success&&(g=x.data.message)}e8.Am.error(g)}})};var tn=v(88649);function FloatingWhatsappButton(){let m=(0,ex.useRouter)(),[g,v]=(0,eu.useState)(!1),[x,k]=(0,eu.useState)(!1),E="/pet/onboarding/v2/[coverageBundleId]/quoteSummary"===m.pathname;(0,eu.useEffect)(()=>(()=>{if(!E){k(!1);return}let m=setTimeout(()=>k(!0),2e3);return()=>clearTimeout(m)})(),[E]);let T="https://wa.me/".concat("56938795424","?text=").concat(encodeURIComponent(E?"Hola! Estoy en el proceso de cotizaci\xf3n y me gustar\xeda un plan personalizado para mi mascota.":"Hola! Estoy en el proceso de cotizaci\xf3n y tengo dudas sobre los planes de seguro para mascotas. \xbfMe puedes ayudar?")),K=E?"\xbfQuieres un plan personalizado? Escr\xedbenos":"\xbfTienes dudas? Te las resolvemos";return(0,er.jsx)("div",{className:"fixed right-5 z-50 animate-fade-in-up",style:{bottom:"70px"},children:(0,er.jsxs)("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"relative flex items-center justify-center w-[50px] h-[50px] bg-green-500 hover:bg-green-600 text-white rounded-full shadow-lg hover:shadow-2xl transition-all duration-300 ease-out hover:scale-110 active:scale-95 group","aria-label":"Chat con nosotros por WhatsApp",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[(0,er.jsx)("div",{className:"absolute inset-0 rounded-full bg-green-400 opacity-0 group-hover:opacity-20 animate-ping transition-opacity"}),(0,er.jsx)(tn.Z,{className:"h-7 w-7 text-white relative z-10 transition-transform duration-300 group-hover:rotate-12"}),E&&x&&!g&&(0,er.jsx)("div",{className:"absolute bottom-full right-0 mb-3 w-max max-w-[calc(100vw-40px)] animate-tooltip-pulse",children:(0,er.jsxs)("div",{className:"relative bg-gradient-to-r from-gray-700 to-gray-800 text-white px-4 py-2.5 rounded-xl shadow-xl",children:[(0,er.jsx)("div",{className:"text-sm font-medium",children:K}),(0,er.jsx)("div",{className:"absolute -bottom-1.5 right-5 w-3 h-3 bg-gray-800 rotate-45"})]})}),(0,er.jsx)("div",{className:"absolute bottom-full right-0 mb-3 w-max max-w-[calc(100vw-40px)] transition-all duration-300 ease-out ".concat(g?"opacity-100 translate-y-0":"opacity-0 translate-y-1 pointer-events-none"),children:(0,er.jsxs)("div",{className:"relative bg-gradient-to-r from-gray-700 to-gray-800 text-white px-4 py-2.5 rounded-xl shadow-xl",children:[(0,er.jsx)("div",{className:"text-sm font-medium",children:K}),(0,er.jsx)("div",{className:"absolute -bottom-1.5 right-5 w-3 h-3 bg-gray-800 rotate-45"})]})})]})})}var tr=v(82819),ts=v(10763);let to=(0,ts.Z)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}
6],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);function OfflineBanner(){let{isOffline:m}=function(){let[m,g]=(0,eu.useState)(!1),v=(0,eu.useRef)(!1);return(0,eu.useEffect)(()=>{let handleOnline=()=>{g(!1),v.current&&((0,e8.Am)({variant:"success",title:"Conexi\xf3n restablecida",description:"Ya puedes usar la aplicaci\xf3n normalmente"}),v.current=!1)},handleOffline=()=>{g(!0),v.current=!0};return g(!navigator.onLine),window.addEventListener("online",handleOnline),window.addEventListener("offline",handleOffline),()=>{window.removeEventListener("online",handleOnline),window.removeEventListener("offline",handleOffline)}},[]),{isOffline:m}}();return(0,er.jsxs)("div",{className:"fixed top-0 left-0 right-0 z-50 flex items-center justify-center gap-2 bg-gray-900/95 text-white px-4 py-2 text-sm font-medium transition-all duration-300 ease-out ".concat(m?"translate-y-0 opacity-100":"-translate-y-full opacity-0 pointer-events-none"),children:[(0,er.jsx)(to,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:"Sin conexi\xf3n a internet"})]})}function LayoutComponent(m){var g;let{Component:v,pageProps:x}=m,k=(0,ex.useRouter)(),E=null!==(g=v.getLayout)&&void 0!==g?g:m=>(0,er.jsx)(Layout,{children:m}),T=function(){let m=(0,ex.useRouter)(),g=(0,eu.useMemo)(()=>m.pathname.includes("/pet/onboarding/v2/")||"/pet/new"===m.pathname||"/pet/new/userInfo"===m.pathname||"/pet/new/petName"===m.pathname||"/pet/new/petKind2"===m.pathname||"/pet/new/petAgeAndGender"===m.pathname||"/pet/new/petBreed"===m.pathname||"/pet/onboarding/userInfo"===m.pathname||"/pet/onboarding/userAddress"===m.pathname||"/checkout"===m.pathname,[m.pathname]);return g}();return function(){let m=(0,ex.useRouter)();(0,eu.useEffect)(()=>{(0,eA.IR)(window.location.pathname)},[]),(0,eu.useEffect)(()=>{let handleRouteChange=m=>{var g;(0,eA.Jj)(null!==(g=m.split("?")[0])&&void 0!==g?g:m)};return m.events.on("routeChangeComplete",handleRouteChange),()=>{m.events.off("routeChangeComplete",handleRouteChange)}},[m.events])}(),function(){let{data:m}=(0,eS.a)(),{mutate:g}=useCreateReferral(),v=(0,ex.useRouter)();function saveReferralFromQuery(){if(v.query.referral){if("string"!=typeof v.query.referral)throw Error("Referral code is not a string");localStorage.setItem("cactus_referral",v.query.referral);let m={...v.query};delete m.referral,v.replace({pathname:v.pathname,query:m}),addReferredCode()}}function addReferredCode(){if(!m)return;let v=localStorage.getItem("cactus_referral");v&&g(v,{onSettled:()=>{localStorage.removeItem("cactus_referral")}})}function saveLucasoFromQuery(){if(v.query.lucaso){if("string"!=typeof v.query.lucaso)throw Error("Lucaso code is not a string");localStorage.setItem("lucaso",v.query.lucaso);let m={...v.query};delete m.lucaso,v.replace({pathname:v.pathname,query:m})}}(0,eu.useEffect)(()=>{saveReferralFromQuery(),addReferredCode(),saveLucasoFromQuery()},[]),(0,eu.useEffect)(()=>{saveReferralFromQuery()},[v.query.referral]),(0,eu.useEffect)(()=>{addReferredCode()},[null==m?void 0:m.id]),(0,eu.useEffect)(()=>{m&&((0,eR.Bc)({email:m.email,phone_number:m.phone?"+56".concat(m.phone):void 0,external_id:m.id.toString()}),(0,eA.um)(m.id.toString(),{$email:m.email,$name:[m.first_name,m.last_name].filter(Boolean).join(" ")}))},[null==m?void 0:m.id,null==m?void 0:m.email,null==m?void 0:m.first_name,null==m?void 0:m.last_name]),(0,eu.useEffect)(()=>{saveLucasoFromQuery()},[v.query.lucaso])}(),function(){let m=(0,ex.useRouter)();(0,eu.useEffect)(()=>{(0,e3.C)()},[m.query.gclid,m.query.gbraid,m.query.wbraid])}(),function(){let m=(0,ex.useRouter)();(0,eu.useEffect)(()=>{(0,e5.r)()},[m.query.utm_source,m.query.utm_medium,m.query.utm_campaign,m.query.utm_term,m.query.utm_content,m.query.utm_id])}(),function(){let m=(0,ex.useRouter)();(0,eu.useEffect)(()=>{(0,e2.cj)()},[m.query.fbclid]),(0,eu.useEffect)(()=>{(0,eR.qw)()},[]),(0,eu.useEffect)(()=>{let handleRouteChange=m=>{(0,eR.Z0)((0,eW.SK)(),window.location.origin+m,{pixel:!0})};return m.events.on("routeChangeComplete",handleRouteChange),()=>{m.events.off("routeChangeComplete",handleRouteChange)}},[m.events])}(),function(){let{data:m}=(0,eS.a)();(0,eu.useEffect)(()=>{m?(0,e$.av)({id:m.id.toString(),email:m.email.toLocaleLowerCase().trim()}):(0,e$.av)(null)},[null==m?void 0:m.id])}(),(0,eu.useEffect)(()=>{(0,eR.Mo)()},[]),(0,eu.useEffect)(()=>{T?document.body.classList.add("hide-intercom"):(document.body.classList.remove("hide-intercom"),(0,tr.D)("update",{hide_default_lau
6ncher:!1}))},[T]),(0,er.jsxs)("div",{children:[!k.pathname.startsWith("/admin")&&(0,er.jsx)(SiteScripts,{}),T&&(0,er.jsx)(FloatingWhatsappButton,{}),E((0,er.jsx)(v,{...x}))]})}function AppReactQueryDevtools(){let m=eu.lazy(()=>v.e(7637).then(v.bind(v,37637)).then(m=>({default:m.ReactQueryDevtools}))),[g,x]=eu.useState(!1);return eu.useEffect(()=>{window.toggleDevtools=()=>x(m=>!m)},[]),(0,er.jsxs)(eu.Fragment,{children:[(0,er.jsx)(ReactQueryDevtools,{initialIsOpen:!1}),g&&(0,er.jsx)(eu.Suspense,{fallback:null,children:(0,er.jsx)(m,{})})]})}function shouldRetry(m,g){var v;return(!(g instanceof eF.AxiosError)||null===(v=g.response)||void 0===v||!v.status||!(g.response.status<500))&&(!(g instanceof eB.o)||!g.statusCode||!(g.statusCode<500))&&m<3}function ClientOnlyComponents(){let[m,g]=eu.useState(!1);return(eu.useEffect(()=>{g(!0)},[]),m)?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(AppReactQueryDevtools,{}),(0,er.jsx)(ez.x,{}),(0,er.jsx)(OfflineBanner,{})]}):null}var _app=function(m){let{Component:g,pageProps:v}=m,[x]=eu.useState(()=>new eM.S({queryCache:new eD.t({onError:m=>{(0,eZ.rj)(m)}}),defaultOptions:{queries:{retry:shouldRetry,retryDelay:m=>Math.min(1e3*2**m,3e4),staleTime:3e5},mutations:{retry:shouldRetry,retryDelay:m=>Math.min(1e3*2**m,3e4),onError:m=>{(0,eZ.rj)(m)}}}}));return(0,eu.useEffect)(()=>{g.displayName&&(0,eR.Kq)(g.displayName)},[g.displayName]),(0,er.jsxs)(eL.aH,{client:x,children:[(0,er.jsx)(ec(),{id:"f3cb0236c39e9bba",dynamic:[es().style.fontFamily],children:":root{--font-dm-sans:".concat(es().style.fontFamily,"}")}),(0,er.jsx)(Hydrate,{state:v.dehydratedState,children:(0,er.jsxs)(eU.pn,{children:[(0,er.jsx)(ClientOnlyComponents,{}),(0,er.jsx)(LayoutComponent,{Component:g,pageProps:v}),(0,er.jsx)(Analytics,{}),(0,er.jsx)(SpeedInsights2,{})]})})]})}},51558:function(m,g,v){"use strict";v.r(g),v.d(g,{default:function(){return ez}});var x,k,E,T=v(52322),K=v(2784),et=v(37903),en=v(23551),er=v(21524);function browserContext(){return{platform:"web",user_agent:"undefined"!=typeof navigator?navigator.userAgent:void 0,screen_resolution:"undefined"!=typeof screen?"".concat(screen.width,"x").concat(screen.height):void 0,viewport_size:"".concat(window.innerWidth,"x").concat(window.innerHeight),url:window.location.href,referrer:"undefined"!=typeof document?document.referrer:void 0}}let trackBenefitsScreenView=()=>{(0,er.j)(en.SY,{...browserContext(),screen_name:"benefits"})},trackBenefitDetailView=(m,g,v,x)=>{(0,er.j)(en.dc,{...browserContext(),benefit_id:m,benefit_name:g,benefit_category:v,benefit_company:x})},trackBenefitNavigationBack=()=>{(0,er.j)(en.ot,{...browserContext(),screen_name:"benefit_detail"})},trackBenefitCardClick=(m,g,v)=>{(0,er.j)(en.ii,{...browserContext(),benefit_id:m,benefit_name:g,benefit_category:v,screen_name:"benefits"})},trackBenefitRedeemClick=(m,g,v)=>{(0,er.j)(en.w2,{...browserContext(),benefit_id:m,benefit_name:g,discount_code:v,screen_name:"benefit_detail"})},trackBenefitExternalLinkClick=(m,g,v)=>{(0,er.j)(en.VC,{...browserContext(),benefit_id:m,benefit_name:g,external_url:v,screen_name:"benefit_detail"})},trackBenefitListScroll=m=>{(0,er.j)(en.Jc,{...browserContext(),scroll_depth:m,screen_name:"benefits"})},trackBenefitCompanyLinkClick=(m,g,v)=>{(0,er.j)(en.jZ,{...browserContext(),company_id:m,company_name:g,benefit_count:v,screen_name:"benefit_detail"})},trackCompanyBenefitsView=(m,g)=>{(0,er.j)(en.OS,{...browserContext(),company_id:m,company_name:g,screen_name:"company_benefits"})},trackBenefitLoadError=m=>{(0,er.j)(en.Pe,{...browserContext(),error_message:m,screen_name:"benefits"})};function BenefitCard(m){let{benefit:g,onClick:v}=m;return(0,T.jsx)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-4 hover:shadow-md transition-shadow cursor-pointer",onClick:v?()=>{var m;trackBenefitCardClick(g.id,g.partnership_name,null!==(m=g.category_name)&&void 0!==m?m:""),v&&v()}:()=>{g.can_redeem?(trackBenefitRedeemClick(g.id,g.partnership_name,g.discount_code||void 0),g.url&&(trackBenefitExternalLinkClick(g.id,g.partnership_name,g.url),window.open(g.url,"_blank"))):trackBenefitRedeemClick(g.id,g.partnership_name,g.discount_code||void 0)},children:(0,T.jsxs)("div",{className:"flex items-center",children:[(0,T.jsxs)("div",{className:"w-14 h-14 bg-gray-50 rounded-xl mr-3 flex items-center justify-center overflow-hidden flex-shrink-0",children:[g.logo_url?(0,T.jsx)("img",{src:g.logo_url,alt:g.partnership_name,className:"w-full h-full object-contain",onError:m=>{var g;m.currentTarget.style.display="none",null===(g=m.currentTarget.nextElementSibling)||void 0===g||g.classList.remove("hidden")}}):null,(0,T.jsx)("div",{className:"w-full h-full flex items-center justify-center text-gray-400 text-lg font-semibold ".concat(g.logo_url?"hidden":""),children:g.partnership_name.charAt(0).toUpperCase()})]}),(0,T.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,T.jsxs)("div",{className:"flex items-center mb-1",children:[(0,T.jsx)("h3",{className:"text-base font-semibold text-gray-900 flex-1 truncate",children:g.partnership_name}),g.is_new&&(0,T.jsx)("span",{className:"bg-emerald-500 text-white text-xs px-2 py-0.5 rounded-md ml-2 flex-shrink-0",children:"Nuevo"})]}),(0,T.jsx)("p",{className:"text-xs text-gray-500 mb-2",children:g.category_name}),(0,T.jsx)("p",{className:"text-sm text-gray-700 mb-2 line-clamp-2",children:g.description}),(0,T.jsxs)("div",{className:"flex items-center justify-between",children:[(0,T.jsxs)("div",{className:"flex items-center",children:[(0,T.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full mr-1.5"}),(0,T.jsx)("span",{className:"text-xs text-gray-500",children:(m=>{switch(m){case"daily":return"Todos los d\xedas";case"weekdays":return"Lunes a Viernes";case"weekends":return"S\xe1bados y Domingos";
vendor: 15,492 bytes, line 6
6case"discount_based":return"Seg\xfan descuento";default:return m}})(g.availability)})]}),g.end_date&&(0,T.jsxs)("span",{className:"text-xs text-amber-600",children:["Hasta ",(0,et.p6)(g.end_date)]})]})]})]})})}var ei=Object.defineProperty,es=Object.getOwnPropertySymbols,el=Object.prototype.hasOwnProperty,ec=Object.prototype.propertyIsEnumerable,__defNormalProp=(m,g,v)=>g in m?ei(m,g,{enumerable:!0,configurable:!0,writable:!0,value:v}):m[g]=v,__spreadValues=(m,g)=>{for(var v in g||(g={}))el.call(g,v)&&__defNormalProp(m,v,g[v]);if(es)for(var v of es(g))ec.call(g,v)&&__defNormalProp(m,v,g[v]);return m},__objRest=(m,g)=>{var v={};for(var x in m)el.call(m,x)&&0>g.indexOf(x)&&(v[x]=m[x]);if(null!=m&&es)for(var x of es(m))0>g.indexOf(x)&&ec.call(m,x)&&(v[x]=m[x]);return v};(m=>{let g=class _QrCode{constructor(m,g,v,x){if(this.version=m,this.errorCorrectionLevel=g,this.modules=[],this.isFunction=[],m<_QrCode.MIN_VERSION||m>_QrCode.MAX_VERSION)throw RangeError("Version value out of range");if(x<-1||x>7)throw RangeError("Mask value out of range");this.size=4*m+17;let k=[];for(let m=0;m<this.size;m++)k.push(!1);for(let m=0;m<this.size;m++)this.modules.push(k.slice()),this.isFunction.push(k.slice());this.drawFunctionPatterns();let E=this.addEccAndInterleave(v);if(this.drawCodewords(E),-1==x){let m=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let v=this.getPenaltyScore();v<m&&(x=g,m=v),this.applyMask(g)}}assert(0<=x&&x<=7),this.mask=x,this.applyMask(x),this.drawFormatBits(x),this.isFunction=[]}static encodeText(g,v){let x=m.QrSegment.makeSegments(g);return _QrCode.encodeSegments(x,v)}static encodeBinary(g,v){let x=m.QrSegment.makeBytes(g);return _QrCode.encodeSegments([x],v)}static encodeSegments(m,g,v=1,k=40,E=-1,T=!0){let K,et;if(!(_QrCode.MIN_VERSION<=v&&v<=k&&k<=_QrCode.MAX_VERSION)||E<-1||E>7)throw RangeError("Invalid value");for(K=v;;K++){let v=8*_QrCode.getNumDataCodewords(K,g),E=x.getTotalBits(m,K);if(E<=v){et=E;break}if(K>=k)throw RangeError("Data too long")}for(let m of[_QrCode.Ecc.MEDIUM,_QrCode.Ecc.QUARTILE,_QrCode.Ecc.HIGH])T&&et<=8*_QrCode.getNumDataCodewords(K,m)&&(g=m);let en=[];for(let g of m)for(let m of(appendBits(g.mode.modeBits,4,en),appendBits(g.numChars,g.mode.numCharCountBits(K),en),g.getData()))en.push(m);assert(en.length==et);let er=8*_QrCode.getNumDataCodewords(K,g);assert(en.length<=er),appendBits(0,Math.min(4,er-en.length),en),appendBits(0,(8-en.length%8)%8,en),assert(en.length%8==0);for(let m=236;en.length<er;m^=253)appendBits(m,8,en);let ei=[];for(;8*ei.length<en.length;)ei.push(0);return en.forEach((m,g)=>ei[g>>>3]|=m<<7-(7&g)),new _QrCode(K,g,ei,E)}getModule(m,g){return 0<=m&&m<this.size&&0<=g&&g<this.size&&this.modules[g][m]}getModules(){return this.modules}drawFunctionPatterns(){for(let m=0;m<this.size;m++)this.setFunctionModule(6,m,m%2==0),this.setFunctionModule(m,6,m%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let m=this.getAlignmentPatternPositions(),g=m.length;for(let v=0;v<g;v++)for(let x=0;x<g;x++)0==v&&0==x||0==v&&x==g-1||v==g-1&&0==x||this.drawAlignmentPattern(m[v],m[x]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(m){let g=this.errorCorrectionLevel.formatBits<<3|m,v=g;for(let m=0;m<10;m++)v=v<<1^(v>>>9)*1335;let x=(g<<10|v)^21522;assert(x>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,getBit(x,m));this.setFunctionModule(8,7,getBit(x,6)),this.setFunctionModule(8,8,getBit(x,7)),this.setFunctionModule(7,8,getBit(x,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,getBit(x,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,getBit(x,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,getBit(x,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let m=this.version;for(let g=0;g<12;g++)m=m<<1^(m>>>11)*7973;let g=this.version<<12|m;assert(g>>>18==0);for(let m=0;m<18;m++){let v=getBit(g,m),x=this.size-11+m%3,k=Math.floor(m/3);this.setFunctionModule(x,k,v),this.setFunctionModule(k,x,v)}}drawFinderPattern(m,g){for(let v=-4;v<=4;v++)for(let x=-4;x<=4;x++){let k=Math.max(Math.abs(x),Math.abs(v)),E=m+x,T=g+v;0<=E&&E<this.size&&0<=T&&T<this.size&&this.setFunctionModule(E,T,2!=k&&4!=k)}}drawAlignmentPattern(m,g){for(let v=-2;v<=2;v++)for(let x=-2;x<=2;x++)this.setFunctionModule(m+x,g+v,1!=Math.max(Math.abs(x),Math.abs(v)))}setFunctionModule(m,g,v){this.modules[g][m]=v,this.isFunction[g][m]=!0}addEccAndInterleave(m){let g=this.version,v=this.errorCorrectionLevel;if(m.length!=_QrCode.getNumDataCodewords(g,v))throw RangeError("Invalid argument");let x=_QrCode.NUM_ERROR_CORRECTION_BLOCKS[v.ordinal][g],k=_QrCode.ECC_CODEWORDS_PER_BLOCK[v.ordinal][g],E=Math.floor(_QrCode.getNumRawDataModules(g)/8),T=x-E%x,K=Math.floor(E/x),et=[],en=_QrCode.reedSolomonComputeDivisor(k);for(let g=0,v=0;g<x;g++){let x=m.slice(v,v+K-k+(g<T?0:1));v+=x.length;let E=_QrCode.reedSolomonComputeRemainder(x,en);g<T&&x.push(0),et.push(x.concat(E))}let er=[];for(let m=0;m<et[0].length;m++)et.forEach((g,v)=>{(m!=K-k||v>=T)&&er.push(g[m])});return assert(er.length==E),er}drawCodewords(m){if(m.length!=Math.floor(_QrCode.getNumRawDataModules(this.version)/8))throw RangeError("Invalid argument");let g=0;for(let v=this.size-1;v>=1;v-=2){6==v&&(v=5);for(let x=0;x<this.size;x++)for(let k=0;k<2;k++){let E=v-k,T=(v+1&2)==0,K=T?this.size-1-x:x;!this.isFunction[K][E]&&g<8*m.length&&(this.modules[K][E]=getBit(m[g>>>3],7-(7&g)),g++)}}assert(g==8*m.length)}applyMask(m){if(m<0||m>7)throw RangeError("Mask value out of range");for(let g=0;g<this.size;g++)for(let v=0;v<this.size;v++){let x;switch(m){case 0:x=(v+g)%2==0;break;case 1:x=g%2==0;break;case 2:x=v%3==0;break;case 3:x=(v+g)%3==0;break;case 4:x=(Math.floor(v/3)+Math.floor(g/2))%2==0;break;case 5:x=v*g%2+v*g%3==0;break;case 6:x=(v*g%2+v*g%3)%2==0;break;case 7:x=((v+g)%2+v*g%3)%2==0;break;default:throw Error("Unreachable")}!this.isFunction[g][v]&&x&&(this.modules[g][v]=!this.modules[g][v])}}getPenaltyScore(){let m=0;for(let g=0;g<this.size;g++){let v=!1,x=0,k=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[g][E]==v?5==++x?m+=_QrCode.PENALTY_N1:x>5&&m++:(this.finderPenaltyAddHistory(x,k),v||(m+=this.finderPenaltyCountPatterns(k)*_QrCode.PENALTY_N3),v=this.modules[g][E],x=1);m+=this.finderPenaltyTerminateAndCount(v,x,k)*_QrCode.PENALTY_N3}for(let g=0;g<this.size;g++){let v=!1,x=0,k=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[E][g]==v?5==++x?m+=_QrCode.PENALTY_N1:x>5&&m++:(this.finderPenaltyAddHistory(x,k),v||(m+=this.finderPenaltyCountPatterns(k)*_QrCode.PENALTY_N3),v=this.modules[E][g],x=1);m+=this.finderPenaltyTerminateAndCount(v,x,k)*_QrCode.PENALTY_N3}for(let g=0;g<this.size-1;g++)for(let v=0;v<this.size-1;v++){let x=this.modules[g][v];x==this.modules[g][v+1]&&x==this.modules[g+1][v]&&x==this.modules[g+1][v+1]&&(m+=_QrCode.PENALTY_N2)}let g=0;for(let m of this.modules)g=m.reduce((m,g)=>m+(g?1:0),g);let v=this.size*this.size,x=Math.ceil(Math.abs(20*g-10*v)/v)-1;return assert(0<=x&&x<=9),assert(0<=(m+=x*_QrCode.PENALTY_N4)&&m<=2568888),m}getAlignmentPatternPositions(){if(1==this.version)return[];{let m=Math.floor(this.version/7)+2,g=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*m-2)),v=[6];for(let x=this.size-7;v.length<m;x-=g)v.splice(1,0,x);return v}}static getNumRawDataModules(m){if(m<_QrCode.MIN_VERSION||m>_QrCode.MAX_VERSION)throw RangeError("Version number out of range");let g=(16*m+128)*m+64;if(m>=2){let v=Math.floor(m/7)+2;g-=(25*v-10)*v-55,m>=7&&(g-=36)}return assert(208<=g&&g<=29648),g}static getNumDataCodewords(m,g){return Math.floor(_QrCode.getNumRawDataModules(m)/8)-_QrCode.ECC_CODEWORDS_PER_BLOCK[g.ordinal][m]*_QrCode.NUM_ERROR_CORRECTION_BLOCKS[g.ordinal][m]}static reedSolomonComputeDivisor(m){if(m<1||m>255)throw RangeError("Degree out of range");let g=[];for(let v=0;v<m-1;v++)g.push(0);g.push(1);let v=1;for(let x=0;x<m;x++){for(let m=0;m<g.length;m++)g[m]=_QrCode.reedSolomonMultiply(g[m],v),m+1<g.length&&(g[m]^=g[m+1]);v=_QrCode.reedSolomonMultiply(v,2)}return g}static reedSolomonComputeRemainder(m,g){let v=g.map(m=>0);for(let x of m){let m=x^v.shift();v.push(0),g.forEach((g,x)=>v[x]^=_QrCode.reedSolomonMultiply(g,m))}return v}static reedSolomonMultiply(m,g){if(m>>>8!=0||g>>>8!=0)throw RangeError("Byte out of range");let v=0;for(let x=7;x>=0;x--)v=v<<1^(v>>>7)*285^(g>>>x&1)*m;return assert(v>>>8==0),v}finderPenaltyCountPatterns(m){let g=m[1];assert(g<=3*this.size);let v=g>0&&m[2]==g&&m[3]==3*g&&m[4]==g&&m[5]==g;return(v&&m[0]>=4*g&&m[6]>=g?1:0)+(v&&m[6]>=4*g&&m[0]>=g?1:0)}finderPenaltyTerminateAndCount(m,g,v){return m&&(this.finderPenaltyAddHistory(g,v),g=0),g+=this.size,this.finderPenaltyAddHistory(g,v),this.finderPenaltyCountPatterns(v)}finderPenaltyAddHistory(m,g){0==g[0]&&(m+=this.size),g.pop(),g.unshift(m)}};function appendBits(m,g,v){if(g<0||g>31||m>>>g!=0)throw RangeError("Value out of range");for(let x=g-1;x>=0;x--)v.push(m>>>x&1)}function getBit(m,g){return(m>>>g&1)!=0}function assert(m){if(!m)throw Error("Assertion error")}g.MIN_VERSION=1,g.MAX_VERSION=40,g.PENALTY_N1=3,g.PENALTY_N2=3,g.PENALTY_N3=40,g.PENALTY_N4=10,g.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],g.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],m.QrCode=g;let v=class _QrSegment{constructor(m,g,v){if(this.mode=m,this.numChars=g,this.bitData=v,g<0)throw RangeError("Invalid argument");this.bitData=v.slice()}static makeBytes(m){let g=[];for(let v of m)appendBits(v,8,g);return new _QrSegment(_QrSegment.Mode.BYTE,m.length,g)}static makeNumeric(m){if(!_QrSegment.isNumeric(m))throw RangeError("String contains non-numeric characters");let g=[];for(let v=0;v<m.length;){let x=Math.min(m.length-v,3);appendBits(parseInt(m.substring(v,v+x),10),3*x+1,g),v+=x}return new _QrSegment(_QrSegment.Mode.NUMERIC,m.length,g)}static makeAlphanumeric(m){let g;if(!_QrSegment.isAlphanumeric(m))throw RangeError("String contains unencodable characters in alphanumeric mode");let v=[];for(g=0;g+2<=m.length;g+=2){let x=45*_QrSegment.ALPHANUMERIC_CHARSET.indexOf(m.charAt(g));appendBits(x+=_QrSegment.ALPHANUMERIC_CHARSET.indexOf(m.charAt(g+1)),11,v)}return g<m.length&&appendBits(_QrSegment.ALPHANUMERIC_CHARSET.indexOf(m.charAt(g)),6,v),new _QrSegment(_QrSegment.Mode.ALPHANUMERIC,m.length,v)}static makeSegments(m){return""==m?[]:_QrSegment.isNumeric(m)?[_QrSegment.makeNumeric(m)]:_QrSegment.isAlphanumeric(m)?[_QrSegment.makeAlphanumeric(m)]:[_QrSegment.makeBytes(_QrSegment.toUtf8ByteArray(m))]}static makeEci(m){let g=[];if(m<0)throw RangeError("ECI assignment value out of range");if(m<128)appendBits(m,8,g);else if(m<16384)appendBits(2,2,g),appendBits(m,14,g);else if(m<1e6)appendBits(6,3,g),appendBits(m,21,g);else throw RangeError("ECI assignment value out of range");return new _QrSegment(_QrSegment.Mode.ECI,0,g)}static isNumeric(m){return _QrSegment.NUMERIC_REGEX.test(m)}static isAlphanumeric(m){return _QrSegment.ALPHANUMERIC_REGEX.test(m)}getData(){return this.bitData.slice()}static getTotalBits(m,g){let v=0;for(let x of m){let m=x.mode.numCharCountBits(g);if(x.numChars>=1<<m)return 1/0;v+=4+m+x.bitData.length}return v}static toUtf8ByteArray(m){m=encodeURI(m);let g=[];for(let v=0;v<m.length;v++)"%"!=m.charAt(v)?g.push(m.charCodeAt(v)):(g.push(parseInt(m.substring(v+1,v+3),16)),v+=2);return g}};v.NUMERIC_REGEX=/^[0-9]*$/,v.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,v.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let x=v;m.QrSegment=v})(E||(E={})),(m=>{let g=class{constructor(m,g){this.ordinal=m,this.formatBits=g}};g.LOW=new g(0,1),g.MEDIUM=new g(1,0),g.QUARTILE=new g(2,3),g.HIGH=new g(3,2),m.Ecc=g})((x=E||(E={})).QrCode||(x.QrCode={})),(m=>{let g=class{constructor(m,g){this.modeBits=m,this.numBitsCharCount=g}numCharCountBits(m){return this.numBitsCharCount[Math.floor((m+7)/17)]}};g.NUMERIC=new g(1,[10,12,14]),g.ALPHANUMERIC=new g(2,[9,11,13]),g.BYTE=new g(4,[8,16,16]),g.KANJI=new g(8,[8,10,12]),g.ECI=new g(7,[0,0,0]),m.Mode=g})((k=E||(E={})).QrSegment||(k.QrSegment={}));var eu=E,ed={L:eu.QrCode.Ecc.LOW,M:eu.QrCode.Ecc.MEDIUM,Q:eu.QrCode.Ecc.QUARTILE,H:eu.QrCode.Ecc.HIGH},ep="#FFFFFF",em="#000000";function generatePath(m,g=0){let v=[];return m.forEach(function(m,x){let k=null;m.forEach(function(E,T){if(!E&&null!==k){v.push(`M${k+g} ${x+g}h${T-k}v1H${k+g}z`),k=null;return}if(T===m.length-1){if(!E)return;null===k?v.push(`M${T+g},${x+g} h1v1H${T+g}z`):v.push(`M${k+g},${x+g} h${T+1-k}v1H${k+g}z`);return}E&&null===k&&(k=T)})}),v.join("")}function excavateModules(m,g){return m.slice().map((m,v)=>v<g.y||v>=g.y+g.h?m:m.map((m,v)=>(v<g.x||v>=g.x+g.w)&&m))}function useQRCode({value:m,level:g,minVersion:v,includeMargin:x,marginSize:k,imageSettings:E,size:T,boostLevel:et}){let en=K.useMemo(()=>{let x=Array.isArray(m)?m:[m],k=x.reduce((m,g)=>(m.push(...eu.QrSegment.makeSegments(g)),m),[]);return eu.QrCode.encodeSegments(k,ed[g],v,void 0,void 0,et)},[m,g,v,et]),{cells:er,margin:ei,numCells:es,calculatedImageSettings:el}=K.useMemo(()=>{let m=en.getModules(),g=null!=k?Math.max(Math.floor(k),0):x?4:0,v=m.length+2*g,K=function(m,g,v,x){if(null==x)return null;let k=m.length+2*v,E=Math.floor(.1*g),T=k/g,K=(x.width||E)*T,et=(x.height||E)*T,en=null==x.x?m.length/2-K/2:x.x*T,er=null==x.y?m.length/2-et/2:x.y*T,ei=null==x.opacity?1:x.opacity,es=null;if(x.excavate){let m=Math.floor(en),g=Math.floor(er),v=Math.ceil(K+en-m),x=Math.ceil(et+er-g);es={x:m,y:g,w:v,h:x}}let el=x.crossOrigin;return{x:en,y:er,h:et,w:K,excavation:es,opacity:ei,crossOrigin:el}}(m,T,g,E);return{cells:m,margin:g,numCells:v,calculatedImageSettings:K}},[en,T,E,x,k]);return{qrcode:en,margin:ei,cells:er,numCells:es,calculatedImageSettings:el}}var ef=function(){try{new Path2D().addPath(new Path2D)}catch(m){return!1}return!0}();K.forwardRef(function(m,g){let{value:v,size:x=128,level:k="L",bgColor:E=ep,fgColor:T=em,includeMargin:et=!1,minVersion:en=1,boostLevel:er,marginSize:ei,imageSettings:es}=m,el=__objRest(m,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:ec}=el,eu=__objRest(el,["style"]),ed=null==es?void 0:es.src,eh=K.useRef(null),eg=K.useRef(null),ev=K.useCallback(m=>{eh.current=m,"function"==typeof g?g(m):g&&(g.current=m)},[g]),[ey,eb]=K.useState(!1),{margin:ex,cells:e_,numCells:ew,calculatedImageSettings:eS}=useQRCode({value:v,level:k,minVersion:en,boostLevel:er,includeMargin:et,marginSize:ei,imageSettings:es,size:x});K.useEffect(()=>{if(null!=eh.current){let m=eh.current,g=m.getContext("2d");if(!g)return;let v=e_,k=eg.current,K=null!=eS&&null!==k&&k.complete&&0!==k.naturalHeight&&0!==k.naturalWi
6dth;K&&null!=eS.excavation&&(v=excavateModules(e_,eS.excavation));let et=window.devicePixelRatio||1;m.height=m.width=x*et;let en=x/ew*et;g.scale(en,en),g.fillStyle=E,g.fillRect(0,0,ew,ew),g.fillStyle=T,ef?g.fill(new Path2D(generatePath(v,ex))):e_.forEach(function(m,v){m.forEach(function(m,x){m&&g.fillRect(x+ex,v+ex,1,1)})}),eS&&(g.globalAlpha=eS.opacity),K&&g.drawImage(k,eS.x+ex,eS.y+ex,eS.w,eS.h)}}),K.useEffect(()=>{eb(!1)},[ed]);let eC=__spreadValues({height:x,width:x},ec),ek=null;return null!=ed&&(ek=K.createElement("img",{src:ed,key:ed,style:{display:"none"},onLoad:()=>{eb(!0)},ref:eg,crossOrigin:null==eS?void 0:eS.crossOrigin})),K.createElement(K.Fragment,null,K.createElement("canvas",__spreadValues({style:eC,height:x,width:x,ref:ev,role:"img"},eu)),ek)}).displayName="QRCodeCanvas";var eh=K.forwardRef(function(m,g){let{value:v,size:x=128,level:k="L",bgColor:E=ep,fgColor:T=em,includeMargin:et=!1,minVersion:en=1,boostLevel:er,title:ei,marginSize:es,imageSettings:el}=m,ec=__objRest(m,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:eu,cells:ed,numCells:ef,calculatedImageSettings:eh}=useQRCode({value:v,level:k,minVersion:en,boostLevel:er,includeMargin:et,marginSize:es,imageSettings:el,size:x}),eg=ed,ev=null;null!=el&&null!=eh&&(null!=eh.excavation&&(eg=excavateModules(ed,eh.excavation)),ev=K.createElement("image",{href:el.src,height:eh.h,width:eh.w,x:eh.x+eu,y:eh.y+eu,preserveAspectRatio:"none",opacity:eh.opacity,crossOrigin:eh.crossOrigin}));let ey=generatePath(eg,eu);return K.createElement("svg",__spreadValues({height:x,width:x,viewBox:`0 0 ${ef} ${ef}`,ref:g,role:"img"},ec),!!ei&&K.createElement("title",null,ei),K.createElement("path",{fill:E,d:`M0,0 h${ef}v${ef}H0z`,shapeRendering:"crispEdges"}),K.createElement("path",{fill:T,d:ey,shapeRendering:"crispEdges"}),ev)});eh.displayName="QRCodeSVG";var eg=v(6342),ev=v(19679),ey=v(85913),eb=v(32263),ex=v(87078),e_=v(51279),ew=v(84713),eS=v(95369),eC=v(42710),ek=v(7313),eE=v(62350),ej=v(53538),eN=v(44994),eR=v(14016),eI=v(13346);let eP=ej.Ry({code:ej.Z_(),formatted_code:ej.Z_(),expires_at:ej.Z_(),benefit_name:ej.Z_()});var eT=v(676),eO=v(93829),eA=v(87779),eM=v(36479),eD=v(25987);function CompanyLogo(m){let{logoUrl:g,name:v,className:x}=m,[k,E]=(0,K.useState)(!1);return(0,T.jsx)("div",{className:(0,eD.cn)("flex items-center justify-center overflow-hidden rounded-xl bg-muted",x),children:g&&!k?(0,T.jsx)("img",{src:g,alt:v,className:"h-full w-full object-contain",onError:()=>E(!0)}):(0,T.jsx)("span",{className:"text-xl font-semibold text-muted-foreground",children:v.charAt(0).toUpperCase()})})}function VerificationCodeSection(m){let{benefit:g}=m,[v,x]=(0,K.useState)(null),[k,E]=(0,K.useState)(null),[et,en]=(0,K.useState)(!1),{toast:er}=(0,eT.pm)(),ei=(0,eE.D)({mutationFn:async m=>{try{let{data:g}=await (0,eN.h)(eP,{method:"post",url:eI.Z.benefits.generateCode(m)});return g}catch(m){(0,eR.zG)(m,"Error al generar el c\xf3digo de verificaci\xf3n")}}}),es=(0,K.useCallback)(()=>{v&&E(function(m){let g=new Date().getTime(),v=new Date(m).getTime(),x=v-g;if(x<=0)return{hours:0,minutes:0,expired:!0};let k=Math.floor(x/36e5),E=Math.floor(x%36e5/6e4);return{hours:k,minutes:E,expired:!1}}(v.expires_at))},[v]);if((0,K.useEffect)(()=>{es();let m=setInterval(es,6e4);return()=>clearInterval(m)},[es]),!v||(null==k?void 0:k.expired))return(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(eO.z,{variant:"default",size:"full",onClick:()=>{ei.mutate(g.id,{onSuccess:m=>{m&&x(m)},onError:m=>{let{message:g,details:v}=(0,eR.EV)(m,"Error al generar el c\xf3digo");er({title:"Error",description:g+v,variant:"destructive"})}})},loading:ei.isLoading,disabled:!g.can_redeem,children:v?"Generar nuevo c\xf3digo":"Generar c\xf3digo de verificaci\xf3n"}),(0,T.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:"Tu c\xf3digo personal para usar en tienda"})]});let el="".concat(window.location.origin,"/verificar-beneficio?code=").concat(v.code);return(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsxs)("div",{className:"flex items-center justify-center gap-3 rounded-lg bg-muted p-4",children:[(0,T.jsx)("code",{className:"font-mono text-2xl tracking-[0.3em] text-foreground",children:v.formatted_code}),(0,T.jsx)(eO.z,{variant:"outline",size:"icon",title:"Copiar c\xf3digo",onClick:()=>{navigator.clipboard.writeText(v.code).then(()=>{en(!0),setTimeout(()=>en(!1),2e3)})},children:et?(0,T.jsx)(eg.Z,{className:"text-success"}):(0,T.jsx)(ev.Z,{})})]}),el&&(0,T.jsx)("div",{className:"flex justify-center",children:(0,T.jsxs)("div",{className:"rounded-lg border border-border bg-background p-3",children:[(0,T.jsx)(eh,{value:el,size:128,className:"hidden lg:block"}),(0,T.jsx)(eh,{value:el,size:96,className:"block lg:hidden"})]})}),k&&(0,T.jsxs)("p",{className:"text-center text-sm text-muted-foreground",children:["Expira en ",k.hours,"h ",k.minutes,"m"]}),(0,T.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:"Muestra este c\xf3digo o QR en la tienda para validar tu benef
6icio"})]})}function BenefitDetail(m){let{benefit:g,onCompanyClick:v}=m,[x,k]=(0,K.useState)(!1);(0,K.useEffect)(()=>{var m;trackBenefitDetailView(g.id,g.partnership_name,null!==(m=g.category_name)&&void 0!==m?m:"",g.partnership_name)},[g.id,g.partnership_name,g.category_name]);let E="presential"===g.method,en="verification"===g.redemption_type,er=en?null:(0,T.jsx)(eO.z,{variant:"default",size:"full",onClick:()=>{trackBenefitRedeemClick(g.id,g.partnership_name,g.discount_code||void 0),g.can_redeem&&g.url&&(trackBenefitExternalLinkClick(g.id,g.partnership_name,g.url),window.open(g.url,"_blank"))},disabled:!g.can_redeem,children:g.can_redeem?E?"Ver ubicaci\xf3n":"Usar beneficio":"Beneficio no disponible"});return(0,T.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,T.jsxs)("div",{className:"grid grid-cols-1 gap-6 p-4 lg:grid-cols-2 lg:gap-8 lg:p-6",children:[(0,T.jsxs)("div",{className:"space-y-5",children:[(0,T.jsxs)("div",{className:"flex items-start gap-4",children:[(0,T.jsx)(CompanyLogo,{logoUrl:g.logo_url,name:g.partnership_name,className:"h-16 w-16 shrink-0 lg:h-20 lg:w-20"}),(0,T.jsxs)("div",{className:"min-w-0",children:[(0,T.jsx)("h2",{className:"text-xl font-bold text-foreground lg:text-2xl",children:g.partnership_name}),(0,T.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[g.category_name&&(0,T.jsx)(eA.C,{variant:"secondary",children:g.category_name}),g.is_new&&(0,T.jsx)(eA.C,{className:"border-transparent bg-success/15 text-success hover:bg-success/15",children:"Nuevo"})]}),g.company_description&&(0,T.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:g.company_description})]})]}),g.description&&(0,T.jsxs)("div",{className:"rounded-lg border border-success/20 bg-success/10 p-4",children:[(0,T.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 text-success",children:[(0,T.jsx)(ey.Z,{className:"h-4 w-4"}),(0,T.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"El beneficio"})]}),(0,T.jsx)("p",{className:"text-base font-medium text-foreground",children:g.description})]}),(0,T.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,T.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs text-muted-foreground",children:[(0,T.jsx)(eb.Z,{className:"h-3.5 w-3.5"}),function(m){switch(m){case"daily":return"Todos los d\xedas";case"weekdays":return"Lunes a Viernes";case"weekends":return"S\xe1bados y Domingos";case"discount_based":return"Seg\xfan descuento";default:return m}}(g.availability)]}),g.end_date&&(0,T.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs text-muted-foreground",children:[(0,T.jsx)(ex.Z,{className:"h-3.5 w-3.5"}),"Hasta ",(0,et.p6)(g.end_date)]})]}),g.benefit_detail&&(0,T.jsxs)(eM.zF,{children:[(0,T.jsxs)(eM.wy,{className:"group flex w-full items-center justify-between rounded-lg border border-border px-4 py-3 text-sm font-medium text-foreground",children:[(0,T.jsxs)("span",{className:"flex items-center gap-2",children:[(0,T.jsx)(e_.Z,{className:"h-4 w-4 text-muted-foreground"}),"Condiciones del beneficio"]}),(0,T.jsx)(ew.Z,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),(0,T.jsx)(eM.Fw,{className:"px-4 py-3 text-sm leading-relaxed text-muted-foreground",children:g.benefit_detail})]}),g.company_benefit_count>1&&v&&(0,T.jsxs)("button",{type:"button",onClick:()=>{trackBenefitCompanyLinkClick(g.company_id,g.partnership_name,g.company_benefit_count),null==v||v(g.company_id)},className:"flex w-full items-center justify-between rounded-lg border border-border px-4 py-3 text-sm font-medium text-primary transition-colors hover:bg-accent",children:[(0,T.jsxs)("span",{className:"flex items-center gap-2",children:[(0,T.jsx)(eS.Z,{className:"h-4 w-4"}),"Descubre los otros ",g.company_benefit_count-1," beneficios de ",g.partnership_name]}),(0,T.jsx)(eC.Z,{className:"h-4 w-4 shrink-0"})]})]}),(0,T.jsxs)("div",{className:"space-y-4 lg:sticky lg:top-6 lg:self-start",children:[(0,T.jsxs)("div",{className:"rounded-lg border border-border p-4 ".concat(g.can_redeem?"":"opacity-60"),children:[(0,T.jsx)("h3",{className:"mb-3 font-semibold text-foreground",children:"\xbfC\xf3mo usar este beneficio?"}),en?(0,T.jsx)(VerificationCodeSection,{benefit:g}):E?(0,T.jsx)("p",{className:"text-sm text-muted-foreground",children:"Pres\xe9ntate en el establecimiento y muestra la a
6pp de Cacttus para validar tu beneficio."}):(0,T.jsxs)("div",{className:"space-y-3",children:[(0,T.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Copia el c\xf3digo y \xfasalo en el sitio web del comercio."}),g.discount_code&&(0,T.jsxs)("div",{className:"flex items-center gap-2",children:[(0,T.jsx)("div",{className:"flex-1 rounded-lg bg-muted p-3",children:(0,T.jsx)("code",{className:"font-mono text-lg text-foreground",children:g.discount_code})}),(0,T.jsx)(eO.z,{variant:"outline",onClick:()=>{g.discount_code&&navigator.clipboard.writeText(g.discount_code).then(()=>{k(!0),setTimeout(()=>k(!1),2e3)}).catch(m=>{console.error("Error copying to clipboard:",m)})},iconLeft:x?(0,T.jsx)(eg.Z,{}):(0,T.jsx)(ev.Z,{}),children:x?"Copiado":"Copiar"})]})]})]}),!g.can_redeem&&(0,T.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-warning/20 bg-warning/10 p-3 text-sm text-foreground",children:[(0,T.jsx)(ek.Z,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,T.jsx)("span",{children:"Necesitas una p\xf3liza activa para usar este beneficio."})]}),er&&(0,T.jsx)("div",{className:"hidden lg:block",children:er})]})]}),er&&(0,T.jsx)("div",{className:"sticky bottom-0 border-t border-border bg-card p-4 lg:hidden",children:er})]})}var eL=v(70333),eF=v(63271);function CompanyBenefits(m){let{companyId:g,onSelectBenefit:v}=m,{data:x,isLoading:k,isError:E,error:et,refetch:en}=(0,eF.i_)(g);return(0,K.useEffect)(()=>{x&&trackCompanyBenefitsView(x.company_id,x.company_name)},[x]),(0,T.jsx)(eL.o,{isLoading:k,isError:E,error:et,refetch:()=>{en()},data:x,children:x&&(0,T.jsxs)("div",{className:"space-y-6",children:[(0,T.jsxs)("div",{className:"flex items-start gap-4 roun
6ded-2xl border border-border bg-card p-6",children:[(0,T.jsx)(CompanyLogo,{logoUrl:x.logo_url,name:x.company_name,className:"h-16 w-16 shrink-0 lg:h-20 lg:w-20"}),(0,T.jsxs)("div",{className:"min-w-0",children:[(0,T.jsx)("h2",{className:"text-xl font-bold text-foreground lg:text-2xl",children:x.company_name}),(0,T.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[x.benefits.length," ",1===x.benefits.length?"beneficio disponible":"beneficios disponibles"]}),x.company_description&&(0,T.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:x.company_description})]})]}),(0,T.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:x.benefits.map(m=>(0,T.jsx)(BenefitCard,{benefit:m,onClick:()=>v(m)},m.id))})]})})}var eZ=v(51804),eB=v(4028),e$=v(65096);let BenefitsSearch=m=>{let{onSearch:g,isLoading:v=!1}=m,[x,k]=(0,K.useState)(""),[E,et]=(0,K.useState)(""),en=(0,K.useRef)(),{data:er}=(0,e$.e_)(),ei=(0,K.useCallback)(g,[g]),es=(0,K.useCallback)((m,g)=>{en.current&&clearTimeout(en.current),en.current=setTimeout(()=>{ei({search:m||void 0,category:g||void 0})},300)},[ei]),handleSearchChange=m=>{k(m),es(m,E)},handleCategoryChange=m=>{et(m),es(x,m)},el=x||E;return(0,T.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-4",children:[(0,T.jsxs)("div",{className:"relative mb-4",children:[(0,T.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,T.jsx)(eZ.Z,{className:"h-5 w-5 text-gray-400"})}),(0,T.jsx)("input",{type:"text",placeholder:"Buscar beneficios...",value:x,onChange:m=>handleSearchChange(m.target.value),className:"block w-full pl-10 pr-10 py-3 border border-gray-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",disabled:v}),x&&(0,T.jsx)("button",{onClick:()=>handleSearchChange(""),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 transition-colors",children:(0,T.jsx)(eB.Z,{className:"h-5 w-5"})})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3",children:"Categor\xedas"}),(0,T.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,T.jsx)("button",{onClick:()=>handleCategoryChange(""),className:"px-4 py-2 rounded-full border text-xs transition-all ".concat(E?"bg-white border-gray-200 text-gray-700 hover:border-gray-300 font-medium":"bg-blue-50 border-blue-500 text-blue-500 font-bold"),disabled:v,children:"Todas"}),null==er?void 0:er.map(m=>(0,T.jsx)("button",{onClick:()=>handleCategoryChange(m.name),className:"px-4 py-2 rounded-full border text-xs transition-all ".concat(E===m.name?"bg-blue-50 border-blue-500 text-blue-500 font-bold":"bg-white border-gray-200 text-gray-700 hover:border-gray-300 font-medium"),disabled:v,children:m.name},m.id))]})]}),el&&(0,T.jsx)("div",{className:"flex justify-center mt-4 pt-4 border-t border-gray-100",children:(0,T.jsx)("button",{onClick:()=>{k(""),et(""),en.current&&clearTimeout(en.current),ei({})},className:"text-xs text-gray-500 hover:text-gray-700 font-medium transition-colors",disabled:v,children:"Limpiar filtros"})})]})};var eU=v(78134),ez=(0,v(67618).Z)(function(){let[m,g]=(0,K.useState)(null),[v,x]=(0,K.useState)(null),[k,E]=(0,K.useState)({}),[et,en]=(0,K.useState)(!1),{data:er,isLoading:ei,error:es,refetch:el}=(0,eF.F0)(k,{keepPreviousData:!0});(0,K.useEffect)(()=>{trackBenefitsScreenView(),window.scrollTo(0,0)},[]),(0,K.useEffect)(()=>{es&&trackBenefitLoadError("Failed to load benefits")},[es]);let ec=(0,K.useCallback)(m=>{en(!0),E(m),setTimeout(()=>{en(!1)},100)},[]);return ei&&!er?(0,T.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,T.jsx)(eL.o,{isLoading:ei,isError:!!es,error:es,refetch:()=>{el()},fullPageSize:!0,className:"min-h-screen"})}):m?(0,T.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,T.jsxs)("div",{className:"max-w-5xl mx-auto p-6",children:[(0,T.jsx)("div",{className:"mb-6",children:(0,T.jsxs)("button",{onClick:()=>{trackBenefitNavigationBack(),g(null)},className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors font-medium",children:[(0,T.jsx)(eU.Z,{size:20}),v?"Volver al comercio":"Volver a beneficios"]})}
6),(0,T.jsx)(BenefitDetail,{benefit:m,onCompanyClick:m=>{x(m),g(null)}})]})}):v?(0,T.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,T.jsxs)("div",{className:"max-w-6xl mx-auto p-6",children:[(0,T.jsx)("div",{className:"mb-6",children:(0,T.jsxs)("button",{onClick:()=>{trackBenefitNavigationBack(),x(null)},className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors font-medium",children:[(0,T.jsx)(eU.Z,{size:20}),"Volver a beneficios"]})}),(0,T.jsx)(CompanyBenefits,{companyId:v,onSelectBenefit:m=>g(m)})]})}):(0,T.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,T.jsxs)("div",{className:"max-w-6xl mx-auto p-6",children:[(0,T.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-6 mb-6",children:[(0,T.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Club de Beneficios"}),(0,T.jsx)("p",{className:"text-gray-600 text-sm",children:"Descubre todos los beneficios exclusivos para nuestros clientes"})]}),(0,T.jsx)("div",{className:"mb-6",children:(0,T.jsx)(BenefitsSearch,{onSearch:ec,isLoading:ei})}),et&&(0,T.jsx)("div",{className:"fixed inset-0 bg-white bg-opacity-75 flex items-center justify-center z-50",children:(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsx)("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-blue-500 mx-auto mb-3"}),(0,T.jsx)("p",{className:"text-gray-600 font-medium",children:"Buscando beneficios..."})]})}),(0,T.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 relative",onScroll:m=>{let g=m.target,v=Math.round(g.scrollTop/(g.scrollHeight-g.clientHeight)*100);trackBenefitListScroll(v)},children:null==er?void 0:er.map(m=>(0,T.jsx)(BenefitCard,{benefit:m,onClick:()=>g(m)},m.id))}),(null==er?void 0:er.length)===0&&!et&&(0,T.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 text-center py-16 px-6",children:[(0,T.jsx)("div",{className:"w-16 h-16 bg-gray-100 rounded-2xl flex items-center justify-center mx-auto mb-4",children:(0,T.jsx)("svg",{className:"w-8 h-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,T.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"})})}),(0,T.jsx)("p",{className:"text-gray-600 font-medium mb-2",children:k.search||k.category?"No se encontraron beneficios con los filtros aplicados":"No hay beneficios disponibles en este momento"}),(k.search||k.category)&&(0,T.jsx)("button",{onClick:()=>E({}),className:"mt-4 px-4 py-2 text-blue-500 hover:text-blue-600 font-medium transition-colors",children:"Limpiar filtros"})]})]})})})},99714:function(m,g,v){"use strict";v.r(g),v.d(g,{MobileMenu:function(){return MobileMenu},default:function(){return n9}});var x,k,E,T,K,et,en,er,ei,es,el,ec,eu,ed,ep,em,ef,eh,eg,ev,ey,eb,ex,e_,ew,eS,eC=v(52322),ek=v(2784),eE=v(67618),ej=v(27350),eN=v(53328),eR=v(39776),eI=v(5632),eP=v(93829);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var plus_with_border=function(m){return ek.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),x||(x=ek.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,clipPath:"url(#plus-with-border_svg__a)"},ek.createElement("path",{d:"M8 12h4m4 0h-4m0 0V8m0 4v4M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10"}))),k||(k=ek.createElement("defs",null,ek.createElement("clipPath",{id:"plus-with-border_svg__a"},ek.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},eT=v(82819),eO=v(31980);function exclamation_lines_extends(){return(exclamation_lines_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var exclamation_lines=function(m){return ek.createElement("svg",exclamation_lines_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 82 82"}
6,m),E||(E=ek.createElement("g",{filter:"url(#exclamation_lines_svg__a)"},ek.createElement("circle",{cx:41.027,cy:36.003,r:20.66,fill:"#DB2777"}))),T||(T=ek.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M41.348 30.43v7.096M41.348 42.269l.01-.012"})),K||(K=ek.createElement("rect",{width:2.769,height:6.923,x:39.617,fill:"#EC4899",rx:1.385})),et||(et=ek.createElement("rect",{width:2.769,height:6.923,x:39.617,y:65.078,fill:"#EC4899",rx:1.385})),en||(en=ek.createElement("rect",{width:2.769,height:6.923,x:77,y:34.617,fill:"#EC4899",rx:1.385,transform:"rotate(90 77 34.617)"})),er||(er=ek.createElement("rect",{width:2.769,height:6.923,x:11.922,y:34.617,fill:"#EC4899",rx:1.385,transform:"rotate(90 11.922 34.617)"})),ei||(ei=ek.createElement("rect",{width:2.769,height:6.923,x:65.422,y:9.613,fill:"#EC4899",rx:1.385,transform:"rotate(45 65.422 9.613)"})),es||(es=ek.createElement("rect",{width:2.817,height:6.992,x:19.445,y:55.594,fill:"#EC4899",rx:1.409,transform:"rotate(45 19.445 55.594)"})),el||(el=ek.createElement("rect",{width:2.817,height:6.933,x:67.512,y:60.496,fill:"#EC4899",rx:1.409,transform:"rotate(135 67.512 60.496)"})),ec||(ec=ek.createElement("rect",{width:2.817,height:6.916,x:21.438,y:14.422,fill:"#EC4899",rx:1.409,transform:"rotate(135 21.438 14.422)"})),eu||(eu=ek.createElement("defs",null,ek.createElement("filter",{id:"exclamation_lines_svg__a",width:81.319,height:81.319,x:.367,y:.344,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},ek.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ek.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),ek.createElement("feOffset",{dy:5}),ek.createElement("feGaussianBlur",{stdDeviation:10}),ek.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),ek.createElement("feColorMatrix",{values:"0 0 0 0 0.858824 0 0 0 0 0.152941 0 0 0 0 0.466667 0 0 0 0.3 0"}),ek.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_3455_18409"}),ek.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_3455_18409",result:"shape"})))))},eA=v(35151);function dashboard_dog_extends(){return(dashboard_dog_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var dashboard_dog=function(m){return ek.createElement("svg",dashboard_dog_extends({xmlns:"http://www.w3.org/2000/svg",width:239,height:182,fill:"none"},m),ed||(ed=ek.createElement("g",{clipPath:"url(#dashboard_dog_svg__a)"},ek.createElement("ellipse",{cx:119.5,cy:169.5,fill:"url(#dashboard_dog_svg__b)",fillOpacity:.1,rx:119.5,ry:12.5}),ek.createElement("g",{clipPath:"url(#dashboard_dog_svg__c)"},ek.createElement("path",{fill:"#93C5FD",d:"M182.752 167.749h-25.629s-9.987-42.101-9.987-44.667c0-2.565 29.256-28.21 32.028-19.24 2.411 7.781-4.262 54.073-4.262 54.073a14.4 14.4 0 0 1 5.051 4.016 14.5 14.5 0 0 1 2.799 5.818"}),ek.createElement("path",{fill:"#3B82F6",d:"M101.572 167.749H83.679s-6.407-19.45-3.797-32.914c2.61-13.463 18.15-4.921 20.713-2.356s-1.956 29.882-1.956 29.882z"}),ek.createElement("path",{fill:"#93C5FD",d:"M62.748 137.61c36.945 14.319 78.788 7.478 94.384-1.71s19.849-27.136 19.849-27.136l-40.134-56.639s-32.028 9.188-43.343 6.195a82.8 82.8 0 0 1-20.713-8.979s-7.907-8.76-11.742-8.114 0 6.651 0 6.651-8.543 0-11.96.855 5.126 5.13 5.126 5.13-14.524 1.892-14.951 4.03c-.427 2.137 8.97 3.639 8.97 3.639s-8.543 3.8-7.689 6.65c.855 2.851 9.825 3.174 9.825 3.174z"}),ek.createElement("path",{fill:"#BFDBFE",d:"M72.791 49.341s-7.907-8.76-11.742-8.114 0 6.651 0 6.651-8.543 0-11.96.855 5.126 5.13 5.126 5.13-14.524 1.892-14.951 4.03c-.427 2.137 8.97 3.639 8.97 3.639s-8.543 3.8-7.689 6.65c.855 2.851 9.825 3.174 9.825 3.174 2.45-10.052 9.227-17.768 22.421-22.015"}),ek.createElement("path",{fill:"#60A5FA",d:"M136.847 52.125s-32.028 9.188-43.343 6.195a56 56 0 0 1-2.335-.665c5.363 7.506 7.29 15.506 4.509 22.31-4.823 11.81-22.27 16.256-41.568 11.63l8.6 46.015c36.945 14.319 78.788 7.478 94.384-1.71s19.849-27.137 19.849-27.137z"}),ek.createElement("path",{fill:"#3B82F6",d:"M158.394 82.53a55 55 0 0 1-.351 4.285c-4.063 32.172-35.815 54.634-70.909 50.187a68.7 68.7 0 0 1-26.152-8.846l1.766 9.501c36.3 16.105 78.228 8.761 93.814-.427 15.587-9.188 20.419-28.419 20.419-28.419z"}),ek.createElement("path",{fill:"#3B82F6",d:"M73.095 84.174s8.895 16.751 2.373 53.864l-8.135-1.131zM115.564 90.74s-12.815 24.504-6.55 51.003h13.67z"}),ek.createElement("path",{fill:"#93C5FD",d:"M139.191 167.749h-22.63a25.6 25.6 0 0 1 1.899-7.478s-6.835-29.283-6.835-31.849-5.117-34.205 2.781-43.175 24.13 26.082 26.475 32.058c2.344 5.977-3.702 44.22-3.702 44.22z"}),ek.createElement("path",{fill:"#60A5FA",d:"M114.349 114.712c8.164-2.024 19.09 13.729 24.396 35.155 0 .114.057.228.076.333 1.604-11.782 3.598-29.065 2.079-32.932-2.307-5.939-18.577-40.99-26.475-32.02-5.145 5.852-4.746 21.311-3.873 32.086a7 7 0 0 1 3.797-2.622"}),ek.createElement("path",{fill:"#BFDBFE",d:"M128.939 156.129a21.7 21.7 0 0 0-9.046 1.9 6.595 6.595 0 0 0-3.579 4.247 35.4 35.4 0 0 0-1.034 5.435h26.161s-2.715-9.369-3.731-9.806a21.7 21.7 0 0 0-8.771-1.776M166.957 156.034c3.736.009 7.443.668 10.954 1.948a9.43 9.43 0 0 1 5.06 4.285 37.3 37.3 0 0 1 2.344 5.482h-30.48s1.348-7.934 2.297-8.618a17.08 17.08 0 0 1 9.825-3.097"}),ek.createElement("path",{fill:"#EFF6FF",d:"M156.278 135.263c-21.643-10.547-28.193-36.41-28.193-36.41l-1.424 2.281-8.002-14.243-11.106-10.262v-3.42s-8.828-1.425-9.113-2.565 3.702-8.257 3.702-8.257-3.702.855-3.987-.57c-.285-1.426 11.106-14.538 11.106-14.538s-5.126 0-5.695-1.425c-.5
67-1.425 13.384-15.953 20.219-18.803 0 0-3.133-.57-2.848-2.28.285-1.711 6.265-3.706 6.265-3.706l27.396-10.338a31.4 31.4 0 0 1 17.627-2.746c12.692 1.9 23.447 12.352 27.927 26.67l15.33 17.474s2.279 3.42 1.424 5.416c-.854 1.995-3.417 3.135-3.417 3.135s3.417 5.701 2.848 6.832c-.57 1.13-4.272-.57-4.272-.57s-3.132 11.117-4.271 12.542c-1.14 1.425-2.848-.285-2.848-.285l-9.597 12.466-1.899 9.834-3.123 1.425s.446 4.428-.503 6.271c-1.471 2.784-25.525 23.64-33.546 26.072"}),ek.createElement("path",{fill:"#DBEAFE",d:"M216.08 58.795c.348-.367.63-.791.836-1.254.204-.556.247-1.16.123-1.739-.161.513-.513 1.625-.959 2.993M209.331 67.87l-10.546 12.646-1.974 9.245 8.144-10.566s1.709 1.71 2.848.285c.854-1.074 2.848-7.658 3.797-10.832a3.03 3.03 0 0 1-2.269-.779M193.251 91.86a67 67 0 0 1-2.848 6.85c-1.585 2.851-25.705 23.527-34.514 26.101-23.732-10.157-27.196-36.998-27.196-36.998l-5.24 3.401-8.752-14.1-12.179-10.053V63.66l-.95-.133c-1.11 2.052-3.303 6.28-3.094 7.135.285 1.14 9.113 2.566 9.113 2.566v3.42l11.068 10.243 7.964 14.252 1.424-2.28s6.55 25.863 28.193 36.41c8.021-2.433 32.075-23.289 33.518-26.072.949-1.844.503-6.271.503-6.271l3.123-1.426 1.898-9.834.817-1.064zM212.938 67.299c1.13.427 3.01.95 3.408.209s-.721-2.926-1.632-4.665a47 47 0 0 1-1.776 4.456"}),ek.createElement("path",{fill:"#93C5FD",d:"M147.307 48.277c6.531-3.516 8.876-12.846 9.493-14.062a68.7 68.7 0 0 0 7.091-26.253 40 40 0 0 0-15.331.409 41.16 41.16 0 0 0-21.358 12.694c-3.911.74-6.037 2.375-6.255 3.705-.285 1.71 2.847 2.28 2.847 2.28-6.834 2.851-20.788 17.379-20.219 18.804.57 1.425 5.696 1.425 5.696 1.425S98.953 59.156 98.212 61.532c18.548-6.423 44.501-10.785 49.095-13.255M173.117 40.192c.95 5.577 17.4 22.746 37.676 31.098.721-2.385 1.281-4.352 1.281-4.352s3.703 1.71 4.272.57-2.848-6.831-2.848-6.831 2.563-1.14 3.418-3.136c.854-1.995-1.424-5.416-1.424-5.416.285-3.42-10.252-20.523-12.53-24.219-2.279-3.696-20.779-17.673-23.627-18.528-1.035-.304-3.864-.845-7.11-1.397a166.3 166.3 0 0 0 .892 32.21"}),ek.createElement("path",{fill:"#1E3A8A",d:"M159.543 67.033a.946.946 0 0 1-.949-.808c-.721-5.111.807-11.753.873-12.038a.96.96 0 0 1 .426-.591.95.95 0 0 1 1.425 1.028c0 .066-1.518 6.584-.844 11.326a.954.954 0 0 1-.798 1.073z"}),ek.createElement("path",{fill:"#F9A8D4",d:"M160.673 55.66c-3.294.067-6.721-3.8-6.322-4.608.398-.808 11.59-.599 12.245.294s-5.923 4.314-5.923 4.314"}),ek.createElement("path",{fill:"#60A5FA",d:"M66.014 167.749H44.665s-9.322-35.906-4.215-75.87c2.335-18.318 26.693-47.783 34.828-.218 1.68 9.834-13.574 67.736-13.574 67.736z"}),ek.createElement("path",{fill:"#93C5FD",d:"M75.278 91.66C70.978 66.51 64.4 54.236 56.682 59.1c-6.891 4.341-15.13 24.133-16.232 32.78a211 211 0 0 0-.873 42.091c3.265 5.34 7.47 8.323 12.207 7.943 8.097-.636 15.672-10.879 20.153-25.521 2.326-11.221 4.006-21.16 3.341-24.732"}),ek.createElement("path",{fill:"#BFDBFE",d:"M55.923 156.318a22.1 22.1 0 0 0-9.037 1.901 6.47 6.47 0 0 0-3.56 4.19 33.4 33.4 0 0 0-1.005 5.34h26.17s-1.993-7.744-3.797-8.903a16.57 16.57 0 0 0-8.77-2.528"}),ek.createElement("path",{fill:"#F472B6",d:"M146.728 63.66a20.3 20.3 0 0 0 5.8 4.323c11.106 5.511 23.485-1.52 25.165-2.508l-6.825 1.416-13.546-.171z"}),ek.createElement("path",{fill:"#1E3A8A",d:"M162.144 67.517a14 14 0 0 1-1.718-.057c-2.611-.294-9.341-2.394-12.957-3.525-.95-.304-1.823-.57-2.003-.608-.522-.123-1.595-.38-3.152-7.126a.94.94 0 0 1 .12-.718.96.96 0 0 1 .592-.422.947.947 0 0 1 1.139.713c.731 3.173 1.5 5.273 1.899 5.7l1.984.609c3.293 1.035 10.166 3.173 12.606 3.458 4.015.456 16.013-1.245 17.39-2.242.949-.713 1.794-4.285 2.05-6.594a.95.95 0 0 1 .682-.815.95.95 0 0 1 1.008.323.945.945 0 0 1 .199.7c-.114 1.065-.816 6.471-2.848 7.935s-12.064 2.67-16.991 2.67"}),ek.createElement("path",{fill:"#93C5FD",d:"M121.735 29.898a29.7 29.7 0 0 0-4.348-9.273 29 29 0 0 0-4.167-4.751c.276-.865 2.611-7.915 9.759-10.452a15.6 15.6 0 0 1 9.682-.123l11.305 8.617a49.6 49.6 0 0 0-22.231 15.982"}),ek.createElement("path",{fill:"#3B82F6",d:"M122.684 24.9a22.1 22.1 0 0 0-6.36-10.052c.181-.609 1.728-5.54 6.797-7.193a11.4 11.4 0 0 1 6.939.076l8.258 6.3a34 34 0 0 0-6.644 3.011 33 33 0 0 0-8.99 7.858"}),ek.createElement("path",{fill:"#60A5FA",d:"M107.886 30.744c-2.032.427-4.747-2.908-5.933-5.815-2.734-6.528-.19-16.153 6.407-21.027 7.053-5.188 18.036-4.4 25.934 2.66A22.87 22.87 0 0 0 123.026 9.1c-6.91 3.668-10.157 10.3-11.011 12.086-2.563 5.454-2.145 9.14-4.129 9.559"}),ek.createElement("path",{fill:"#93C5FD",d:"M202.8 29.702a29.4 29.4 0 0 1 4.348-9.265 29 29 0 0 1 4.167-4.75c-.275-.874-2.61-7.924-9.758-10.452a15.65 15.65 0 0 0-9.683-.133l-11.305 8.618a49 49 0 0 1 9.378 4.504A50 50 0 0 1 202.8 29.702"}),ek.createElement("path",{fill:"#3B82F6",d:"M202.193 24.704a21.9 21.9 0 0 1 3.284-6.651 21.6 21.6 0 0 1 3.076-3.42c-.181-.609-1.728-5.55-6.797-7.203a11.4 11.4 0 0 0-6.939.086l-8.258 6.29a34 34 0 0 1 6.644 3.012 33.1 33.1 0 0 1 8.99 7.886"}),ek.createElement("path",{fill:"#60A5FA",d:"M216.65 30.557c2.032.418 4.746-2.908 5.933-5.815 2.734-6.537.19-16.153-6.408-21.037-7.052-5.187-18.035-4.39-25.933 2.66A22.76 22.76 0 0 1 201.5 8.932c6.911 3.658 10.157 10.29 11.011 12.086 2.573 5.435 2.155 9.112 4.139 9.54"}),ek.createElement("path",{fill:"#1E3A8A",d:"M141.308 35.004c.399 4.028.807 7.458 3.019 7.458 2.211 0 2.211-9.501 2.211-9.501a3.42 3.42 0 0 0-2.439-.599 3.56 3.56 0 0 0-2.791 2.642M185.818 37.237c-.398 4.028-.807 7.458-3.018 7.458-2.212 0-2.212-9.501-2.212-9.501a3.42 3.42 0 0 1 2.439-.599 3.56 3.56 0 0 1 2.791 2.642"}),ek.createElement("path",{fill:"#FCD34D",d:"M167.242 84.24a5.26 5.26 0 0 1 5.097-1.577h.133V66.51l-7.898.95c-.484.058-1.025.096-1.604.115a.95.95 0 0 1 .437.807 1.02 1.02 0 0 1-1.002 1.031 1.015 1.015 0 0 1-1.03-1.002.947.947 0 0 1 .446-.817c-.303 0-.607 0-.949-.067a17 17 0 0 1-2.335-.38l-6.92-1.948v10.205a17 17 0 0 1-4.177 11.164l-9.131 10.518q-.094.103-.171.219l11.951 12.418a10 10 0 0 1-.636.456q.447-.276.864-.598l15.548-12.514a19 19 0 0 0 2.25-2.176 10.9 10.9 0 0 1-2.535-5.368 6.812 6.812 0 0 1 1.662-5.283m2.097-12.741a1.026 1.026 0 1 1-1.015 1.026 1.017 1.017 0 0 1 1.015-1.026m-25.924 25.948a1.016 1.016 0 1 1 .002-2.032 1.016 1.016 0 0 1-.002 2.032m6.778 8.314a1.025 1.025 0 0 1-.734-1.752 1.02 1.02 0 0 1 1.121-.22 1.027 1.027 0 0 1 .331 1.674c-.19.191-.448.298-.718.298m.845-8.314a1.014 1.014 0 0 1-.996-1.215 1.016 1.016 0 1 1 .996 1.215m0-7.458a1.014 1.014 0 0 1-.996-1.215 1.016 1.016 0 1 1 .996 1.215m3.047-13.74a1.014 1.014 0 0 1-.996-1.215 1.016 1.016 0 1 1 .996 1.215m1.443-7.971a1.014 1.014 0 0 1 1.214-.997 1.015 1.015 0 0 1 .74 1.386 1.017 1.017 0 0 1-1.657.33c-.19-.191-.297-.45-.297-.72m1.775 31.355a1.018 1.018 0 0 1-.986-1.221 1.02 1.02 0 0 1 1.386-.734 1.019 1.019 0 0 1 .625.938 1.02 1.02 0 0 1-.629.96q-.19.076-.396.076zm1.899-12.21a1.016 1.016 0 1 1 .987-.96 1.02 1.02 0 0 1-1.016.95zm3.388 6.784a1.014 1.014 0 0 1-.996-1.215 1.016 1.016 0 0 1 2.012.199 1.02 1.02 0 0 1-.301.741 1 1 0 0 1-.743.294zm1.358-14.157a1.017 1.017 0 1 1 1.015-1.017 1 1 0 0 1-.3.742 1.02 1.02 0 0 1-.744.294z"}),ek.createElement("path",{fill:"#419BDF",d:"M172.472 82.663v.599a17.68 17.68 0 0 1-4.338 11.591 16.87 16.87 0 0 0 4.348-12.19z"}),ek.createElement("path",{fill:"#DB2777",d:"M172.472 82.663h-.133a5.26 5.26 0 0 0-5.097 1.568 6.81 6.81 0 0 0-1.643 5.282 10.9 10.9 0 0 0 2.535 5.369 17.68 17.68 0 0 0 4.338-11.592z"}),ek.createElement("path",{fill:"#419BDF",d:"M138.071 108.194a8.685 8.685 0 0 1 .085-10.89l-.132-.132a8.696 8.696 0 0 0-.247 11.107 8.784 8.784 0 0 0 11.694 1.9 8.67 8.67 0 0 1-11.4-1.985"}),ek.createElement("path",{fill:"#DB2777",d:"M138.156 97.305a8.697 8.697 0 0 0 5.432 14.168 8.68 8.68 0 0 0 5.884-1.256 10 10 0 0 0 .636-.456zM157.578 68.278a1.014 1.014 0 0 0-1.214-.997 1.015 1.015 0 0 0-.74 1.386 1.017 1.017 0 0 0 1.657.33c.19-.19.297-.45.297-.72M154.085 74.216a1.014 1.014 0 0 0-.996 1.215 1.016 1.016 0 1 0 .996-1.215M151.038 87.955a1.014 1.014 0 0 0-.996 1.215 1.016 1.016 0 1 0 .996-1.215M151.038 95.414a1.014 1.014 0 0 0-.996 1.215 1.016 1.016 0 1 0 .996-1.215M157.303 97.618a1.018 1.018 0 1 0 .4 1.955 1.018 1.018 0 0 0-.4-1.955M150.193 103.718a1.02 1.02 0 0 0-.954.627 1.03 1.03 0 0 0 .216 1.122 1.026 1.026 0 0 0 1.679-1.115 1.015 1.015 0 0 0-.941-.634M143.415 95.414a1.014 1.014 0 0 0-.996 1.215 1.016 1.016 0 1 0 .996-1.215M161.821 67.546a.96.96 0 0 0-.446.864 1.015 1.015 0 1 0 2.032 0 .95.95 0 0 0-.437-.807c-.361-.038-.75-.048-1.149-.057M163.919 78.036a1.
6014 1.014 0 0 0-.996 1.215 1.016 1.016 0 1 0 .996-1.215M159.173 85.409a1.015 1.015 0 0 0-.998 1.201 1.016 1.016 0 1 0 .998-1.201M162.562 92.165a1.014 1.014 0 0 0-.996 1.215 1.016 1.016 0 1 0 .996-1.215M169.339 73.542a1.02 1.02 0 0 0 .955-.63 1.028 1.028 0 0 0-.748-1.404 1.023 1.023 0 0 0-1.222 1.017 1.02 1.02 0 0 0 1.015 1.016"})))),ep||(ep=ek.createElement("defs",null,ek.createElement("clipPath",{id:"dashboard_dog_svg__a"},ek.createElement("path",{fill:"#fff",d:"M0 0h239v182H0z"})),ek.createElement("clipPath",{id:"dashboard_dog_svg__c"},ek.createElement("path",{fill:"#fff",d:"M38.922 0h184.743v167.749H38.922z"})),ek.createElement("radialGradient",{id:"dashboard_dog_svg__b",cx:0,cy:0,r:1,gradientTransform:"matrix(0 12.5 -119.5 0 119.5 169.5)",gradientUnits:"userSpaceOnUse"},ek.createElement("stop",null),ek.createElement("stop",{offset:1,stopOpacity:0})))))},eM=v(37133),eD=v(84355),eL=v(26991),eF=v(64599),eZ=v(68096),eB=v(97443),e$=v(70333),eU=v(39097),ez=v.n(eU),eV=v(13346),eq=v(11168),eH=v(27484),eW=v.n(eH),eK=v(77546),eG=v(38421),eQ=v.n(eG),eY=v(87779),eX=v(55830),eJ=v(62350),e0=v(53538),e1=v(44994),e2=v(14016),e3=v(67669),e5=v(676),e4=v(64652),e6=v(52320),e7=v(93227);function PolicyStatusBadges(m){let{policy:g}=m,v=(0,e4.Hq)(g);return v.isCancelled?(0,eC.jsx)(eY.C,{variant:"outline",className:"bg-gray-100 text-gray-600 border-gray-200",children:"Cancelada"}):(0,eC.jsxs)(eC.Fragment,{children:[(0,eC.jsx)(eY.C,{variant:"outline",className:"bg-emerald-50 text-emerald-700 border-emerald-200",children:"Vigente"}),v.allActive&&(0,eC.jsx)(eY.C,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:"Activa"})]})}function PolicyCard(m){var g,v;let{policy:x}=m,k=(0,eI.useRouter)(),{toast:E}=(0,e5.pm)(),T=function(){let m=(0,eX.NL)();return(0,eJ.D)({mutationFn:async m=>{try{let g=await (0,e1.h)(e0.Ry({message:e0.Z_(),amount_spent:e0.Rx()}),{method:"post",url:eV.Z.user.policies.v2.voidCancellation(m.policyId),data:{amount_spent:0}});return g.data}catch(m){(0,e2.zG)(m,"No pudimos revertir la cancelaci\xf3n.")}},onSuccess:()=>{m.invalidateQueries({queryKey:e3.a.policies.index()})}})}(),K=!!(null===(v=x.coverage_bundle)||void 0===v?void 0:null===(g=v.health_item)||void 0===g?void 0:g.amount_limit);if(!K)return null;let et=(0,e6.uF)(x.coverage_bundle),handleVoidCancellation=async()=>{try{await T.mutateAsync({policyId:x.id}),E({title:"Cancelaci\xf3n revertida",description:"Tu p\xf3liza sigue activa."})}catch(v){let{message:m,details:g}=(0,e2.EV)(v,"Error al revertir la cancelaci\xf3n");E({title:"Error",description:m+g,variant:"destructive"})}};return(0,eC.jsxs)("div",{className:"w-full flex flex-col bg-white rounded-2xl shadow-sm border border-gray-200 p-5",children:[x.insurable_object&&(0,eC.jsx)(eO.Z,{pet:x.insurable_object,isBgBlue:!0,subtitle:(0,eC.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 mt-1.5",children:(0,eC.jsx)(PolicyStatusBadges,{policy:x})})}),et&&(0,eC.jsxs)("div",{className:"mt-5 pt-4 border-t border-gray-200",children:[(0,eC.jsx)("p",{className:"text-2xs font-bold uppercase tracking-wide text-gray-500",children:"Plan contratado"}),(0,eC.jsx)("p",{className:"mt-1 font-bold text-gray-900",children:et})]}),(0,eC.jsx)(eP.z,{variant:"brand",size:"full",className:"mt-5",onClick:()=>void k.push(eV.Z.frontend.policies.show(x.id)),children:"Ver detalles de mi plan"}),x.has_active_cancellation_request&&(0,eC.jsxs)("div",{className:"mt-4 bg-amber-50 border border-amber-200 rounded-xl p-4",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,eC.jsx)(e7.Z,{className:"w-5 h-5 text-amber-500 flex-shrink-0"}),(0,eC.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:"Cancelaci\xf3n en proceso"})]}),(0,eC.jsx)("p",{className:"text-xs text-gray-500 mb-3 ml-7",children:"Se cancelar\xe1 en 48h h\xe1biles"}),(0,eC.jsx)(eP.z,{variant:"outline",size:"sm",className:"w-full border-amber-300 text-amber-700 hover:bg-amber-100 hover:text-amber-800",onClick:()=>void handleVoidCancellation(),disabled:T.isLoading,children:T.isLoading?"Revirtiendo...":"Anular cancelaci\xf3n"})]})]})}var e8=v(5289),e9=v(25766);let tt=e0.Ry({url:e0.Z_().url()}),useGenerateTeleHealthUrlMutation=()=>(0,eJ.D)({mutationFn:async m=>{let{policyId:g,reason:v}=m;try{let m=await (0,e1.h)(tt,{method:"post",url:eV.Z.saludtech.generateUrl(g),data:{reason:v}});return m.data}catch(m){(0,e2.zG)(m,"Hubo un error al generar el link de teleconsulta. Por favor, intenta nuevamente.")}}});var tn=v(80593);function PreventiveCoverageDetailModal(m){var g;let v=Math.max(0,Math.round(null!==(g=m.item.coverage.remaining_amount_covered)&&void 0!==g?g:0));return(0,eC.jsx)(eD.Vq,{open:m.open,onOpenChange:m.onOpenChange,children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-md",children:[(0,eC.jsxs)(eD.fK,{children:[(0,eC.jsxs)(eD.$N,{className:"flex items-center gap-3",children:[(0,eC.jsx)(m.item.icon,{className:"w-6 h-6 text-blue-500"}),m.item.title]}),(0,eC.jsxs)("p",{className:"text-sm text-gray-500",children:["Para ",m.petName]})]}),(0,eC.jsxs)("div",{className:"space-y-4 py-4",children:[(0,eC.jsxs)("div",{className:"bg-blue-50 rounded-xl p-4 text-center border border-blue-100",children:[(0,eC.jsx)("p",{className:"text-sm text-gray-500",children:"Cobertura disponible"}),(0,eC.jsxs)("p",{className:"text-2xl font-bold text-blue-600",children:["~$",v.toLocaleStr
6ing("es-CL")]})]}),(0,eC.jsxs)("div",{className:"space-y-3",children:[(0,eC.jsxs)("div",{children:[(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase",children:"Qu\xe9 incluye"}),(0,eC.jsx)("p",{className:"text-sm text-gray-700 mt-1",children:m.item.description})]}),(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase",children:"Tope"}),(0,eC.jsxs)("p",{className:"text-sm text-gray-700",children:[m.item.value," ",m.item.amount&&(0,eC.jsxs)("span",{className:"text-gray-400",children:["(",m.item.amount,")"]})]})]}),(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase",children:"Frecuencia"}),(0,eC.jsx)("p",{className:"text-sm text-gray-700",children:m.item.events})]}),(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase",children:"Porcentaje cubierto"}),(0,eC.jsxs)("p",{className:"text-sm text-gray-700",children:[Math.round(100*m.item.coverage.percentage_covered),"%"]})]}),m.item.coverage.deductible>0&&(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase",children:"Deducible"}),(0,eC.jsxs)("p",{className:"text-sm text-gray-700",children:[m.item.coverage.deductible," UF"]})]})]})]}),(0,eC.jsx)(eD.cN,{children:(0,eC.jsx)(eP.z,{variant:"outline",onClick:()=>m.onOpenChange(!1),className:"w-full",children:"Cerrar"})})]})})}function TeleconsultationDialog(m){let{toast:g}=(0,e5.pm)(),[v,x]=(0,ek.useState)(""),k=useGenerateTeleHealthUrlMutation(),handleOpenChange=g=>{g||x(""),m.onOpenChange(g)},handleConfirm=async()=>{let x=(0,tn.K)();try{let g=await k.mutateAsync({policyId:m.policyId,reason:v.trim()});g?x.navigateTo(g.url):x.close(),handleOpenChange(!1)}catch(k){x.close();let{message:m,details:v}=(0,e2.EV)(k,"No se pudo generar el link de teleconsulta");g({title:"Error",description:m+v,variant:"destructive"})}};return(0,eC.jsx)(eD.Vq,{open:m.open,onOpenChange:handleOpenChange,children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-md",children:[(0,eC.jsxs)(eD.fK,{children:[(0,eC.jsx)(eD.$N,{children:"Agendar teleconsulta"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500",children:"Cu\xe9ntanos el motivo de tu consulta"})]}),(0,eC.jsxs)("div",{className:"space-y-2 py-4",children:[(0,eC.jsx)(e8._,{htmlFor:"teleconsulta-reason",children:"Motivo de la consulta"}),(0,eC.jsx)(e9.g,{id:"teleconsulta-reason",value:v,onChange:m=>x(m.target.value),placeholder:"Describe brevemente el motivo de la teleconsulta...",rows:3})]}),(0,eC.jsxs)(eD.cN,{children:[(0,eC.jsx)(eP.z,{variant:"outline",onClick:()=>handleOpenChange(!1),className:"w-full sm:w-auto",children:"Cancelar"}),(0,eC.jsx)(eP.z,{onClick:()=>void handleConfirm(),disabled:!v.trim()||k.isLoading,className:"w-full sm:w-auto",children:k.isLoading?"Generando...":"Agendar teleconsulta"})]})]})})}function PetSelectionModal(m){return(0,eC.jsx)(eD.Vq,{open:m.open,onOpenChange:m.onOpenChange,children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-sm",children:[(0,eC.jsxs)(eD.fK,{children:[(0,eC.jsx)(eD.$N,{children:"Selecciona una mascota"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500",children:m.itemTitle})]}),(0,eC.jsx)("div",{className:"space-y-2 py-4",children:m.policies.map(g=>{var v,x;return(0,eC.jsxs)("button",{className:"w-full flex items-center gap-3 p-3 rounded-lg border border-gray-200 hover:bg-gray-50 transition-colors text-left",onClick:()=>{m.onSelectPolicy(g),m.onOpenChange(!1)},children:[(0,eC.jsx)("span",{className:"font-semibold text-gray-900",children:null===(v=g.insurable_object)||void 0===v?void 0:v.name}),(0,eC.jsx)("span",{className:"text-sm text-gray-500",children:null===(x=g.insurable_object)||void 0===x?void 0:x.breed})]},g.id)})})]})})}function PreventionSection(m){let{policies:g,uf:v}=m,{toast:x}=(0,e5.pm)(),[k,E]=(0,ek.useState)(!1),[T,K]=(0,ek.useState)(null),[et,en]=(0,ek.useState)(""),[er,ei]=(0,ek.useState)(!1),[es,el]=(0,ek.useState)(""),[ec,eu]=(0,ek.useState)(!1),[ed,ep]=(0,ek.useState)(""),em=g.filter(m=>{var g;return!m.is_cancelled&&(null===(g=m.coverage_bundle)||void 0===g?void 0:g.has_preventive_package)});if(0===em.length)return null;let ef=em.flatMap(m=>m.coverage_bundle?(0,e4.r5)(m.coverage_bundle,v):[]),eh=function(m){let g=new Set;return m.filter(m=>!g.has(m.title)&&(g.add(m.title),!0))}(ef);if(0===eh.length)return null;let handleTileClick=m=>{if("Teleconsultas"===m.title){let m=em[0];m?(ep(m.id),eu(!0)):x({title:"No disponible",description:"Teleconsulta no dis
6ponible.",variant:"destructive"});return}if(1===em.length){let x=em[0];if(!x)return;let T=x.coverage_bundle?(0,e4.r5)(x.coverage_bundle,v):[],et=T.find(g=>g.title===m.title);if(et){var g,k;K(et),en(null!==(k=null===(g=x.insurable_object)||void 0===g?void 0:g.name)&&void 0!==k?k:""),E(!0)}return}el(m.title),ei(!0)};return(0,eC.jsxs)("div",{children:[(0,eC.jsx)("h2",{className:"font-bold text-xl text-gray-900 mb-4",children:"Prevenci\xf3n"}),(0,eC.jsx)("div",{className:"flex gap-3 overflow-x-auto pb-2 -mx-1 px-1",children:eh.map(m=>(0,eC.jsxs)("button",{className:"flex-shrink-0 w-28 flex flex-col items-center p-3 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-blue-200 transition-all",onClick:()=>handleTileClick(m),children:[(0,eC.jsx)("div",{className:"w-10 h-10 bg-blue-50 rounded-lg flex items-center justify-center mb-2",children:(0,eC.jsx)(m.icon,{className:"w-5 h-5 text-blue-500"})}),(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-700 text-center leading-tight",children:m.title})]},m.title))}),T&&(0,eC.jsx)(PreventiveCoverageDetailModal,{open:k,onOpenChange:E,item:T,petName:et,uf:v}),(0,eC.jsx)(PetSelectionModal,{open:er,onOpenChange:ei,policies:em,onSelectPolicy:m=>{let g=m.coverage_bundle?(0,e4.r5)(m.coverage_bundle,v):[],x=g.find(m=>m.title===es);if(x){var k,T;K(x),en(null!==(T=null===(k=m.insurable_object)||void 0===k?void 0:k.name)&&void 0!==T?T:""),E(!0)}},itemTitle:es}),(0,eC.jsx)(TeleconsultationDialog,{open:ec,onOpenChange:eu,policyId:ed})]})}var tr=v(63271),ts=v(35882);function BenefitLogo(m){let{url:g,name:v}=m,[x,k]=(0,ek.useState)(!1);return(0,eC.jsx)("div",{className:"w-12 h-12 rounded-lg bg-gray-50 border border-gray-100 flex items-center justify-center mb-2 overflow-hidden",children:g&&!x?(0,eC.jsx)("img",{src:g,alt:v,className:"w-10 h-10 object-contain",onError:()=>k(!0)}):(0,eC.jsx)("span",{className:"text-gray-400 text-lg font-bold",children:v.charAt(0).toUpperCase()})})}function BenefitsPreviewSection(){var m;let g=(0,eI.useRouter)(),{data:v,isLoading:x}=(0,tr.F0)(),k=null!==(m=null==v?void 0:v.filter(m=>m.is_active).slice(0,6))&&void 0!==m?m:[],navigateToBenefits=()=>{g.push(eV.Z.profile.index("benefits"))};return x?(0,eC.jsxs)("div",{children:[(0,eC.jsx)("div",{className:"h-6 w-40 bg-gray-200 rounded animate-pulse mb-4"}),(0,eC.jsx)("div",{className:"flex gap-3",children:[1,2,3].map(m=>(0,eC.jsx)("div",{className:"w-24 h-24 bg-gray-100 rounded-xl animate-pulse flex-shrink-0"},m))})]}):0===k.length?null:(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,eC.jsx)("div",{children:(0,eC.jsx)("h2",{className:"font-bold text-xl text-gray-900",children:"Club de Beneficios"})}),(0,eC.jsxs)("button",{className:"flex items-center text-sm font-semibold text-blue-500 hover:text-blue-600 transition-colors",onClick:navigateToBenefits,children:["Ver todos",(0,eC.jsx)(ts.Z,{className:"w-4 h-4 ml-1"})]})]}),(0,eC.jsx)("div",{className:"flex gap-3 overflow-x-auto pb-2 -mx-1 px-1",children:k.map(m=>(0,eC.jsxs)("button",{className:"flex-shrink-0 w-28 flex flex-col items-center p-3 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-blue-200 transition-all",onClick:navigateToBenefits,children:[(0,eC.jsx)(BenefitLogo,{url:m.logo_url,name:m.partnership_name}),(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-600 text-center leading-tight line-clamp-2",children:m.partnership_name})]},m.id))})]})}var to=v(4028);function AppDownloadBanner(){return(0,eC.jsx)("div",{children:(0,eC.jsx)("div",{className:"border border-neutral-200 rounded-lg items-center px-4 sm:px-6 py-3 w-full shadow-md",children:(0,eC.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[(0,eC.jsxs)("div",{className:"flex-1 text-center sm:text-left",children:[(0,eC.jsx)("h3",{className:"text-neutral-800 text-base sm:text-xl font-bold mb-1 leading-tight",children:"Descarga la app"}),(0,eC.jsx)("p",{className:"text-neutral-500 text-xs font-normal leading-relaxed",children:"Haz tus reembolsos y accede a descuentos"})]}),(0,eC.jsxs)("div",{className:"flex gap-2",children:[(0,eC.jsx)("a",{href:eq.H7,target:"_blank",rel:"noopener noreferrer",className:"block transition-all duration-200 hover:scale-[1.10] active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded","aria-label":"Descargar aplicaci\xf3n para iOS",children:(0,eC.jsx)(eQ(),{src:"/static/Download_on_the_App_Store_Badge_ESMX_RGB_blk_100217.svg",alt:"Descargar en App Store",width:120,height:40,className:"w-auto h-auto",priority:!0})}),(0,eC.jsx)("a",{href:eq.pv,target:"_blank",rel:"noopener noreferrer",className:"block transition-all duration-200 hover:scale-[1.10] active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded","aria-label":"Descargar aplicaci\xf3n para Android",children:(0,eC.jsx)(eQ(),{src:"/static/GetItOnGooglePlay_Badge_Web_color_Spanish-LATAM.png",alt:"Conseguir en Google Play",width:135,height:40,className:"w-auto h-auto",priority:!0})})]})]})})})}function PendingPetCard(m){let{refetch:g}=(0,eM.XD)(),[v,x]=(0,ek.useState)(!1),{pet:k,onDelete:E}=m,deletePet=async()=>{x(!1),E(),await eA.Z.delete("".concat(eq.yx,"/api/v2/user/pets/").concat(k.id,"/")),await g()};return(0,eC.jsxs)("div",{className:"relative bg-white shadow-sm border border-gray-200 rounded-2xl p-5 md:px-6 flex items-center flex-col md:flex-row md:justify-between hover:shadow-md transition-shadow",children:[(0,eC.jsx)(eO.Z,{pet:k,isBgBlue:!1}),(0,eC.jsx)(eP.z,{variant:"brand-outline",className:"flex w-full md:w-fit shrink-0 mt-4 md:mt-0 ml-0 md:ml-2 shadow-sm hover:shadow-md transition-shadow",onClick:()=>m.handleOnPetClick(k),children:"Seguir contrataci\xf3n"}),(0,eC.jsx)("button",{className:"absolute -top-3 -right-3 w-8 h-8 bg-pink-500 hover:bg-pink-600 rounded-full flex items-center justify-center shadow-md transition-all hover:scale-110",onClick:()=>x(!0),children:(0,eC.jsx)(to.Z,{className:"text-white w-5 h-5"})}),(0,eC.jsx)(eD.Vq,{open:v,onOpenChange:m=>{m||x(!1)},children:(0,eC.jsx)(eD.cZ,{hideCloseButton:!0,children:(0,eC.jsxs)("div",{className:"relative max-w-md mx-auto",children:[(0,eC.jsxs)("div",{className:"flex flex-col text-center items-center rounded-lg bg-white w-full py-6 px-6 sm:px-9",children:[(0,eC.jsx)(exclamation_lines,{}),(0,eC.jsxs)("div",{className:"mt-4 text-lg sm:text-xl font-bold",children:["\xbfQuieres eliminar la cotizaci\xf3n de ",k.name,"?"]}),(0,eC.jsx)("div",{className:"mt-4 text-sm sm:text-base text-neutral-500",children:"Se perder\xe1n los datos registrados. Puedes comenzar una nueva cotizaci\xf3n cuando quieras."}),(0,eC.jsxs)("div",{className:"mt-6 sm:mt-9 flex w-full gap-2",children:[(0,eC.jsx)(eP.z,{variant:"brand-outline",size:"full",onClick:()=>void deletePet(),children:"S\xed"}),(0,eC.jsx)(eP.z,{variant:"brand",size:"full",onClick:()=>x(!1),children:"No"})]})]}),(0,eC.jsx)("button",{onClick:()=>x(!1),className:"absolute top-2 right-2 sm:top-4 sm:right-4 p-2 hover:bg-gray-100 rounded-full transition-colors",children:(0,eC.jsx)(to.Z,{className:"text-neutral-500 h-5 w-5 sm:h-6 sm:w-6"})})]})})})]})}function InviteBanner(){return(0,eC.jsx)(ez(),{href:{pathname:"/profile",query:{tab:"invite"}},legacyBehavior:!0,children:(0,eC.jsxs)("div",{className:"bg-blue-500 flex items-center justify-center text-white py-1 
6w-full cursor-pointer",children:[(0,eC.jsx)("div",{children:"Invita y gana premios para tu peludo"}),(0,eC.jsx)(ts.Z,{className:"ml-1 w-5 h-5"})]})})}function InvoiceDueBanner(){return(0,eC.jsx)(ez(),{href:{pathname:"/profile",query:{tab:"payments"}},legacyBehavior:!0,children:(0,eC.jsxs)("div",{className:"border-2 border-pink-300 bg-gradient-to-r from-pink-50 to-rose-50 rounded-2xl flex items-center text-pink-700 py-5 w-full cursor-pointer px-5 shadow-sm hover:shadow-md hover:from-pink-100 hover:to-rose-100 transition-all group",children:[(0,eC.jsx)("div",{className:"w-12 h-12 bg-pink-500 rounded-xl flex items-center justify-center flex-shrink-0 group-hover:scale-110 transition-transform",children:(0,eC.jsx)(eK.Z,{className:"text-white w-6 h-6"})}),(0,eC.jsxs)("div",{className:"ml-4 flex-1",children:[(0,eC.jsx)("p",{className:"font-bold text-pink-900 mb-0.5",children:"Deuda pendiente"}),(0,eC.jsx)("p",{className:"text-sm text-pink-700",children:"Haz click aqu\xed para regularizar tu pago"})]}),(0,eC.jsx)(ts.Z,{className:"w-6 h-6 text-pink-400 group-hover:text-pink-600 group-hover:translate-x-1 transition-all"})]})})}function PendingPets(m){let[g,v]=(0,ek.useState)(m.pets.filter(m=>!m.has_policy));return 0==g.length?null:(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center mb-4",children:[(0,eC.jsx)("h2",{className:"font-bold text-xl text-gray-900",children:"Cotizaciones pendientes"}),(0,eC.jsx)("div",{className:"ml-3 w-7 h-7 flex items-center justify-center text-sm font-bold bg-gradient-to-br from-pink-500 to-rose-500 rounded-full text-white shadow-sm",children:g.length})]}),(0,eC.jsx)("div",{className:"flex flex-col space-y-4",children:g.map((x,k)=>(0,eC.jsx)(PendingPetCard,{pet:x,handleOnPetClick:m.handleOnPetClick,onDelete:()=>{let m=g.filter(m=>m.id!=x.id);v(m)}},k))})]})}function Policies(){var m;let g=(0,eI.useRouter)(),{data:v}=(0,eR.a)(),{data:x,isLoading:k,isError:E,refetch:T}=(0,eL.e$)(),K=null!==(m=null==x?void 0:x.filter(m=>!m.is_cancelled))&&void 0!==m?m:[],{data:et,isLoading:en,isError:er,refetch:ei}=(0,eF.yQ)(),es=null==et?void 0:et.value,{data:el,isLoading:ec,isError:eu,refetch:ed}=(0,eZ.Y)(),{data:ep,isLoading:em,isError:ef,refetch:eh}=(0,eM.XD)(),{data:eg}=(0,eB.Ml)();function goToPetNew(){let m=eN.w.getState().resetOnboarding;m(),g.push(eV.Z.pet.new.index())}return(0,ek.useEffect)(()=>{(0,eT.D)("hide")},[]),!v||k||en||ec||em||E||er||eu||ef||!es?(0,eC.jsx)("div",{className:"mt-9",children:(0,eC.jsx)(e$.o,{isLoading:!v||k||en||ec||em||!es,isError:E||er||eu||ef,refetch:()=>void function(){let m=[];E&&m.push(T()),er&&m.push(ei()),eu&&m.push(ed()),ef&&m.push(eh()),Promise.all(m)}()})}):0==ep.length&&0==K.length?(0,eC.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,eC.jsx)(InviteBanner,{}),(0,eC.jsxs)("div",{className:"flex flex-col items-center w-full max-w-3xl mx-auto px-6 my-6 md:mt-12",children:[(0,eC.jsx)("div",{className:"border border-neutral-200 rounded-lg items-center px-4 sm:px-6 py-3 w-full shadow-md",children:(0,eC.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[(0,eC.jsxs)("div",{className:"flex-1 text-center sm:text-left",children:[(0,eC.jsx)("h3",{className:"text-neutral-800 text-base sm:text-xl font-bold mb-1 leading-tight",children:"Descarga la app"}),(0,eC.jsx)("p",{className:"text-neutral-500 text-xs font-normal leading-relaxed",children:"Haz tus reembolsos y accede a descuentos"})]}),(0,eC.jsxs)("div",{className:"flex gap-2",children:[(0,eC.jsx)("a",{href:eq.H7,target:"_blank",rel:"noopener noreferrer",className:"block transition-all duration-200 hover:scale-[1.10] active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded","aria-label":"Descargar aplicaci\xf3n para iOS",children:(0,eC.jsx)(eQ(),{src:"/static/Download_on_the_App_Store_Badge_ESMX_RGB_blk_100217.svg",alt:"Descargar en App Store",width:120,height:40,className:"w-auto h-auto",priority:!0})}),(0,eC.jsx)("a",{href:eq.pv,target:"_blank",rel:"noopener noreferrer",className:"block transition-all duration-200 hover:scale-[1.10] active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded","aria-label":"Descargar aplicaci\xf3n para Android",children:(0,eC.jsx)(eQ(),{src:"/static/GetItOnGooglePlay_Badge_Web_color_Spanish-LATAM.png",alt:"Conseguir en Google Play",width:135,height:40,className:"w-auto h-auto",priority:!0})})]})]})}),(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-8 w-full",children:[(0,eC.jsx)("h1",{className:"font-bold text-3xl text-gray-900 mb-8",children:"Tus coberturas"}),(0,eC.jsxs)("div",{className:"flex flex-col items-center py-12",children:[(0,eC.jsx)(dashboard_dog,{className:"mb-8"}),(0,eC.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"A\xfan no tienes mascotas aseguradas"}),(0,eC.jsx)("p",{className:"text-gray-600 mb-8 text-center max-w-md",children:"\xa1Protege a tu peludo antes de que sea tarde! Obt\xe9n cobertura veterinaria completa."}),(0,eC.jsx)(eP.z,{size:"full",variant:"brand",className:"max-w-xs shadow-md hover:shadow-lg transition-shadow",onClick:()=>goToPetNew(),iconLeft:(0,eC.jsx)(plus_with_border,{className:"w-6"}),children:"Agregar mascota"})]})]})]})]}):(0,eC.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,eC.jsx)(InviteBanner,{}),(0,eC.jsxs)("div",{className:"flex flex-col justify-center w-full max-w-4xl mx-auto px-6 h-full my-6 md:mt-12 space-y-6 grow",children:[(0,eC.jsx)(AppDownloadBanner,{}),function(){if(!(null==eg?void 0:eg.results)||!x)return!1;let m=new Set(x.filter(m=>!m.is_cancelled).map(m=>m.id));return eg.results.some(g=>!g.is_paid&&null!==g.policy_id&&m.has(g.policy_id)&&null!==g.due_date&&eW()(g.due_date).isBefore(eW()()))}()&&(0,eC.jsx)(InvoiceDueBanner,{}),(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,eC.jsx)("h2",{className:"font-bold text-xl text-gray-900",children:"Mascotas aseguradas"}),(0,eC.jsxs)("button",{className:"flex items-center gap-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm font-semibold px-4 py-2 rounded-lg transition-colors",onClick:()=>goToPetNew(),children:[(0,eC.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"currentColor",children:(0,eC.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),"Agregar mascota"]})]}),(0,eC.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 items-start",children:K.map(m=>(0,eC.jsx)(PolicyCard,{policy:m},m.id))})]}),(0,eC.jsx)(PendingPets,{pets:ep,handleOnPetClick:function(m){let v=m.last_coverage_bundle_id;
6v&&g.push(eV.Z.frontend.accidentCoverage(v))}}),(0,eC.jsx)(PreventionSection,{policies:K,uf:es}),(0,eC.jsx)(BenefitsPreviewSection,{})]})]})}var tl=v(43889),tc=v(25987),tu=v(34160);function chat_bubble_extends(){return(chat_bubble_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var chat_bubble=function(m){return ek.createElement("svg",chat_bubble_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),em||(em=ek.createElement("path",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17 12.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1M12 12.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1M7 12.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1"})),ef||(ef=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12c0 1.821.487 3.53 1.338 5L2.5 21.5l4.5-.838A9.96 9.96 0 0 0 12 22"})))};function home_extends(){return(home_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var home=function(m){return ek.createElement("svg",home_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),eh||(eh=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 9.5 12 4l9 5.5M19 13v6.4a.6.6 0 0 1-.6.6H5.6a.6.6 0 0 1-.6-.6V13"})))};function share_android_extends(){return(share_android_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var share_android=function(m){return ek.createElement("svg",share_android_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),eg||(eg=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6M6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6"})),ev||(ev=ek.createElement("path",{stroke:"currentColor",strokeWidth:1.5,d:"m15.5 6.5-7 4M8.5 13.5l7 4"})))};function settings_extends(){return(settings_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var settings=function(m){return ek.createElement("svg",settings_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),ey||(ey=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6"})),eb||(eb=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m19.622 10.395-1.097-2.65L20 6l-2-2-1.735 1.483-2.707-1.113L12.935 2h-1.954l-.632 2.401-2.645 1.115L6 4 4 6l1.453 1.789-1.08 2.657L2 11v2l2.401.656L5.516 16.3 4 18l2 2 1.791-1.46 2.606 1.072L11 22h2l.604-2.387 2.651-1.098C16.697 18.832 18 20 18 20l2-2-1.484-1.75 1.098-2.652 2.386-.62V11z"})))};function logout_extends(){return(logout_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var logout=function(m){return ek.createElement("svg",logout_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),ex||(ex=ek.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,clipPath:"url(#logout_svg__clip0_1177_6828)"},ek.createElement("path",{d:"M12 12h7m0 0-3 3m3-3-3-3M19 6V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1"}))))},td=v(63406);function design_pencil_extends(){return(design_pencil_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var design_pencil=function(m){return ek.createElement("svg",design_pencil_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m),e_||(e_=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2"})),ew||(ew=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 21.168V14l4-7 4 7v7.168"})),eS||(eS=ek.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 14s1.127 1 2 1 2-1 2-1 1.127 1 2 1 2-1 2-1"})))},tp=v(10763);let tm=(0,tp.Z)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var tf=v(13057),th=v(12635),tg=v(42710),tv=v(7313),ty=v(29245),tb=v(94386),tx=v(44273),t_=v(63955),tw=v(3101),tS=v(7040),tC=v(89644);let tk=e0.Ry({id:e0.Rx(),account_number:e0.Z_(),account_type:e0.Rx(),account_type_display:e0.Z_(),bank_name:e0.Rx(),bank_name_display:e0.Z_(),holder_rut:e0.Z_().nullable(),holder_rut_matches_user:e0.O7().nullable()}),tE=["user","bankAccount"],useBankAccountQuery=()=>{let m=(0,tl.t)(m=>m.token);return(0,tS.a)(tE,async()=>{try{let{data:m}=await (0,e1.h)(tk,{method:"get",url:eV.Z.user.bankAccount.get()});return m}catch(g){var m;if(g instanceof tC.AxiosError&&(null===(m=g.response)||void 0===m?void 0:m.status)===404)return null;throw g}},{enabled:!!m,staleTime:3e5,retry:!1})},useUpdateBankAccountMutation=()=>{let m=(0,eX.NL)();return(0,eJ.D)(async m=>{try{let{data:g}=await (0,e1.h)(tk,{method:"post",url:eV.Z.user.bankAccount.upsert(),data:m});return g}catch(m){(0,e2.zG)(m,"Hubo un error al actualizar la cuenta bancaria. Por favor, intenta nuevamente.")}},{onSuccess:()=>
6{m.invalidateQueries(tE)}})};var tj=v(8270);let useBankChoicesQuery=()=>(0,tS.a)({queryKey:e3.a.bankChoices.list(),queryFn:async()=>{let{data:m}=await (0,e1.h)(e0.IX(tj.y),{method:"get",url:eV.Z.bankChoices.list()});return m},staleTime:6e5});var tN=v(45447),tR=v(68471),tI=v(81171),tP=v(9869);let tT=ek.forwardRef((m,g)=>{var v,x;let{submitLabel:k="Guardar",onSaved:E}=m,[T,K]=(0,ek.useState)(null),{data:et}=useBankAccountQuery(),{data:en}=(0,eR.a)(),er=useUpdateBankAccountMutation(),{data:ei,isLoading:es,isError:el}=useBankChoicesQuery(),{register:ec,handleSubmit:eu,trigger:ed,control:ep,reset:em,formState:{errors:ef,isDirty:eh,isSubmitting:eg}}=(0,t_.cI)({mode:"onSubmit",defaultValues:{account_number:"",account_type:0,bank_name:1,holder_rut:""}}),ev=(null!=ei?ei:[]).map(m=>({value:m.code,label:m.name}));(0,ek.useEffect)(()=>{if(et){var m,g;em({account_number:et.account_number,account_type:et.account_type,bank_name:et.bank_name,holder_rut:(0,tw.format)(null!==(g=null!==(m=et.holder_rut)&&void 0!==m?m:null==en?void 0:en.rut)&&void 0!==g?g:"")});return}(null==en?void 0:en.rut)&&em(m=>{var g;return{...m,holder_rut:(0,tw.format)(null!==(g=en.rut)&&void 0!==g?g:"")}})},[et,en,em]);let onSubmit=async m=>{K(null);try{await er.mutateAsync(m),await (null==E?void 0:E())}catch(m){K((0,e2.EV)(m,"Por favor int\xe9ntalo nuevamente").message)}},ey=(0,ek.useRef)(null);return(0,ek.useImperativeHandle)(g,()=>({submit:async()=>!!await ed()&&(eh&&eu(onSubmit)(),!0)})),(0,eC.jsx)("form",{ref:ey,onSubmit:m=>{eu(onSubmit)(m)},className:"w-full",children:(0,eC.jsxs)("div",{className:"space-y-4",children:[(0,eC.jsxs)("div",{children:[(0,eC.jsx)("div",{className:"font-bold text-sm",children:"N\xfamero de cuenta"}),(0,eC.jsx)("div",{className:"mt-2",children:(0,eC.jsx)(tN.Z,{theme:"square",inputProps:{...ec("account_number",{required:{value:!0,message:"El n\xfamero de cuenta es requerido"}})},errorMessage:null===(v=ef.account_number)||void 0===v?void 0:v.message})})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("div",{className:"font-bold text-sm",children:"Tipo de cuenta"}),(0,eC.jsxs)("div",{className:"mt-2",children:[(0,eC.jsx)(t_.Qr,{control:ep,defaultValue:tP.Pp[0].value,name:"account_type",render:m=>{let{field:{onChange:g,value:v}}=m;return(0,eC.jsxs)(tR.Ph,{value:String(v),onValueChange:m=>g(Number(m)),children:[(0,eC.jsx)(tR.i4,{children:(0,eC.jsx)(tR.ki,{placeholder:"Selecciona un tipo de cuenta"})}),(0,eC.jsx)(tR.Bw,{children:tP.Pp.map(m=>(0,eC.jsx)(tR.Ql,{value:String(m.value),children:m.label},m.value))})]})}}),ef.account_type&&(0,eC.jsx)("p",{className:"text-pink-600 text-sm mt-1",children:ef.account_type.message})]})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("div",{className:"font-bold text-sm",children:"Nombre del banco"}),(0,eC.jsxs)("div",{className:"mt-2",children:[el?(0,eC.jsx)("p",{className:"text-destructive text-sm",children:"No se pudieron cargar los bancos. Intenta nuevamente."}):(0,eC.jsx)(t_.Qr,{control:ep,name:"bank_name",render:m=>{let{field:{onChange:g,value:v}}=m;return(0,eC.jsx)(tI.Z,{options:ev,selectedValue:ev.length>0?v:null,setSelectedValue:m=>g(null!=m?m:1),placeholder:es?"Cargando bancos...":"Buscar banco..."})}}),ef.bank_name&&(0,eC.jsx)("p",{className:"text-pink-600 text-sm mt-1",children:ef.bank_name.message})]})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("div",{className:"font-bold text-sm",children:"RUT del titular de la cuenta"}),(0,eC.jsx)("div",{className:"mt-2",children:(0,eC.jsx)(tN.Z,{theme:"square",inputProps:{...ec("holder_rut",{required:{value:!0,message:"El RUT del titular es requerido"},validate:m=>(0,tw.validate)(m)||"El RUT ingresado no es v\xe1lido"}),placeholder:"12.345.678-5",autoComplete:"off"},errorMessage:null===(x=ef.holder_rut)||void 0===x?void 0:x.message})}),(0,eC.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"La cuenta debe estar a tu nombre. Si el titular es otra persona, el banco puede rechazar la transferencia."})]}),!et&&(0,eC.jsx)("div",{className:"p-4 bg-yellow-50 text-yellow-800 rounded-lg",children:"Si ingresas tu cuenta, te podremos reembolsar m\xe1s r\xe1pido si ocurre un siniestro."}),T&&(0,eC.jsx)("p",{className:"text-destructive text-sm text-center",children:T}),(0,eC.jsx)("div",{className:"mt-9 flex justify-center",children:(0,eC.jsx)(eP.z,{variant:"brand",type:"submit",disabled:!eh&&!E||eg,loading:eg,children:k})})]})})});function Settings(){var m;let{data:g}=(0,eR.a)(),[v,x]=(0,ek.useState)("personal");(0,ek.useEffect)(()=>{(0,eT.D)("hide")},[]);let k=[{id:"personal",label:"Datos personales"},{id:"address",label:"Domicilio"},{id:"bank",label:"Cuenta bancaria"}];return null===g?null:(0,eC.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,eC.jsxs)("div",{className:"max-w-5xl mx-auto p-6",children:[(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-6 mb-6",children:[(0,eC.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Configuraci\xf3n"}),(0,eC.jsx)("p",{className:"text-gray-600 text-sm",children:"Administra tu informaci\xf3n personal y preferencias"})]}),(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 mb-6 overflow-hidden",children:[(0,eC.jsx)("div",{className:"md:hidden overflow-x-auto",children:(0,eC.jsx)("nav",{className:"flex whitespace-nowrap px-4","aria-label":"Tabs",children:k.map(m=>(0,eC.jsx)("button",{onClick:()=>x(m.id),className:(0,tc.cn)(v===m.id?"border-blue-500 text-blue-500 font-semibold":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700","whitespace-nowrap border-b-2 py-4 px-4 text-sm font-medium transition-colors"),children:m.label},m.id))})}),(0,eC.jsx)("div",{className:"hidden md:block",children:(0,eC.jsx)("nav",{className:"flex px-6","aria-label":"Tabs",children:k.map(m=>(0,eC.jsx)("button",{onClick:()=>x(m.id),className:(0,tc.cn)(v===m.id?"border-blue-500 text-blue-500 font-semibold":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700","whitespace-nowrap border-b-2 py-5 px-6 text-sm font-medium transition-colors"),children:m.label},m.id))})})]}),(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-6",children:[(0,eC.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-6",children:null===(m=k.find(m=>m.id===v))||void 0===m?void 0:m.label}),(0,eC.jsxs)("div",{children:["personal"===v&&g&&(0,eC.jsx)("div",{className:"bg-gray-50 rounded-xl border border-gray-200 p-6",children:(0,eC.jsx)(tb.Z,{user:g,isLoading:!1})}),"address"===v&&(0,eC.jsx)("div",{className:"bg-gray-50 rounded-xl border border-gray-200 p-6",children:(0,eC.jsx)(tx.Z,{})}),"bank"===v&&(0,eC.jsx)("div",{className:"bg-gray-50 rounded-xl border border-gray-200 p-6",children:(0,eC.jsx)(tT,{})})]})]})]})})}tT.displayName="UserBankAccount";var tO=v(51558);let tA=[{key:"all",label:"Todos",color:"gray"},{key:"paid",label:"Pagadas",color:"emerald"},{key:"free",label:"Gratis",color:"yellow"},{key:"future",label:"Futuras",color:"blue"},{key:"overdue",label:"Vencidas",color:"red"}];var profile_PaymentFilters=m=>{let{activeFilter:g,onFilterChange:v}=m;return(0,eC.jsxs)("div",{className:"bg-white rounded-2xl p-4 shadow-sm mb-6 border border-gray-200",children:[(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3",children:"Filtrar por estado"}),(0,eC.jsx)("div",{className:"flex flex-wrap gap-2",children:tA.map(m=>{let x=g===m.key;return(0,eC.jsx)("button",{onClick:()=>v(m.key),className:"px-4 py-2 rounded-full border text-xs transition-all ".concat(x?"bg-blue-50 border-blue-500 text-blue-500 font-bold":"bg-white border-gray-200 text-gray-700 hover:border-gray-300 font-medium"),children:m.label},m.key)})})]})},profile_SummaryCard=m=>{let{overdueCount:g,upcomingCount:v,paidCount:x,freeCount:k}=m;return(0,eC.jsxs)("div",{className:"bg-white rounded-2xl p-6 shadow-sm mb-6 border border-gray-200",children:[(0,eC.jsx)("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-4",children:"Resumen"}),(0,eC.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,eC.jsxs)("div",{className:"text-center p-3 rounded-xl bg-gray-50",children:[(0,eC.jsx)("div",{className:"text-2xl font-bold mb-1 ".concat(g>0?"text-red-600":"text-gray-900"),children:g}),(0,eC.jsx)("div",{className:"text-xs text-gray-600 font-medium",children:"Vencidas"})]}),(0,eC.jsxs)("div",{className:"text-center p-3 rounded-xl bg-gray-50",children:[(0,eC.jsx)("div",{className:"text-2xl font-bold text-gray-900 mb-1",children:v}),(0,eC.jsx)("div",{className:"text-xs text-gray-600 font-medium",children:"Futuras"})]}),(0,eC.jsxs)("div",{className:"text-center p-3 rounded-xl bg-gray-50",children:[(0,eC.jsx)("div",{className:"text-2xl font-bold text-gray-900 mb-1",children:x}),(0,eC.jsx)("div",{className:"text-xs text-gray-600 font-medium",children:"Pagadas"})]}),(0,eC.jsxs)("div",{className:"text-center p-3 rounded-xl bg-gray-50",children:[(0,eC.jsx)("div",{className:"text-2xl font-bold mb-1 ".concat(k>0?"text-amber-600":"text-gray-900"),children:k}),(0,eC.jsx)("div",{className:"text-xs text-gray-600 font-medium",children:"Gratis"})]})]})]})},tM=v(43335),tD=v(42661);let shouldShowDiscountCode=(m,g)=>{if(!m.discount_code)return!1;let v=m.is_paid&&m.is_free_invoice,x=null==g?void 0:g.willBeFree;return v||!!x},getPaymentDisplayAmount=(m,g)=>{var v;return m.is_paid&&m.is_free_invoice?"Gratis":(null==g?void 0:g.willBeFree)?"Ser\xe1 Gratis":(null===(v=m.display_amount)||void 0===v?void 0:v.toString())||"0"},hasDiscount=m=>!m.is_paid&&!m.is_free_invoice&&!!m.price_clp&&!!m.display_amount&&m.display_amount<m.price_clp,getDiscountPercentage=m=>{if(!hasDiscount(m)||!m.price_clp||!m.display_amount)return 0;let g=(m.price_clp-m.display_amount)/m.price_clp*100;return Math.round(g)},getPaymentIntentError=m=>m.last_payment_intent&&"failed"===m.last_payment_intent.status?m.last_payment_intent.error_message||"Error al procesar el pago":null,getFriendlyPaymentError=m=>{let g=getPaymentIntentError(m);if(!g)return null;for(let[m,v]of Object.entries({insufficient_funds:"Fondos insuficientes",card_declined:"Tarjeta rechazada",expired_card:"Tarjeta vencida",invali
6d_card:"Tarjeta inv\xe1lida",processing_error:"Error al procesar el pago"}))if(g.toLowerCase().includes(m))return v;return g.length>100?"".concat(g.substring(0,100),"..."):g};var tL=v(87078),tF=v(41983),tZ=v(38681);let usePaymentStatus=(m,g)=>(0,ek.useMemo)(()=>{if(null==g?void 0:g.willBeFree)return{label:"Ser\xe1 Gratis",color:"#3B82F6",bgColor:"bg-blue-50",textColor:"text-blue-700",borderColor:"border-blue-200",icon:tL.Z};if(m.is_paid&&m.is_free_invoice)return{label:"Gratis",color:"#F59E0B",bgColor:"bg-yellow-50",textColor:"text-yellow-700",borderColor:"border-yellow-200",icon:tF.Z};if(m.is_paid)return{label:"Pagada",color:"#10B981",bgColor:"bg-green-50",textColor:"text-green-700",borderColor:"border-green-200",icon:tZ.Z};if(!m.due_date)return{label:"Sin fecha",color:"#6B7280",bgColor:"bg-gray-50",textColor:"text-gray-700",borderColor:"border-gray-200",icon:tL.Z};let v=new Date(m.due_date)<new Date;return v?{label:"Vencida",color:"#EF4444",bgColor:"bg-red-50",textColor:"text-red-700",borderColor:"border-red-200",icon:tv.Z}:{label:"Futura",color:"#F59E0B",bgColor:"bg-yellow-50",textColor:"text-yellow-700",borderColor:"border-yellow-200",icon:tL.Z}},[m,g]);var profile_PaymentListItem=m=>{var g,v;let{payment:x,onPress:k,pendingFreeInfo:E}=m,T=usePaymentStatus(x,E),K=T.icon,et=shouldShowDiscountCode(x,E),en=hasDiscount(x),er=getDiscountPercentage(x),ei=getFriendlyPaymentError(x);return(0,eC.jsx)("div",{className:"p-4 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>k(x),children:(0,eC.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eC.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,eC.jsx)("div",{className:"p-2 rounded-full ".concat(T.bgColor," ").concat(T.borderColor," border"),children:(0,eC.jsx)(K,{className:"h-5 w-5 ".concat(T.textColor)})}),(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,eC.jsxs)("span",{className:"text-sm font-medium text-gray-900",children:["Cuota ",x.fee_payment_number]}),(0,eC.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ".concat(T.bgColor," ").concat(T.textColor," ").concat(T.borderColor," border"),children:T.label})]}),(0,eC.jsxs)("div",{className:"text-sm text-gray-500",children:["Vence: ",(0,tD.J_)(x.due_date)]}),(0,eC.jsxs)("div",{className:"text-xs text-gray-400",children:["P\xf3liza #",(null===(g=x.policy)||void 0===g?void 0:g.document_number)||"N/A"," • ",(null===(v=x.policy)||void 0===v?void 0:v.pet_name)||"Sin nombre"]}),(null==E?void 0:E.willBeFree)&&(0,eC.jsxs)("div",{className:"text-xs text-blue-600",children:["Ser\xe1 gratis el ",(0,tD.J_)(E.availableDate),et&&(0,eC.jsxs)("span",{className:"ml-1 text-yellow-600",children:["• C\xf3digo: ",x.discount_code]})]}),x.is_paid&&x.is_free_invoice&&(0,eC.jsxs)("div",{className:"text-xs text-yellow-600",children:["Cuota gratis aplicada el ",(0,tD.J_)(x.paid_at),et&&(0,eC.jsxs)("span",{className:"ml-1",children:["• C\xf3digo: ",x.discount_code]})]}),ei&&!x.is_paid&&(0,eC.jsxs)("div",{className:"flex items-center gap-1 text-xs text-red-600 mt-1",children:[(0,eC.jsx)(e7.Z,{className:"h-3 w-3"}),(0,eC.jsxs)("span",{children:["\xdaltimo intento fall\xf3: ",ei]})]})]})]}),(0,eC.jsx)("div",{className:"text-right",children:(0,eC.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[en&&(0,eC.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eC.jsx)("span",{className:"text-xs text-gray-400 line-through",children:(0,tM.Ed)(x.price_clp||0)}),(0,eC.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 border border-green-200",children:[er,"% OFF"]})]}),(0,eC.jsx)("div",{className:"text-sm font-medium text-gray-900",children:(()=>{let m=getPaymentDisplayAmount(x,E);return"Gratis"===m||"Ser\xe1 Gratis"===m?m:(0,tM.Ed)(Number(m))})()}),!en&&(0,eC.jsx)("div",{className:"text-xs text-gray-500",children:(0,tM.cD)(x.price)})]})})]})})},profile_PaymentMonthGroup=m=>{let{month:g,payments:v,onPaymentPress:x,getPendingFreeInvoiceInfo:k}=m;return(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,eC.jsx)("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent via-gray-200 to-gray-200"}),(0,eC.jsx)("h3",{className:"text-sm text-gray-600 font-semibold capitalize px-3 py-1 bg-white rounded-full border border-gray-200 shadow-sm",children:g}),(0,eC.jsx)("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent via-gray-200 to-gray-200"})]}),(0,eC.jsx)("div",{className:"bg-white rounded-2xl border border-gray-200 shadow-sm overflow-hidden divide-y divide-gray-100",children:v.map(m=>(0,eC.jsx)(profile_PaymentListItem,{payment:m,onPress:x,pendingFreeInfo:k(m)},m.id))})]})},tB=v(37903),profile_PaymentList=m=>{let{payments:g,onPaymentPress:v,getPendingFreeInvoiceInfo:x}=m,k=function(m){let g=new Map;return m.forEach(m=>{if(!m.due_date)return;let v=eW()(m.due_date),x=v.format("YYYY-MM"),k=(0,tB.Pb)(m.due_date),E=k.charAt(0).toUpperCase()+k.slice(1);g.has(x)||g.set(x,{monthYear:x,displayName:E,payments:[],totalAmount:0,paidCount:0,futureCount:0,overdueCount:0});let T=g.get(x);T&&(T.payments.push(m),T.totalAmount+=m.amount||0,m.is_paid?T.paidCount++:v.isBefore(eW()())?T.overdueCount++:T.futureCount++)}),Array.from(g.values()).sort((m,g)=>m.monthYear.localeCompare(g.monthYear))}(g);return 0===g.length?(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 text-center py-16 px-6",children:[(0,eC.jsx)("div",{className:"w-16 h-16 bg-gray-100 rounded-2xl flex items-center justify-center mx-auto mb-4",children:(0,eC.jsx)("svg",{className:"w-8 h-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,eC.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})}),(0,eC.jsx)("p",{className:"text-gray-600 font-medium",children:"No hay cuotas disponibles"})]}):(0,eC.jsx)("div",{className:"space-y-6",children:k.map(m=>(0,eC.jsx)(profile_PaymentMonthGroup,{month:m.displayName,payments:m.payments,onPaymentPress:v,getPendingFreeInvoiceInfo:x},m.monthYear))})},profile_PaymentDetailModal=m=>{var g,v,x;let{payment:k,visible:E,onClose:T,pendingFreeInfo:K}=m;if(!k)return null;let et=usePaymentStatus(k,K),en=et.icon,er=shouldShowDiscountCode(k,K),ei=(()=>{let m=getPaymentDisplayAmount(k,K);return"Gratis"===m||"Ser\xe1 Gratis"===m?m:(0,tM.Ed)(Number(m))})();return(0,eC.jsx)(eD.Vq,{open:E,onOpenChange:m=>{m||T()},children:(0,eC.jsx)(eD.cZ,{hideCloseButton:!0,children:(0,eC.jsxs)("div",{className:"space-y-6 p-6",children:[(0,eC.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Detalles de la Cuota"}),(0,eC.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("h3",{className:"text-lg font-semibold text-gray-900",children:["Cuota ",k.fee_payment_number]}),(0,eC.jsxs)("p",{className:"text-sm text-gray-500",children:["P\xf3liza #",(null===(g=k.policy)||void 0===g?void 0:g.document_number)||"N/A"]}),(0,eC.jsx)("p",{className:"text-sm text-gray-500",children:(null===(v=k.policy)||void 0===v?void 0:v.pet_name)||"Sin nombre"})]}),(0,eC.jsxs)("div",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium ".concat(et.bgColor," ").concat(et.textColor),children:[(0,eC.jsx)(en,{className:"h-4 w-4 mr-1"}),et.label]})]}),(0,eC.jsx)("div",{className:"bg-gray-50 rounded-lg p-4",children:(0,eC.jsxs)("div",{className:"text-center",children:[(0,eC.jsx)("div",{className:"text-2xl font-bold text-gray-900 mb-1",children:ei}),(0,eC.jsx)("div",{className:"text-sm text-gray-500",children:(0,tM.cD)(k.price)})]})}),(0,eC.jsxs)("div",{className:"space-y-3",children:[(0,eC.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"Informaci\xf3n"}),(0,eC.jsxs)("div",{className:"space-y-2",children:[(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("span",{className:"text-sm text-gray-600",children:"Fecha de vencimiento"}),(0,eC.jsx)("span",{className:"text-sm font-medium text-gray-900",children:(0,tD.J_)(k.due_date)})]}),k.is_paid&&(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("span",{className:"text-sm text-gray-600",children:"Fecha de pago"}),(0,eC.jsx)("span",{className:"text-sm font-medium text-gray-900",children:(0,tD.J_)(k.paid_at)})]}),(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("span",{className:"text-sm text-gray-600",children:"Fecha de creaci\xf3n"}),(0,eC.jsx)("span",{className:"text-sm font-medium text-gray-900",children:(0,tD.J_)(k.created_at)})]}),(null==K?void 0:K.willBeFree)&&(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("span",{className:"text-sm text-gray-600",children:"Disponible desde"}),(0,eC.jsx)("span",{className:"text-sm font-medium text-blue-600",children:(0,tD.J_)(K.availableDate)})]}),k.is_paid&&k.is_free_invoice&&(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("span",{className:"text-sm text-gray-600",children:"Tipo de Pago"}),(0,eC.jsx)("span",{className:"text-sm font-medium text-yellow-600",children:"Cuota Gratis"})]}),er&&(0,eC.jsxs)("div",{className:"flex justify-between",children:[(0,eC.jsx)("span",{className:"text-sm text-gray-600",children:"C\xf3digo de descuento"}),(0,eC.jsx)("span",{className:"text-sm font-medium text-yellow-600",children:k.discount_code})]}),k.last_payment_intent&&"failed"===k.last_payment_intent.status&&(0,eC.jsx)("div",{className:"mt-3 p-3 bg-red-50 rounded-lg border border-red-200",children:(0,eC.jsxs)("div",{className:"flex items-start gap-2",children:[(0,eC.jsx)("svg",{className:"w-5 h-5 text-red-600 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,eC.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,eC.jsxs)("div",{className:"flex-1",children:[(0,eC.jsx)("p",{className:"text-sm font-medium text-red-900 mb-1",children:"\xdaltimo intento de pago fall\xf3"}),(0,eC.jsx)("p",{className:"text-xs text-red-700",children:k.last_payment_intent.error_message||"Error desconocido al procesar el pago"}),k.last_payment_intent.processor_status&&(0,eC.jsxs)("p",{className:"text-xs text-red-600 mt-1",children:["C\xf3digo: ",k.last_payment_intent.processor_status]})]})]})})]})]}),(null===(x=k.policy)||void 0===x?void 0:x.insurable_object)&&(0,eC.jsxs)("div",{className:"space-y-3",children:[(0,eC.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"Mascota"}),(0,eC.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3",children:[(0,eC.jsx)("div",{className:"text-sm font-medium text-gray-900",children:k.policy.insurable_object.name}),(0,eC.jsxs)("div",{className:"text-xs text-gray-500",children:[k.policy.insurable_object.breed," • ",k.policy.insurable_object.age_in_words]})]})]})]})})})},t$=v(68344),tU=v(20463),tz=v(70522),tV=v(6342);let formatDateString=m=>m?(0,tB.p6)(m):"";
6var profile_ModifyFutureDatesModal=m=>{let{isOpen:g,onClose:v}=m,[x,k]=(0,ek.useState)(""),[E,T]=(0,ek.useState)(1),[K,et]=(0,ek.useState)(null),[en,er]=(0,ek.useState)("policy"),[ei,es]=(0,ek.useState)(!1),{data:el=[]}=(0,eL.e$)(),ec=el.filter(m=>!m.is_cancelled),eu=(0,eB.rv)(),ed=(0,eB.Fk)(),handlePolicySelect=m=>{k(m),er("day")},handleDaySelect=m=>{T(m),er("preview"),fetchPreview(x,m)},fetchPreview=async(m,g)=>{try{let v=await eu.mutateAsync({policy_id:m,new_day_of_month:g});et(v)}catch(m){m instanceof t$.o?alert(m.message):((0,tU.Tb)(m),alert("No se pudo obtener el preview de fechas")),er("day")}},handleConfirm=async()=>{if(K){es(!0);try{await ed.mutateAsync({policy_id:K.policy_id,first_due_date:K.first_due_date}),alert("Las fechas de las cuotas futuras han sido actualizadas correctamente"),v(),resetModal()}catch(m){console.error("Error updating dates:",m),alert("No se pudieron actualizar las fechas")}finally{es(!1)}}},resetModal=()=>{k(""),T(1),et(null),er("policy"),es(!1)},renderPolicySelection=()=>(0,eC.jsxs)("div",{children:[(0,eC.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:"Selecciona una p\xf3liza"}),(0,eC.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Elige la p\xf3liza para la cual quieres modificar las fechas de las cuotas futuras"}),(0,eC.jsx)("div",{className:"max-h-80 overflow-y-auto space-y-3",children:ec.map(m=>{var g;return(0,eC.jsx)("button",{className:"w-full bg-white border border-gray-200 rounded-lg p-4 text-left hover:bg-gray-50 transition-colors",onClick:()=>handlePolicySelect(m.id),children:(0,eC.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eC.jsxs)("div",{className:"flex-1",children:[(0,eC.jsx)("div",{className:"text-base font-medium text-gray-900",children:(null===(g=m.insurable_object)||void 0===g?void 0:g.name)||"Mascota"}),(0,eC.jsxs)("div",{className:"text-sm text-gray-500",children:["P\xf3liza #",String(m.document_number)]})]}),(0,eC.jsx)(ts.Z,{className:"h-5 w-5 text-gray-400"})]})},m.id)})})]}),renderDaySelection=()=>(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("button",{className:"flex items-center mb-4 text-gray-600 hover:text-gray-800",onClick:()=>er("policy"),children:[(0,eC.jsx)(tz.Z,{className:"h-5 w-5 mr-2"}),"Volver"]}),(0,eC.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:"Selecciona el d\xeda del mes"}),(0,eC.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:"Elige qu\xe9 d\xeda del mes quieres que se cobren tus cuotas futuras"}),(0,eC.jsx)("div",{className:"space-y-3",children:[1,5,28].map(m=>(0,eC.jsxs)("button",{className:"w-full flex items-center justify-between p-4 rounded-lg border-2 transition-colors ".concat(E===m?"bg-blue-50 border-blue-500":"bg-white border-gray-300 hover:bg-gray-50"),onClick:()=>T(m),children:[(0,eC.jsxs)("div",{className:"flex items-center",children:[(0,eC.jsx)("div",{className:"w-8 h-8 rounded-full border-2 flex items-center justify-center mr-3 ".concat(E===m?"bg-blue-500 border-blue-500":"bg-white border-gray-300"),children:(0,eC.jsx)("span",{className:"text-sm font-medium ".concat(E===m?"text-white":"text-gray-700"),children:m})}),(0,eC.jsxs)("span",{className:"text-base font-medium text-gray-900",children:["D\xeda ",m," de cada mes"]})]}),E===m&&(0,eC.jsx)(tV.Z,{className:"h-5 w-5 text-blue-500"})]},m))}),(0,eC.jsx)(eP.z,{onClick:()=>handleDaySelect(E),className:"w-full mt-6",disabled:!E,children:"Continuar"})]}),renderPreview=()=>(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,eC.jsxs)("button",{className:"flex items-center text-gray-600 hover:text-gray-800",onClick:()=>er("day"),children:[(0,eC.jsx)(tz.Z,{className:"h-5 w-5 mr-2"}),"Volver"]}),(0,eC.jsx)(eP.z,{onClick:()=>void handleConfirm(),disabled:ed.isLoading||ei,className:"bg-blue-500 hover:bg-blue-600",children:ei?"Actualizando...":"Confirmar"})]}),(0,eC.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:"Como quedar\xedan mis pagos"}),eu.isLoading?(0,eC.jsx)("div",{className:"text-center py-8",children:(0,eC.jsx)("div",{className:"text-gray-600",children:"Cargando preview..."})}):K?(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("p",{className:"text-sm text-gray-600 mb-4",children:["Se modificar\xe1n ",K.total_invoices," cuotas futuras para el d\xeda ",E," de ca
6da mes"]}),(0,eC.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 mb-4",children:[(0,eC.jsx)("h3",{className:"text-base font-medium text-gray-900 mb-3",children:"Cambios propuestos:"}),(0,eC.jsxs)("div",{className:"flex items-center mb-2 pb-2 border-b border-gray-200",children:[(0,eC.jsx)("div",{className:"flex-1",children:(0,eC.jsx)("div",{className:"text-xs font-medium text-gray-500 uppercase",children:"Actual"})}),(0,eC.jsx)("div",{className:"mx-3 w-4"}),(0,eC.jsx)("div",{className:"flex-1",children:(0,eC.jsx)("div",{className:"text-xs font-medium text-gray-500 uppercase",children:"Nueva"})})]}),K.current_dates.map((m,g)=>{let v=K.new_dates[g];return v?(0,eC.jsxs)("div",{className:"flex items-center mb-3",children:[(0,eC.jsx)("div",{className:"flex-1",children:(0,eC.jsx)("div",{className:"text-sm font-medium text-gray-900",children:formatDateString(m)})}),(0,eC.jsx)("div",{className:"mx-3",children:(0,eC.jsx)(ts.Z,{className:"h-4 w-4 text-blue-500"})}),(0,eC.jsx)("div",{className:"flex-1",children:(0,eC.jsx)("div",{className:"text-sm font-medium text-blue-600",children:formatDateString(v)})})]},g):null})]})]}):null]});return(0,eC.jsx)(eD.Vq,{open:g,onOpenChange:()=>{resetModal(),v()},children:(0,eC.jsxs)(eD.cZ,{className:"max-w-2xl max-h-[80vh] overflow-y-auto","aria-describedby":"modify-dates-description",children:[(0,eC.jsx)(eD.$N,{className:"text-lg font-bold text-gray-900 mb-4",children:"Modificar Cuotas Futuras"}),(0,eC.jsx)("div",{className:"p-6",children:(()=>{switch(en){case"policy":default:return renderPolicySelection();case"day":return renderDaySelection();case"preview":return renderPreview()}})()}),ei&&(0,eC.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center rounded-lg",children:(0,eC.jsxs)("div",{className:"bg-white rounded-lg p-6 text-center",children:[(0,eC.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto mb-3"}),(0,eC.jsx)("div",{className:"text-base font-medium text-gray-900",children:"Actualizando fechas..."}),(0,eC.jsx)("div",{className:"text-sm text-gray-600 mt-1",children:"Por favor espera mientras procesamos los cambios"})]})})]})})};let usePendingFreeInvoiceInfo=()=>({getPendingFreeInvoiceInfo:m=>m.will_be_free&&m.free_available_date?{willBeFree:!0,availableDate:m.free_available_date,rewardType:"free_invoice"}:null});var tq=v(19249),tH=v(32263),profile_BillingDateCard=m=>{let{nextPaymentDate:g,onPress:v}=m,x=g?(0,tB.TT)(g):"No hay cuotas pendientes";return(0,eC.jsx)("div",{className:"mb-6",children:(0,eC.jsx)("button",{onClick:v,className:"w-full bg-gradient-to-r from-blue-50 to-indigo-50 rounded-2xl p-5 border-2 border-blue-200 shadow-sm hover:from-blue-100 hover:to-indigo-100 hover:border-blue-300 transition-all text-left group",children:(0,eC.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eC.jsxs)("div",{className:"flex items-center flex-1",children:[(0,eC.jsx)("div",{className:"w-12 h-12 bg-blue-500 rounded-xl flex items-center justify-center mr-4 group-hover:scale-110 transition-transform",children:(0,eC.jsx)(tH.Z,{className:"h-6 w-6 text-white"})}),(0,eC.jsxs)("div",{className:"flex-1",children:[(0,eC.jsx)("div",{className:"text-base font-bold text-gray-900 mb-1",children:"Pr\xf3ximo Cobro"}),(0,eC.jsx)("div",{className:"text-sm text-gray-700 font-medium",children:x})]})]}),(0,eC.jsx)(ts.Z,{className:"h-6 w-6 text-blue-400 group-hover:text-blue-600 group-hover:translate-x-1 transition-all"})]})})})},profile_PaymentsPage=()=>{let[m,g]=(0,ek.useState)("all"),[v,x]=(0,ek.useState)(null),[k,E]=(0,ek.useState)(!1),[T,K]=(0,ek.useState)(!1),{data:et,isLoading:en,error:er,refetch:ei}=(0,eB.Ml)(),{getPendingFreeInvoiceInfo:es}=usePendingFreeInvoiceInfo(),el=(null==et?void 0:et.results)||[],ec=(0,ek.useMemo)(()=>{if(0===el.length)return null;let m=el.filter(m=>!m.is_paid&&m.due_date);if(m.length>0){let g=m.sort((m,g)=>m.due_date&&g.due_date?new Date(m.due_date).getTime()-new Date(g.due_date).getTime():0)[0];return(null==g?void 0:g.due_date)||null}return null},[el]),eu=(0,ek.useMemo)(()=>"all"===m?el:el.filter(g=>{var v;let x=null!==(v=g.is_free_invoice)&&void 0!==v&&v,k=es(g);switch(m){case"paid":return g.is_paid&&!x;case"free":return g.is_paid&&x||(null==k?void 0:k.willBeFree);case"future":return!g.is_paid&&g.due_date&&new Date(g.due_date)>=new Date;case"overdue":return!g.is_paid&&g.due_date&&new Date(g.due_date)<new Date;default:return!0}}),[el,m,es]),ed=(0,ek.useMemo)(()=>{let m=el.filter(m=>!m.is_paid&&m.due_date&&new Date(m.due_date)<new Date).length,g=el.filter(m=>!m.is_paid&&m.due_date&&new Date(m.due_date)>=new Date).length,v=el.filter(m=>{var g;return m.is_paid&&!(null!==(g=m.is_free_invoice)&&void 0!==g&&g)}).length,x=el.filter(m=>{var g;let v=null!==(g=m.is_free_invoice)&&void 0!==g&&g,x=es(m);return m.is_paid&&v||(null==x?void 0:x.willBeFree)}).length;return{overdueCount:m,upcomingCount:g,paidCount:v,freeCount:x}},[el,es]);return en?(0,eC.jsx)(e$.o,{isLoading:!0,isError:!1,refetch:()=>void ei()}):er?(0,eC.jsx)(e$.o,{isLoading:!1,isError:!0,refetch:()=>void ei()}):(0,eC.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,eC.jsxs)("div",{className:"p-6 max-w-5xl mx-auto",children:[(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-6 mb-6",children:[(0,eC.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Mis Cuotas"}),(0,eC.jsx)("p",{className:"text-gray-600 text-sm",children:"Gestiona y visualiza el estado de tus pagos"})]}),(0,eC.jsx)("div",{className:"mb-6",children:(0,eC.jsx)(tq.Z,{})}),(0,eC.jsx)(profile_BillingDateCard,{nextPaymentDate:ec,onPress:()=>{K(!0)}}),(0,eC.jsx)(profile_SummaryCard,{...ed}),(0,eC.jsx)(profile_PaymentFilters,{activeFilter:m,onFilterChange:g}),(0,eC.jsx)(profile_PaymentList,{payments:eu,onPaymentPress:m=>{x(m),E(!0)},getPendingFreeInvoiceInfo:es}),(0,eC.jsx)(profile_PaymentDetailModal,{payment:v,visible:k,onClose:()=>{E(!1),x(null)},pendingFreeInfo:v?es(v):null}
6),(0,eC.jsx)(profile_ModifyFutureDatesModal,{isOpen:T,onClose:()=>K(!1)})]})})};e0.Ry({is_tc_accepted:e0.O7(),is_mkt_accepted:e0.O7()});let tW=e0.Ry({id:e0.Rx(),is_tc_accepted:e0.O7(),tc_accepted_at:e0.Z_().datetime({offset:!0}).nullable(),is_mkt_accepted:e0.O7(),mkt_accepted_at:e0.Z_().datetime({offset:!0}).nullable()});var tK=v(77353),tG=v(65575),tQ=v(85320);let tY="toku-migration-popup-dismissed-at";function TokuMigrationPopup(){let{data:m}=(0,eR.a)(),{data:g,isLoading:v}=(0,tK.P)(),{data:x,isLoading:k,refetch:E}=(0,tG.g)(),T=(0,eX.NL)(),[K,et]=(0,ek.useState)(!1),[en,er]=(0,ek.useState)(!1),ei=!!g&&!!g.card_number&&0===g.response_code,es=!!x&&x.has_card&&!!x.default_card,el=(null==m?void 0:m.is_tc_accepted)===!1,ec=v||k;(0,ek.useEffect)(()=>{(()=>{if(ec)return;let m=ei&&!es&&!el&&!function(){let m=localStorage.getItem(tY);if(!m)return!1;let g=new Date(m),v=new Date,x=v.getTime()-g.getTime();return x/864e5<7}();et(m)})()},[ec,ei,es,el]);let handleDismiss=()=>{localStorage.setItem(tY,new Date().toISOString()),et(!1)};return(0,eC.jsxs)(eC.Fragment,{children:[(0,eC.jsx)(eD.Vq,{open:K,onOpenChange:m=>{m||handleDismiss()},children:(0,eC.jsxs)(eD.cZ,{className:"max-w-md rounded-2xl p-6",children:[(0,eC.jsx)(eD.fK,{children:(0,eC.jsxs)("div",{className:"flex items-center",children:[(0,eC.jsx)(th.Z,{className:"h-6 w-6 text-blue-500 mr-3"}),(0,eC.jsx)(eD.$N,{className:"text-lg font-bold text-foreground",children:"Actualiza tu medio de pago"})]})}),(0,eC.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:"Estamos mejorando nuestro sistema de pagos. Para seguir disfrutando de tu seguro sin interrupciones, inscribe tu tarjeta con nuestro nuevo procesador de pagos."}),(0,eC.jsxs)("div",{className:"mt-6 flex space-x-3",children:[(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>{et(!1),er(!0)},className:"flex-1",children:"Inscribir tarjeta"}),(0,eC.jsx)(eP.z,{variant:"brand-outline",onClick:handleDismiss,className:"flex-1",children:"M\xe1s tarde"})]})]})}),(0,eC.jsx)(tQ.Z,{isOpen:en,onClose:()=>er(!1),onUpdateSuccess:()=>{E(),T.invalidateQueries({queryKey:e3.a.mercadopago.customerInfo()}),er(!1)},hasCard:!1})]})}var tX=v(6660),tJ=v(35682),t0=v(88557),t1=v(51279),t2=v(10371),t3=v(70391);let t5=["S\xedndrome Braquiocef\xe1lico","Procedimientos Dentales","Alimentos y Suplementos","Productos de Cosm\xe9tica","Etolog\xeda","Castraciones / Esterilizaci\xf3n","Pre\xf1ez y parto"];function formatCLP(m){return"$".concat(Math.round(m).toLocaleString("es-CL"))}function isDateReached(m){let g=(0,tB.OT)(m);return null!==g&&g<=0}function hasCoverageBeforeThisPolicy(m){return!!m.coverage_start_date&&!!m.start_date&&(0,tB.X$)(m.coverage_start_date)<(0,tB.X$)(m.start_date)}function StepDots(m){let{total:g,current:v}=m;return(0,eC.jsx)("div",{className:"flex justify-center items-center gap-2 mb-4",children:Array.from({length:g},(m,g)=>(0,eC.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(g<=v?"bg-blue-500":"bg-neutral-200")},g))})}function PetIntroductionContent(m){var g,v;let{policy:x}=m,k=null===(g=x.insurable_object)||void 0===g?void 0:g.name,E=(null===(v=x.insurable_object)||void 0===v?void 0:v.kind)==="C"?tJ.Z:t0.Z;return(0,eC.jsxs)("div",{className:"p-2",children:[(0,eC.jsxs)("div",{className:"flex flex-col items-center",children:[(0,eC.jsx)("div",{className:"w-28 h-28 bg-gradient-to-br from-blue-50 to-blue-100 rounded-3xl flex items-center justify-center",children:(0,eC.jsx)(E,{className:"w-16 h-16 text-blue-600"})}),(0,eC.jsxs)("div",{className:"flex flex-col items-center mt-4 mb-4",children:[(0,eC.jsxs)("h2",{className:"text-3xl font-bold text-neutral-900 text-center mb-3 leading-tight",children:["P\xf3liza de ",k]}),(0,eC.jsx)("div",{className:"bg-neutral-50 px-4 py-2 rounded-full",children:(0,eC.jsxs)("span",{className:"text-sm font-semibold text-neutral-700",children:["P\xf3liza vigente desde ",(0,tB.TT)(x.start_date)]})})]})]}),(0,eC.jsxs)("div",{className:"bg-white border border-neutral-100 rounded-2xl px-6 py-4 shadow-card-subtle",children:[(0,eC.jsxs)("div",{className:"flex items-start mb-4",children:[(0,eC.jsx)("div",{className:"w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center mr-3 mt-0.5 flex-shrink-0",children:(0,eC.jsx)(t1.Z,{className:"w-5 h-5 text-blue-600"})}),(0,eC.jsxs)("div",{className:"flex-1",children:[(0,eC.jsx)("h3",{className:"text-lg font-semibold text-neutral-900 mb
6-2",children:"\xbfQu\xe9 veremos?"}),(0,eC.jsx)("p",{className:"text-neutral-600 leading-6 text-sm",children:"Te explicaremos paso a paso c\xf3mo funcionan los tiempos de espera y la cobertura de esta p\xf3liza."})]})]}),(0,eC.jsxs)("div",{className:"flex gap-3",children:[(0,eC.jsxs)("div",{className:"flex-1 bg-neutral-50 rounded-xl p-3 flex flex-col items-center",children:[(0,eC.jsx)(tL.Z,{className:"w-5 h-5 mb-2 text-neutral-600"}),(0,eC.jsx)("span",{className:"text-2xs font-medium text-neutral-700 text-center",children:"Tiempos de espera"})]}),(0,eC.jsxs)("div",{className:"flex-1 bg-neutral-50 rounded-xl p-3 flex flex-col items-center",children:[(0,eC.jsx)(t2.Z,{className:"w-5 h-5 mb-2 text-neutral-600"}),(0,eC.jsx)("span",{className:"text-2xs font-medium text-neutral-700 text-center",children:"Cobertura"})]}),(0,eC.jsxs)("div",{className:"flex-1 bg-neutral-50 rounded-xl p-3 flex flex-col items-center",children:[(0,eC.jsx)(t3.Z,{className:"w-5 h-5 mb-2 text-neutral-600"}),(0,eC.jsx)("span",{className:"text-2xs font-medium text-neutral-700 text-center",children:"Reembolsos"})]})]})]})]})}function WaitingPeriodsContent(m){let{policy:g}=m,v=function(m){var g,v,x,k,E,T,K;let et=null!==(K=m.coverage_start_date)&&void 0!==K?K:m.start_date,en=et?(0,tB.X$)(et):"",er=[{name:"Cobertura preventiva",isIncluded:!!(null===(g=m.coverage_bundle)||void 0===g?void 0:g.has_preventive_package),waitingDays:0,availableDate:en},{name:"Responsabilidad Civil",isIncluded:!!(null===(v=m.coverage_bundle)||void 0===v?void 0:v.has_liability),waitingDays:0,availableDate:en},{name:"Accidentes",isIncluded:!!(null===(x=m.coverage_bundle)||void 0===x?void 0:x.has_accidents),waitingDays:7,availableDate:(0,tB.eW)(en,8)},{name:"Enfermedades",isIncluded:!!(null===(k=m.coverage_bundle)||void 0===k?void 0:k.has_illnesses),waitingDays:28,availableDate:(0,tB.eW)(en,29)},{name:"Accidentes relacionados con ligamentos cruzados, luxaciones, displasias y hernias",isIncluded:!!(null===(E=m.coverage_bundle)||void 0===E?void 0:E.has_accidents),waitingDays:90,availableDate:(0,tB.eW)(en,91)},{name:"Enfermedades relacionadas con neoplasias benignas o malignas, ligamentos cruzados, luxaciones, displasias y hernias",isIncluded:!!(null===(T=m.coverage_bundle)||void 0===T?void 0:T.has_illnesses),waitingDays:90,availableDate:(0,tB.eW)(en,91)}];return er.filter(m=>m.isIncluded)}(g),x=v.length>0&&v.every(m=>isDateReached(m.availableDate));return hasCoverageBeforeThisPolicy(g)&&x?(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center mb-4",children:[(0,eC.jsx)(tZ.Z,{className:"w-6 h-6 mr-3 text-teal-600"}),(0,eC.jsx)("h3",{className:"text-lg font-bold text-neutral-900 flex-1",children:"Cobertura activa desde el primer d\xeda"})]}),(0,eC.jsxs)("div",{className:"bg-teal-50 border border-teal-200 rounded-2xl px-6 py-8 flex flex-col items-center text-center gap-3",children:[(0,eC.jsx)("div",{className:"w-14 h-14 bg-teal-100 rounded-full flex items-center justify-center",children:(0,eC.jsx)(tZ.Z,{className:"w-7 h-7 text-teal-600"})}),(0,eC.jsx)("p",{className:"text-sm text-teal-800 leading-5 max-w-sm",children:"Tu p\xf3liza no tiene per\xedodos de espera porque corresponde a una renovaci\xf3n o cambio de plan: tu cobertura contin\xfaa sin interrupciones."})]})]}):(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center mb-4",children:[(0,eC.jsx)(tL.Z,{className:"w-6 h-6 mr-3 text-blue-500"}),(0,eC.jsx)("h3",{className:"text-lg font-bold text-neutral-900 flex-1",children:"Tiempos de espera"})]}),(0,eC.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-6 flex items-start",children:[(0,eC.jsx)(tv.Z,{className:"w-5 h-5 mr-2 mt-0.5 text-yellow-600 flex-shrink-0"}),(0,eC.jsx)("p",{className:"text-sm text-yellow-800 leading-5",children:"La p\xf3liza no cubre eventos, enfermedades o accidentes que hayan comenzado antes del inicio de la cobertura de cada categor\xeda, sin importar cu\xe1ndo se solicite el reembolso."})]}),(0,eC.jsx)("p",{className:"text-sm text-neutral-600 mb-6 leading-5",children:"Tu p\xf3liza tiene per\xedodos de espera antes de que puedas usar ciertos beneficios:"}),(0,eC.jsx)("div",{className:"relative",children:v.map((m,g)=>{let x=isDateReached(m.availableDate),k=g===v.length-1;return(0,eC.jsxs)("div",{className:"relative flex",children:[!k&&(0,eC.jsx)("div",{className:"absolute left-3 top-6 w-0.5 h-16 ".concat(x?"bg-blue-500":"bg-neutral-200")}),(0,eC.jsx)("div",{className:"relative z-10 mr-4 mt-1",children:(0,eC.jsx)("div",{className:"w-6 h-6 rounded-full border-2 flex items-center justify-center ".concat(x?"bg-blue-500 border-blue-500":"bg-white border-neutral-200"),children:x&&(0,eC.jsx)("div",{className:"w-3 h-3 rounded-full bg-white"})})}),(0,eC.jsxs)("div",{className:"flex-1 pb-6",children:[(0,eC.jsx)("p",{className:"text-sm font-medium text-neutral-900 mb
6-1",children:m.name}),(0,eC.jsx)("p",{className:"text-xs text-neutral-500 mb-1",children:0===m.waitingDays?"Disponible inmediatamente":"".concat(m.waitingDays," d\xedas de espera")}),(0,eC.jsx)("p",{className:"text-xs font-bold ".concat(x?"text-blue-500":"text-neutral-500"),children:x?"Activo desde el ".concat((0,tB.TT)(m.availableDate)):"Disponible a partir del ".concat((0,tB.TT)(m.availableDate))})]})]},m.name)})})]})}function CoverageAndReimbursementContent(m){var g,v,x,k,E,T,K,et,en,er,ei,es,el,ec;let{policy:eu}=m,{data:ed}=(0,eF.yQ)(),ep=null!==(en=null==ed?void 0:ed.value)&&void 0!==en?en:0,em=null===(g=eu.coverage_bundle)||void 0===g?void 0:g.health_item,ef=null==em?void 0:em.is_annual_deductible,eh=Math.round((null!==(er=null==em?void 0:em.percentage_covered)&&void 0!==er?er:0)*100),eg=null!==(ei=null==em?void 0:em.deductible)&&void 0!==ei?ei:0,ev=null!==(es=null==em?void 0:em.amount_limit)&&void 0!==es?es:0,ey=20-eg,eb=ey*(null!==(el=null==em?void 0:em.percentage_covered)&&void 0!==el?el:0),ex=eg+ey*(1-(null!==(ec=null==em?void 0:em.percentage_covered)&&void 0!==ec?ec:0)),e_=(null===(v=eu.coverage_bundle)||void 0===v?void 0:v.has_accidents)&&(null===(x=eu.coverage_bundle)||void 0===x?void 0:x.has_illnesses)?"accidentes y enfermedades":(null===(k=eu.coverage_bundle)||void 0===k?void 0:k.has_accidents)?"accidentes":"enfermedades";return(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center mb-4",children:[(0,eC.jsx)(t2.Z,{className:"w-6 h-6 mr-3 text-blue-500"}),(0,eC.jsx)("h3",{className:"text-lg font-bold text-neutral-900 flex-1",children:"C\xf3mo funciona tu cobertura"})]}),(0,eC.jsxs)("p",{className:"text-sm text-neutral-600 mb-4 leading-5",children:["Tu p\xf3liza cubre ",e_," con las siguientes condiciones:"]}),(0,eC.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,eC.jsxs)("div",{className:"flex-1 bg-blue-50 rounded-lg p-4",children:[(0,eC.jsxs)("p",{className:"text-center text-blue-600 text-xl font-bold mb-1",children:[eh,"%"]}),(0,eC.jsx)("p",{className:"text-center text-blue-500 text-xs",children:"de cobertura"})]}),(0,eC.jsxs)("div",{className:"flex-1 bg-neutral-50 rounded-lg p-4",children:[(0,eC.jsxs)("p",{className:"text-center text-neutral-700 text-xl font-bold mb-1",children:[eg," UF"]}),(0,eC.jsxs)("p",{className:"text-center text-neutral-500 text-xs",children:["deducible ",ef?"anual":"por evento"]})]}),(0,eC.jsxs)("div",{className:"flex-1 bg-pink-50 rounded-lg p-4",children:[(0,eC.jsxs)("p",{className:"text-center text-pink-600 text-xl font-bold mb-1",children:[ev," UF"]}),(0,eC.jsx)("p",{className:"text-center text-pink-500 text-xs",children:"tope anual"})]})]}),(0,eC.jsxs)("div",{className:"bg-neutral-50 rounded-lg p-4 mb-4",children:[(0,eC.jsx)("p",{className:"text-sm font-bold text-neutral-800 mb-3",children:"\xbfC\xf3mo funciona?"}),(0,eC.jsxs)("div",{className:"mb-3",children:[(0,eC.jsxs)("p",{className:"text-xs font-bold text-neutral-700 mb-1",children:["1. Deducible ",ef?"anual":"por evento"]}),(0,eC.jsx)("p",{className:"text-xs text-neutral-600 leading-4",children:ef?"Pagas ".concat(eg," UF una vez al a\xf1o. Despu\xe9s de cubrirlo, no pagas m\xe1s deducible hasta renovar la p\xf3liza."):"Pagas ".concat(eg," UF por cada evento m\xe9dico. Se aplica por separado a cada ").concat("accidentes y enfermedades"===e_?"accidente o enfermedad":"accidentes"===e_?"accidente":"enfermedad",".")})]}),(0,eC.jsxs)("div",{className:"mb-3",children:[(0,eC.jsxs)("p",{className:"text-xs font-bold text-neutral-700 mb-1",children:["2. Cobertura del ",eh,"%"]}),(0,eC.jsxs)("p",{className:"text-xs text-neutral-600 leading-4",children:["Despu\xe9s del deducible, cubrimos el ",eh,"% de los gastos elegibles."]})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("p",{className:"text-xs font-bold text-neutral-700 mb-1",children:["3. Tope anual de ",ev," UF"]}),(0,eC.jsx)("p",{className:"text-xs text-neutral-600 leading-4",children:"M\xe1ximo que cubrimos por a\xf1o. Una vez alcanzado, los gastos corren por tu cuenta."})]})]}),(0,eC.jsxs)("div",{className:"bg-white border border-neutral-200 rounded-lg p-4 mb-4",children:[(0,eC.jsx)("p",{className:"text-sm font-bold text-neutral-800 text-center",children:"Ejemplo de reembolso"}),(0,eC.jsx)("div",{className:"border-b border-neutral-200 pb-2 mb-3"}),(0,eC.jsxs)("div",{className:"space-y-2 mb-3",children:[(0,eC.jsxs)("div",{className:"flex justify-between items-center",children:[(0,eC.jsx)("span",{className:"text-xs text-neutral-700",children:"Costo total del tratamiento"}),(0,eC.jsxs)("div",{className:"text-right",children:[(0,eC.jsx)("p",{className:"text-xs font-medium text-neutral-900",children:formatCLP(20*ep)}),(0,eC.jsxs)("p",{className:"text-xs text-neutral-500",children:["(",20," UF)"]})]})]}),(0,eC.jsxs)("div",{className:"flex justify-between items-center",children:[(0,eC.jsxs)("span",{className:"text-xs text-neutral-700",children:["Deducible ",ef?"(anual)":"(por evento)"]}),(0,eC.jsxs)("div",{className:"text-right",children:[(0,eC.jsxs)("p",{className:"text-xs font-medium text-pink-600",children:["-",formatCLP(eg*ep)]}),(0,eC.jsxs)("p",{className:"text-xs text-pink-400",children:["(",eg," UF)"]})]})]}),(0,eC.jsx)("div",{className:"border-t border-neutral-100 pt-2",children:(0,eC.jsxs)("div",{className:"flex justify-between items-center",children:[(0,eC.jsx)("span",{className:"text-xs text-neutral-700",children:"Monto reembolsable"}),(0,eC.jsxs)("div",{className:"text-right",children:[(0,eC.jsx)("p",{className:"text-xs font-medium text-neutral-900",children:formatCLP(ey*ep)}),(0,eC.jsxs)("p",{className:"text-xs text-neutral-500",children:["(",ey," UF)"]})]})]})}),(0,eC.jsxs)("div",{className:"flex justify-between items-center",children:[(0,eC.jsxs)("span",{className:"text-xs text-neutral-700",children:["Cobertura (",eh,"%)"]}),(0,eC.jsxs)("div",{className:"text-right",children:[(0,eC.jsxs)("p",{className:"text-xs font-medium text-neutral-900",children:["+",formatCLP(eb*ep)]}),(0,eC.jsxs)("p",{className:"text-xs text-neutral-500",children:["(~",Math.round(eb)," UF)"]})]})]})]}),(0,eC.jsxs)("div",{className:"border-t-2 border-neutral-200 pt-3",children:[(0,eC.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,eC.jsx)("span",{className:"text-sm font-bold text-neutral-800",children:"Cacttus reembolsa:"}),(0,eC.jsxs)("div",{className:"text-right",children:[(0,eC.jsxs)("p",{className:"text-sm font-bold text-blue-600",children:["~",formatCLP(eb*ep)]}),(0,eC.jsxs)("p",{className:"text-xs text-blue-400",children:["(~",Math.round(eb)," UF)"]})]})]}),(0,eC.jsxs)("div",{className:"flex justify-between items-center",children:[(0,eC.jsx)("span",{className:"text-sm font-bold text-neutral-800",children:"T\xfa pagas:"}),(0,eC.jsxs)("div",{className:"text-right",children:[(0,eC.jsx)("p",{className:"text-sm font-bold text-neutral-900",children:formatCLP(ex*ep)}),(0,eC.jsxs)("p",{className:"text-xs text-neutral-500",children:["(",Math.round(ex)," UF)"]})]})]})]})]}),((null===(E=eu.coverage_bundle)||void 0===E?void 0:E.has_preventive_package)||(null===(T=eu.coverage_bundle)||void 0===T?void 0:T.has_liability))&&(0,eC.jsxs)("div",{children:[(0,eC.jsx)("p",{className:"text-sm font-bold text-neutral-800 mb-3",children:"Coberturas adicionales"}),(0,eC.jsxs)("div",{className:"space-y-2",children:[(null===(K=eu.coverage_bundle)||void 0===K?void 0:K.has_preventive_package)&&(0,eC.jsxs)("div",{className:"bg-blue-50 rounded-lg p-3 flex justify-between items-center",children:[(0,eC.jsx)("span",{className:"text-xs font-medium text-neutral-700",children:"Preventivos"}),(0,eC.jsx)("span",{className:"text-xs font-bold text-blue-600",children:"100% cubierto"})]}),(null===(et=eu.coverage_bundle)||void 0===et?void 0:et.has_liability)&&(0,eC.jsxs)("div",{className:"bg-blue-50 rounded-lg p-3 flex justify-between items-center",children:[(0,eC.jsx)("span",{className:"text-xs font-medium text-neutral-700",children:"Responsabilidad Civil"}),(0,eC.jsx)("span",{className:"text-xs font-bold text-blue-600",children:"50 UF"})]})]})]})]})}function PreExistingConditionsStep(m){let{policies:g}=m,v=g.filter(m=>{var g;return(null===(g=m.insurable_object)||void 0===g?void 0:g.formatted_preexisting_conditions)&&"Sin condiciones ni s\xedntomas declarados"!==m.insurable_object.formatted_preexisting_conditions}),x=v.length>0;return(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center mb-4",children:[(0,eC.jsx)(tv.Z,{className:"w-6 h-6 mr-3 text-blue-500"}),(0,eC.jsx)("h3",{className:"text-lg font-bold text-neutral-900 flex-1",children:"Condiciones pre-existentes"})]}),(0,eC.jsx)("p",{className:"text-sm text-neutral-600 mb-4 leading-5",children:"Las condiciones pre-existentes no est\xe1n cubiertas por tu seguro. Estas son condiciones de salud que tu mascota ten\xeda antes de contratar la p\xf3liza."}),x?(0,eC.jsxs)("div",{children:[(0,eC.jsx)("p",{className:"text-sm font-medium text-neutral-900 mb
6-3",children:"Se han declarado condiciones pre-existentes:"}),(0,eC.jsx)("div",{className:"space-y-2",children:v.map(m=>{var g;return(0,eC.jsxs)("div",{className:"bg-blue-50 rounded-lg p-4",children:[(0,eC.jsx)("p",{className:"text-sm font-bold text-neutral-900 mb-1",children:null===(g=m.insurable_object)||void 0===g?void 0:g.name}),(0,eC.jsx)("p",{className:"text-sm text-blue-600",children:"Condiciones declaradas"})]},m.id)})})]}):(0,eC.jsx)("div",{className:"bg-pink-50 rounded-lg p-4",children:(0,eC.jsxs)("p",{className:"text-sm text-pink-700 text-center leading-5",children:["No has declarado condiciones pre-existentes para tu",g.length>1?"s":""," mascota",g.length>1?"s":"","."]})})]})}function GeneralExclusionsStep(){return(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center mb-4",children:[(0,eC.jsx)(e7.Z,{className:"w-6 h-6 mr-3 text-pink-600"}),(0,eC.jsx)("h3",{className:"text-lg font-bold text-neutral-900 flex-1",children:"Exclusiones generales"})]}),(0,eC.jsxs)("p",{className:"text-sm text-neutral-600 mb-4 leading-5",children:["Con o sin preexistencias, estos gastos ",(0,eC.jsx)("span",{className:"text-pink-600 font-bold",children:"NO"})," tienen cobertura:"]}),(0,eC.jsx)("div",{className:"space-y-2",children:t5.map(m=>(0,eC.jsx)("div",{className:"bg-pink-50 rounded-lg p-3",children:(0,eC.jsx)("span",{className:"text-sm text-pink-700",children:m})},m))})]})}function DocumentTitle(m){let{number:g,title:v}=m;return(0,eC.jsxs)("div",{className:"flex items-center",children:[(0,eC.jsx)("div",{className:"w-6 h-6 bg-blue-500 rounded-full mr-3 flex items-center justify-center flex-shrink-0",children:(0,eC.jsx)("span",{className:"text-white text-xs font-bold",children:g})}),(0,eC.jsx)("p",{className:"text-base font-bold text-neutral-900 flex-1",children:v})]})}function RequiredDocumentsStep(){let handleDownload=m=>{window.open(m,"_blank")};return(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center mb-4",children:[(0,eC.jsx)(t1.Z,{className:"w-6 h-6 mr-3 text-blue-500"}),(0,eC.jsx)("h3",{className:"text-lg font-bold text-neutral-900 flex-1",children:"Documentos para reembolsar"})]}),(0,eC.jsxs)("div",{className:"space-y-3",children:[(0,eC.jsxs)("div",{className:"bg-neutral-50 py-4 px-4 rounded-lg",children:[(0,eC.jsx)(DocumentTitle,{number:1,title:"Video con tu declaraci\xf3n"}),(0,eC.jsx)("p",{className:"text-sm text-neutral-500 ml-9 mt-2 leading-4",children:"Requerido para accidentes, enfermedades y terapias complementarias."})]}),(0,eC.jsxs)("div",{className:"bg-neutral-50 py-4 px-4 rounded-lg",children:[(0,eC.jsx)(DocumentTitle,{number:2,title:"Boletas con detalle o voucher junto con el presupuesto"}),(0,eC.jsx)("p",{className:"text-sm text-neutral-500 ml-9 mt-2 leading-4",children:"Presupuesto firmado y timbrado sirve como detalle."}),(0,eC.jsx)(eP.z,{variant:"brand-ghost",size:"sm",className:"mt-3 ml-9",iconLeft:(0,eC.jsx)(t3.Z,{className:"w-4 h-4"}),onClick:()=>handleDownload("/static/presupuesto.pdf"),children:"Descargar presupuesto"})]}),(0,eC.jsxs)("div",{className:"bg-neutral-50 py-4 px-4 rounded-lg",children:[(0,eC.jsx)(DocumentTitle,{number:3,title:"Informe cl\xednico"}),(0,eC.jsx)("p",{className:"text-sm text-neutral-500 ml-9 mt-2 leading-4",children:"Documento firmado por tu veterinario."}),(0,eC.jsx)(eP.z,{variant:"brand-ghost",size:"sm",className:"mt-3 ml-9",iconLeft:(0,eC.jsx)(t3.Z,{className:"w-4 h-4"}),onClick:()=>handleDownload("/static/informe_clinico.pdf"),children:"Descargar informe cl\xednico"})]}),(0,eC.jsxs)("div",{className:"bg-neutral-50 py-4 px-4 rounded-lg",children:[(0,eC.jsx)(DocumentTitle,{number:4,title:"Recetas y \xf3rdenes si son necesarias"}),(0,eC.jsx)("p",{className:"text-sm text-neutral-500 ml-9 mt-2 leading-4",children:"Para medicamentos o ex\xe1menes."})]})]})]})}function PolicyOnboardingModal(m){var g,v;let{isOpen:x,onClose:k,policies:E,showAllPolicies:T=!1}=m,K=function(){let m=(0,eX.NL)();return(0,eJ.D)({mutationFn:async m=>{try{let g=await (0,e1.h)(e0.Ry({message:e0.Z_()}),{method:"post",url:eV.Z.user.policies.completeOnboarding(m)});return g.data}catch(m){(0,e2.zG)(m,"No pudimos completar el onboarding.")}},onSuccess:()=>
6{m.invalidateQueries({queryKey:e3.a.policies.index()})}})}(),et=(0,ek.useMemo)(()=>T?E:E.filter(m=>!m.mobile_onboarding_completed),[E,T]),[en,er]=(0,ek.useState)(0),[ei,es]=(0,ek.useState)(1),[el,ec]=(0,ek.useState)(null),[eu,ed]=(0,ek.useState)(!1);(0,ek.useEffect)(()=>{x&&(er(0),es(1),ec(null),ed(!1))},[x]);let ep=et[en],em=(0,ek.useCallback)(()=>{et.forEach(m=>{K.mutate(m.id)})},[et,K]),ef=(0,ek.useCallback)(()=>{if(null===el){if(ei<3){es(m=>m+1);return}if(en<et.length-1){er(m=>m+1),es(1);return}ec("pre-existing-conditions");return}if("pre-existing-conditions"===el){ec("general-exclusions");return}"general-exclusions"===el&&ec("required-documents")},[el,ei,en,et.length]),eh=(0,ek.useCallback)(()=>{em(),k()},[em,k]),eg=(0,ek.useCallback)(()=>{eu&&em(),k()},[eu,em,k]);if(0===et.length)return(0,eC.jsx)(eD.Vq,{open:x,onOpenChange:m=>!m&&k(),children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-sm",children:[(0,eC.jsxs)("div",{className:"flex flex-col items-center text-center gap-3",children:[(0,eC.jsx)("div",{className:"w-12 h-12 bg-pink-100 rounded-full flex items-center justify-center",children:(0,eC.jsx)(e7.Z,{className:"w-6 h-6 text-pink-600"})}),(0,eC.jsx)("h2",{className:"text-lg font-bold text-neutral-900",children:"No tienes p\xf3lizas activas"}),(0,eC.jsx)("p",{className:"text-sm text-neutral-600",children:"Para acceder al resumen de tus p\xf3lizas, necesitas tener al menos una p\xf3liza activa."})]}),(0,eC.jsx)(eP.z,{variant:"brand",size:"full",onClick:k,className:"mt-4",children:"Entendido"})]})});let ev=3*et.length+3,ey=3*en+(ei-1);"pre-existing-conditions"===el&&(ey=3*et.length),"general-exclusions"===el&&(ey=3*et.length+1),"required-documents"===el&&(ey=3*et.length+2);let eb="required-documents"===el,ex=null===el?"Para la p\xf3liza de ".concat(null!==(v=null==ep?void 0:null===(g=ep.insurable_object)||void 0===g?void 0:g.name)&&void 0!==v?v:""):"Condiciones generales de todas las p\xf3lizas",e_=null===el&&!!ep&&hasCoverageBeforeThisPolicy(ep);return(0,eC.jsx)(eD.Vq,{open:x,onOpenChange:m=>!m&&eg(),children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-xl max-h-[90vh] overflow-hidden p-0 flex flex-col",children:[(0,eC.jsxs)("div",{className:"px-6 pt-5 border-b border-neutral-100",children:[(0,eC.jsx)(StepDots,{total:ev,current:ey}),(0,eC.jsx)("h2",{className:"text-xl font-bold text-neutral-900 text-center mb-1",children:e_?"\xa1Tu cobertura contin\xfaa!":"\xa1Bienvenido a Cacttus!"}),(0,eC.jsx)("p",{className:"text-sm text-neutral-500 text-center mb-1",children:e_?"Revisemos los detalles de tu nueva p\xf3liza":"Te explicaremos c\xf3mo funciona tu p\xf3liza"}),(0,eC.jsx)("p",{className:"text-sm font-bold text-blue-500 text-center mb-4",children:ex})]}),(0,eC.jsx)("div",{className:"px-6 py-4 overflow-y-auto flex-1",children:null===el&&ep?1===ei?(0,eC.jsx)(PetIntroductionContent,{policy:ep}):2===ei?(0,eC.jsx)(WaitingPeriodsContent,{policy:ep}):(0,eC.jsx)(CoverageAndReimbursementContent,{policy:ep}):"pre-existing-conditions"===el?(0,eC.jsx)(PreExistingConditionsStep,{policies:et}):"general-exclusions"===el?(0,eC.jsx)(GeneralExclusionsStep,{}):(0,eC.jsx)(RequiredDocumentsStep,{})}),(0,eC.jsxs)("div",{className:"px-6 py-4 border-t border-neutral-100 bg-white",children:[(0,eC.jsx)(tX.Z,{label:"No volver a mostrar",isChecked:eu,setIsChecked:ed}),(0,eC.jsxs)("div",{className:"flex gap-3 mt-4",children:[(0,eC.jsx)(eP.z,{variant:"brand-outline",size:"full",className:"flex-1",onClick:eg,children:"Omitir"}),(0,eC.jsx)(eP.z,{variant:"brand",size:"full",className:"flex-1",onClick:eb?eh:ef,loading:eb&&K.isLoading,children:eb?"Entendido":"Continuar"})]})]})]})})}var t4=v(96577),t6=v.n(t4),t7=v(3386);function useBankAccountsQuery(){return(0,tS.a)({queryKey:e3.a.bankAccounts.index(),queryFn:async()=>{try{let m=await (0,e1.h)(tk,{method:"GET",url:eV.Z.user.bankAccount.get()});return m.data?{results:[m.data]}:{results:[]}}catch(g){var m;if(g instanceof tC.AxiosError&&(null===(m=g.response)||void 0===m?void 0:m.status)===404)return{results:[]};throw(0,tU.Tb)(g),g}}})}var t8=v(36479),t9=v(79212),nt=v.n(t9),nn=v(88883);let nr=e0.Ry({policyId:e0.Z_().min(1,"Selecciona una mascota"),petName:e0.Z_().optional(),isAddendum:e0.O7().optional(),originalClaimId:e0.Z_().nullable().optional(),category:e0.PG().nullable(),severity:e0.Km(["better","same","worse","deceased"]).nullable().optional(),eventDate:e0.Z_().nullable(),reimbursableItems:e0.IX(e0.Z_()),claimId:e0.Z_().nullable().optional()}),ni={policyId:"",petName:"",isAddendum:!1,originalClaimId:null,category:null,severity:null,eventDate:null,reimbursableItems:[],claimId:null},na={"select-policy":"Seleccionar mascota","addendum-select":"\xbfNuevo evento?","type-of-claim":"\xbfQu\xe9 necesitas reembolsar?",severity:"\xbfC\xf3mo se encuentra tu mascota?","event-date":"\xbfCu\xe1ndo ocurri\xf3?","video-declaration":"Video o declaraci\xf3n","documents-info":"Documentos necesarios",documents:"Subir documentos","steps-overview":"Revisar y enviar",success:"\xa1Listo!"};var ns=v(68945);let no={0:{video:"disabled",allowWrittenDeclaration:!0},1:{video:"required"},2:{video:"required"},3:{video:"disabled",allowWrittenDeclaration:!0},4:{video:"disabled",allowWrittenDeclaration:!0},5:{video:"disabled",allowWrittenDeclaration:!0},6:{video:"disabled",allowWrittenDeclaration:!0},7:{video:"disabled",allowWrittenDeclaration:!0},8:{video:"required"},9:{video:"disabled"}},nl={video:"optional",allowWrittenDeclaration:!0};
6function getVideoRequirement(m,g){var v,x;if("deceased"===g)return nl.video;let k=(0,ns._m)(m);return null!==(x=null===(v=no[k])||void 0===v?void 0:v.video)&&void 0!==x?x:"disabled"}function allowsWrittenDeclaration(m,g){var v,x,k;if("deceased"===g)return null!==(x=nl.allowWrittenDeclaration)&&void 0!==x&&x;let E=(0,ns._m)(m);return null!==(k=null===(v=no[E])||void 0===v?void 0:v.allowWrittenDeclaration)&&void 0!==k&&k}function requiresVideoStep(m,g){let v=getVideoRequirement(m,g),x=allowsWrittenDeclaration(m,g);return"disabled"!==v||x}function SelectPolicyStep(m){let{policies:g,goToStep:v}=m,{setValue:x}=(0,t_.Gc)(),k=g.filter(m=>!m.is_cancelled),handleSelectPolicy=m=>{var g,k;x("policyId",m.id),x("petName",null!==(k=null===(g=m.insurable_object)||void 0===g?void 0:g.name)&&void 0!==k?k:""),v("addendum-select")};return 0===k.length?(0,eC.jsxs)("div",{className:"h-full flex flex-col items-center justify-center p-6 text-center",children:[(0,eC.jsx)("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,eC.jsx)(t6(),{src:"/static/icons/dog.svg",alt:"Mascota",width:32,height:32})}),(0,eC.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No tienes p\xf3lizas activas"}),(0,eC.jsx)("p",{className:"text-gray-500",children:"Para solicitar un reembolso necesitas tener una p\xf3liza activa."})]}):(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Selecciona tu mascota"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"\xbfPara qui\xe9n necesitas solicitar un reembolso?"})]}),(0,eC.jsx)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4",children:(0,eC.jsx)("div",{className:"space-y-3",children:k.map(m=>{let g=m.insurable_object,v=(null==g?void 0:g.kind)==="D"?"/static/icons/dog.svg":"/static/icons/cat.svg";return(0,eC.jsxs)("button",{onClick:()=>handleSelectPolicy(m),className:"w-full flex items-center gap-4 p-4 rounded-xl border border-gray-200 text-left transition-all hover:border-blue-300 hover:bg-blue-50/50 active:bg-blue-100",children:[(0,eC.jsx)("div",{className:"w-12 h-12 bg-blue-100 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,eC.jsx)(t6(),{src:v,alt:(null==g?void 0:g.kind)==="D"?"Perro":"Gato",width:28,height:28})}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsx)("p",{className:"font-semibold text-gray-900",children:null==g?void 0:g.name}),(0,eC.jsxs)("p",{className:"text-sm text-gray-500 truncate",children:[null==g?void 0:g.breed," \xb7 ",null==g?void 0:g.age_in_words]})]}),(0,eC.jsx)(ts.Z,{className:"w-5 h-5 text-gray-400"})]},m.id)})})})]})}let nc=(0,tp.Z)("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);function AddendumSelectStep(m){var g;let{policies:v,onNext:x}=m,{watch:k,setValue:E}=(0,t_.Gc)(),T=k("policyId"),{data:K}=(0,t7._U)({policyId:T||void 0}),et=null!==(g=null==K?void 0:K.items.filter(m=>!!m.last_claim_history&&!m.original_claim_id))&&void 0!==g?g:[],handleSelectClaim=m=>{E("originalClaimId",m),x()};return(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"\xbfEvento nuevo o relacionado?"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"\xbfEste gasto se vincula con alg\xfan reembolso anterior?"})]}),(0,eC.jsx)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4",children:(0,eC.jsxs)("div",{className:"space-y-3",children:[(0,eC.jsxs)("button",{onClick:()=>{E("originalClaimId",null),x()},className:(0,tc.cn)("w-full flex items-center gap-4 p-4 rounded-xl border-2 border-blue-500","bg-blue-50 hover:bg-blue-100 active:bg-blue-150 transition-all text-left"),children:[(0,eC.jsx)("div",{className:"w-11 h-11 bg-blue-500 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,eC.jsx)(nc,{className:"w-6 h-6 text-white"})}),(0,eC.jsxs)("div",{className:"flex-1",children:[(0,eC.jsx)("p",{className:"font-semibold text-blue-600",children:"Es un nuevo evento"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500",children:"Iniciar un reembolso desde cero"})]}),(0,eC.jsx)(ts.Z,{className:"w-5 h-5 text-blue-500"})]}),et.length>0&&(0,eC.jsxs)(eC.Fragment,{children:[(0,eC.jsxs)("div",{className:"relative py-3",children:[(0,eC.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,eC.jsx)("div",{className:"w-full border-t border-gray-200"})}),(0,eC.jsx)("div",{className:"relative flex justify-center",children:(0,eC.jsx)("span",{className:"bg-white px-3 text-sm text-gray-500",children:"o vinc\xfalalo con"})})]}),et.map(m=>{let g=(0,tB.mn)(m.claim_date);return(0,eC.jsxs)("button",{onClick:()=>handleSelectClaim(m.id),className:(0,tc.cn)("w-full flex items-center gap-4 p-4 rounded-xl border border-gray-200","hover:border-gray-300 hover:bg-gray-50 active:bg-gray-100 transition-all text-left"),children:[(0,eC.jsx)("div",{className:"w-11 h-11 bg-gray-100 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,eC.jsx)(t1.Z,{className:"w-5 h-5 text-gray-500"})}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsx)("p",{className:"font-medium text-gray-900",children:m.claim_int?"Siniestro #".concat(m.claim_int):"Reembolso"}),(0,eC.jsxs)("p",{className:"text-sm text-gray-500 truncate",children:[m.reason||"Sin diagn\xf3stico"," \xb7 ",g]})]}),(0,eC.jsx)(ts.Z,{className:"w-5 h-5 text-gray-400"})]},m.id)})]})]})})]})}var nd=v(28416);let np={accidents:["accident"],accidents_and_illnesses:["accident","sickness"],petplanv1:["accident","sickness"],vaccines:["preventive-vaccines"],preventive_exams:["preventive-exams"],preventive_consultations:["preventive-consultation"],teleconsultations:["preventive-teleconsultation"],chip_posture:["preventive-chip-installation"],complementary_treatments:["complementary-therapy"],liability:["liability"]},nm={accident:"/static/icons/claims/broken-bone.svg",sickness:"/static/icons/claims/measure-device.svg","complementary-therapy":"/static/icons/claims/lotus-flower.svg","preventive-vaccines":"/static/icons/claims/syringe.svg","preventive-exams":"/static/icons/claims/sample-tube.svg","preventive-consultation":"/static/icons/claims/dog-frame.svg","preventive-chip-installation":"/static/icons/claims/chip.svg","preventive-teleconsultation":"/static/icons/claims/laptop.svg",preventive:"/static/icons/claims/syringe.svg",liability:"/static/icons/claims/dog-jaw.svg"};function TypeOfClaimStep(m){let{policies:g,onNext:v}=m,{watch:x,setValue:k}=(0,t_.Gc)(),E=x("policyId"),T=x("originalClaimId"),[K,et]=(0,ek.useState)(null),[en,er]=(0,ek.useState)(!1),ei=g.find(m=>m.id===E),es=null==ei?void 0:ei.coverage_bundle,{data:el}=(0,t7._U)({policyId:E||void 0}),ec=(0,ek.useMemo)(()=>
6{if(!es)return["accident"];let m=new Set,g=[];for(let x of es.items){var v;for(let k of null!==(v=np[x.coverage.name])&&void 0!==v?v:[])m.has(k)||(m.add(k),g.push(k))}let x=["accident","sickness"];return[...x.filter(g=>m.has(g)),...g.filter(m=>!x.includes(m))]},[es]),checkForExistingClaims=m=>{if(!el)return!1;let g=(0,ns._m)(m),v=el.items.filter(m=>m.category===g&&m.id!==T);return v.some(m=>{var g;return(0,ns.xT)(null===(g=m.last_claim_history)||void 0===g?void 0:g.status_key)})},handleSelectCategory=m=>{if("liability"===m){er(!0);return}if(checkForExistingClaims(m)){et("Ya tienes un reembolso en proceso, espera a que se resuelva para crear otro. Si te falt\xf3 subir algo no te preocupes. Cuando se cierre este, podr\xe1s solicitar uno nuevo asociado al mismo evento.");return}et(null),k("category",m),v(m)};return(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4",children:[K&&(0,eC.jsxs)("div",{className:"mb-4 p-3 bg-amber-50 border border-amber-200 rounded-xl flex items-start gap-2",children:[(0,eC.jsx)(tv.Z,{className:"w-5 h-5 text-amber-500 flex-shrink-0"}),(0,eC.jsx)("p",{className:"text-sm text-amber-700",children:K})]}),(0,eC.jsx)("div",{className:"space-y-2",children:ec.map(m=>{let g=nm[m];return(0,eC.jsxs)("button",{onClick:()=>handleSelectCategory(m),className:"w-full flex items-center gap-3 p-3 sm:p-4 rounded-xl border border-gray-200 hover:border-blue-300 hover:bg-blue-50/50 active:bg-blue-100 transition-all text-left",children:[(0,eC.jsx)("div",{className:"w-11 h-11 rounded-xl bg-blue-50 flex items-center justify-center flex-shrink-0",children:(0,eC.jsx)(t6(),{src:g,alt:ns.sY[m],width:24,height:24})}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsx)("p",{className:"font-medium text-sm text-gray-900",children:ns.sY[m]}),(0,eC.jsx)("p",{className:"text-xs text-gray-500 truncate",children:ns.Yi[m]})]}),(0,eC.jsx)(ts.Z,{className:"w-5 h-5 text-gray-400 flex-shrink-0"})]},m)})})]}),(0,eC.jsx)(eD.Vq,{open:en,onOpenChange:er,children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-md",children:[(0,eC.jsx)(eD.fK,{children:(0,eC.jsx)(eD.$N,{children:"Responsabilidad civil"})}),(0,eC.jsx)("p",{className:"text-sm text-gray-600",children:"Para este tipo de siniestro, por favor cont\xe1ctate directamente con soporte."}),(0,eC.jsx)(eD.cN,{children:(0,eC.jsxs)(eP.z,{onClick:()=>{(0,eT.D)("showNewMessage","Hola, quiero ingresar un siniestro de responsabilidad civil."),er(!1)},className:"w-full sm:w-auto",children:[(0,eC.jsx)(nd.Z,{className:"w-4 h-4 mr-2"}),"Contactar soporte"]})})]})})]})}let nf=(0,tp.Z)("face-slightly-smiling",[["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M9 10V9",key:"1lazqi"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ng=v(80534),nv=v(37813);let ny={better:nf,same:ng.Z,worse:e7.Z,deceased:nv.Z},nb={better:{bg:"bg-emerald-100",icon:"text-emerald-600",hover:"hover:border-emerald-300 hover:bg-emerald-50"},same:{bg:"bg-amber-100",icon:"text-amber-600",hover:"hover:border-amber-300 hover:bg-amber-50"},worse:{bg:"bg-orange-100",icon:"text-orange-600",hover:"hover:border-orange-300 hover:bg-orange-50"},deceased:{bg:"bg-gray-100",icon:"text-gray-500",hover:"hover:border-gray-300 hover:bg-gray-50"}},nx={better:{title:"Nos alegra saber eso",message:"Es muy bueno saber que est\xe1 mejorando. Continuemos con tu solicitud."},same:{title:"Esperamos que mejore pronto",message:"Sabemos que puede ser un momento dif\xedcil. Estamos aqu\xed para ayudarte."},worse:{title:"Lamentamos mucho escuchar eso",message:"Entendemos que este es un momento muy dif\xedcil para ti y tu familia. Haremos todo lo posible para agilizar tu solicitud."},deceased:{title:"Nuestras m\xe1s sinceras condolencias",message:"Sabemos que perder a un miembro de la familia es incre\xedblemente doloroso. Lamentamos profundamente tu p\xe9rdida. Estamos aqu\xed para apoyarte y facilitarte este proceso."}};function SeverityStep(m){let{onNext:g}=m,{watch:v,setValue:x}=(0,t_.Gc)(),k=v("petName"),[E,T]=(0,ek.useState)(null),[K,et]=(0,ek.useState)(!1),handleSelectSeverity=m=>{T(m),x("severity",m),"worse"===m||"deceased"===m?et(!0):g()};if(K&&E){let m=nx[E],v="deceased"===E;return(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6 py-8",children:[(0,eC.jsx)("div",{className:(0,tc.cn)("w-16 h-16 rounded-full flex items-center justify-center mb-6",v?"bg-gray-100":"bg-orange-100"),children:(0,eC.jsx)(nv.Z,{className:(0,tc.cn)("w-8 h-8",v?"text-gray-500":"text-orange-500")})}),(0,eC.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-3",children:m.title}),(0,eC.jsx)("p",{className:"text-gray-600 max-w-sm leading-relaxed text-balance",children:m.message})]}),(0,eC.jsx)("div",{className:"flex-shrink-0 px-4 sm:px-6 py-4 bg-white border-t border-gray-100",children:(0,eC.jsx)(eP.z,{onClick:()=>{g()},variant:"brand",size:"full",children:"Continuar"})})]})}return(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Estado de salud"}),(0,eC.jsxs)("p",{className:"text-sm text-gray-500 mt-0.5",children:["\xbfC\xf3mo se encuentra ",(0,eC.jsx)("span",{className:"font-medium text-gray-700",children:k})," actualmente?"]})]}),(0,eC.jsx)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4",children:(0,eC.jsx)("div",{className:"space-y-2",children:ns.og.map(m=>{let{value:g,label:v}=m,x=ny[g],k=nb[g];return(0,eC.jsxs)("button",{onClick:()=>handleSelectSeverity(g),className:(0,tc.cn)("w-full flex items-center gap-4 p-4 rounded-xl border border-gray-200 transition-all text-left",k.hover),children:[(0,eC.jsx)("div",{className:(0,tc.cn)("w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0",k.bg),children:(0,eC.jsx)(x,{className:(0,tc.cn)("w-5 h-5",k.icon)})}),(0,eC.jsx)("div",{className:"flex-1",children:(0,eC.jsx)("p",{className:"font-medium text-gray-900",children:v})}),(0,eC.jsx)(ts.Z,{className:"w-5 h-5 text-gray-400"})]},g)})})})]})}var n_=v(28836),nw=v(23551),nS=v(21524),nC=v(52284);let nk=[{value:0,label:"Enero"},{value:1,label:"Febrero"},{value:2,label:"Marzo"},{value:3,label:"Abril"},{value:4,label:"Mayo"},{value:5,label:"Junio"},{value:6,label:"Julio"},{value:7,label:"Agosto"},{value:8,label:"Septiembre"},{value:9,label:"Octubre"},{value:10,label:"Noviembre"},{value:11,label:"Diciembre"}];function getDaysInMonth(m,g){return new Date(g,m+1,0).getDate()}function EventDateStep(m){var g;let{onNext:v}=m,{watch:x,setValue:k}=(0,t_.Gc)(),E=x("policyId"),T=x("category"),K=x("originalClaimId"),et=x("severity"),en=x("reimbursableItems"),er=eW()(),[ei,es]=(0,ek.useState)(er.date()),[el,ec]=(0,ek.useState)(er.month()),[eu,ed]=(0,ek.useState)(er.year()),[ep,em]=(0,ek.useState)(null),ef=(0,n_.P7)(),eh=Array.from({length:3},(m,g)=>er.year()-g),eg=getDaysInMonth(el,eu),ev=Array.from({length:eg},(m,g)=>g+1),handleContinue=async()=>{let m=eW()(new Date(eu,el,ei));if(m.isAfter(er)){em("La fecha no puede ser futura");return}if(!E||!T){em("Faltan datos para crear el reembolso");return}em(null);let g=m.format("YYYY-MM-DD");k("eventDate",g);try{let m=await ef.mutateAsync({policyId:E,category:(0,ns._m)(T),eventDate:g,originalClaimId:K||void 0,reimbursableItems:en.length>0?en:["general"],severityLevel:et||void 0});k("claimId",m.id),(0,nS.j)(nw.Mb,{claim_id:m.id,policy_id:m.policy_id,claim_type:(0,nC.d$)(T),is_addendum:!!K}),v()}catch(g){let{message:m}=(0,e2.EV)(g,"Error al crear el reembolso");em(m)}},ey=ef.isLoading;return(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Fecha del evento"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:K?"\xbfCu\xe1ndo ocurri\xf3 este nuevo gasto?":T&&(0,ns.Ve)(T)?"\xbfCu\xe1ndo ocurri\xf3?":"preventive-exams"===T?"\xbfCu\xe1ndo le hiciste los ex\xe1menes?":"\xbfCu\xe1ndo notaste los primeros s\xedntomas?"})]}),(0,eC.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-6",children:[ep&&(0,eC.jsxs)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-xl flex items-start gap-2",children:[(0,eC.jsx)(tv.Z,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),(0,eC.jsx)("p",{className:"text-sm text-red-700",children:ep})]}),(0,eC.jsxs)("div",{className:"grid grid-cols-3 gap-3 max-w-md mx-auto",children:[(0,eC.jsxs)("div",{children:[(0,eC.jsx)("label",{className:"block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"D\xeda"}),(0,eC.jsx)("select",{value:ei,onChange:m=>es(Number(m.target.value)),className:"w-full px-3 py-3 border border-gray-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-center text-base font-medium",children:ev.map(m=>(0,eC.jsx)("option",{value:m,children:m},m))})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("label",{className:"block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Mes"}),(0,eC.jsx)("select",{value:el,onChange:m=>{let g=Number(m.target.value);ec(g);let v=getDaysInMonth(g,eu);ei>v&&es(v)},className:"w-full px-3 py-3 border border-gray-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-center text-base font-medium",children:nk.map(m=>(0,eC.jsx)("option",{value:m.value,children:m.label},m.value))})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("label",{className:"block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"A\xf1o"}),(0,eC.jsx)("select",{value:eu,onChange:m=>{let g=Number(m.target.value);ed(g);let v=getDaysInMonth(el,g);ei>v&&es(v)},className:"w-full px-3 py-3 border border-gray-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-center text-base font-medium",children:eh.map(m=>(0,eC.jsx)("option",{value:m,children:m},m))})]})]}),(0,eC.jsx)("div",{className:"mt-6 text-center",children:(0,eC.jsxs)("p",{className:"text-lg font-medium text-gray-700",children:[ei," de ",null===(g=nk.find(m=>m.value===el))||void 0===g?void 0:g.label,", ",eu]})})]}),(0,eC.jsx)("div",{className:"flex-shrink-0 px-4 sm:px-6 py-4 bg-white border-t border-gray-100",children:(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>void handleContinue(),disabled:ey,loading:ey,size:"full",children:"Continuar"})})]})}var nE=v(59507),nj=v(32301);let nN=(0,tp.Z)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var nR=v(97501);function VideoDeclarationStep(m){let{onNext:g}=m,{watch:v}=(0,t_.Gc)(),x=v("category"),k=v("severity"),E=v("claimId"),[T,K]=(0,ek.useState)(null),[et,en]=(0,ek.useState)("idle"),[er,ei]=(0,ek.useState)(null),[es,el]=(0,ek.useState)(null),[ec,eu]=(0,ek.useState)(""),[ed,ep]=(0,ek.useState)(null),[em,ef]=(0,ek.useState)(0),eh=(0,ek.useRef)(null),eg=(0,ek.useRef)(null),ev=(0,ek.useRef)(null),ey=(0,ek.useRef)(null),eb=(0,ek.useRef)([]),ex=(0,ek.useRef)(null),e_=(0,n_.Mg)(),ew=(0,n_.uf)(),eS=(0,n_.ST)(),eE=x?getVideoRequirement
6(x,k):"disabled",ej=!!x&&allowsWrittenDeclaration(x,k),eN=!!x&&"disabled"!==getVideoRequirement(x,k),eR="optional"===eE;(0,ek.useEffect)(()=>()=>{eI(),ex.current&&clearInterval(ex.current),es&&URL.revokeObjectURL(es)},[es]),(0,ek.useEffect)(()=>{let assignStream=async()=>{if("ready"===et&&ey.current&&eh.current){eh.current.srcObject=ey.current;try{await eh.current.play()}catch(m){}}};assignStream()},[et]);let eI=(0,ek.useCallback)(()=>{ey.current&&(ey.current.getTracks().forEach(m=>m.stop()),ey.current=null)},[]),eT=(0,ek.useCallback)(async()=>{ep(null),en("requesting");try{let m=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:640},height:{ideal:480}},audio:!0});ey.current=m,eh.current&&(eh.current.srcObject=m),en("ready")}catch(m){ep("No se pudo acceder a la c\xe1mara. Verifica los permisos del navegador."),en("idle")}},[]),eO=(0,ek.useCallback)(()=>{if(!ey.current)return;eb.current=[],ef(0);let m=MediaRecorder.isTypeSupported("video/webm;codecs=vp9")?"video/webm;codecs=vp9":"video/webm",g=new MediaRecorder(ey.current,{mimeType:m});ev.current=g,g.ondataavailable=m=>{m.data.size>0&&eb.current.push(m.data)},g.onstop=()=>{let m=new Blob(eb.current,{type:"video/webm"}),g=URL.createObjectURL(m);ei(m),el(g),eI(),en("recorded")},g.start(1e3),en("recording"),ex.current=setInterval(()=>{ef(m=>m>=59?(eA(),60):m+1)},1e3)},[eI]),eA=(0,ek.useCallback)(()=>{ev.current&&"recording"===ev.current.state&&ev.current.stop(),ex.current&&(clearInterval(ex.current),ex.current=null)},[]),eM=(0,ek.useCallback)(()=>{es&&URL.revokeObjectURL(es),ei(null),el(null),en("idle"),ef(0)},[es]),uploadVideo=async()=>{if(er&&E){ep(null),en("uploading");try{let m=await e_.mutateAsync({claimId:E,fileName:"videos/video.webm"}),v=new File([er],"video.webm",{type:"video/webm"}),{s3Key:x}=await ew.mutateAsync({url:m.url,fields:m.fields,file:v}),k=m.s3_key||x;await eS.mutateAsync({claimId:E,videoDescriptionKey:null!=k?k:m.fields.key}),en("uploaded"),(0,nS.j)(nw.JS,{claim_id:E,step:"statement",method:"video"}),g()}catch(m){ep(m instanceof Error?m.message:"Error al subir el video"),en("recorded")}}},submitDeclaration=async()=>{if(ec.trim()&&E){ep(null);try{await eS.mutateAsync({claimId:E,writtenDeclaration:ec.trim()}),(0,nS.j)(nw.JS,{claim_id:E,step:"statement",method:"written"}),g()}catch(m){ep(m instanceof Error?m.message:"Error al guardar la declaraci\xf3n")}}},formatTime=m=>{let g=Math.floor(m/60);return"".concat(g,":").concat((m%60).toString().padStart(2,"0"))},eD=eS.isLoading,eL="uploading"===et;return T?"text"===T?(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("button",{onClick:()=>K(null),className:"text-sm text-blue-500 hover:text-blue-600 font-medium mb-2",children:"← Cambiar m\xe9todo"}),(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Declaraci\xf3n escrita"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500",children:"Describe qu\xe9 pas\xf3 y qu\xe9 te dijo el veterinario"})]}),(0,eC.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4",children:[ed&&(0,eC.jsxs)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-xl flex items-start gap-2",children:[(0,eC.jsx)(tv.Z,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),(0,eC.jsx)("p",{className:"text-sm text-red-700",children:ed})]}),(0,eC.jsx)("textarea",{value:ec,onChange:m=>eu(m.target.value),placeholder:"Describe los s\xedntomas, tratamientos anteriores, y cualquier informaci\xf3n relevante del caso...",className:"w-full h-48 p-4 border border-gray-200 rounded-xl resize-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm"}),(0,eC.jsx)("p",{className:"text-xs text-gray-400 mt-2",children:"Esta informaci\xf3n ayudar\xe1 a procesar tu reembolso m\xe1s r\xe1pido."})]}),(0,eC.jsx)("div",{className:"flex-shrink-0 px-4 sm:px-6 py-4 bg-white border-t border-gray-100",children:(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>void submitDeclaration(),disabled:!ec.trim()||eD,loading:eD,size:"full",children:"Continuar"})})]}):(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:["idle"===et&&(0,eC.jsx)("button",{onClick:()=>K(null),className:"text-sm text-blue-500 hover:text-blue-600 font-medium mb-2",children:"← Cambiar m\xe9todo"}),(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Grabar video"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500",children:"M\xe1ximo 1 minuto cont\xe1ndonos qu\xe9 pas\xf3"})]}),(0,eC.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4",children:[ed&&(0,eC.jsxs)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-xl flex items-start gap-2",children:[(0,eC.jsx)(tv.Z,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),(0,eC.jsx)("p",{className:"text-sm text-red-700",children:ed})]}),(0,eC.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[300px]",children:["idle"===et&&(0,eC.jsxs)("div",{className:"text-center flex flex-col items-center justify-center",children:[(0,eC.jsx)("div",{className:"w-24 h-24 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,eC.jsx)(nE.Z,{className:"w-12 h-12 text-blue-500"})}),(0,eC.jsx)("p",{className:"text-gray-600 mb-4",children:"Activa la c\xe1mara para comenzar"}),(0,eC.jsx)(eP.z,{onClick:()=>void eT(),variant:"brand",children:"Activar c\xe1mara"})]}),"requesting"===et&&(0,eC.jsxs)("div",{className:"text-center",children:[(0,eC.jsx)("div",{className:"w-12 h-12 border-4 border-blue-500 border-t-transparent roun
6ded-full animate-spin mx-auto mb-4"}),(0,eC.jsx)("p",{className:"text-gray-600",children:"Solicitando acceso a la c\xe1mara..."})]}),("ready"===et||"recording"===et)&&(0,eC.jsx)("div",{className:"w-full max-w-md",children:(0,eC.jsxs)("div",{className:"relative rounded-2xl overflow-hidden bg-black aspect-video mb-4 shadow-lg",children:[(0,eC.jsx)("video",{ref:eh,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover transform scale-x-[-1]"}),"recording"===et&&(0,eC.jsxs)("div",{className:"absolute top-3 left-3 flex items-center gap-2 bg-red-600 text-white px-3 py-1.5 rounded-full shadow-lg",children:[(0,eC.jsx)("div",{className:"w-2 h-2 bg-white rounded-full animate-pulse"}),(0,eC.jsx)("span",{className:"text-sm font-semibold",children:formatTime(em)})]}),"ready"===et&&(0,eC.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,eC.jsx)("div",{className:"w-16 h-16 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center",children:(0,eC.jsx)(nj.Z,{className:"w-8 h-8 text-white ml-1"})})})]})}),"recorded"===et&&es&&(0,eC.jsx)("div",{className:"w-full max-w-md",children:(0,eC.jsxs)("div",{className:"relative rounded-2xl overflow-hidden bg-black aspect-video mb-4 shadow-lg",children:[(0,eC.jsx)("video",{ref:eg,src:es,controls:!0,playsInline:!0,autoPlay:!0,muted:!0,className:"w-full h-full object-contain"}),(0,eC.jsx)("div",{className:"absolute top-3 right-3",children:(0,eC.jsx)(tZ.Z,{className:"w-8 h-8 text-emerald-500 bg-white rounded-full shadow-lg"})})]})}),"uploading"===et&&(0,eC.jsxs)("div",{className:"text-center",children:[(0,eC.jsx)("div",{className:"w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),(0,eC.jsx)("p",{className:"text-gray-600",children:"Subiendo video..."})]})]})]}),(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 py-4 bg-white border-t border-gray-100 space-y-2",children:["ready"===et&&(0,eC.jsxs)(eP.z,{onClick:eO,variant:"brand",size:"full",children:[(0,eC.jsx)("div",{className:"w-3 h-3 bg-white rounded-full mr-2 inline-block"}),"Iniciar grabaci\xf3n"]}),"recording"===et&&(0,eC.jsxs)(eP.z,{onClick:eA,variant:"brand-destructive",size:"full",children:[(0,eC.jsx)(nN,{className:"w-5 h-5 mr-2 inline-block"}),"Detener (",formatTime(60-em)," restantes)"]}),"recorded"===et&&(0,eC.jsxs)(eC.Fragment,{children:[(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>void uploadVideo(),disabled:eL,loading:eL,size:"full",children:"Usar este video"}),(0,eC.jsxs)(eP.z,{onClick:eM,disabled:eL,variant:"brand-outline",size:"full",children:[(0,eC.jsx)(nR.Z,{className:"w-5 h-5 mr-2 inline-block"}),"Grabar de nuevo"]})]})]})]}):(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Cu\xe9ntanos qu\xe9 pas\xf3"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:eR?"Elige c\xf3mo prefieres contarnos sobre el caso":eN?"Graba un video de m\xe1ximo 1 minuto":"Escribe una breve descripci\xf3n"})]}),(0,eC.jsx)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-6",children:(0,eC.jsxs)("div",{className:"space-y-4 max-w-md mx-auto",children:[eN&&(0,eC.jsx)("button",{onClick:()=>K("video"),className:"w-full p-5 bg-white border-2 border-gray-200 rounded-2xl hover:border-blue-400 hover:bg-blue-50/50 transition-all group text-left",children:(0,eC.jsxs)("div",{className:"flex items-center gap-4",children:[(0,eC.jsx)("div",{className:"w-14 h-14 rounded-xl bg-blue-100 flex items-center justify-center group-hover:bg-blue-200 transition-colors",children:(0,eC.jsx)(nE.Z,{className:"w-7 h-7 text-blue-500"})}),(0,eC.jsxs)("div",{className:"flex-1",children:[(0,eC.jsx)("p",{className:"font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:"Grabar video"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"M\xe1ximo 1 minuto"})]}),eR&&(0,eC.jsx)("span",{className:"text-xs text-blue-500 font-medium bg-blue-100 px-2 py-1 rounded-full",children:"Opcional"})]})}),ej&&eN&&(0,eC.jsxs)("div",{className:"flex items-center gap-4 px-4",children:[(0,eC.jsx)("div",{className:"flex-1 h-px bg-gray-200"}),(0,eC.jsx)("span",{className:"text-gray-400 text-sm font-medium",children:"o"}),(0,eC.jsx)("div",{className:"flex-1 h-px bg-gray-200"})]}),ej&&(0,eC.jsx)("button",{onClick:()=>K("text"),className:"w-full p-5 bg-white border-2 border-gray-200 rounded-2xl hover:border-gray-400 hover:bg-gray-50 transition-all group text-left",children:(0,eC.jsxs)("div",{className:"flex items-center gap-4",children:[(0,eC.jsx)("div",{className:"w-14 h-14 roun
6ded-xl bg-gray-100 flex items-center justify-center group-hover:bg-gray-200 transition-colors",children:(0,eC.jsx)(t1.Z,{className:"w-7 h-7 text-gray-600"})}),(0,eC.jsxs)("div",{className:"flex-1",children:[(0,eC.jsx)("p",{className:"font-semibold text-gray-900",children:"Declaraci\xf3n escrita"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"Describe brevemente qu\xe9 pas\xf3"})]}),eR&&(0,eC.jsx)("span",{className:"text-xs text-gray-500 font-medium bg-gray-100 px-2 py-1 rounded-full",children:"Opcional"})]})})]})})]})}var nI=v(48328),nP=v(37228);function RequirementCard(m){let{item:g,badge:v,index:x}=m,k="diagnosis"===g.type||"budget"===g.type,E="diagnosis"===g.type?"/static/informe_clinico.pdf":"budget"===g.type?"/static/presupuesto.pdf":null;return(0,eC.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[(0,eC.jsxs)("div",{className:"flex items-start gap-3",children:[(0,eC.jsx)("span",{className:(0,tc.cn)("w-6 h-6 rounded-full text-white text-xs font-bold flex items-center justify-center flex-shrink-0","Obligatorio"===v?"bg-pink-500":"Recomendado"===v?"bg-blue-500":"bg-gray-400"),children:x}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[(0,eC.jsx)("span",{className:"font-medium text-gray-900 text-sm",children:g.label}),(0,eC.jsx)("span",{className:(0,tc.cn)("text-2xs px-1.5 py-0.5 rounded-full font-semibold","Obligatorio"===v?"bg-pink-100 text-pink-700":"Recomendado"===v?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-500"),children:v})]}),(0,eC.jsx)("p",{className:"text-xs text-gray-500",children:g.description}),g.conditionalNote&&(0,eC.jsx)("p",{className:"text-xs text-amber-700 mt-1.5 p-2 rounded-lg bg-amber-50",children:g.conditionalNote})]})]}),k&&E&&(0,eC.jsx)("div",{className:"flex items-center justify-center mt-3 pt-3 border-t border-gray-100",children:(0,eC.jsx)(eP.z,{onClick:()=>{E&&window.open(E,"_blank")},variant:"brand-ghost",size:"sm",iconLeft:(0,eC.jsx)(t3.Z,{className:"w-4 h-4"}),children:"Descargar plantilla"})})]})}function DocumentsInfoStep(m){var g;let v,{onNext:x}=m,{watch:k}=(0,t_.Gc)(),E=k("category");if(!E)throw Error("DocumentsInfoStep requires a category to be set. This is a programming error.");let T=(0,ek.useMemo)(()=>(0,nP.Q4)(E),[E]);return(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Documentos necesarios"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"Ten estos documentos listos para el siguiente paso"})]}),(0,eC.jsx)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4 space-y-3",children:(v=0,(0,eC.jsxs)(eC.Fragment,{children:[T.required.map(m=>(0,eC.jsx)(RequirementCard,{item:m,badge:"Obligatorio",index:++v},m.type)),null===(g=T.expected)||void 0===g?void 0:g.map(m=>(0,eC.jsx)(RequirementCard,{item:m,badge:"Recomendado",index:++v},m.type)),T.optional.map(m=>(0,eC.jsx)(RequirementCard,{item:m,badge:"Opcional",index:++v},m.type))]}))}),(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 py-4 bg-white border-t border-gray-100 space-y-3",children:[(0,eC.jsx)(nI.Z,{variant:"info",description:"Sube todos los documentos juntos. Nuestra IA los clasificar\xe1 autom\xe1ticamente."}),(0,eC.jsx)(eP.z,{onClick:x,variant:"brand",size:"full",children:"Continuar a subir documentos"})]})]})}var nT=v(35115),nO=v(59056),nA=v(66477);function BudgetLinkingModal(m){let{isOpen:g,onClose:v,receiptsNeedingBudget:x,budgets:k,links:E,onSave:T}=m,[K,et]=(0,ek.useState)(E),[en,er]=(0,ek.useState)(null);if(!g)return null;let handleLink=(m,g)=>{et(v=>({...v,[m]:g}))},handleUnlink=m=>{et(g=>{let v={...g};return delete v[m],v})},ei=x.filter(m=>!K[m.id]).length,es=0===ei,getLinkedBudget=m=>{let g=K[m];return k.find(m=>m.id===g)},isBudgetUsed=m=>Object.values(K).includes(m);return(0,eC.jsxs)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:[(0,eC.jsxs)("div",{className:"bg-white rounded-2xl w-full max-w-lg max-h-[90vh] overflow-hidden flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[(0,eC.jsxs)("div",{children:[(0,eC.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:"Vincular presupuestos"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"Selecciona un presupuesto para cada boleta"})]}),(0,eC.jsx)("button",{onClick:v,className:"p-2 rounded-lg hover:bg-gray-100 transition-colors",children:(0,eC.jsx)(to.Z,{className:"w-5 h-5 text-gray-500"})})]}),(0,eC.jsx)("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:x.map(m=>{let g=getLinkedBudget(m.id),v=!!g;return(0,eC.jsxs)("div",{className:(0,tc.cn)("rounded-xl border-2 p-4 transition-all",v?"border-green-200 bg-green-50":"border-gray-200 bg-white"),children:[(0,eC.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,eC.jsx)("div",{className:"relative",children:m.previewUrl?(0,eC.jsxs)("button",{onClick:()=>er(m),className:"w-16 h-16 rounded-lg overflow-hidden border border-gray-200 hover:border-blue-400 transition-colors relative group",children:[(0,eC.jsx)("img",{src:m.previewUrl,alt:m.filename,className:"w-full h-full object-cover"}),(0,eC.jsx)("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,eC.jsx)(nO.Z,{className:"w-6 h-6 text-white"})})]}):(0,eC.jsx)("div",{className:"w-16 h-16 rounded-lg bg-gray-100 flex items-center justify-center",children:(0,eC.jsx)(t1.Z,{className:"w-6 h-6 text-gray-400"})})}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase",children:"Boleta"}),(0,eC.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:m.filename})]}),v&&(0,eC.jsx)(tZ.Z,{className:"w-6 h-6 text-green-500 flex-shrink-0"})]}),v?(0,eC.jsx)("div",{className:"bg-green-100 rounded-lg p-3",children:(0,eC.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eC.jsx)(nA.Z,{className:"w-4 h-4 text-green-600"}),(0,eC.jsxs)("span",{className:"text-sm font-medium text-green-800",children:["Vinculado a: ",g.f
6ilename]})]}),(0,eC.jsx)("button",{onClick:()=>handleUnlink(m.id),className:"text-xs text-red-600 hover:text-red-700 font-medium",children:"Desvincular"})]})}):(0,eC.jsxs)("div",{children:[(0,eC.jsx)("p",{className:"text-xs font-medium text-gray-500 mb-2",children:"Selecciona un presupuesto:"}),(0,eC.jsx)("div",{className:"space-y-2",children:k.map(g=>{let v=isBudgetUsed(g.id),x=K[m.id]===g.id;return(0,eC.jsxs)("button",{onClick:()=>!v&&handleLink(m.id,g.id),disabled:v&&!x,className:(0,tc.cn)("w-full flex items-center gap-3 p-3 rounded-lg border-2 transition-all text-left",x?"border-blue-500 bg-blue-50":v?"border-gray-100 bg-gray-50 opacity-50 cursor-not-allowed":"border-gray-200 hover:border-blue-300 hover:bg-blue-50"),children:[(0,eC.jsx)("div",{className:(0,tc.cn)("w-5 h-5 rounded-full border-2 flex items-center justify-center flex-shrink-0",x?"border-blue-500 bg-blue-500":"border-gray-300"),children:x&&(0,eC.jsx)("svg",{className:"w-3 h-3 text-white",viewBox:"0 0 12 12",children:(0,eC.jsx)("path",{fill:"currentColor",d:"M10.28 2.28L4.5 8.06 1.72 5.28a1 1 0 00-1.44 1.44l3.5 3.5a1 1 0 001.44 0l6.5-6.5a1 1 0 00-1.44-1.44z"})})}),g.previewUrl?(0,eC.jsx)("div",{className:"relative",children:(0,eC.jsx)("img",{src:g.previewUrl,alt:g.filename,className:"w-12 h-12 rounded-lg object-cover border border-gray-200"})}):(0,eC.jsx)("div",{className:"w-12 h-12 rounded-lg bg-gray-100 flex items-center justify-center",children:(0,eC.jsx)(t1.Z,{className:"w-5 h-5 text-gray-400"})}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:g.filename}),v&&!x&&(0,eC.jsx)("p",{className:"text-xs text-gray-400",children:"Ya vinculado"})]}),g.previewUrl&&(0,eC.jsx)("button",{onClick:m=>{m.stopPropagation(),er(g)},className:"p-1.5 rounded-lg hover:bg-gray-200 transition-colors flex-shrink-0",title:"Ver presupuesto",children:(0,eC.jsx)(nO.Z,{className:"w-4 h-4 text-gray-500"})})]},g.id)})})]})]},m.id)})}),(0,eC.jsxs)("div",{className:"p-4 border-t border-gray-200 space-y-3",children:[es?(0,eC.jsxs)("div",{className:"flex items-center gap-2 text-green-700 bg-green-50 rounded-lg px-3 py-2",children:[(0,eC.jsx)(tZ.Z,{className:"w-5 h-5"}),(0,eC.jsx)("span",{className:"text-sm font-medium",children:"Todos los presupuestos han sido vinculados"})]}):(0,eC.jsx)("div",{className:"flex items-center gap-2 text-amber-700 bg-amber-50 rounded-lg px-3 py-2",children:(0,eC.jsxs)("span",{className:"text-sm",children:["Faltan ",ei," boleta",1!==ei?"s":""," por vincular"]})}),(0,eC.jsxs)("div",{className:"flex gap-2",children:[(0,eC.jsx)(eP.z,{onClick:v,variant:"brand-outline",size:"full",children:"Cancelar"}),(0,eC.jsx)(eP.z,{onClick:()=>{T(K),v()},disabled:!es,variant:"brand",size:"full",children:"Guardar"})]})]})]}),en&&en.previewUrl&&(0,eC.jsx)(nT.Z,{isOpen:!0,onClose:()=>er(null),imageUrl:en.previewUrl,imageName:en.filename})]})}var nM=v(69405),nD=v(68093);let nL=e0.Ry({processing_id:e0.Z_(),status:e0.Km(["processing","completed","failed"]),global_validation_errors:e0.IX(e0.Z_()),documents:e0.IX(e0.Ry({file_id:e0.Z_().optional(),file_type:e0.Z_().optional(),confidence:e0.Rx().optional(),needs_budget:e0.O7().optional(),s3_key:e0.Z_().nullish(),validation_errors:e0.IX(e0.Z_()).optional()}))}),nF={receipt:"Boleta",budget:"Presupuesto",diagnosis:"Informe cl\xednico",prescription:"Receta",exam:"Examen","exam-results":"Examen","exam-prescription":"Orden m\xe9dica","vaccination-card":"Carnet vacunas",other:"Documento"},nZ={receipt:"receipt",budget:"budget",diagnosis:"diagnosis",prescription:"prescription","exam-results":"extra-documents","exam-prescription":"exam-prescription","vaccination-card":"vaccination-card",other:"extra-documents",unknown:"extra-documents"},nB=[{value:"receipt",label:"Boleta"},{value:"budget",label:"Presupuesto"},{value:"diagnosis",label:"Informe cl\xednico"},{value:"prescription",label:"Receta"},{value:"exam-prescription",label:"Orden m\xe9dica"},{value:"exam-results",label:"Resultados de examen"},{value:"vaccination-card",label:"Carnet de vacunaci\xf3n"},{value:"other",label:"Otro documento"}];function isImageFile(m){var g,v;let x=null!==(v=null==m?void 0:m.split("?")[0])&&void 0!==v?v:"",k=(null===(g=x.split(".").pop())||void 0===g?void 0:g.toLowerCase())||"";return["jpg","jpeg","png","gif","webp","heic","heif"].includes(k)}function DocumentsStep(m){var g;let{onNext:v}=m,{watch:x}=(0,t_.Gc)(),k=x("claimId"),E=x("category");if(!E)throw Error("DocumentsStep requires a category to be set. This is a programming error.");let{data:T,refetch:K}=(0,t7.GH)(null!=k?k:void 0),[et,en]=(0,ek.useState)([]),[er,ei]=(0,ek.useState)([]),[es,el]=(0,ek.useState)(!1),[ec,eu]=(0,ek.useState)(null),[ed,ep]=(0,ek.useState)(!1),[em,ef]=(0,ek.useState)(null),[eh,eg]=(0,ek.useState)(null),[ev,ey]=(0,ek.useState)({}),[eb,ex]=(0,ek.useState)(!1),e_=(0,ek.useRef)(null),ew=(0,ek.useRef)(null),eS=(0,ek.useRef)(null),eE=(0,ek.useRef)(!1),ej=(0,ek.useRef)(0),eN=(0,n_.Mg)(),eR=(0,n_.uf)(),eI=(0,n_.Zw)(),eT=(0,n_.Qd)(),eO=(0,n_.kF)();(0,ek.useEffect)(()=>{(()=>{if(!T)return;let m=T.documents.map(m=>{var g;return{id:m.id,document:m.document_url,document_name:m.document_name,file_description:null!==(g=m.file_type)&&void 0!==g?g:"other",needs_budget:m.needs_budget,linked_budget_document_id:m.linked_budget_document_id}});ei(m)})()},[T]);let eA=(0,ek.useMemo)(()=>(0,nP.Q4)(E),[E]),eM=(0,ek.useMemo)(()=>{let m={receipt:0,budget:0,diagnosis:0,prescription:0,"exam-results":0,"exam-prescription":0,"vaccination-card":0,"extra-documents":0};return er.forEach(g=>{let v=(0,nP.JD)(g.file_description);v&&v in m&&m[v]++}),et.filter(m=>"analyzed"===m.status&&m.predictedType).forEach(g=>{let v=(0,nP.JD)(g.predictedType);v&&v in m&&m[v]++}),m},[et,er]),eD=(0,ek.useCallback)(m=>eM[m]>0,[eM]),eL=(0,ek.useMemo)(()=>eA.required.filter(m=>!eD(m.type)),[eA.required,eD]),eF=(0,ek.useMemo)(()=>et.filter(m=>"analyzed"===m.status&&"receipt"===m.predictedType&&!0===m.needsBudget),[et]),eZ=(0,ek.useMemo)(()=>et.filter(m=>"analyzed"===m.status&&"budget"===m.predictedType),[et]),eB=(0,ek.useMemo)(()=>er.filter(m=>
6"budget"===m.file_description),[er]),e$=eF.length>0&&eZ.length>0,eU=eF.length>0&&eZ.length+eB.length===0,ez=(0,ek.useMemo)(()=>0===eF.length||0!==eZ.length&&eF.every(m=>{let g=ev[m.id];return g&&eZ.some(m=>m.id===g)}),[eF,eZ,ev]),eq=(0,ek.useRef)([]);eq.current=et,(0,ek.useEffect)(()=>()=>{ej.current+=1,ew.current&&(clearTimeout(ew.current),ew.current=null),eS.current&&(clearTimeout(eS.current),eS.current=null),eq.current.forEach(m=>{m.previewUrl&&URL.revokeObjectURL(m.previewUrl)})},[k]);let eH=(0,ek.useCallback)(async m=>{if(!m||!k)return;let getFileSignature=m=>"".concat(m.name,"-").concat(m.size),g=new Set([...et.map(m=>getFileSignature(m.file))]),v=new Set([...er.map(m=>m.document_name||"")]),x=[],E=[];Array.from(m).forEach(m=>{let k=getFileSignature(m);g.has(k)?x.push(m.name):v.has(m.name)?x.push(m.name):(E.push(m),g.add(k),v.add(m.name))});let T=Math.max(0,30-et.length),K=E.slice(0,T),ei=E.length-K.length,es=[];if(x.length>0){let m=Array.from(new Set(x));1===m.length?es.push('El archivo "'.concat(m[0],'" ya fue agregado. Por favor, selecciona otro documento.')):es.push("Los siguientes archivos ya fueron agregados: ".concat(m.join(", "),". Por favor, selecciona otros documentos."))}if(0===T&&E.length>0?es.push("Puedes subir hasta ".concat(30," documentos por an\xe1lisis. Ya alcanzaste ese m\xe1ximo.")):ei>0&&es.push("Puedes subir hasta ".concat(30," documentos por an\xe1lisis. Se agregaron solo los primeros ").concat(K.length,".")),eu(es.length>0?es.join(" "):null),0===K.length){e_.current&&(e_.current.value="");return}let el=K.map(m=>({id:crypto.randomUUID(),file:m,status:"pending",previewUrl:isImageFile(m.name)?URL.createObjectURL(m):void 0}));for(let m of(en(m=>[...m,...el]),el))try{en(g=>g.map(g=>g.id===m.id?{...g,status:"uploading"}:g));let g=await eN.mutateAsync({claimId:k,fileName:m.file.name}),{s3Key:v}=await eR.mutateAsync({url:g.url,fields:g.fields,file:m.file});en(x=>x.map(x=>x.id===m.id?{...x,status:"uploaded",s3Key:g.s3_key||v}:x))}catch(g){(0,nS.j)(nw.Mt,{claim_id:k,stage:"upload",reason:(0,nC.bQ)(g)}),en(v=>v.map(v=>v.id===m.id?{...v,status:"error",error:g instanceof Error?g.message:"Error al subir"}:v))}e_.current&&(e_.current.value="")},[k,eN,eR,et,er]),eW=(0,ek.useCallback)(m=>{m.preventDefault(),eH(m.dataTransfer.files)},[eH]),eK=(0,ek.useCallback)(m=>{m.preventDefault()},[]),eG=(0,ek.useCallback)(m=>{en(g=>{let v=g.find(g=>g.id===m);return(null==v?void 0:v.previewUrl)&&URL.revokeObjectURL(v.previewUrl),g.filter(g=>g.id!==m)}),ey(g=>{let v={};return Object.entries(g).forEach(g=>{let[x,k]=g;x!==m&&k!==m&&(v[x]=k)}),v})},[]),eQ=(0,ek.useCallback)((m,g)=>{en(v=>v.map(v=>v.id===m?{...v,predictedType:g,status:"analyzed"}:v)),"receipt"!==g&&ey(g=>{let v={...g};return delete v[m],v}),"budget"!==g&&ey(g=>{let v={};return Object.entries(g).forEach(g=>{let[x,k]=g;k!==m&&(v[x]=k)}),v})},[]),eY=(0,ek.useCallback)(m=>{ef(m)},[]),eX=(0,ek.useCallback)(()=>{ef(null)},[]),eJ=(0,ek.useCallback)((m,g)=>{g===ej.current&&k&&!eE.current&&(eE.current=!0,(0,nS.j)(nw.Mt,{claim_id:k,stage:"analysis",reason:m}))},[k]),e0=(0,ek.useCallback)(async(m,g)=>{if(g===ej.current&&k)try{let x=await (0,e1.h)(nL,{method:"GET",url:eV.Z.claims.v2.documents.analysisStatus(k,m)});if(g!==ej.current)return;let E=x.data;if("processing"===E.status){ew.current=setTimeout(()=>{e0(m,g)},2500);return}if(eS.current&&(clearTimeout(eS.current),eS.current=null),"completed"===E.status&&E.documents)en(m=>m.map(m=>{var g,v;if("analyzing"!==m.status)return m;let x=null===(g=E.documents)||void 0===g?void 0:g.find(g=>g.file_id===m.id);if(x){let g="unknown"===x.file_type?"other":x.file_type;return{...m,status:"analyzed",predictedType:g||"other",needsBudget:null!==(v=x.needs_budget)&&void 0!==v&&v}}return{...m,status:"analyzed",predictedType:"other",needsBudget:!1}})),el(!1);else if("failed"===E.status){var v;eJ("validation",g);let m=(null===(v=E.global_validation_errors)||void 0===v?void 0:v.join(", "))||"Error en el an\xe1lisis";eu(m),en(m=>m.map(m=>"analyzing"===m.status?{...m,status:"uploaded"}:m)),el(!1)}ej.current+=1}catch(m){if(g!==ej.current)return;eJ((0,nC.bQ)(m),g),ej.current+=1,eS.current&&(clearTimeout(eS.current),eS.current=null),eu("Error al verificar el estado del an\xe1lisis"),en(m=>m.map(m=>"analyzing"===m.status?{...m,status:"uploaded"}:m)),el(!1)}},[k,eJ]),e2=(0,ek.useCallback)(async()=>
6{if(!k)return;let m=et.filter(m=>"uploaded"===m.status&&m.s3Key);if(0===m.length)return;let g=++ej.current;ew.current&&(clearTimeout(ew.current),ew.current=null),eS.current&&(clearTimeout(eS.current),eS.current=null),el(!0),eu(null),eE.current=!1,en(m=>m.map(m=>"uploaded"===m.status?{...m,status:"analyzing"}:m)),eS.current=setTimeout(()=>{g===ej.current&&(eJ("timeout",g),ej.current+=1,eS.current=null,ew.current&&(clearTimeout(ew.current),ew.current=null),eu("El an\xe1lisis de documentos est\xe1 tomando m\xe1s tiempo del esperado"),en(m=>m.map(m=>"analyzing"===m.status?{...m,status:"uploaded"}:m)),el(!1))},9e4);try{let v=m.map(m=>({document_id:m.id,s3_key:m.s3Key})),x=await eI.mutateAsync({claimId:k,documents:v});if(g!==ej.current)return;e0(x.processing_id,g)}catch(v){if(g!==ej.current)return;eJ((0,nC.bQ)(v),g),ej.current+=1,eS.current&&(clearTimeout(eS.current),eS.current=null);let m="Error al iniciar an\xe1lisis";v instanceof Error&&(m=v.message,v.details&&(m+=" (".concat(JSON.stringify(v.details),")"))),eu(m),el(!1),en(m=>m.map(m=>"analyzing"===m.status?{...m,status:"uploaded"}:m))}},[k,et,eI,e0,eJ,9e4]),e3=(0,ek.useCallback)(()=>{en(m=>m.map(m=>"uploaded"===m.status?{...m,status:"analyzed",predictedType:""}:m)),eu(null)},[]),e5=(0,ek.useCallback)(async()=>{if(!k)return;let m=et.filter(m=>"analyzed"===m.status&&m.s3Key);if(0===m.length&&er.length>0){(0,nS.j)(nw.JS,{claim_id:k,step:"documents",document_count:er.length}),v();return}if(0!==m.length){ep(!0);try{let g=m.filter(m=>"receipt"===m.predictedType),x=m.filter(m=>"budget"===m.predictedType),E=m.filter(m=>"receipt"!==m.predictedType&&"budget"!==m.predictedType),T={};for(let m of g){let g=nZ[m.predictedType||"other"]||"extra-documents",v=await eT.mutateAsync({claimId:k,fileTypeCode:g,documentKey:m.s3Key,documentName:m.file.name,needsBudget:!0===m.needsBudget});T[m.id]=v.id}let et={};for(let m of x){let g=nZ[m.predictedType||"other"]||"extra-documents",v=await eT.mutateAsync({claimId:k,fileTypeCode:g,documentKey:m.s3Key,documentName:m.file.name});et[m.id]=v.id}for(let m of E){let g=nZ[m.predictedType||"other"]||"extra-documents";await eT.mutateAsync({claimId:k,fileTypeCode:g,documentKey:m.s3Key,documentName:m.file.name})}for(let[m,g]of Object.entries(ev)){let v=T[m],x=et[g];v&&x&&await eO.mutateAsync({claimId:k,documentId:v,budgetDocumentId:x})}await K(),(0,nS.j)(nw.JS,{claim_id:k,step:"documents",document_count:m.length+er.length}),v()}catch(m){(0,nS.j)(nw.Mt,{claim_id:k,stage:"save",reason:(0,nC.bQ)(m)}),eu(m instanceof Error?m.message:"Error al guardar documentos")}finally{ep(!1)}}},[k,et,er,eT,eO,v,ev,K]),e4=et.filter(m=>"uploaded"===m.status).length,e6=et.filter(m=>"analyzed"===m.status).length,e8=e4>0,e9=e6>0||er.length>0,tt=0===et.length||et.every(m=>"analyzed"===m.status||"error"===m.status),tn=et.filter(m=>"analyzed"===m.status).every(m=>m.predictedType&&""!==m.predictedType),tr=(0,ek.useMemo)(()=>{var m;let g=[];return eA.required.forEach(m=>g.push({type:m.type,label:m.label,badge:"Obligatorio"})),null===(m=eA.expected)||void 0===m||m.forEach(m=>g.push({type:m.type,label:m.label,badge:"Recomendado"})),eA.optional.forEach(m=>g.push({type:m.type,label:m.label,badge:"Opcional"})),g},[eA]),ts=tr.filter(m=>eM[m.type]>0).length,tl=tr.length,tu=eL.length>0||eU||e$&&!ez||!tt||!tn,td=!(g={hasBlockingIssues:tu,isAnalyzing:es,documentCount:et.length+er.length,allAnalyzedHaveType:tn,missingRequiredLabels:eL.map(m=>m.label),needsBudgetButNoBudgets:eU,needsBudgetLinking:e$&&!ez}).hasBlockingIssues||g.isAnalyzing?null:0===g.documentCount?"Agrega al menos un documento":g.allAnalyzedHaveType?g.missingRequiredLabels.length>0?"Falta: ".concat(g.missingRequiredLabels.join(", ")):g.needsBudgetButNoBudgets?"Sube el presupuesto de tu boleta":g.needsBudgetLinking?"Vincula los presupuestos":null:"Selecciona el tipo de cada documento";return(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-2 bg-white border-b border-gray-100",children:[(0,eC.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,eC.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eC.jsx)("div",{className:"flex items-center gap-1.5",children:tr.map(m=>(0,eC.jsx)("div",{className:(0,tc.cn)("w-2 h-2 rounded-full transition-colors",eM[m.type]>0?"bg-emerald-500":"bg-gray-200"),title:m.label},m.type))}),(0,eC.jsxs)("span",{className:"text-xs text-gray-500 font-medium",children:[ts,"/",tl]})]})}),(0,eC.jsx)("div",{className:"flex flex-wrap gap-1.5",children:tr.map(m=>{let g=eM[m.type],v=g>0;return(0,eC.jsxs)("span",{className:(0,tc.cn)("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium transition-colors",v?"bg-emerald-100 text-emerald-700":"Obligatorio"===m.badge?"bg-pink-50 text-pink-600 border border-pink-200":"Recomendado"===m.badge?"bg-blue-50 text-blue-600":"bg-gray-50 text-gray-500"),children:[v?(0,eC.jsx)(tZ.Z,{className:"w-3 h-3"}):"Obligatorio"===m.badge?(0,eC.jsx)(e7.Z,{className:"w-3 h-3"}):"Recomendado"===m.badge?(0,eC.jsx)(tv.Z,{className:"w-3 h-3"}):(0,eC.jsx)(nM.Z,{className:"w-3 h-3"}),m.label,g>1&&" (".concat(g,")")]},m.type)})})]}),(0,eC.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4",children:[et.length>0&&(0,eC.jsx)(nI.Z,{variant:"info",title:"Categorizaci\xf3n autom\xe1tica",description:"Usamos IA para categorizar tus documentos. Puedes editar el tipo si detectas un error. Si un documento aplica a dos categor\xedas, s\xfabelo dos veces.",className:"mb-4"}),(0,eC.jsxs)("div",{onDrop:eW,onDragOver:eK,onClick:()=>{var m;return null===(m=e_.current)||void 0===m?void 0:m.click()},className:(0,tc.cn)("relative rounded-xl p-6 text-center cursor-pointer transition-all border-2 border-dashed","hover:border-blue-400 hover:bg-blue-50/50",0===et.length?"border-gray-300 bg-gray-50/50 min-h-[140px]":"border-gray-200 bg-white"),children:[(0,eC.jsx)(nD.Z,{className:"w-8 h-8 text-gray-400 mx-auto mb-2"}),(0,eC.jsxs)("p",{className:"text-sm font-medium text-gray-700",children:[(0,eC.jsx)("span",{className:"text-blue-600",children:"Seleccionar archivos"})," o arrastra aqu\xed"]}),(0,eC.jsxs)("p",{className:"text-xs text-gray-400 mt-1",children:["PDF, JPG, PNG, HEIC/HEIF • M\xe1x 10MB • M\xe1ximo ",30," documentos por an\xe1lisis"]}),(0,eC.jsx)("input",{ref:e_,type:"file",multiple:!0,accept:".pdf,.jpg,.jpeg,.png,.heic,.heif,
6image/heic,image/heif",onChange:m=>void eH(m.target.files),className:"hidden"})]}),ec&&(0,eC.jsx)(nI.Z,{variant:"warning",title:"No pudimos analizar los documentos",description:ec,className:"mt-4",action:e8?{label:"Reintentar",onClick:()=>void e2()}:void 0,secondaryAction:e8?{label:"Categorizar manualmente",onClick:e3}:void 0}),er.length>0&&(0,eC.jsxs)("div",{className:"mt-4",children:[(0,eC.jsxs)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:["Guardados (",er.length,")"]}),(0,eC.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-2 -mx-1 px-1",children:er.map(m=>{var g;let v=null!==(g=nF[m.file_description])&&void 0!==g?g:m.file_description,x=m.document&&isImageFile(m.document);return(0,eC.jsxs)("button",{onClick:()=>eg(m),className:"w-16 h-20 flex-shrink-0 rounded-lg overflow-hidden border border-emerald-300 bg-emerald-50 hover:border-emerald-400 transition-all relative group",children:[x&&m.document?(0,eC.jsx)("img",{src:m.document,alt:v,className:"w-full h-full object-cover"}):(0,eC.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,eC.jsx)(t1.Z,{className:"w-6 h-6 text-emerald-500"})}),(0,eC.jsx)("div",{className:"absolute inset-x-0 bottom-0 bg-emerald-600/90 px-1 py-0.5",children:(0,eC.jsx)("p",{className:"text-2xs text-white truncate text-center font-medium",children:v})}),(0,eC.jsx)(tZ.Z,{className:"absolute top-1 right-1 w-4 h-4 text-emerald-500 bg-white rounded-full"})]},m.id)})})]}),et.length>0&&(0,eC.jsxs)("div",{className:"mt-4",children:[(0,eC.jsxs)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:["Nuevos (",et.length,")"]}),(0,eC.jsx)("div",{className:"space-y-2",children:et.map(m=>(0,eC.jsxs)("div",{className:(0,tc.cn)("flex items-center gap-3 p-3 rounded-xl border transition-all","error"===m.status?"border-red-200 bg-red-50":"analyzed"===m.status?"border-emerald-200 bg-emerald-50/50":"uploading"===m.status||"analyzing"===m.status?"border-blue-200 bg-blue-50/50":"border-gray-200 bg-white"),children:[m.previewUrl?(0,eC.jsx)("button",{onClick:()=>eY(m),className:"w-12 h-12 rounded-lg overflow-hidden flex-shrink-0 border border-gray-200 hover:border-blue-400 transition-colors",children:(0,eC.jsx)("img",{src:m.previewUrl,alt:m.file.name,className:"w-full h-full object-cover"})}):(0,eC.jsx)("div",{className:(0,tc.cn)("w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0","analyzed"===m.status?"bg-emerald-100":"bg-gray-100"),children:(0,eC.jsx)(t1.Z,{className:"w-6 h-6 text-gray-400"})}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:m.file.name}),(0,eC.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:["pending"===m.status&&(0,eC.jsx)("span",{className:"text-xs text-gray-400",children:"Esperando..."}),"uploading"===m.status&&(0,eC.jsxs)("span",{className:"text-xs text-blue-600 flex items-center gap-1",children:[(0,eC.jsx)(nR.Z,{className:"w-3 h-3 animate-spin"})," Subiendo..."]}),"uploaded"===m.status&&(0,eC.jsxs)("span",{className:"text-xs text-amber-600 font-medium",children:[(0,eC.jsx)(tL.Z,{className:"w-3 h-3 inline-block mr-1"}),"Pendiente de an\xe1lisis"]}),"analyzing"===m.status&&(0,eC.jsxs)("span",{className:"text-xs text-blue-600 flex items-center gap-1 animate-pulse",children:[(0,eC.jsx)(nR.Z,{className:"w-3 h-3 animate-spin"})," Analizando..."]}),"analyzed"===m.status&&(0,eC.jsxs)("select",{value:m.predictedType||"",onChange:g=>eQ(m.id,g.target.value),onClick:m=>m.stopPropagation(),className:"text-xs px-2 py-1 rounded-lg bg-emerald-100 text-emerald-800 font-medium border border-emerald-200 cursor-pointer hover:bg-emerald-200 transition-colors",children:[!m.predictedType&&(0,eC.jsx)("option",{value:"",children:"Seleccionar..."}),nB.map(m=>(0,eC.jsx)("option",{value:m.value,children:m.label},m.value))]}),"error"===m.status&&(0,eC.jsx)("span",{className:"text-xs text-red-600",children:m.error||"Error"})]})]}),(0,eC.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:["analyzed"===m.status&&(0,eC.jsx)(tZ.Z,{className:"w-5 h-5 text-emerald-500"}),("uploading"===m.status||"analyzing"===m.status)&&(0,eC.jsx)(nR.Z,{className:"w-5 h-5 text-blue-500 animate-spin"}),!["uploading","analyzing"].includes(m.status)&&(0,eC.jsx)("button",{onClick:()=>eG(m.id),className:"p-1.5 rounded-lg hover:bg-gray-200 transition-colors",children:(0,eC.jsx)(to.Z,{className:"w-4 h-4 text-gray-400"})})]})]},m.id))})]}),tu&&(0,eC.jsxs)("div",{className:"mt-4 space-y-2",children:[eL.length>0&&(0,eC.jsx)(nI.Z,{variant:"required",title:"Faltan documentos obligatorios",description:eL.map(m=>m.label).join(", ")}),!tn&&tt&&et.length>0&&(0,eC.jsx)(nI.Z,{variant:"warning",description:"Selecciona el tipo de cada documento para continuar."}),eU&&(0,eC.jsx)(nI.Z,{variant:"error",title:"Se requiere presupuesto",description:"Tu boleta no tiene detalle. Sube el presupuesto para vincular."})]}),e$&&(0,eC.jsx)("div",{className:"mt-4",children:ez?(0,eC.jsx)(nI.Z,{variant:"success",description:"Presupuestos vinculados correctamente.",action:{label:"Editar",onClick:()=>ex(!0)}}):(0,eC.jsxs)("button",{onClick:()=>ex(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-3 border-2 border-blue-400 text-blue-600 font-medium rounded-xl hover:bg-blue-50 transition-all",children:[(0,eC.jsx)(nA.Z,{className:"w-5 h-5"}),"Vincular presupuestos"]})})]}),(0,eC.jsx)("div",{className:"flex-shrink-0 px-4 sm:px-6 py-4 bg-white border-t border-gray-100",children:es?(0,eC.jsx)(eP.z,{variant:"brand-outline",size:"full",disabled:!0,loading:!0,children:"Analizando con IA..."}):e8&&!tt?(0,eC.jsxs)(eP.z,{onClick:()=>void e2(),variant:"brand-outline",size:"full",children:["Analizar documentos (",e4,")"]}):(0,eC.jsxs)(eC.Fragment,{children:[td&&(0,eC.jsx)("p",{className:"text-xs text-gray-500 text-center mb-2",children:td}),(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>void e5(),disabled:!e9||ed||tu,loading:ed,size:"full",children:"Continuar"})]})}),(0,eC.jsx)(nT.Z,{isOpen:!!em&&!!em.previewUrl,onClose:eX,imageUrl:(null==em?void 0:em.previewUrl)||"",imageName:null==em?void 0:em.file.name,onDelete:()=>em&&eG(em.id),deleteLabel:"Eliminar"}),eh&&eh.document&&isImageFile(eh.document)&&(0,eC.jsx)(nT.Z,{isOpen:!0,onClose:()=>eg(null),imageUrl:eh.document,imageName:eh.document_name||"Documento"}),eh&&eh.document&&!isImageFile(eh.document)&&(0,eC.jsxs)("div",{className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center p-4",onClick:()=>eg(null),children:[(0,eC.jsx)("button",{onClick:()=>eg(null),className:"absolute top-4 right-4 z-20 p-2 bg-white rounded-full shadow-lg",children:(0,eC.jsx)(to.Z,{className:"w-6 h-6 text-gray-700"})}),(0,eC.jsxs)("div",{className:"bg-white rounded-xl p-8 text-center max-w-sm",onClick:m=>m.stopPropagation(),children:[(0,eC.jsx)(t1.Z,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),(0,eC.jsx)("p",{className:"text-gray-600 mb-4",children:eh.document_name||"Documento PDF"}),(0,eC.jsx)("a",{href:eh.document,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 font-medium hover:text-blue-700",children:"Abrir documento"})]})]}),(0,eC.jsx)(BudgetLinkingModal,{isOpen:eb,onClose:()=>ex(!1),receiptsNeedingBudget:eF.map(m=>({id:m.id,filename:m.file.name,previewUrl:m.previewUrl,type:"receipt"})),budgets:eZ.map(m=>({id:m.id,filename:m.file.name,previewUrl:m.previewUrl,type:"budget"})),links:ev,onSave:ey})]})}var n$=v(64771);function BankAccountModal(m){var g,v,x;let{isOpen:k,onClose:E,onSuccess:T}=m,{data:K}=useBankAccountsQuery(),{data:et}=(0,eR.a)(),en=null==K?void 0:null===(g=K.results)||void 0===g?void 0:g[0],er=useUpdateBankAccountMutation(),{register:ei,handleSubmit:es,control:el,reset:ec,formState:{errors:eu}}=(0,t_.cI)({mode:"onSubmit"});(0,ek.useEffect)(()=>
6{if(en){var m,g;ec({account_number:en.account_number,account_type:en.account_type,bank_name:en.bank_name,holder_rut:(0,tw.format)(null!==(g=null!==(m=en.holder_rut)&&void 0!==m?m:null==et?void 0:et.rut)&&void 0!==g?g:"")});return}(null==et?void 0:et.rut)&&ec(m=>{var g;return{...m,holder_rut:(0,tw.format)(null!==(g=et.rut)&&void 0!==g?g:"")}})},[en,et,ec]);let onSubmit=async m=>{await er.mutateAsync(m),T(),E()};if(!k)return null;let ed=!!en;return(0,eC.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:(0,eC.jsxs)("div",{className:"bg-white rounded-2xl w-full max-w-md overflow-hidden",children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-100",children:[(0,eC.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:ed?"Editar cuenta bancaria":"Agregar cuenta bancaria"}),(0,eC.jsx)("button",{onClick:E,className:"p-2 rounded-lg hover:bg-gray-100 transition-colors",children:(0,eC.jsx)(to.Z,{className:"w-5 h-5 text-gray-500"})})]}),(0,eC.jsxs)("form",{onSubmit:m=>void es(onSubmit)(m),className:"p-4 space-y-4",children:[(0,eC.jsxs)("div",{children:[(0,eC.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"N\xfamero de cuenta"}),(0,eC.jsx)(tN.Z,{theme:"square",inputProps:{...ei("account_number",{required:{value:!0,message:"El n\xfamero de cuenta es requerido"}}),placeholder:"Ej: 12345678"},errorMessage:null===(v=eu.account_number)||void 0===v?void 0:v.message})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Tipo de cuenta"}),(0,eC.jsx)(t_.Qr,{control:el,name:"account_type",rules:{required:"El tipo de cuenta es requerido"},render:m=>{let{field:{onChange:g,value:v}}=m;return(0,eC.jsx)(n$.Z,{options:tP.Pp,selectedValue:v,setSelectedValue:m=>g(m),placeholder:"Selecciona tipo de cuenta",size:"medium",isError:!!eu.account_type})}}),eu.account_type&&(0,eC.jsx)("p",{className:"text-pink-600 text-sm mt-1",children:eu.account_type.message})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Banco"}),(0,eC.jsx)(t_.Qr,{control:el,name:"bank_name",rules:{required:"El banco es requerido"},render:m=>{let{field:{onChange:g,value:v}}=m;return(0,eC.jsx)(n$.Z,{options:tP.TX,selectedValue:v,setSelectedValue:m=>g(m),placeholder:"Selecciona tu banco",size:"medium",isError:!!eu.bank_name})}}),eu.bank_name&&(0,eC.jsx)("p",{className:"text-pink-600 text-sm mt-1",children:eu.bank_name.message})]}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"RUT del titular de la cuenta"}),(0,eC.jsx)(tN.Z,{theme:"square",inputProps:{...ei("holder_rut",{required:{value:!0,message:"El RUT del titular es requerido"},validate:m=>(0,tw.validate)(m)||"El RUT ingresado no es v\xe1lido"}),placeholder:"12.345.678-5",autoComplete:"off"},errorMessage:null===(x=eu.holder_rut)||void 0===x?void 0:x.message}),(0,eC.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"La cuenta debe estar a tu nombre para que el banco acepte la transferencia."})]}),(0,eC.jsxs)("div",{className:"pt-2 space-y-2",children:[(0,eC.jsx)(eP.z,{type:"submit",variant:"brand",size:"full",loading:er.isLoading,disabled:er.isLoading,children:ed?"Guardar cambios":"Agregar cuenta"}),(0,eC.jsx)(eP.z,{type:"button",onClick:E,variant:"brand-outline",size:"full",children:"Cancelar"})]})]})]})})}var nU=v(72009),nz=v(69494);let nV={receipt:"Boleta",budget:"Presupuesto",diagnosis:"Informe cl\xednico",prescription:"Receta","exam-results":"Examen","exam-prescription":"Orden m\xe9dica","vaccination-card":"Carnet vacunas","extra-documents":"Documento"};function isImageUrl(m){var g;let v=(null===(g=m.split(".").pop())||void 0===g?void 0:g.toLowerCase().split("?")[0])||"";return["jpg","jpeg","png","gif","webp"].includes(v)}function StepsOverviewStep(m){var g,v;let{onNext:x,goToStep:k}=m,{watch:E}=(0,t_.Gc)(),T=E("claimId"),K=E("category"),et=E("severity");if(!K)throw Error("StepsOverviewStep requires a category to be set. This is a programming error.");let{data:en}=useBankAccountsQuery(),{data:er,isLoading:ei}=(0,t7.GH)(null!=T?T:void 0),es=(0,n_.D5)(),[el,ec]=(0,ek.useState)(null),[eu,ed]=(0,ek.useState)(null),[ep,em]=(0,ek.useState)(!1),[ef,eh
6]=(0,ek.useState)(!1),{refetch:eg}=useBankAccountsQuery(),ev=requiresVideoStep(K,et),ey="required"===getVideoRequirement(K,et),eb=!!(null==er?void 0:er.video_description),ex=!!(null==er?void 0:er.written_declaration),e_=!ey||eb||ex,ew=(0,ek.useMemo)(()=>(0,nP.Q4)(K),[K]),eS=(0,ek.useMemo)(()=>er?er.documents.map(m=>{var g;return{id:m.id,document:m.document_url,document_name:m.document_name,file_description:null!==(g=m.file_type)&&void 0!==g?g:"other"}}):[],[er]),eE=(0,ek.useMemo)(()=>{let m={receipt:0,budget:0,diagnosis:0,prescription:0,"exam-results":0,"exam-prescription":0,"vaccination-card":0,"extra-documents":0};return eS.forEach(g=>{let v=(0,nP.JD)(g.file_description);v&&v in m&&m[v]++}),m},[eS]),ej=null==en?void 0:null===(g=en.results)||void 0===g?void 0:g[0],eN=!!ej,eR=ew.required.every(m=>eE[m.type]>0),eI=eR&&e_,handleSubmit=async()=>{if(!T){ec("No se encontr\xf3 el reembolso");return}if(!eI){ec("Completa todos los pasos requeridos antes de enviar");return}try{await es.mutateAsync(T),x()}catch(g){(0,nS.j)(nw.IX,{claim_id:T,reason:(0,nC.bQ)(g)});let{message:m}=(0,e2.EV)(g,"Error al enviar el reembolso");ec(m)}},eT=es.isLoading;return ei?(0,eC.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,eC.jsx)("div",{className:"w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"})}):(0,eC.jsxs)("div",{className:"h-full flex flex-col",children:[(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100",children:[(0,eC.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Resumen de tu solicitud"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"Verifica que todo est\xe9 correcto antes de enviar"})]}),(0,eC.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6 py-4 space-y-3",children:[el&&(0,eC.jsxs)("div",{className:"p-3 bg-red-50 border border-red-200 rounded-xl flex items-start gap-2",children:[(0,eC.jsx)(e7.Z,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),(0,eC.jsx)("p",{className:"text-sm text-red-700",children:el})]}),ev&&(0,eC.jsxs)("div",{className:"rounded-xl border border-gray-200 overflow-hidden bg-white",children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-100",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-2",children:[e_?(0,eC.jsx)(tZ.Z,{className:"w-5 h-5 text-emerald-500"}):(0,eC.jsx)(e7.Z,{className:"w-5 h-5 text-amber-500"}),(0,eC.jsx)("span",{className:"font-medium text-gray-900 text-sm",children:eb?"Video":"Declaraci\xf3n"})]}),(0,eC.jsx)("button",{onClick:()=>k("video-declaration"),className:(0,tc.cn)("text-xs font-semibold px-2 py-1 rounded-lg transition-colors",e_?"text-gray-600 hover:bg-gray-100":"text-amber-600 bg-amber-100 hover:bg-amber-200"),children:e_?"Editar":"Completar"})]}),(0,eC.jsx)("div",{className:"p-3",children:eb?(0,eC.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eC.jsx)("div",{className:"w-10 h-10 rounded-lg bg-blue-100 flex items-center justify-center",children:(0,eC.jsx)(nE.Z,{className:"w-5 h-5 text-blue-600"})}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:"Video grabado"}),(0,eC.jsx)("p",{className:"text-xs text-gray-500",children:"Tu video ha sido subido"})]})]}):ex?(0,eC.jsxs)("div",{className:"flex items-start gap-3",children:[(0,eC.jsx)("div",{className:"w-10 h-10 rounded-lg bg-blue-100 flex items-center justify-center flex-shrink-0",children:(0,eC.jsx)(t1.Z,{className:"w-5 h-5 text-blue-600"})}),(0,eC.jsxs)("div",{className:"min-w-0",children:[(0,eC.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:"Declaraci\xf3n escrita"}),(0,eC.jsx)("p",{className:"text-xs text-gray-500 line-clamp-2 mt-0.5",children:null==er?void 0:er.written_declaration})]})]}):(0,eC.jsxs)("div",{className:"text-center py-2",children:[(0,eC.jsx)(nE.Z,{className:"w-8 h-8 text-gray-300 mx-auto mb-1"}),(0,eC.jsx)("p",{className:"text-xs text-gray-500",children:ey?"Debes grabar un video":"Graba un video o escribe"})]})})]}),(0,eC.jsxs)("div",{className:"rounded-xl border border-gray-200 overflow-hidden bg-white",children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-100",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-2",children:[eR?(0,eC.jsx)(tZ.Z,{className:"w-5 h-5 text-emerald-500"}):(0,eC.jsx)(e7.Z,{className:"w-5 h-5 text-amber-500"}),(0,eC.jsxs)("span",{className:"font-medium text-gray-900 text-sm",children:["Documentos",(0,eC.jsxs)("span",{className:"text-gray-400 font-normal ml-1",children:["(",eS.length,")"]})]})]}),(0,eC.jsx)("button",{onClick:()=>k("documents"),className:(0,tc.cn)("text-xs font-semibold px-2 py-1 rounded-lg transition-colors",eR?"text-gray-600 hover:bg-gray-100":"text-amber-600 bg-amber-100 hover:bg-amber-200"),children:eR?"Editar":"Subir faltantes"})]}),eS.length>0?(0,eC.jsxs)("div",{className:"p-3",children:[(0,eC.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1 -mx-1 px-1",children:eS.map(m=>{var g;let v=null!==(g=nV[m.file_description])&&void 0!==g?g:m.file_description,x=m.document&&isImageUrl(m.document);return(0,eC.jsxs)("button",{onClick:()=>ed(m),className:"w-16 h-20 flex-shrink-0 rounded-lg overflow-hidden border border-gray-200 hover:border-blue-400 transition-colors relative",children:[x&&m.document?(0,eC.jsx)("img",{src:m.document,alt:v,className:"w-full h-full object-cover"}):(0,eC.jsx)("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center",children:(0,eC.jsx)(t1.Z,{className:"w-6 h-6 text-gray-400"})}),(0,eC.jsx)("div",{className:"absolute inset-x-0 bottom-0 bg-black/70 px-1 py-0.5",children:(0,eC.jsx)("p",{className:"text-2xs text-white truncate text-center font-medium",children:v})})]},m.id)})}),!eR&&(0,eC.jsx)("div",{className:"mt-2 p-2 bg-amber-50 rounded-lg",children:(0,eC.jsxs)("p",{className:"text-xs text-amber-700",children:[(0,eC.jsx)("span",{className:"font-semibold",children:"Falta:"})," ",ew.required.filter(m=>0===eE[m.type]).map(m=>
6nV[m.type]||m.label).join(", ")]})})]}):(0,eC.jsxs)("div",{className:"p-4 text-center",children:[(0,eC.jsx)(nU.Z,{className:"w-8 h-8 text-gray-300 mx-auto mb-1"}),(0,eC.jsx)("p",{className:"text-xs text-gray-500",children:"No hay documentos"})]})]}),(0,eC.jsxs)("div",{className:"rounded-xl border border-gray-200 overflow-hidden bg-white",children:[(0,eC.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-100",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-2",children:[eN?(0,eC.jsx)(tZ.Z,{className:"w-5 h-5 text-emerald-500"}):(0,eC.jsx)(th.Z,{className:"w-5 h-5 text-gray-400"}),(0,eC.jsx)("span",{className:"font-medium text-gray-900 text-sm",children:"Cuenta bancaria"})]}),(0,eC.jsx)("button",{onClick:()=>eh(!0),className:"text-xs font-semibold px-2 py-1 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors",children:eN?"Editar":"Agregar"})]}),eN?(0,eC.jsx)("div",{className:"p-3",children:(0,eC.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eC.jsx)("div",{className:"w-10 h-10 rounded-lg bg-blue-100 flex items-center justify-center",children:(0,eC.jsx)("span",{className:"text-blue-600 font-bold text-sm",children:(0,tP.XC)(ej.bank_name).charAt(0)})}),(0,eC.jsxs)("div",{children:[(0,eC.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:(0,tP.XC)(ej.bank_name)}),(0,eC.jsxs)("p",{className:"text-xs text-gray-500",children:[(0,tP.Ly)(ej.account_type)," \xb7 ",(v=ej.account_number).length<=4?v:"•••• "+v.slice(-4)]})]})]})}):(0,eC.jsx)("div",{className:"p-3",children:(0,eC.jsxs)("p",{className:"text-xs text-gray-600",children:["Para recibir tu reembolso necesitas una cuenta bancaria.",(0,eC.jsx)("span",{className:"text-gray-400",children:" Puedes agregarla despu\xe9s en Ajustes."})]})})]})]}),(0,eC.jsxs)("div",{className:"flex-shrink-0 px-4 sm:px-6 py-4 bg-white border-t border-gray-100 space-y-3",children:[(0,eC.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,eC.jsx)("input",{type:"checkbox",checked:ep,onChange:m=>em(m.target.checked),className:"mt-0.5 w-5 h-5 rounded text-emerald-500 focus:ring-emerald-500 border-blue-500 cursor-pointer"}),(0,eC.jsx)("span",{className:"text-xs text-gray-500 leading-relaxed",children:"Declaro que la informaci\xf3n entregada es ver\xeddica y puede ser sujeta a investigaci\xf3n."})]}),(0,eC.jsxs)(eP.z,{variant:"brand",onClick:()=>void handleSubmit(),disabled:!eI||!ep||eT,loading:eT,size:"full",children:[(0,eC.jsx)(nz.Z,{className:"w-4 h-4 mr-2 -rotate-45 inline-block"}),"Solicitar reembolso"]})]}),eu&&eu.document&&(0,eC.jsxs)("div",{className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center p-4",onClick:()=>ed(null),children:[(0,eC.jsx)("button",{onClick:()=>ed(null),className:"absolute top-4 right-4 z-20 p-2 bg-white rounded-full shadow-lg",children:(0,eC.jsx)(to.Z,{className:"w-6 h-6 text-gray-700"})}),(0,eC.jsx)("div",{className:"relative w-full h-full flex items-center justify-center",onClick:m=>m.stopPropagation(),children:isImageUrl(eu.document)?(0,eC.jsx)("img",{src:eu.document,alt:eu.document_name||"Documento",className:"max-w-full max-h-[85vh] object-contain rounded-lg"}):(0,eC.jsxs)("div",{className:"bg-white rounded-xl p-8 text-center max-w-sm",children:[(0,eC.jsx)(t1.Z,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),(0,eC.jsx)("p",{className:"text-gray-600 mb-4",children:eu.document_name||"Documento PDF"}),(0,eC.jsx)("a",{href:eu.document,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 font-medium hover:text-blue-600",children:"Abrir documento"})]})})]}),(0,eC.jsx)(BankAccountModal,{isOpen:ef,onClose:()=>eh(!1),onSuccess:()=>{T&&(0,nS.j)(nw.JS,{claim_id:T,step:"bank_account"}),eg()}})]})}function CheckIcon(){return(0,eC.jsx)("svg",{className:"w-16 h-16 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,eC.jsx)("path",{d:"M5 13l4 4L19 7",style:{strokeDasharray:24,strokeDashoffset:24,animation:"drawCheck 0.4s ease-out 0.3s forwards"}})})}function FloatingShape(m){let{className:g,delay:v,color:x}=m;return(0,eC.jsx)("div",{className:"absolute rounded-full opacity-60 ".concat(g),style:{backgroundColor:x,animation:"floatUp 3s ease-in-out ".concat(v," infinite")}})}function SuccessStep(m){let{onClose:g}=m,[v,x]=(0,ek.useState)(!1);return(0,ek.useEffect)(()=>{let m=setTimeout(()=>x(!0),100);return()=>clearTimeout(m)},[]),(0,eC.jsxs)("div",{className:"h-full flex flex-col items-center justify-center p-8 text-center relative overflow-hidden bg-gradient-to-b from-teal-50/50 to-white",children:[(0,eC.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n  @keyframes drawCheck {\n    to { stroke-dashoffset: 0; }\n  }\n  @keyframes floatUp {\n    0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }\n    50% { transform: translateY(-20px) scale(1.1); opacity: 0.8; }\n  }\n  @keyframes confettiLeft {\n    0% { transform: translateX(-30px) translateY(30px) rotate(-10deg); opacity: 0; }\n    20% { opacity: 1; }\n    100% { transform: translateX(0) translateY(0) rotate(0deg); opacity: 1; }\n  }\n  @keyframes confettiRight {\n    0% { transform: translateX(30px) translateY(30px) rotate(10deg); opacity: 0; }\n    20% { opacity: 1; }\n    100% { transform: translateX(0) translateY(0) rotate(0deg); opacity: 1; }\n  }\n  @keyframes scaleIn {\n    0% { transform: scale(0); opacity: 0; }\n    50% { transform: scale(1.1); }\n    100% { transform: scale(1); opacity: 1; }\n  }\n  @keyframes slideUp {\n    0% { transform: translateY(20px); opacity: 0; }\n    100% { transform: translateY(0); opacity: 1; }\n  }\n  @keyframes pulseRing {\n    0% { transform: scale(0.8); opacity: 0.8; }\n    50% { transform: scale(1.2); opacity: 0; }\n    100% { transform: scale(0.8); opacity: 0; }\n  }\n"}}),(0,eC.jsx)(FloatingShape,{className:"w-3 h-3 top-20 left-10",delay:"0s",color:"#3B82F6"}),(0,eC.jsx)(FloatingShape,{className:"w-2 h-2 top-32 right-12",delay:"0.5s",color:"#2DD4BF"}),(0,eC.jsx)(FloatingShape,{className:"w-4 h-4 bottom-40 left-16",delay:"1s",color:"#FACC15"}),(0,eC.jsx)(FloatingShape,{className:"w-2 h-2 bottom-32 right-20",delay:"1.5s",color:"#DB2777"}),(0,eC.jsx)(FloatingShape,{className:"w-3 h-3 top-48 left-1/4",delay:"0.8s",color:"#3B82F6"}),(0,eC.jsxs)("div",{className:"relative mb-6",children:[(0,eC.jsx)("div",{className:"absolute -left-16 -top-8 w-16 h-20",style:{animation:v?"confettiLeft 0.6s ease-out 0.2s forwards":"none",opacity:0}
6,children:(0,eC.jsx)(t6(),{src:"/static/images/policyRenewal/left-confetti.svg",alt:"",width:64,height:80,className:"w-full h-full"})}),(0,eC.jsx)("div",{className:"absolute -right-16 -top-8 w-16 h-20",style:{animation:v?"confettiRight 0.6s ease-out 0.2s forwards":"none",opacity:0},children:(0,eC.jsx)(t6(),{src:"/static/images/policyRenewal/right-confetti.svg",alt:"",width:64,height:80,className:"w-full h-full"})}),(0,eC.jsxs)("div",{className:"relative",children:[(0,eC.jsx)("div",{className:"absolute inset-0 bg-blue-500 rounded-full",style:{animation:v?"pulseRing 2s ease-out 0.5s infinite":"none"}}),(0,eC.jsx)("div",{className:"w-24 h-24 bg-gradient-to-br from-blue-400 to-blue-500 rounded-full flex items-center justify-center shadow-lg shadow-blue-200 relative",style:{animation:v?"scaleIn 0.5s ease-out forwards":"none",opacity:v?1:0},children:(0,eC.jsx)(CheckIcon,{})})]})]}),(0,eC.jsxs)("div",{style:{animation:v?"slideUp 0.5s ease-out 0.4s forwards":"none",opacity:0},children:[(0,eC.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-3",children:"\xa1Solicitud recibida!"}),(0,eC.jsx)("p",{className:"text-gray-600 mb-2 max-w-sm",children:"Tu reembolso est\xe1 en camino. Nuestro equipo revisar\xe1 tu solicitud lo antes posible."}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mb-8",children:"Te notificaremos cada avance."})]}),(0,eC.jsx)("div",{className:"w-full max-w-xs",style:{animation:v?"slideUp 0.5s ease-out 0.6s forwards":"none",opacity:0},children:(0,eC.jsx)(eP.z,{onClick:g,variant:"brand",size:"full",children:"Volver al inicio"})}),(0,eC.jsxs)("div",{className:"mt-6 flex items-center gap-2 text-sm text-gray-400",style:{animation:v?"slideUp 0.5s ease-out 0.8s forwards":"none",opacity:0},children:[(0,eC.jsx)("span",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),"Procesando tu solicitud"]})]})}var nq=v(78134);let nH=[{id:"info",label:"Info",steps:["select-policy","addendum-select","type-of-claim","severity","event-date"]},{id:"video",label:"Video",steps:["video-declaration"]},{id:"documents",label:"Docs",steps:["documents-info","documents"]},{id:"confirm",label:"Enviar",steps:["steps-overview"]}];function ClaimWizard(m){let{isOpen:g,onClose:v,claimId:x,initialPolicy:k}=m,[E,T]=(0,ek.useState)("select-policy"),{data:K}=(0,eL.e$)(),{data:et}=(0,t7.GH)(x),en=(0,ek.useMemo)(()=>{if(!x||!et)return null;let m=null==K?void 0:K.find(m=>m.id===et.policy_id);return m?{claim:et,policy:m}:null},[x,et,K]),er=(0,t_.cI)({resolver:(0,nn.F)(nr),defaultValues:ni,mode:"onChange"}),{watch:ei,reset:es,setValue:el}=er,ec=ei("petName"),eu=ei("category"),ed=ei("severity"),[ep,em]=(0,ek.useState)(!1);(0,ek.useEffect)(()=>{var m,v,E,K;if(!g){em(!1);return}if(g&&en&&!ep){let{claim:g,policy:x}=en;el("policyId",x.id.toString()),el("petName",null!==(v=null===(m=x.insurable_object)||void 0===m?void 0:m.name)&&void 0!==v?v:""),null!==g.category&&void 0!==g.category&&el("category",(0,ns.n7)(g.category)),g.severity_level&&el("severity",g.severity_level),el("eventDate",g.claim_date),el("isAddendum",!!g.original_claim_id),el("originalClaimId",g.original_claim_id||null),el("claimId",g.id),g.reimbursable_items.length>0&&el("reimbursableItems",g.reimbursable_items);let k=g.documents.length>0;k?T("steps-overview"):g.category?T("documents-info"):T("type-of-claim"),em(!0)}else g&&k&&!x&&!ep&&(el("policyId",k.id.toString()),el("petName",null!==(K=null===(E=k.insurable_object)||void 0===E?void 0:E.name)&&void 0!==K?K:""),em(!0))},[g,en,k,x,el,ep]);let ef=(0,ek.useCallback)(()=>{v(),setTimeout(()=>{es(ni),T("select-policy")},300)},[v,es]),eh=(0,ek.useCallback)(m=>{T(m)},[]),eg=(0,ek.useCallback)((m,g)=>{let v=g||eu;return"severity"===m&&!!v&&!(0,ns.pv)(v)||"video-declaration"===m&&!!v&&!requiresVideoStep(v,ed)},[eu,ed]),ev=(0,ek.useCallback)(m=>{let g=m||eu,v=["select-policy","addendum-select","type-of-claim","severity","event-date","video-declaration","documents-info","documents","steps-overview","success"],x=v.indexOf(E);if(-1===x||x>=v.length-1)return;let k=x+1,K=v[k];for(;K&&eg(K,g);){if(++k>=v.length)return;K=v[k]}K&&T(K)},[E,eg,eu]),ey=(0,ek.useCallback)(()=>{let m=["select-policy","addendum-select","type-of-claim","severity","event-date","video-declaration","documents-info","documents","steps-overview","success"],g=m.indexOf(E);if(g<=0)return;let v=g-1,x=m[v];for(;x&&eg(x,eu);){if(--v<0)return;x=m[v]}x&&T(x)},[E,eg,eu]),eb=!["select-policy","success"].includes(E),ex="success"!==E,e_=(0,ek.useMemo)(()=>{for(let m=0;m<nH.length;m++){let g=nH[m];if(g&&g.steps.includes(E))return m}return 0},[E]),ew=eu?ns.sY[eu]:null,eS=(()=>{let m=na[E];return"select-policy"===E?"Nuevo reembolso":"type-of-claim"===E?ec?"\xbfQu\xe9 le pas\xf3 a ".concat(ec,"?"):"\xbfQu\xe9 necesitas reembolsar?":ew?"".concat(ew," de ").concat(ec):m})();return(0,eC.jsx)(eD.Vq,{open:g,onOpenChange:m=>!m&&ef(),children:(0,eC.jsxs)(eD.cZ,{className:"w-full max-w-[98vw] sm:max-w-[95vw] h-[95vh] sm:h-[92vh] overflow-visible p-0 flex flex-col border-none",children:[ex&&(0,eC.jsxs)(eD.fK,{className:"flex-shrink-0 px-4 sm:px-6 pt-4 pb-3 border-b border-gray-100 bg-white",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[eb?(0,eC.jsx)("button",{onClick:ey,className:"p-2 -ml-2 roun
6ded-full hover:bg-gray-100 transition-colors","aria-label":"Volver",children:(0,eC.jsx)(nq.Z,{className:"w-5 h-5 text-gray-600"})}):(0,eC.jsx)("div",{className:"w-9"}),(0,eC.jsx)(eD.$N,{className:"flex-1 text-base sm:text-lg font-semibold text-gray-900 truncate text-center",children:eS})]}),(0,eC.jsx)("div",{className:"flex items-center justify-center gap-1 sm:gap-2",children:nH.map((m,g)=>{let v=g<e_,x=g===e_;return(0,eC.jsxs)(ek.Fragment,{children:[(0,eC.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,eC.jsx)("div",{className:(0,tc.cn)("w-7 h-7 sm:w-8 sm:h-8 rounded-full flex items-center justify-center text-xs sm:text-sm font-semibold transition-all",v&&"bg-emerald-500 text-white",x&&"bg-blue-500 text-white ring-2 ring-blue-200",!v&&!x&&"bg-gray-100 text-gray-400"),children:v?(0,eC.jsx)(tV.Z,{className:"w-4 h-4"}):g+1}),(0,eC.jsx)("span",{className:(0,tc.cn)("text-2xs sm:text-xs font-medium",x?"text-blue-600":v?"text-emerald-600":"text-gray-400"),children:m.label})]}),g<nH.length-1&&(0,eC.jsx)("div",{className:(0,tc.cn)("w-6 sm:w-10 h-0.5 -mt-4 transition-colors",g<e_?"bg-emerald-500":"bg-gray-200")})]},m.id)})})]}),(0,eC.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,eC.jsx)(t_.RV,{...er,children:(0,eC.jsx)("div",{className:"h-full flex flex-col",children:(()=>{switch(E){case"select-policy":return(0,eC.jsx)(SelectPolicyStep,{policies:K||[],onNext:ev,goToStep:eh});case"addendum-select":return(0,eC.jsx)(AddendumSelectStep,{policies:K||[],onNext:ev});case"type-of-claim":return(0,eC.jsx)(TypeOfClaimStep,{policies:K||[],onNext:m=>ev(m)});case"severity":return(0,eC.jsx)(SeverityStep,{onNext:ev});case"event-date":return(0,eC.jsx)(EventDateStep,{onNext:ev});case"video-declaration":return(0,eC.jsx)(VideoDeclarationStep,{onNext:ev});case"documents-info":return(0,eC.jsx)(DocumentsInfoStep,{onNext:ev});case"documents":return(0,eC.jsx)(DocumentsStep,{onNext:ev,onBack:ey});case"steps-overview":return(0,eC.jsx)(StepsOverviewStep,{onNext:ev,goToStep:eh});case"success":return(0,eC.jsx)(SuccessStep,{onClose:ef});default:return null}})()})})})]})})}var nW=v(76741),nK=v(48023),nG=v(48260),nQ=v(3510);let nY={state:"idle"};function ClaimDetailModal(m){var g,v,x,k;let{isOpen:E,onClose:T,claim:K,policy:et}=m,[en,er]=(0,ek.useState)(null),[ei,es]=(0,ek.useState)(!1),[el,ec]=(0,ek.useState)(nY),[eu,ed]=(0,ek.useState)(!1),ep=(0,n_.st)(),{refetch:em}=(0,eL.e$)(),{refetch:ef}=useBankAccountsQuery(),{data:eh}=(0,eR.a)(),eg=(0,eX.NL)(),ev="transferring"===el.state,{data:ey,refetch:eb}=(0,t7.GH)(K.id,{enabled:ev,refetchInterval:!!ev&&1e3});(0,ek.useEffect)(()=>{E||(er(null),es(!1),ec(nY),ed(!1))},[E]);let ex=(0,ek.useCallback)(()=>{eg.invalidateQueries({queryKey:e3.a.claims.all()}),eg.invalidateQueries({queryKey:e3.a.policies.index()})},[eg]);(0,ek.useEffect)(()=>{if(!ev)return;let m=setTimeout(()=>{ec(m=>"transferring"===m.state?{...m,state:"delayed"}:m),ex()},3e4);return()=>clearTimeout(m)},[ev,ex]),(0,ek.useEffect)(()=>{if("transferring"!==el.state)return;let m=null==ey?void 0:ey.last_claim_history;if(!m)return;let g=(0,nQ.zH)(m,el.baselineHistoryId);"transferring"!==g&&(ec(nY),ed("paid"===g),ex())},[el,ey,ex]);let handleAcceptSettlement=async()=>{er(null),es(!0);try{await ep.mutateAsync({claimId:K.id,statusKey:"settled"}),(0,nS.j)(nw.bw,{});let[{data:m}]=await Promise.all([eb(),em()]);if(m&&(0,nQ.eX)(m)){let g=m.last_claim_history;if(!g)throw Error("Claim ".concat(m.id," has no last_claim_history after settling"));ec({state:"transferring",baselineHistoryId:g.id})}else T()}catch(m){er((0,e2.EV)(m,"Error al aceptar la liquidaci\xf3n").message)}finally{es(!1)}},handleAppealSubmit=async m=>{er(null),await ep.mutateAsync({claimId:K.id,statusKey:"appealed",comment:m}),await em()},handleBankAccountSaved=async()=>{let m=K.last_claim_history;if(!m)throw Error("Claim ".concat(K.id," has no last_claim_history in payment_error"));await ef(),ec({state:"transferring",baselineHistoryId:m.id})};return(0,eC.jsxs)(eC.Fragment,{children:[(0,eC.jsx)(eD.Vq,{open:E,onOpenChange:m=>!m&&T(),children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-4xl lg:max-w-5xl max-h-[90vh] overflow-y-auto",children:[(0,eC.jsx)(eD.fK,{children:(0,eC.jsx)(eD.$N,{className:"sr-only",children:"Detalle del reembolso"})}),(0,eC.jsxs)("div",{className:"space-y-6",children:[(0,eC.jsx)(nW.Z,{claim:K,pet:et.insurable_object}),en&&(0,eC.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded-xl text-red-700 text-sm",children:en}),(0,eC.jsx)(nK.Z,{claim:K,pet:et.insurable_object,actions:{onAcceptSettlement:()=>void handleAcceptSettlement(),onSubmitAppeal:handleAppealSubmit,onContactSupport:()=>{T(),(0,eT.D)("showNewMessage")},onClaimChanged:em,onClose:T},bankAccountForm:(0,eC.jsx)(tT,{submitLabel:"Guardar datos",onSaved:handleBankAccountSaved}),referrerCode:null!==(v=null==eh?void 0:eh.referrer_code)&&void 0!==v?v:null,isProcessing:ei,isAppealSubmitting:ep.isLoading}),(0,eC.jsx)(eP.z,{onClick:T,variant:"brand-outline",size:"full",children:"Cerrar"})]})]})}),(0,eC.jsx)(nG.bT,{transferState:el.state,onDelayedConfirm:()=>{ec(nY),eb()}}),(0,eC.jsx)(nG.i_,{isOpen:eu,onClose:()=>ed(!1),amount:null!==(x=null==ey?void 0:ey.payable_amount)&&void 0!==x?x:K.payable_amount,petName:null!==(k=null===(g=et.insurable_object)||void 0===g?void 0:g.name)&&void 0!==k?k:""})]})}var nX=v(19167),nJ=v(90206),n0=v(79654),n1=v(53244);let n2=(0,tp.Z)("mouse-pointer-click",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.
6074z",key:"s0h3yz"}]]);var n3=v(49827);eW().extend(nt());let n5={accident:"/static/icons/claims/broken-bone.svg",sickness:"/static/icons/claims/measure-device.svg","complementary-therapy":"/static/icons/claims/lotus-flower.svg","preventive-vaccines":"/static/icons/claims/syringe.svg","preventive-exams":"/static/icons/claims/sample-tube.svg","preventive-consultation":"/static/icons/claims/dog-frame.svg","preventive-chip-installation":"/static/icons/claims/chip.svg","preventive-teleconsultation":"/static/icons/claims/laptop.svg",preventive:"/static/icons/claims/syringe.svg",liability:"/static/icons/claims/dog-jaw.svg"};function isClaimDraft(m){return!m.last_claim_history}let n4={neutral:{color:"text-pink-600",bgColor:"bg-pink-50",Icon:e7.Z},info:{color:"text-blue-500",bgColor:"bg-blue-50",Icon:tL.Z},warning:{color:"text-amber-600",bgColor:"bg-amber-50",Icon:tL.Z},review:{color:"text-pink-600",bgColor:"bg-pink-50",Icon:e7.Z},attention:{color:"text-pink-600",bgColor:"bg-pink-50",Icon:e7.Z},waiting:{color:"text-blue-500",bgColor:"bg-blue-50",Icon:tL.Z},success:{color:"text-emerald-600",bgColor:"bg-emerald-50",Icon:tZ.Z},danger:{color:"text-red-600",bgColor:"bg-red-50",Icon:e7.Z},rejected:{color:"text-gray-600",bgColor:"bg-gray-100",Icon:tv.Z},response:{color:"text-pink-600",bgColor:"bg-pink-50",Icon:e7.Z}};function PetFilterTab(m){let{pet:g,isSelected:v,onPress:x}=m;return(0,eC.jsx)("button",{onClick:x,className:(0,tc.cn)("px-4 py-2 rounded-full border text-xs transition-colors",{"bg-blue-50 border-blue-500 text-blue-500 font-bold":v,"bg-white border-gray-200 text-gray-700 hover:border-gray-300 font-medium":!v}),children:g.name})}function ReimbursementCard(m){let{reimbursement:g,onClick:v,isDraft:x,onDelete:k}=m,E=g.StatusIcon;return(0,eC.jsxs)("div",{className:"relative",children:[(0,eC.jsx)("button",{onClick:v,className:(0,tc.cn)("w-full text-left bg-white rounded-xl p-4 shadow-sm border transition-all hover:shadow-md",{"border-pink-300 border-2 shadow-md":x||g.requiresAction,"border-blue-200":g.isActive&&!x&&!g.requiresAction,"border-gray-100":!g.isActive&&!x&&!g.requiresAction}),children:(0,eC.jsxs)("div",{className:"flex items-start gap-3",children:[(0,eC.jsx)("div",{className:(0,tc.cn)("w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0",g.isActive?x||g.requiresAction?"bg-pink-50":"bg-blue-50":"bg-gray-100"),children:(0,eC.jsx)(t6(),{src:g.categoryIcon,alt:g.categoryLabel,width:28,height:28,className:(0,tc.cn)(!g.isActive&&"opacity-50 grayscale")})}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,eC.jsx)("span",{className:(0,tc.cn)("text-xs font-medium",g.isActive?x||g.requiresAction?"text-pink-500":"text-blue-500":"text-gray-400"),children:g.categoryLabel}),(0,eC.jsx)("span",{className:"text-gray-300",children:"•"}),(0,eC.jsx)("span",{className:(0,tc.cn)("text-xs",g.isActive?"text-gray-500":"text-gray-400"),children:g.petName})]}),(0,eC.jsx)("p",{className:(0,tc.cn)("font-semibold",g.isActive?"text-gray-900":"text-gray-600"),children:g.claimNumber?"Siniestro #".concat(g.claimNumber):"Reembolso"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-0.5 truncate",children:g.reason}),(0,eC.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,eC.jsx)(E,{className:(0,tc.cn)("w-4 h-4",g.statusColor)}),(0,eC.jsx)("span",{className:(0,tc.cn)("text-xs font-medium px-2 py-1 rounded-full",g.statusBgColor,g.statusColor),children:g.statusText})]})]}),(0,eC.jsxs)("div",{className:"flex flex-col items-end justify-between ml-2",children:[g.payableAmount>0&&(0,eC.jsx)("span",{className:(0,tc.cn)("font-bold text-lg",g.isActive?"text-blue-500":"text-gray-600"),children:(0,tM.Ed)(g.payableAmount)}),g.requiresAction||x?(0,eC.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-4 py-2 mt-2 bg-pink-500 text-white text-xs font-bold rounded-full hover:bg-pink-600 transition-colors shadow-sm whitespace-nowrap",children:[x?"Ir a completar solicitud":g.statusText,(0,eC.jsx)(ts.Z,{className:"w-4 h-4"})]}):(0,eC.jsx)(ts.Z,{className:"w-5 h-5 text-gray-400 mt-2"})]})]})}),x&&k&&(0,eC.jsx)("button",{onClick:m=>{m.stopPropagation(),null==k||k()},className:"absolute -top-2 -right-2 w-6 h-6 bg-pink-500 hover:bg-pink-600 rounded-full flex items-center justify-center shadow-md transition-colors",title:"Eliminar borrador",children:(0,eC.jsx)(to.Z,{className:"w-4 h-4 text-white"})})]})}function DeleteDraftModal(m){let{isOpen:g,onClose:v,onConfirm:x,isLoading:k,petName:E}=m;return(0,eC.jsx)(eD.Vq,{open:g,onOpenChange:v,children:(0,eC.jsxs)(eD.cZ,{className:"sm:max-w-md",children:[(0,eC.jsxs)(eD.fK,{children:[(0,eC.jsx)("div",{className:"mx-auto w-12 h-12 bg-pink-50 rounded-full flex items-center justify-center mb-4",children:(0,eC.jsx)(n0.Z,{className:"w-6 h-6 text-pink-500"})}),(0,eC.jsx)(eD.$N,{className:"text-center",children:"Eliminar borrador"}),(0,eC.jsxs)(eD.Be,{className:"text-center",children:["\xbfEstas seguro que quieres eliminar el borrador de reembolso de ",E,"? Esta accion no se puede deshacer."]}
6)]}),(0,eC.jsxs)("div",{className:"flex gap-3 mt-4",children:[(0,eC.jsx)(eP.z,{onClick:v,disabled:k,variant:"brand-outline",size:"full",className:"flex-1",children:"Cancelar"}),(0,eC.jsx)(eP.z,{onClick:x,disabled:k,loading:k,variant:"brand-destructive",size:"full",className:"flex-1",children:k?"Eliminando...":"Eliminar"})]})]})})}function ReimbursementsSummary(m){var g;let{reimbursements:v}=m,{data:x}=useBankAccountsQuery(),{data:k}=(0,eR.a)(),E=v.filter(m=>m.requiresAction).length,T=null==x?void 0:null===(g=x.results)||void 0===g?void 0:g[0],K=(0,ek.useMemo)(()=>{let m=eW()().subtract(12,"month").startOf("day");return v.filter(g=>{var v;let x=null===(v=g.originalClaim.last_claim_history)||void 0===v?void 0:v.created_at,k="Pagado"===g.statusText||"Cerrado"===g.statusText,E=x&&k?eW()(x):eW()(g.claimDate);return E.isSameOrAfter(m)&&k}).reduce((m,g)=>m+g.payableAmount,0)},[v]);return 0===v.length?null:(0,eC.jsxs)("div",{className:"space-y-4 mb-6",children:[E>0&&(0,eC.jsxs)("div",{className:"bg-pink-50 border border-pink-200 rounded-xl px-4 py-3 flex items-center gap-3",children:[(0,eC.jsx)(e7.Z,{className:"w-5 h-5 text-pink-500 flex-shrink-0"}),(0,eC.jsxs)("p",{className:"text-pink-700 text-base font-medium",children:[E," reembolso",E>1?"s":""," requiere",E>1?"n":""," tu atenci\xf3n"]})]}),(0,eC.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,eC.jsxs)("div",{className:"bg-white rounded-xl p-4 shadow-sm border border-gray-100",children:[(0,eC.jsx)("p",{className:"text-gray-600 text-sm font-medium mb-2",children:"Reembolso \xfaltimos 12 meses"}),(0,eC.jsx)("p",{className:"text-blue-500 text-3xl font-bold",children:(0,tM.Ed)(K)})]}),(0,eC.jsxs)("div",{className:"bg-white rounded-xl p-4 shadow-sm border border-gray-100",children:[(0,eC.jsx)("p",{className:"text-gray-600 text-sm font-medium mb-2",children:"Datos de pago"}),T?(0,eC.jsxs)("div",{className:"space-y-1 text-xs text-gray-500",children:[(0,eC.jsx)("p",{className:"font-medium",children:"Tus reembolsos llegar\xe1n a:"}),(0,eC.jsxs)("p",{children:[(0,eC.jsx)("span",{className:"font-bold",children:"Banco:"})," ",(0,tP.XC)(T.bank_name)]}),(0,eC.jsxs)("p",{children:[(0,eC.jsx)("span",{className:"font-bold",children:"Tipo de cuenta:"})," ",(0,tP.Ly)(T.account_type)]}),(0,eC.jsxs)("p",{children:[(0,eC.jsx)("span",{className:"font-bold",children:"N\xb0 de cuenta:"})," ",T.account_number]}),(null==k?void 0:k.rut)&&(0,eC.jsxs)("p",{children:[(0,eC.jsx)("span",{className:"font-bold",children:"Rut:"})," ",(0,tM.t2)(k.rut)]})]}):(0,eC.jsx)("p",{className:"text-xs text-gray-500",children:"Configura tu cuenta bancaria para recibir reembolsos"})]})]})]})}function ReimbursementsHistory(){var m,g;let[v,x]=(0,ek.useState)("all"),[k,E]=(0,ek.useState)(!1),[T,K]=(0,ek.useState)(),[et,en]=(0,ek.useState)(),[er,ei]=(0,ek.useState)(null),[es,el]=(0,ek.useState)(null),[ec,eu]=(0,ek.useState)(null),[ed,ep]=(0,ek.useState)(new Set),[em,ef]=(0,ek.useState)(!1),[eh,eg]=(0,ek.useState)(!1),{data:ev,isLoading:ey,isError:eb,refetch:ex}=(0,eL.e$)({includeCancelled:!0}),{data:e_,isLoading:ew,isError:eS,refetch:eE}=(0,t7.ou)(),{data:ej}=(0,t7.GH)(null==ec?void 0:ec.claimId),eN=(0,n_.mc)(),eR=null!==(m=null==ev?void 0:ev.some(m=>!m.is_cancelled))&&void 0!==m&&m,{allReimbursements:eI,petFilters:eT,groupedReimbursements:eO,draftReimbursements:eA}=(0,ek.useMemo)(()=>{var m;let g=null!==(m=null==e_?void 0:e_.items.filter(m=>{if(ed.has(m.id))return!1;if(isClaimDraft(m)){var g;return eW()(null!==(g=m.claim_date)&&void 0!==g?g:m.created_at).diff(eW()().subtract(1,"month"))>0}return!0}).map(m=>{var g,v;let x=null==ev?void 0:ev.find(g=>g.id===m.policy_id);return function(m,g,v){var x,k,E,T,K,et;let en=(0,nJ.sk)(null===(x=m.last_claim_history)||void 0===x?void 0:x.status_key,m.payable_amount),er=n4[en.tone],ei=(0,ns.n7)(null!==(E=m.category)&&void 0!==E?E:0);return{id:m.id,claimNumber:null!==(T=m.claim_int)&&void 0!==T?T:null,petName:g,reason:m.reason||"Reembolso",claimDate:null!==(K=m.claim_date)&&void 0!==K?K:m.created_at,lastUpdateDate:(null===(k=m.last_claim_history)||void 0===k?void 0:k.created_at)||m.claim_date||m.created_at,payableAmount:null!==(et=m.payable_amount)&&void 0!==et?et:0,policyId:v,statusText:en.label,statusColor:er.color,statusBgColor:er.bgColor,StatusIcon:er.Icon,requiresAction:en.requiresAction,isActive:en.isActive,originalClaim:m,categoryString:ei,categoryLabel:ns.sY[ei],categoryIcon:n5[ei]}}(m,null!==(v=null==x?void 0:null===(g=x.insurable_object)||void 0===g?void 0:g.name)&&void 0!==v?v:"",m.policy_id)}))&&void 0!==m?m:[],x=g.filter(m=>isClaimDraft(m.originalClaim)),k=g.filter(m=>!isClaimDraft(m.originalClaim)),E=k.sort((m,g)=>m.requiresAction&&!g.requiresAction?-1:!m.requiresAction&&g.requiresAction?1:eW()(g.lastUpdateDate).diff(eW()(m.lastUpdateDate))),T=x.sort((m,g)=>eW()(g.lastUpdateDate).diff(eW()(m.lastUpdateDate))),K=(null==ev?void 0:ev.map(m=>{var g,v;return{id:m.id.toString(),name:null!==(v=null===(g=m.insurable_object)||void 0===g?void 0:g.name)&&void 0!==v?v:""}}))||[],et="all"===v?E:E.filter(m=>m.policyId===v),en="all"===v?T:T.filter(m=>m.policyId===v),er=et.reduce((m,g)=>{let v=eW()(g.lastUpdateDate).format("YYYY-MM-DD");return m[v]||(m[v]=[]),m[v].push(g),m},{}),ei=Object.keys(er).sort((m,g)=>eW()(g).diff(eW()(m))).map(m=>{var g;return{date:m,reimbursements:null!==(g=er[m])&&void 0!==g?g:[]}});return{allReimbursements:g,petFilters:K,groupedReimbursements:ei,draftReimbursements:en}},[e_,ev,v,ed]),eM=(0,ek.useMemo)(()=>{var m;if(!ec||!ej||!ev)return null;let g=null!==(m=ev.find(m=>m.id===ej.policy_id))&&void 0!==m?m:ev.find(m=>m.id===ec.policyId);return g?{claim:ej,policy:g}:null},[ec,ej,ev]),handleReimbursementClick=m=>{if(isClaimDraft(m.originalClaim)){let g=getPolicyForReimbursement(m.policyId);g&&(K(m.id),en(g),E(!0))}else eu({claimId:m.id,policyId:m.policyId})},handleDeleteDraft=m=>{ei(m),el(null)},handleRefetch=()=>{ex(),eE()};if(ey||ew)return(0,eC.jsx)(e$.o,{isLoading:!0,isError:!1,refetch:handleRefetch});if(eb||eS)return(0,eC.jsx)(e$.o,{isLoading:!1,isError:!0,refetch:handleRefetch});let getPolicyForReimbursement=m=>null==ev?void 0:ev.find(g=>g.id.toString()===m);return(0,eC.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,eC.jsxs)("div",{className:"p-6 max-w-5xl mx-auto",children:[(0,eC.jsx)(ClaimWizard,{isOpen:k,onClose:()=>{E(!1),K(void 0),en(void 0)},claimId:T,initialPolicy:et}),(0,eC.jsx)(DeleteDraftModal,{isOpen:!!er,onClose:()=>ei(null),onConfirm:()=>{if(!er)return;let m=er.id;ep(g=>new Set(g).add(m)),ei(null),eN.mutate(m,{onSettled:()=>{ep(g=>{let v=new Set(g);return v.delete(m),v})},onError:m=>{let{message:g}
6=(0,e2.EV)(m,"Error al eliminar el borrador");el(g)}})},isLoading:eN.isLoading,petName:null!==(g=null==er?void 0:er.petName)&&void 0!==g?g:""}),eM&&(0,eC.jsx)(ClaimDetailModal,{isOpen:!!eM,onClose:()=>eu(null),claim:eM.claim,policy:eM.policy}),(0,eC.jsx)(nX.Z,{isOpen:em,onClose:()=>ef(!1)}),es&&(0,eC.jsx)("div",{className:"mb-4 p-4 bg-red-50 border border-red-200 rounded-xl text-red-700 text-sm",children:es}),(0,eC.jsx)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-6 mb-6",children:(0,eC.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,eC.jsxs)("div",{children:[(0,eC.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Mis Reembolsos"}),(0,eC.jsx)("p",{className:"text-gray-600 text-sm",children:"Revisa y gestiona el estado de tus solicitudes"})]}),eR&&(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>E(!0),iconLeft:(0,eC.jsx)(n1.Z,{className:"w-5 h-5 font-bold"}),className:"shadow-md hover:shadow-lg transition-shadow",children:"Nuevo reembolso"})]})}),(0,eC.jsxs)("button",{onClick:()=>ef(!0),className:"w-full mb-6 px-5 py-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-2 border-blue-200 rounded-2xl flex items-center gap-4 hover:from-blue-100 hover:to-indigo-100 hover:border-blue-300 transition-all group shadow-sm",children:[(0,eC.jsx)("div",{className:"w-10 h-10 bg-blue-500 rounded-xl flex items-center justify-center flex-shrink-0 group-hover:scale-110 transition-transform",children:(0,eC.jsx)(n2,{className:"w-6 h-6 text-white"})}),(0,eC.jsxs)("div",{className:"flex-1 text-left",children:[(0,eC.jsx)("p",{className:"font-bold text-gray-900 mb-0.5",children:"\xbfQu\xe9 documentos necesito?"}),(0,eC.jsx)("p",{className:"text-sm text-gray-600",children:"Conoce los requisitos para tu reembolso"})]}),(0,eC.jsx)(ts.Z,{className:"w-6 h-6 text-blue-400 group-hover:text-blue-600 group-hover:translate-x-1 transition-all"})]}),0===eI.length?(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 text-center py-20 px-6",children:[(0,eC.jsx)("div",{className:"w-20 h-20 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-2xl flex items-center justify-center mx-auto mb-6",children:(0,eC.jsx)(t1.Z,{className:"w-10 h-10 text-blue-500"})}),(0,eC.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"No tienes reembolsos a\xfan"}),(0,eC.jsx)("p",{className:"text-gray-600 mb-8 max-w-md mx-auto",children:"Cuando solicites tu primer reembolso aparecer\xe1 aqu\xed"})]}):(0,eC.jsxs)(eC.Fragment,{children:[(0,eC.jsx)(ReimbursementsSummary,{reimbursements:eI}),eT.length>1&&(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-4 mb-6",children:[(0,eC.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3",children:"Filtrar por mascota"}),(0,eC.jsxs)("div",{className:"flex gap-2 overflow-x-auto pb-1",children:[(0,eC.jsx)(PetFilterTab,{pet:{id:"all",name:"Todos"},isSelected:"all"===v,onPress:()=>x("all")}),eT.map(m=>(0,eC.jsx)(PetFilterTab,{pet:m,isSelected:v===m.id,onPress:()=>x(m.id)},m.id))]})]}),eA.length>0&&(0,eC.jsx)(t8.zF,{open:eh,onOpenChange:eg,className:"mb-6",children:(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden",children:[(0,eC.jsx)(t8.wy,{className:"w-full",children:(0,eC.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 bg-gradient-to-r from-pink-50 to-rose-50 hover:from-pink-100 hover:to-rose-100 transition-all cursor-pointer group",children:[(0,eC.jsxs)("div",{className:"flex items-center gap-4",children:[(0,eC.jsx)("div",{className:"w-10 h-10 bg-pink-500 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,eC.jsx)(t1.Z,{className:"w-5 h-5 text-white"})}),(0,eC.jsxs)("div",{className:"text-left",children:[(0,eC.jsxs)("span",{className:"font-bold text-pink-900 block",children:[eA.length," borrador",eA.length>1?"es":""," pendiente",eA.length>1?"s":""]}),(0,eC.jsx)("span",{className:"text-xs text-pink-700",children:eh?"Click para ocultar":"Click para ver y completar"})]})]}),(0,eC.jsx)(ts.Z,{className:(0,tc.cn)("w-6 h-6 text-pink-500 transition-all duration-300 group-hover:text-pink-700",{"rotate-90":eh})})]})}),(0,eC.jsx)(t8.Fw,{children:(0,eC.jsx)("div",{className:"p-4 space-y-3 bg-gray-50",children:eA.map(m=>(0,eC.jsx)(ReimbursementCard,{reimbursement:m,onClick:()=>handleReimbursementClick(m),isDraft:!0,onDelete:()=>handleDeleteDraft(m)},"draft-".concat(m.id,"-").concat(m.policyId)))})})]})}),0===eO.length?(0,eC.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 text-center py-12 px-6",children:[(0,eC.jsx)("div",{className:"w-16 h-16 bg-gray-100 rounded-2xl flex items-center justify-center mx-auto mb-4",children:(0,eC.jsx)(n3.Z,{className:"w-8 h-8 text-gray-400"})}),(0,eC.jsx)("p",{className:"text-gray-600 font-medium",children:eA.length>0?"No tienes reembolsos enviados a\xfan":"No hay reembolsos para mostrar"}),(0,eC.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Completa tus borradores para verlos aqu\xed"})]}):(0,eC.jsx)("div",{className:"space-y-8",children:eO.map(m=>{let g=eW()(m.date),v=g.isSame(eW()(),"day"),x=g.isSame(eW()().subtract(1,"day"),"day"),k=(0,tB.n4)(m.date);return(0,eC.jsxs)("div",{children:[(0,eC.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,eC.jsx)("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent via-gray-200 to-gray-200"}),(0,eC.jsx)("p",{className:"text-sm text-gray-600 font-semibold capitalize px-3 py-1 bg-white rounded-full border border-gray-200 shadow-sm",children:v?"Hoy, ".concat(k):x?"Ayer, ".concat(k):k}),(0,eC.jsx)("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent via-gray-200 to-gray-200"})]}),(0,eC.jsx)("div",{className:"space-y-3",children:m.reimbursements.map(m=>(0,eC.jsx)(ReimbursementCard,{reimbursement:m,onClick:()=>handleReimbursementClick(m),isDraft:!1,onDelete:void 0},"".concat(m.id,"-").concat(m.policyId)))})]},m.date)})})]})]})})}var n6=v(46443);let n7=ek.createContext({activeTab:"policies",setActiveTab:()=>{}}),n8="profile-sidebar-collapsed",Tab=m=>{var g,v;let{activeTab:x,setActiveTab:k}=(0,ek.useContext)(n7),E=(0,eI.useRouter)(),T=null!==(g=m.isCollapsed)&&void 0!==g&&g,K=null!==(v=m.isNavBar)&&void 0!==v&&v,et=x===m.name,en=(0,eC.jsxs)("button",{onClick:function(){K?(E.push(eV.Z.profile.index(m.name)),m.closeModalCallback&&m.closeModalCallback(!1)):k(m.name)},className:(0,tc.cn)("relative flex items-center w-full py-3 transition-colors duration-150",{"px-6":!T,"justify-center px-0":T,"bg-blue-50 text-blue-500":et,"text-neutral-500 hover:bg-blue-50 hover:text-blue-500":!et}),children:[et&&(0,eC.jsx)("div",{className:"absolute inset-y-0 left-0 w-1 h-full bg-blue-500"}),(0,eC.jsx)("div",{className:(0,tc.cn)("w-6 h-6 flex-shrink-0",{"mx-auto":T}),children:m.icon}),!T&&(0,eC.jsx)("div",{className:"ml-6 text-left",children:m.label})]});return T?(0,eC.jsxs)(n6.u,{children:[(0,eC.jsx)(n6.aJ,{asChild:!0,children:en}),(0,eC.jsx)(n6._v,{side:"right",sideOffset:8,children:m.label})]}):en},Panel=m=>{let{name:g,children:v}=m,{activeTab:x}=(0,ek.useContext)(n7);return x===g?(0,eC.jsx)("div",{children:v}):null},ChatScreen=()=>((0,ek.useEffect)(()=>{(0,eT.D)("showMessages")},[]),(0,eC.jsx)(eC.Fragment,{})),DesktopMenuOpen=m=>{var g;let{data:v}=(0,eM.XD)(),[x,k]=(0,ek.useState)([]),E=(0,eI.useRouter)(),T=(0,eN.w)(m=>m.resetOnboarding);(0,ek.useEffect)(()=>{v&&k(v.filter(m=>!m.has_policy))},[v]);
6let K=null!==(g=m.isCollapsed)&&void 0!==g&&g,et=(0,eC.jsxs)("a",{className:(0,tc.cn)("relative flex items-center w-full py-3 cursor-pointer text-neutral-500 hover:bg-blue-50 hover:text-blue-500 transition-colors duration-150",{"px-6":!K,"justify-center px-0":K}),href:eV.Z.blog.index(),children:[(0,eC.jsx)("div",{className:(0,tc.cn)("w-6 h-6 flex-shrink-0",{"mx-auto":K}),children:(0,eC.jsx)(design_pencil,{className:"w-6 h-6"})}),!K&&(0,eC.jsx)("div",{className:"ml-6 text-left",children:"Blog"})]}),en=(0,eC.jsxs)("button",{className:(0,tc.cn)("relative flex items-center w-full py-3 cursor-pointer hover:bg-pink-50 transition-colors duration-150",{"px-6":!K,"justify-center px-0":K}),onClick:m.onLogoutClick,children:[(0,eC.jsx)("div",{className:(0,tc.cn)("w-6 h-6 flex-shrink-0",{"mx-auto":K}),children:(0,eC.jsx)(logout,{className:"text-pink-600 w-6 h-6"})}),!K&&(0,eC.jsx)("div",{className:"ml-6 text-pink-600 text-left",children:"Cerrar sesi\xf3n"})]});return(0,eC.jsxs)("div",{className:(0,tc.cn)("flex flex-col sticky top-0 left-0 h-screen bg-white z-30 shadow-4xl transition-all duration-300 ease-in-out",{"w-[72px]":K,"w-[280px]":!K,hidden:!m.menuOpen}),children:[(0,eC.jsxs)("div",{className:(0,tc.cn)("flex items-center border-b border-neutral-100",{"justify-center py-6":K,"justify-between py-8 px-6":!K}),children:[!K&&(0,eC.jsx)(eQ(),{alt:"Cacttus",src:"/static/logo-cacttus-full.svg",className:"object-center",width:116,height:24}),(0,eC.jsx)("button",{onClick:m.onToggle,className:(0,tc.cn)("p-2 rounded-lg text-neutral-400 hover:text-neutral-600 hover:bg-neutral-100 transition-colors",{"mx-auto":K}),title:K?"Expandir":"Colapsar",children:(0,eC.jsx)(tm,{className:(0,tc.cn)("w-5 h-5 transition-transform duration-1000",{"rotate-180":K})})})]}),(0,eC.jsxs)("nav",{className:"flex-1 pt-4",children:[(0,eC.jsx)(Tab,{name:"policies",label:"Inicio",icon:(0,eC.jsx)(home,{className:"w-6 h-6"}),isCollapsed:K}),(0,eC.jsx)(Tab,{name:"reimbursements",label:"Reembolsos",icon:(0,eC.jsx)(tf.Z,{className:"w-6 h-6"}),isCollapsed:K}),(0,eC.jsx)(Tab,{name:"chat",label:"Chat",icon:(0,eC.jsx)(chat_bubble,{className:"w-6 h-6"}),isCollapsed:K}),K?(0,eC.jsxs)(n6.u,{children:[(0,eC.jsx)(n6.aJ,{asChild:!0,children:et}),(0,eC.jsx)(n6._v,{side:"right",sideOffset:8,children:"Blog"})]}):et,(0,eC.jsx)(Tab,{name:"invite",label:"\xa1Invita y gana!",icon:(0,eC.jsx)(share_android,{className:"w-6 h-6"}),isCollapsed:K}),(0,eC.jsx)(Tab,{name:"benefits",label:"Beneficios",icon:(0,eC.jsx)(td.Z,{className:"w-6 h-6"}),isCollapsed:K}),(0,eC.jsx)(Tab,{name:"payments",label:"Cuotas",icon:(0,eC.jsx)(th.Z,{className:"w-6 h-6"}),isCollapsed:K}),(0,eC.jsx)(Tab,{name:"settings",label:"Opciones",icon:(0,eC.jsx)(settings,{className:"w-6 h-6"}),isCollapsed:K})]}),x.length>0&&!K&&(0,eC.jsx)("div",{className:"px-6 pb-4",children:(0,eC.jsx)(eP.z,{className:"w-full",variant:"brand-destructive",iconRight:(0,eC.jsx)(tg.Z,{className:"h-5 w-5"}),onClick:()=>{var m;(null===(m=x[0])||void 0===m?void 0:m.last_coverage_bundle_id)?E.push(eV.Z.frontend.accidentCoverage(x[0].last_coverage_bundle_id)):(T(),E.push(eV.Z.pet.new.index()))},children:"Seguir cotizaci\xf3n"})}),(0,eC.jsx)("div",{className:"mt-auto border-t border-neutral-100",children:K?(0,eC.jsxs)(n6.u,{children:[(0,eC.jsx)(n6.aJ,{asChild:!0,children:en}),(0,eC.jsx)(n6._v,{side:"right",sideOffset:8,children:"Cerrar sesi\xf3n"})]}):en})]})},DesktopMenu=m=>{var g;let v=(0,eI.useRouter)(),{isCollapsed:x,toggle:k}=function(){let[m,g]=(0,ek.useState)(!1);return(0,ek.useEffect)(()=>{let m=localStorage.getItem(n8);"true"===m&&g(!0)},[]),{isCollapsed:m,toggle:()=>{g(m=>(localStorage.setItem(n8,String(!m)),!m))}}}(),E=null!==(g=v.query.tab)&&void 0!==g?g:"policies";return(0,eC.jsx)(n7.Provider,{value:{activeTab:E,setActiveTab:m=>{v.push(eV.Z.profile.index(m),void 0,{shallow:!0})}},children:(0,eC.jsx)(n6.pn,{delayDuration:100,children:(0,eC.jsxs)("div",{className:"flex flex-row",children:[(0,eC.jsx)(DesktopMenuOpen,{menuOpen:!0,onLogoutClick:m.onLogoutClick,isCollapsed:x,onToggle:k}),(0,eC.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,eC.jsx)(Panel,{name:"policies",children:(0,eC.jsx)(Policies,{})}),(0,eC.jsx)(Panel,{name:"reimbursements",children:(0,eC.jsx)(ReimbursementsHistory,{})}),(0,eC.jsx)(Panel,{name:"chat",children:(0,eC.jsx)(ChatScreen,{})}),(0,eC.jsx)(Panel,{name:"invite",children:(0,eC.jsx)(ej.Z,{})}),(0,eC.jsx)(Panel,{name:"benefits",children:(0,eC.jsx)(tO.default,{})}),(0,eC.jsx)(Panel,{name:"payments",children:(0,eC.jsx)(profile_PaymentsPage,{})}),(0,eC.jsx)(Panel,{name:"settings",children:(0,eC.jsx)(Settings,{})})]})]})})})},MobileMenu=m=>{var g,v;let x=(0,eI.useRouter)(),k=null!==(g=x.query.tab)&&void 0!==g?g:"policies",E=null!==(v=m.isNavBar)&&void 0!==v&&v,onUnauthenticatedClick=async g=>{await x.push(g),m.onNavBarClose&&m.onNavBarClose()};return(0,eC.jsxs)(n7.Provider,{value:{activeTab:k,setActiveTab:m=>{x.push(eV.Z.profile.index(m),void 0,{shallow:!0})}},children:[!E&&(0,eC.jsxs)("div",{className:(0,tc.cn)("col-span-4"),children:[(0,eC.jsx)(Panel,{name:"policies",children:(0,eC.jsx)(Policies,{})}),(0,eC.jsx)(Panel,{name:"reimbursements",children:(0,eC.jsx)(ReimbursementsHistory,{})}),(0,eC.jsx)(Panel,{name:"invite",children:(0,eC.jsx)(ej.Z,{})}),(0,eC.jsx)(Panel,{name:"benefits",children:(0,eC.jsx)(tO.default,{})}),(0,eC.jsx)(Panel,{name:"payments",children:(0,eC.jsx)(profile_PaymentsPage,{})}),(0,eC.jsx)(Panel,{name:"settings",children:(0,eC.jsx)(Settings,{})})]}),(0,eC.jsxs)("div",{className:(0,tc.cn)("flex flex-col h-screen md:hidden bg-white pb-12 w-[320px]",{hidden:!E}),children:[(0,eC.jsxs)("div",{className:"relative bg-neutral-50 flex justify-bwtween py-6 px-7",children:[(0,eC.jsx)(eQ(),{alt:"Cacttus",src:"/static/logo-cacttus-full.svg",className:"object-center",width:116,height:24}),(0,eC.jsx)("button",{className:"absolute top-6 right-6",onClick:()=>{m.onNavBarClose&&m.onNavBarClose()},children:(0,eC.jsx)(tu.Z,{className:"w-6"})})]}),m.user?(0,eC.jsxs)("div",{className:"flex flex-col h-full pt-3",children:[(0,eC.jsx)(Tab,{isNavBar:E,closeModalCallback:m.onNavBarClose,name:"policies",label:"Inicio",icon:(0,eC.jsx)(home,{className:"w-6"})}),(0,eC.jsx)(Tab,{isNavBar:E,closeModalCallback:m.onNavBarClose,name:"reimbursements",label:"Reembolsos",icon:(0,eC.jsx)(tf.Z,{className:"w-6"})}),(0,eC.jsxs)("button",{className:"relative flex px-6 py-3 items-center space-x-6 w-full cursor-pointer",onClick:()=>(0,eT.D)("showMessages"),children:[(0,eC.jsx)(chat_bubble,{className:"text-neutral-500 w-6"}),(0,eC.jsx)("div",{className:"text-neutral-500 text-left grow",children:"Chat"})]}),(0,eC.jsxs)("a",{className:"relative flex px-6 py-3 items-center space-x-6 w-full cursor-pointer",href:eV.Z.blog.index(),children:[(0,eC.jsx)(design_pencil,{className:"text-neutral-500 w-6"}),(0,eC.jsx)("div",{className:"text-neutral-500 text-left grow",children:"Blog"})]}),(0,eC.jsx)(Tab,{isNavBar:E,closeModalCallback:m.onNavBarClose,name:"invite",label:"\xa1Invita y gana!",icon:(0,eC.jsx)(share_android,{className:"w-6"})}),(0,eC.jsx)(Tab,{isNavBar:E,closeModalCallback:m.onNavBarClose,name:"benefits",label:"Beneficios",icon:(0,eC.jsx)(td.Z,{className:"w-6"})}),(0,eC.jsx)(Tab,{isNavBar:E,closeModalCallback:m.onNavBarClose,name:"payments",label:"Cuotas",icon:(0,eC.jsx)(th.Z,{className:"w-6"})}),(0,eC.jsx)(Tab,{isNavBar:E,closeModalCallback:m.onNavBarClose,name:"settings",label:"Opciones",icon:(0,eC.jsx)(settings,{className:"w-6"})}),(0,eC.jsx)("div",{className:"grow mt-auto"}),(0,eC.jsxs)("button",{className:"relative flex px-6 py-3 items-center space-x-6 w-full cursor-pointer",onClick:m.onLogoutClick,children:[(0,eC.jsx)(logout,{className:"text-pink-600 w-6"}),(0,eC.jsx)("div",{className:"text-pink-600 text-left grow",children:"Cerrar sesi\xf3n"})]})]}):(0,eC.jsxs)("div",{className:"flex flex-col h-full space-y-6 pt-6",children:[(0,eC.jsx)("button",{className:"relative flex px-6 items-center space-x-6 w-full cursor-pointer",onClick:()=>void onUnauthenticatedClick("/profile"),children:(0,eC.jsx)("div",{className:"text-neutral-500 text-left grow",children:"Iniciar Sesi\xf3n"})}),(0,eC.jsx)("a",{className:"relative flex px-6 items-center space-x-6 w-full cursor-pointer",href:eV.Z.blog.index(),children:(0,eC.jsx)("div",{className:"text-neutral-500 text-left grow",children:"Blog"})}),(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>void onUnauthenticatedClick(eV.Z.pet.new.index()),className:"self-start mx-6",children:"Cotizar seguro"})]})]})]})};var n9=(0,eE.Z)(()=>{let{data:m}=(0,eR.a)(),[g,v]=(0,ek.useState)(!1),[x,k]=(0,ek.useState)(!0),[E,T]=(0,ek.useState)(!0),K=(0,tl.t)(m=>m.logout),et=(0,eX.NL)(),en=(0,eJ.D)({mutationFn:async m=>{try{let g=await (0,e1.h)(tW,{method:"put",url:eV.Z.user.update(
6),data:m});return g.data}catch(m){if(m instanceof tC.AxiosError&&m.response){if(400===m.response.status)throw Error("Datos inv\xe1lidos. Por favor, intenta nuevamente.");if(401===m.response.status)throw Error("No tienes autorizaci\xf3n para realizar esta acci\xf3n.")}throw(0,e2.rj)(m),Error("Hubo un error al actualizar la aceptaci\xf3n de t\xe9rminos. Por favor, intenta nuevamente.")}}}),{data:er,isLoading:ei}=(0,eL.e$)(),[es,el]=(0,ek.useState)(!1),[ec,eu]=(0,ek.useState)(!1),[ed,ep]=(0,ek.useState)(!1),em=(0,ek.useMemo)(()=>{var m;return null!==(m=null==er?void 0:er.filter(m=>!m.is_cancelled))&&void 0!==m?m:[]},[er]);function handleLogout(){K(),window.location.href=eV.Z.index()}(0,ek.useEffect)(()=>{m&&!1===m.is_tc_accepted&&v(!0)},[m]),(0,ek.useEffect)(()=>{if(ei||es||ed)return;let m=em.some(m=>!m.mobile_onboarding_completed);em.length>0&&m&&(eu(!1),el(!0))},[ei,em,es,ed]);let handleAcceptTerms=async()=>{if(!x){(0,e5.Am)({variant:"warning",description:"Debes aceptar los T\xe9rminos y Condiciones para continuar."});return}try{await en.mutateAsync({is_tc_accepted:!0,is_mkt_accepted:E}),await et.invalidateQueries({queryKey:e3.a.user.index()}),(0,e5.Am)({title:"T\xe9rminos aceptados",description:"Has aceptado exitosamente los T\xe9rminos y Condiciones.",variant:"success"}),v(!1)}catch(m){(0,e5.Am)({title:"Error",description:m instanceof Error?m.message:"Hubo un error al procesar tu solicitud.",variant:"destructive"})}},handleCloseTermsModal=()=>{k(!1),T(!1),v(!1)};return(0,eC.jsxs)("div",{className:"min-h-screen",children:[(0,eC.jsx)(eD.Vq,{open:g,onOpenChange:()=>{},children:(0,eC.jsxs)(eD.cZ,{hideCloseButton:!0,className:"max-w-md rounded-2xl p-6",onInteractOutside:m=>m.preventDefault(),onEscapeKeyDown:m=>m.preventDefault(),children:[(0,eC.jsxs)("div",{className:"flex items-start justify-between",children:[(0,eC.jsxs)("div",{className:"flex items-center",children:[(0,eC.jsx)("div",{className:"flex-shrink-0",children:(0,eC.jsx)(tv.Z,{className:"h-6 w-6 text-blue-500","aria-hidden":"true"})}),(0,eC.jsx)("h3",{className:"ml-3 text-lg font-bold leading-6 text-gray-900",children:"T\xe9rminos y Condiciones"})]}),(0,eC.jsxs)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:handleCloseTermsModal,children:[(0,eC.jsx)("span",{className:"sr-only",children:"Cerrar"}),(0,eC.jsx)(to.Z,{className:"h-6 w-6","aria-hidden":"true"})]})]}),(0,eC.jsxs)("div",{className:"mt-4",children:[(0,eC.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Hemos actualizado nuestros T\xe9rminos y Condiciones. Para continuar usando Cacttus, necesitas aceptar las nuevas condiciones."}),(0,eC.jsxs)("div",{className:"space-y-4",children:[(0,eC.jsxs)("div",{className:"flex items-start",children:[(0,eC.jsx)("input",{id:"accept-terms",name:"accept-terms",type:"checkbox",checked:x,onChange:m=>k(m.target.checked),className:"mt-1 h-4 w-4 text-blue-500 border-gray-300 rounded focus:ring-blue-500"}),(0,eC.jsxs)("label",{htmlFor:"accept-terms",className:"ml-3 text-sm text-gray-700",children:["Acepto los"," ",(0,eC.jsx)(ez(),{href:"/terms",target:"_blank",className:"text-blue-500 hover:text-blue-600 underline",children:"T\xe9rminos y Condiciones"})," ","de Cacttus ",(0,eC.jsx)("span",{className:"text-red-500",children:"*"})]})]}),(0,eC.jsxs)("div",{className:"flex items-start",children:[(0,eC.jsx)("input",{id:"accept-marketing",name:"accept-marketing",type:"checkbox",checked:E,onChange:m=>T(m.target.checked),className:"mt-1 h-4 w-4 text-blue-500 border-gray-300 rounded focus:ring-blue-500"}),(0,eC.jsx)("label",{htmlFor:"accept-marketing",className:"ml-3 text-sm text-gray-700",children:"Quiero recibir informaci\xf3n y beneficios sobre mi seguro por tel\xe9fono, correo o WhatsApp"})]})]}),(0,eC.jsxs)("div",{className:"mt-6 flex space-x-3",children:[(0,eC.jsx)(eP.z,{variant:"brand",onClick:()=>void handleAcceptTerms(),disabled:!x||en.isLoading,className:"flex-1",children:en.isLoading?"Procesando...":"Aceptar"}),(0,eC.jsx)(eP.z,{onClick:handleCloseTermsModal,variant:"brand-outline",disabled:en.isLoading,className:"flex-1",children:"Cancelar"})]}),(0,eC.jsx)("p",{className:"mt-3 text-xs text-gray-500 text-center",children:"* Requerido para continuar usando la plataforma"})]})]})}),(0,eC.jsx)(TokuMigrationPopup,{}),(0,eC.jsx)(PolicyOnboardingModal,{isOpen:es,onClose:()=>{el(!1),ep(!0)},policies:em,showAllPolicies:ec}),em.length>0&&(0,eC.jsx)("button",{type:"button",onClick:()=>{eu(!0),ep(!1),el(!0)},title:"Ver introducci\xf3n de tu p\xf3liza",className:"fixed bottom-6 right-6 z-40 w-10 h-10 rounded-full bg-white shadow-4xl border border-neutral-100 flex items-center justify-center text-neutral-500 hover:text-blue-500 hover:border-blue-200 transition-colors",children:(0,eC.jsx)(ty.Z,{className:"w-5 h-5"})}),(0,eC.jsx)("div",{className:"md:hidden",children:(0,eC.jsx)(MobileMenu,{user:m,onLogoutClick:handleLogout})}),(0,eC.jsx)("div",{className:"hidden md:block ",children:(0,eC.jsx)(DesktopMenu,{onLogoutClick:handleLogout})})]})})},63271:function(m,g,v){"use strict";v.d(g,{F0:function(){return useAuthBenefitsQuery},i_:function(){return useCompanyBenefitsQuery}});var x=v(7040),k=v(44994),E=v(13346),T=v(67669),K=v(53538);let et=K.Ry({id:K.Z_(),name:K.Z_(),description:K.Z_()});K.IX(et);let en=K.Ry({id:K.G0([K.Z_(),K.Rx()]).transform(m=>Number(m)),description:K.Z_(),method:K.Z_(),url:K.Z_().nullable(),discount_code:K.Z_().nullable(),partnership_name:K.Z_(),category_name:K.Z_().nullable(),logo_url:K.Z_().nullable(),is_active:K.O7(),can_redeem:K.O7(),availability:K.Z_(),benef
6it_detail:K.Z_().nullable(),company_description:K.Z_().nullable(),end_date:K.Z_().nullable(),redemption_type:K.Z_(),is_new:K.O7(),company_id:K.Rx(),company_benefit_count:K.Rx()}),er=K.Ry({benefits:K.IX(en)}),ei=K.Ry({company_id:K.Rx(),company_name:K.Z_(),logo_url:K.Z_().nullable(),company_description:K.Z_().nullable(),benefits:K.IX(en)});function useAuthBenefitsQuery(m,g){var v;return(0,x.a)({queryKey:T.a.benefits.authIndex(m),queryFn:async()=>{let g=new URLSearchParams;(null==m?void 0:m.search)&&g.set("search",m.search),(null==m?void 0:m.category)&&g.set("category",m.category);let v=g.toString(),x="".concat(E.Z.benefits.authIndex()).concat(v?"?".concat(v):""),{data:T}=await (0,k.h)(er,{method:"get",url:x});return T.benefits},keepPreviousData:null!==(v=null==g?void 0:g.keepPreviousData)&&void 0!==v&&v})}function useCompanyBenefitsQuery(m){return(0,x.a)({queryKey:T.a.benefits.company(null!=m?m:0),queryFn:async()=>{let{data:g}=await (0,k.h)(ei,{method:"get",url:E.Z.benefits.company(m)});return g},enabled:!!m})}},77353:function(m,g,v){"use strict";v.d(g,{P:function(){return useCardQuery},q:function(){return ei}});var x=v(7040),k=v(44994),E=v(53538),T=v(20463),K=v(43889),et=v(89644),en=v(13346);let er=E.Ry({card_number:E.Z_().nullish(),card_type:E.Z_().nullish(),response_code:E.Rx().nullish(),created_at:E.Z_().nullish()}),ei=["user","card"],useCardQuery=()=>{let m=(0,K.t)(m=>m.token);return(0,x.a)(ei,async()=>{try{let{data:m}=await (0,k.h)(er,{method:"get",url:en.Z.user.card()});return m}catch(g){var m;if(g instanceof et.AxiosError&&(null===(m=g.response)||void 0===m?void 0:m.status)===404)return null;throw(0,T.Tb)(g),g}},{enabled:!!m,staleTime:3e5,retry:!1})}},68096:function(m,g,v){"use strict";v.d(g,{Y:function(){return useLastCheckoutQuery},w:function(){return useCheckoutQuery}});var x=v(67669),k=v(7040),E=v(14016),T=v(44994),K=v(26228),et=v(17774),en=v(13346);let er=et.EQ.passthrough();function useLastCheckoutQuery(m){let g=null==m?void 0:m.onSuccess;return(0,k.a)({queryKey:x.a.checkout.last(),queryFn:async()=>(0,K.g)(),onSuccess:g})}function useCheckoutQuery(m){return(0,k.a)({queryKey:x.a.checkout.show(m.checkoutId),queryFn:async()=>{if(!m.checkoutId)throw Error("No checkout id");let g=await (0,T.h)(er,{method:"get",url:en.Z.checkout.show(m.checkoutId)});return g.data},onError:E.rj,enabled:!!m.checkoutId})}},3386:function(m,g,v){"use strict";v.d(g,{CL:function(){return useUpdateAdminClaimMutation},C_:function(){return useReviewClaimWithAIMutation},DA:function(){return useMedicalSpecialtiesQuery},Ef:function(){return usePreSettlementHistoryQuery},Ex:function(){return useUpdateClaimDocumentMutation},GH:function(){return useClaimQuery},IJ:function(){return useDeleteClaimDocumentItemMutation},KP:function(){return useCreateClaimHistoryMutation},L$:function(){return useGetDuplicateClaimDocumentsQuery},Mr:function(){return useSetOriginalClaimMutation},NB:function(){return useClaimReasonsQuery},Q:function(){return useCreateDiagnosisMutation},SX:function(){return useCreateClaimDocumentItemMutation},TY:function(){return useFileTypesQuery},Tv:function(){return E},ZS:function(){return useExtractClaimDocumentItemsMutation},ZZ:function(){return useAdminClaimCustomerViewQuery},_U:function(){return useClaimsQuery},bP:function(){return useCreateClaimCommentMutation},bb:function(){return useClaimDocumentItemCategoriesQuery},c0:function(){return useDeleteExternalClaimIdMutation},es:function(){return useUpdateClaimDocumentItemMutation},fd:function(){return useDuplicateClaimMutation},g$:function(){return useDiagnosesQuery},gN:function(){return useDuplicateClaimDocumentMutation},ky:function(){return useAdminClaimChangeHistoryQuery},l1:function(){return useHistoryStatusesQuery},n6:function(){return useUpdateClaimDocumentRotationMutation},oB:function(){return useUpsertAIPromptMutation},ou:function(){return useAllClaimsQuery},tt:function(){return useDeleteClaimDocumentMutation},uk:function(){return useAIPromptQuery},vb:function(){return useCreateClaimDocumentMutation},xj:function(){return useConvertClaimImagesMutation},xq:function(){return useAdminClaimQuery},yG:function(){return useRevertSettlementMutation}});var x,k,E,T,K=v(53538),et=v(7040),en=v(55830),er=v(62350),ei=v(13346),es=v(44994),el=v(35151),ec=v(67669),eu=v(6450),ed=v(68344),ep=v(14016),em=v(89644),ef=v(65864),eh=v(15515);(x=E||(E={}
6))[x.Receipt=1]="Receipt";let eg=K.Ry({id:K.G0([K.Z_().uuid(),K.oQ.string()]),status:K.Rx(),status_name:K.Z_(),description:K.Z_().nullable(),status_key:K.Z_(),created_at:K.G0([K.Z_().datetime(),K.oQ.date()]),comment:K.Z_().nullable(),report:K.Z_().nullable(),report_url:K.Z_().url().nullable(),adjuster_agent:K.Rx().nullable()}),ev=K.Ry({id:K.Rx(),user:K.G0([eu.Bh.pick({id:!0,first_name:!0,last_name:!0,email:!0}),K.Rx(),K.Z_()]).nullable().optional(),user_email:K.Z_().email().optional().nullable(),claim:K.Z_().uuid().optional(),comment:K.Z_().nullable(),created_at:K.Z_(),updated_at:K.Z_().nullable().optional()});K.Ry({id:K.Rx(),name:K.Z_(),rut:K.Z_().nullable()});let ey=K.Ry({id:K.Rx(),name:K.Z_()}),eb=K.Ry({id:K.Rx(),claim_document:K.Rx().optional(),name:K.Z_(),category:K.G0([ey,K.Rx()]).nullable(),category_name:K.Z_().optional().nullable(),user_category:K.G0([ey,K.Rx()]).nullable(),user_category_name:K.Z_().optional().nullable(),provider_service:K.Rx().optional().nullable(),unit_price:K.Rx(),quantity:K.Rx(),coverable:K.O7(),justified:K.O7(),ai_extracted_data:K.IM(K._4()).optional().nullable(),ai_coverable_explanation:K.Z_().nullable().optional(),ai_justified_explanation:K.Z_().nullable().optional(),ai_justification_document_filename:K.Z_().nullable().optional()}),ex=K.Ry({id:K.Rx(),item:K.Z_(),item_detail:K.Z_().optional().nullable(),unit_value:K.Rx(),quantity:K.Rx(),total:K.Rx(),coverable:K.O7(),justified:K.O7(),ai_coverable_explanation:K.Z_().nullable().optional(),ai_justified_explanation:K.Z_().nullable().optional(),ai_justification_document_filename:K.Z_().nullable().optional()}),e_=K.Ry({id:K.Rx(),claim:K.Z_().uuid(),document:K.Z_().nullable(),has_preserved_original:K.O7().nullish(),original_document_url:K.Z_().nullish(),document_name:K.Z_(),document_number:K.Z_().nullable(),issuer_dni:K.Z_().nullable(),clinic:K.Rx().nullable(),emission_date:K.Z_().optional().nullable(),file_format:K.Rx().nullable(),file_type:K.Rx().nullable(),metadata:K.IX(ex).optional().nullable(),related_document:K.Rx().nullable(),created_at:K.Z_().optional().nullable(),updated_at:K.Z_().optional().nullable(),has_issues:K.O7(),issue_comment:K.Z_(),is_edited_by_user:K.O7().optional().nullable(),ai_extracted_data:K.Yj().nullable(),is_duplicate_receipt:K.O7().optional().nullable(),total_amount:K.Rx().optional().nullable(),items:K.IX(eb).optional().nullable(),rotation:K.Rx().nullish(),info_request_round:K.Rx().nullish(),previous_document:K.Rx().nullish()}),ew=K.Ry({id:K.Rx().optional(),account_number:K.Z_(),bank_name:K.G0([K.Z_(),K.Rx()]).optional().nullable()}),eS=K.Ry({id:K.Z_(),name:K.Z_()}),eC=K.Ry({id:K.Z_(),coverage:eS.optional().nullable(),deductible:K.Rx().nullable().optional(),amount_limit:K.Rx().nullable().optional(),percentage_covered:K.Rx().nullable().optional()}),ek=K.Ry({id:K.Z_(),items:K.IX(eC).optional().nullable(),has_illnesses:K.O7().optional().nullable(),has_preventive_package:K.O7().optional().nullable()}),eE=K.Ry({id:K.Rx(),name:K.Z_().optional(),insurance_company:K.Z_().optional()}),ej=K.Ry({id:K.Rx(),email:K.Z_().email(),first_name:K.Z_(),last_name:K.Z_(),name:K.Z_().optional(),phone:K.G0([K.Z_(),K.Rx()]).optional().nullable(),rut:K.Z_().nullable().optional(),bank_account:ew.optional().nullable()}),eN=K.Ry({created_at:K.Z_(),last_symptoms:K.IX(K.Z_()).default([]),pet_conditions:K.IX(K.Z_()).default([]),unknown_categories:K.IX(K.Z_()).default([]),declared_after_policy_creation:K.O7().default(!1)}),eR=K.Ry({id:K.Rx(),birthdate:K.Z_().optional().nullable(),name:K.Z_().optional(),kind:K.Z_().nullable().optional(),breed:K.Z_().nullable().optional(),age_in_words:K.Z_().nullable().optional(),formatted_preexisting_conditions:K.Z_().optional().nullable(),preexisting_conditions:K.Z_().optional().nullable(),preexisting_conditions_record:K.IX(eN).optional().default([])}),eI=K.Ry({due_date:K.Z_().nullable().optional()}),eP=K.Ry({id:K.Z_().uuid(),amount:K.Rx(),status:K.Z_(),created_at:K.Z_().datetime()}),eT=K.Ry({id:K.Z_().uuid(),status:K.Z_(),external_id:K.Z_().uuid().nullable(),amount:K.Rx(),created_at:K.Z_().datetime()}),eO=K.Ry({id:K.Rx(),amount:K.Rx(),is_paid:K.O7(),last_payment_status_key:K.Z_(),payout_transactions:K.IX(eT)}),eA=K.Ry({id:K.Rx(),comment:K.Z_().nullable(),created_at:K.Z_()}),eM=K.Ry({id:K.Z_().uuid(),claim_int:K.Rx().nullable().optional(),event_date:K.Z_().nullable().optional(),company_claim_id:K.Z_().nullable().optional(),reason:K.Z_().nullable().optional(),diagnosis:K.Rx().nullable().optional(),pre_diagnosis:K.IX(K.Rx()).optional().nullable(),status:K.Rx().nullable().optional(),category:K.Rx().nullable().optional(),executive:K.Z_().nullable().optional(),processed_amount:K.Rx().nullable().optional(),last_claim_history:K.Yj().optional().nullable(),total_amount:K.Rx().nullable().optional(),amount_covered:K.Rx().nullable().optional(),original_claim:K.Z_().uuid().optional().nullable(),claim_comments:K.IX(eA).optional().nullable(),policy:K.Z_().uuid(),policy_document_number:K.Z_().nullable()}),eD=K.Ry({id:K.Z_().uuid(),document_number:K.Z_().nullable().optional(),document:K.Z_().nullable().optional(),insured:K.G0([ej,K.oQ.string()]),policy_type:eE.optional().nullable(),insurable_object:K.G0([eR,K.oQ.string()]),start_date:K.Z_().optional(),coverage_bundle:ek.optional(),renewal_quote:K.Ry({coverage_bundle:ek.nullable().optional()}).nullable().optional(),is_delinquent:K.O7().optional().nullable(),previous_policy:K.Ry({id:K.Z_().uuid()}).nullable().optional(),coverage_start_date:K.Z_().nullable().optional(),related_policies:K.IX(K.Ry({id:K.Z_().uuid(),document_number:K.Z_().nullable().optional(),start_date:K.Z_().nullable().optional(),cancelled_at:K.Z_().nullable().optional()})).optional().default([]),policy_task:K.IX(eI).optional().nullable(),claim_set:K.IX(eM).nullable().optional()}),eL=K.Ry({id:K.Rx().optional(),item:K.Z_().optional(),item_detail:K.Z_().optional().nullable(),unit_value:K.Rx().optional().nullable(),quantity:K.Rx().optional().nullable(),justified:K.O7().optional().nullable(),coverable:K.O7().optional().nullable(),total:K.Rx().optional().nullable(),provider_service_id:K.Rx().optional().nullable()}),eF=K.Ry({id:K.Z_().uuid(),claim_int:K.Rx().nullable(),original_claim:K.Z_().uuid().nullable(),policy:eD,category:K.Rx(),internal_category:K.Rx().optional().nullable(),complexity_level:K.Rx().nullable(),video_description:K.Z_().url().nullable(),video_transcription:K.Z_().nullable(),video_summary:K.Z_().nullable(),written_declaration:K.Z_().optional().nullable(),severity_level:K.G0([K.Z_(),K.Rx()]).optional().nullable(),last_claim_history:K.Yj().optional().nullable(),previous_policies_claim_set:K.IX(eM).nullable(),reason:K.Z_(),reimbursable_items:K.IX(K.Yj()).optional().nullable(),claim_date:K.Z_().optional().nullable(),event_date:K.Z_().optional().nullable(),diagnosis_date:K.Z_().optional().nullable(),diagnosis:K.Rx().nullable(),icd10_chapter:K.Z_().optional().nullable(),pre_diagnosis:K.IX(K.Rx()),medical_category:K.Z_().optional().nullable(),provider_clinical_record_id:K.Z_().optional().nullable(),pre_settlement_status:K.Z_(),total_amount:K.Rx().nullable(),reimbursable_amount:K.Rx().nullable(),amount_covered:K.Rx(),provision_amount:K.Rx(),payable_amount:K.Rx().nullable(),justified_amount:K.Rx(),coverage_remainder_amount:K.Rx().nullable(),amount_paid_by_aspor:K.Rx().optional().nullable(),remaining_deductible:K.Rx(),aspor_provisioned_amount_uf:K.Rx().optional().nullable(),is_closed:K.O7(),is_paid:K.O7(),is_bci_reconciled:K.O7().optional(),transaction_id:K.Z_().nullable(),claim_payback_transaction:K.Z_().uuid().optional().nullable(),is_paid_automatically:K.O7().optional().nullable(),incoming_settlement:K.Z_().uuid().optional().nullable(),settled_at:K.Z_().datetime().nullable(),settlement_report:K.Z_().nullable(),percentage_covered:K.Rx(),status:K.Rx(),company_claim_id:K.Z_().nullable(),aspor_status:K.Z_().optional().nullable(),aspor_correlative:K.Rx().optional().nullable(),assigned_to:K.G0([K.Rx(),K.Ry({id:K.Rx(),email:K.Z_(),first_name:K.Z_(),last_name:K.Z_()})]).nullable(),assigned_at:K.Z_().datetime().optional().nullable(),is_ai_reviewed:K.O7(),has_signature:K.O7().optional().nullable(),report_date:K.Z_().datetime().optional().nullable(),vet_name:K.Z_().optional().nullable(),first_attention_date:K.Z_().datetime().optional().nullable(),is_ai_review_valid:K.O7().nullable(),ai_diagnosis_document_filename:K.Z_().optional().nullable(),ai_event_date_document_filename:K.Z_().optional().nullable(),ai_pre_diagnosis_document_filename:K.Z_().optional().nullable(),ai_general_resolution_history:K.IX(K.Ry({timestamp:K.Z_(),resolution:K.Z_(),general_explanation:K.Z_()})).optional().default([]),ai_review_feedback_comment:K.Z_().nullable(),needs_re_adjusting:K.O7().default(!1),claim_history:K.IX(eg),claim_comments:K.IX(ev),claim_documents:K.IX(e_),payout_set:K.IX(eP),movements:K.IX(eO).default([]),user_bank_account:ew.nullable(),claim_breakdown:K.IX(eL).optional().nullable()});K.Ry({reason:K.Z_().optional(),assigned_to_id:K.Rx().optional().nullable(),original_claim:K.Z_().uuid().optional().nullable(),policy_id:K.Z_().uuid().optional(),category:K.Rx().optional(),claim_date:K.Z_().datetime().optional().nullable(),event_date:K.Z_().datetime().optional().nullable(),diagnosis:K.Rx().optional().nullable(),pre_diagnosis:K.IX(K.Rx()).optional().nullable(),diagnosis_date:K.Z_().datetime().optional().nullable(),is_ai_review_valid:K.O7().optional().nullable(),complexity_level:K.Rx().optional().nullable(),ai_review_feedback_comment:K.Z_().optional(),company_claim_id:K.Z_().optional().nullable(),aspor_provisioned_amount_uf:K.Rx().optional().nullable(),pre_settlement_status:K.Z_().optional()});let useAdminClaimQuery=m=>(0,et.a)({queryKey:["adminClaim",m],queryFn:async()=>
6{if(!m)throw Error("Claim ID is required");let g=await (0,es.h)(eF,{method:"GET",url:ei.Z.admin.claims.show(m)});return g.data},enabled:!!m,retry:(m,g)=>{var v;return(null==g||null===(v=g.response)||void 0===v||!v.status||!(g.response.status>=400)||!(g.response.status<500))&&m<3},onError:ep.rj,staleTime:3e6});function useUpdateAdminClaimMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{try{let v=await (0,es.h)(eF,{method:"put",url:ei.Z.admin.claims.update(m),data:g},{decamelizeParams:!0});return v.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al actualizar el siniestro";throw new ed.o(x,{statusCode:g,code:null==v?void 0:v.type,details:null==v?void 0:v.details,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al actualizar el siniestro. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})}let eZ=K.Ry({data:K.IX(K.Z_())});function useClaimReasonsQuery(){return(0,et.a)({queryKey:["claimReasons"],queryFn:async()=>{let m=await (0,es.h)(eZ,{method:"get",url:ei.Z.admin.claimsCatalog.reasons()},{failSilently:!1});return m.data.data},onError:ep.rj})}let eB=K.Ry({id:K.Rx(),name:K.Z_()}),e$=K.Ry({data:K.IX(eB)});function useMedicalSpecialtiesQuery(){return(0,et.a)({queryKey:["medicalSpecialtiesList"],queryFn:async()=>{let m=await (0,es.h)(e$,{method:"get",url:ei.Z.admin.claimsCatalog.medicalSpecialties()},{failSilently:!1});return m.data.data},onError:ep.rj})}let eU=K.Ry({id:K.Rx(),name:K.Z_(),category:K.Z_().optional().nullable()}),ez=K.Ry({data:K.IX(eU)});function useDiagnosesQuery(){return(0,et.a)({queryKey:["diagnosesList"],queryFn:async()=>{let m=await (0,es.h)(ez,{method:"get",url:ei.Z.admin.claimsCatalog.diagnoses()},{failSilently:!1});return m.data.data},onError:ep.rj})}function useCreateClaimCommentMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{try{let v=await (0,es.h)(ev,{method:"post",url:ei.Z.admin.claimComments.create(m),data:g},{decamelizeParams:!0});return v.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al crear el comentario";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al crear el comentario. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})}K.Ry({claim:K.Z_().uuid(),comment:K.Z_(),user:K.Rx()}),(k=T||(T={}))[k.Preventive=0]="Preventive",k[k.Accident=1]="Accident",k[k.Sickness=2]="Sickness",k[k.PreventiveExams=3]="PreventiveExams",k[k.PreventiveVaccines=4]="PreventiveVaccines",k[k.PreventiveConsultation=5]="PreventiveConsultation",k[k.PreventiveChipInstallation=6]="PreventiveChipInstallation",k[k.PreventiveTeleconsultation=7]="PreventiveTeleconsultation",k[k.ComplementaryTherapy=8]="ComplementaryTherapy",k[k.Liability=9]="Liability";let eV=K.Ry({id:K.Rx(),type:K.Z_(),icon_name:K.Z_(),category:K.G0([K.Rx(),K.Z_()]),name:K.Z_(),is_required:K.O7()}),eq=K.Ry({data:K.IX(eV)});function useFileTypesQuery(){return(0,et.a)({queryKey:["fileTypesList"],queryFn:async()=>{let m=await (0,es.h)(eq,{method:"get",url:ei.Z.admin.claimsCatalog.fileTypes()},{failSilently:!1});return m.data.data},onError:ep.rj})}let eH=K.Ry({id:K.Rx(),claim_id:K.Z_(),document:K.Z_().nullable(),document_name:K.Z_(),document_number:K.Z_().nullable(),file_type_id:K.Rx().nullable(),file_format_id:K.Rx().nullable(),file_description:K.Z_().nullable().optional(),related_document_id:K.Rx().nullable().optional(),issuer_dni:K.Z_().nullable(),emission_date:K.Z_().nullable(),has_issues:K.O7(),issue_comment:K.Z_(),clinic_id:K.Rx().nullable(),is_duplicate_receipt:K.O7().nullable(),total_document_amount:K.Rx(),metadata:K.IX(K._4()),rotation:K.Rx().nullish()});function useCreateClaimDocumentMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{try{let v=await (0,es.h)(eH,{method:"post",url:ei.Z.admin.claimDocuments.upload(m),data:g,headers:{}},{decamelizeParams:!1});return v.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al crear el documento";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al crear el documento. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})}function useDeleteClaimDocumentMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{await el.Z.delete(ei.Z.admin.claimDocuments.delete(m,g))},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})}let eW=e_.pick({id:!0});function useDuplicateClaimDocumentMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async m=>{try{let g=await (0,es.h)(eW,{method:"post",url:ei.Z.admin.claimDocuments.duplicate(m)});return g.data}catch(m){throw(0,ep.rj)(m),new ed.o("Hubo un error al duplicar el documento. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})}let eK=K.Ry({data:K.IX(ey)});function useClaimDocumentItemCategoriesQuery(){return(0,et.a)({queryKey:["claimDocumentItemCategoryList"],queryFn:async()=>{let m=await (0,es.h)(eK,{method:"get",url:ei.Z.admin.claimsCatalog.documentItemCategories()},{failSilently:!1});return m.data.data},onError:ep.rj})}function useGetDuplicateClaimDocumentsQuery(m){let g=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return(0,et.a)({queryKey:["duplicateClaimDocuments",m],queryFn:async()=>
6{if(!m)throw Error("Document ID is required");let g=await (0,es.h)(K.IX(K.Ry({document_id:K.Rx(),document_name:K.Z_(),claim_id:K.Z_(),claim_int:K.Rx().nullable(),aspor_claim_id:K.Z_().nullable(),pet_name:K.Z_().nullable(),claim_date:K.Z_().nullable(),created_at:K.Z_().nullable()})),{method:"get",url:ei.Z.admin.claimDocuments.duplicates(m)},{failSilently:!1});return g.data},enabled:g&&!!m,onError:ep.rj})}K.Ry({name:K.Z_(),user_category_id:K.Rx(),unit_price:K.Rx(),quantity:K.Rx(),coverable:K.O7().optional().default(!1),justified:K.O7().optional().default(!1),ai_coverable_explanation:K.Z_().optional().nullable(),ai_justified_explanation:K.Z_().optional().nullable(),ai_justification_document_filename:K.Z_().optional().nullable()});let eG=K.Ry({id:K.Rx(),claim_document_id:K.Rx(),name:K.Z_(),user_category_id:K.Rx().nullable(),user_category_name:K.Z_().nullable(),unit_price:K.Rx(),quantity:K.Rx(),total:K.Rx(),coverable:K.O7(),justified:K.O7(),provider_service_id:K.Rx().nullable()});function useCreateClaimDocumentItemMutation(m,g){let v=(0,en.NL)();return(0,er.D)({mutationFn:async v=>{if(!g)throw Error("Document ID is required to create an item.");try{let x=await (0,es.h)(eG,{method:"post",url:ei.Z.admin.claimDocumentItems.create(m,g),data:v,headers:{}},{decamelizeParams:!1});return x.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al crear el \xedtem del documento";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al crear el \xedtem del documento. Por favor, intenta nuevamente.")}},onSuccess:()=>{v.invalidateQueries({queryKey:["adminClaim",m]})}})}function useDeleteClaimDocumentItemMutation(m,g){let v=(0,en.NL)();return(0,er.D)({mutationFn:async v=>{try{await el.Z.delete(ei.Z.admin.claimDocumentItems.delete(m,g,v))}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al eliminar el \xedtem";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al eliminar el \xedtem. Por favor, intenta nuevamente.")}},onSuccess:()=>{v.invalidateQueries({queryKey:["adminClaim",m]})}})}function useUpdateClaimDocumentItemMutation(m,g){let v=(0,en.NL)();return(0,er.D)({mutationFn:async v=>{let{itemId:x,data:k}=v;try{await (0,es.h)(K.Ry({}),{method:"put",url:ei.Z.admin.claimDocumentItems.update(m,g,x),data:k})}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al actualizar el \xedtem";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al actualizar el \xedtem. Por favor, intenta nuevamente.")}},onSuccess:()=>{v.invalidateQueries({queryKey:["adminClaim",m]})}})}K.Ry({user_category_id:K.Rx(),name:K.Z_(),quantity:K.Rx(),unit_price:K.Rx(),coverable:K.O7(),justified:K.O7()});let eQ=K.Ry({item:K.Z_(),item_detail:K.Z_(),quantity:K.Rx(),total:K.Rx()}),eY=K.Ry({multiple_receipts:K.O7().optional(),is_voucher:K.O7().optional(),document_valid:K.O7().optional(),validation_message:K.Z_().optional(),items:K.IX(eQ)});function useExtractClaimDocumentItemsMutation(){return(0,er.D)({mutationFn:async m=>{try{let g=await (0,es.h)(eY,{method:"post",url:ei.Z.admin.claimDocuments.extractItems(m.documentId)});return g.data}catch(m){throw(0,ep.rj)(m),new ed.o("Hubo un error al extraer los \xedtems. Por favor, intenta nuevamente.")}}})}function useUpdateClaimDocumentMutation(m,g){let v=(0,en.NL)();return(0,er.D)({mutationFn:async v=>{try{let x=await (0,es.h)(eH,{method:"put",url:ei.Z.admin.claimDocuments.update(m,g),data:v},{decamelizeParams:!0});return x.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al actualizar el documento";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al actualizar el documento. Por favor, intenta nuevamente.")}},onSuccess:x=>{v.setQueryData(["adminClaim",m],m=>m?{...m,claim_documents:m.claim_documents.map(m=>m.id===g?{...m,issuer_dni:x.issuer_dni,document_number:x.document_number,emission_date:x.emission_date,has_issues:x.has_issues,issue_comment:x.issue_comment,file_type:x.file_type_id,rotation:x.rotation}:m)}:m)}})}function useUpdateClaimDocumentRotationMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{let{documentId:v,rotation:x}=g;try{let g=await (0,es.h)(eH,{method:"put",url:ei.Z.admin.claimDocuments.update(m,v),data:{rotation:x}},{decamelizeParams:!0});return g.data}catch(m){(0,ep.zG)(m,"Error al guardar la rotaci\xf3n del documento")}},onSuccess:(v,x)=>{g.setQueryData(["adminClaim",m],m=>m?{...m,claim_documents:m.claim_documents.map(m=>{var g;return m.id===x.documentId?{...m,rotation:null!==(g=v.rotation)&&void 0!==g?g:x.rotation}:m})}:m)}})}function useCreateClaimHistoryMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{try{let v=await (0,es.h)(eg,{method:"post",url:ei.Z.admin.claimHistory.create(m),data:g},{decamelizeParams:!0});return v.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al crear el historial";throw new ed.o(x,{statusCode:g,code:null==v?void 0:v.type,details:null==v?void 0:v.details,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al crear el historial. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})}K.Ry({document_number:K.Z_().optional(),emission_date:K.Z_().datetime().optional().nullable(),has_issues:K.O7().optional(),issue_comment:K.Z_().optional().nullable(),file_type_id:K.Rx().optional(),issuer_dni:K.Z_().optional()}),K.Ry({status_id:K.Rx(),comment:K.Z_().optional().nullable(),adjuster_agent_id:K.Rx().optional()});let eX=K.Ry({message:K.Z_(),claim_id:K.Z_().nullable().optional()});function useRevertSettlementMutation(m){let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{try{let v=await (0,es.h)(eX,{method:"post",url:ei.Z.admin.claims.revertSettlement(m),data:{comment:g}});return v.data}catch(m){(0,ep.zG)(m,"Error al deshacer la liquidaci\xf3n aceptada")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]}),g.invalidateQueries({queryKey:["claims"]})}})}let eJ=K.Ry({data:K.IX(K.Ry({id:K.Rx(),status:K.Z_(),status_key:K.Z_()}))}),useHistoryStatusesQuery=()=>(0,et.a)({queryKey:["historyStatuses"],queryFn:async()=>{let m=await (0,es.h)(eJ,{method:"get",url:ei.Z.admin.claimsCatalog.historyStatuses()});return m.data.data},onError:ep.rj});function useCreateDiagnosisMutation(){let m=(0,en.NL)();return(0,er.D)({mutationFn:async m=>{try{let g=await (0,es.h)(eU,{method:"post",url:ei.Z.admin.claimsCatalog.diagnoses(),data:m},{decamelizeParams:!0});return g.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al crear el diagn\xf3stico";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al crear el diagn\xf3stico. Por favor, intenta nuevamente.")}},onSuccess:()=>
6{m.invalidateQueries({queryKey:["diagnosesList"]})}})}K.Ry({name:K.Z_(),medical_specialty:K.Rx(),category:K.Z_()});let e0=K.Ry({name:K.Z_(),text:K.Z_(),updated_at:K.Z_()});e0.pick({name:!0,text:!0});let useAIPromptQuery=(m,g)=>{var v;return(0,et.a)({queryKey:ec.a.aiPrompts.show(m),queryFn:async()=>{let g=await (0,es.h)(e0,{method:"get",url:ei.Z.admin.aiPrompts.get(m)},{decamelizeParams:!1});return g.data},enabled:null===(v=null==g?void 0:g.enabled)||void 0===v||v,onError:ep.rj})},useUpsertAIPromptMutation=()=>{let m=(0,en.NL)();return(0,er.D)({mutationFn:async m=>{try{let g=await (0,es.h)(e0,{method:"post",url:ei.Z.admin.aiPrompts.upsert(),data:m});return g.data}catch(m){throw(0,ep.rj)(m),new ed.o("Hubo un error al guardar el prompt. Por favor, intenta nuevamente.")}},onSuccess:()=>{m.invalidateQueries({queryKey:["ai_prompts"]})}})},e1=K.G0([K.Ry({success:K.i0(!0),task_id:K.Z_(),message:K.Z_()}),K.Ry({success:K.i0(!1),message:K.Z_()})]),useReviewClaimWithAIMutation=m=>{let g=(0,en.NL)();return(0,er.D)({mutationFn:async()=>{try{let g=await (0,es.h)(e1,{method:"post",url:ei.Z.admin.claims.reviewWithAI(m)});return g.data}catch(m){(0,ep.zG)(m,"Hubo un error al revisar con IA. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})},e2=K.Ry({message:K.Z_(),new_claim:eF}),useDuplicateClaimMutation=()=>{let m=(0,en.NL)();return(0,er.D)({mutationFn:async m=>{let{claimId:g}=m;try{let m=await (0,es.h)(e2,{method:"post",url:ei.Z.admin.claims.duplicate(g)});return m.data}catch(m){throw(0,ep.rj)(m),new ed.o("Hubo un error al duplicar el siniestro. Por favor, intenta nuevamente.")}},onSuccess:()=>{m.invalidateQueries({queryKey:["adminClaim"]}),m.invalidateQueries({queryKey:ec.a.claimCRM.list({})})}})},e3=K.Ry({message:K.Z_()}),useDeleteExternalClaimIdMutation=m=>{let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{let{deletion_reason:v}=g;try{let g=await (0,es.h)(e3,{method:"post",url:ei.Z.admin.claims.deleteExternalClaimId(m),data:{deletion_reason:v}});return g.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status,v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al eliminar el ID externo del claim";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al eliminar el ID externo del claim. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})},useSetOriginalClaimMutation=m=>{let g=(0,en.NL)();return(0,er.D)({mutationFn:async g=>{let{original_claim_id:v}=g;try{await (0,es.h)(K.Ry({id:K.Z_()}),{method:"post",url:ei.Z.admin.claims.setOriginalClaim(m),data:{original_claim_id:v}},{decamelizeParams:!0})}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status;if(400===g){let v=K.Ry({errors:K.IX(K.Z_())}).safeParse(m.response.data);if(v.success)throw new ed.o(v.data.errors.join(", "),{statusCode:g,isExpected:!0})}let v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al establecer el siniestro original";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al establecer el siniestro original. Por favor, intenta nuevamente.")}},onSuccess:()=>g.invalidateQueries({queryKey:["adminClaim",m]})})},e5=K.Ry({success:K.O7(),documents_count:K.Rx().optional(),converted:K.Rx().optional(),fixed_db:K.Rx().optional(),fixed_pdf:K.Rx().optional(),resized:K.Rx().optional(),missing:K.Rx().optional(),errors:K.IX(K.Z_()).optional().nullable(),message:K.Z_()}),e4=K.Ry({date:K.Z_(),change:K.Z_(),user_email:K.Z_().nullable()}),e6=K.Ry({history:K.IX(e4)});function usePreSettlementHistoryQuery(m){return(0,et.a)({queryKey:["preSettlementHistory",m],queryFn:async()=>{if(!m)throw Error("Claim ID is required");let g=await (0,es.h)(e6,{method:"get",url:ei.Z.admin.claims.preSettlementHistory(m)},{failSilently:!1});return g.data},enabled:!!m,onError:ep.rj})}let e7=K.Ry({field:K.Z_(),field_label:K.Z_(),old_value:K.Z_().nullish(),new_value:K.Z_().nullish()}),e8=K.Km(["claim","claim_history","claim_movement","claim_settlement_item"]),e9=K.Ry({id:K.Z_(),source:e8,object_id:K.Z_(),event_type:K.Z_(),timestamp:K.Z_(),actor:K.Z_(),action:K.Z_().nullish(),changes:K.IX(e7)}),tt=K.Ry({events:K.IX(e9)});function useAdminClaimChangeHistoryQuery(m){let{enabled:g=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,et.a)({queryKey:ec.a.adminClaims.changeHistory(m),queryFn:async()=>
6{if(!m)throw Error("Claim ID is required");let g=await (0,es.h)(tt,{method:"get",url:ei.Z.admin.claims.changeHistory(m)},{failSilently:!1});return g.data},enabled:!!m&&g,refetchOnWindowFocus:!1,meta:{onError:ep.rj}})}let tn=K.Km(["current","history_entry","audit_event"]),tr=K.Ry({claim:ef.U3,pet:eh.uY.nullable(),referrer_code:K.Z_().nullable(),reference_date:K.Z_(),snapshot:tn});function useAdminClaimCustomerViewQuery(m,g){return(0,et.a)({queryKey:ec.a.adminClaims.customerView(m,g),queryFn:async()=>{let v=await (0,es.h)(tr,{method:"get",url:ei.Z.admin.claims.customerView(m),params:{history_id:g.historyId,as_of:g.asOf}},{failSilently:!1});return v.data},retry:!1,refetchOnWindowFocus:!1,meta:{onError:ep.rj}})}let useConvertClaimImagesMutation=m=>{let g=(0,en.NL)();return(0,er.D)({mutationFn:async()=>{try{let g=await (0,es.h)(e5,{method:"post",url:ei.Z.admin.claims.convertImages(m)});return g.data}catch(m){if(m instanceof em.AxiosError&&m.response){let g=m.response.status;if(400===g){let v=K.Ry({error:K.Z_()}).safeParse(m.response.data);if(v.success)throw new ed.o(v.data.error,{statusCode:g,isExpected:!0})}let v=m.response.data,x=(null==v?void 0:v.message)||(null==v?void 0:v.error)||"Error al convertir las im\xe1genes";throw new ed.o(x,{statusCode:g,isExpected:g<500})}throw(0,ep.rj)(m),new ed.o("Hubo un error al convertir las im\xe1genes. Por favor, intenta nuevamente.")}},onSuccess:()=>{g.invalidateQueries({queryKey:["adminClaim",m]})}})};function useClaimQuery(m){var g,v;let x=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,et.a)({queryKey:ec.a.claims.show(m),queryFn:async()=>{if(!m)throw Error("Claim ID is required");try{let g=await (0,es.h)(ef.U3,{method:"get",url:ei.Z.claims.v2.show(m)});return g.data}catch(m){(0,ep.zG)(m,"Error al cargar el siniestro")}},enabled:!!m&&(null===(g=x.enabled)||void 0===g||g),refetchInterval:null!==(v=x.refetchInterval)&&void 0!==v&&v,onError:ep.rj})}function useClaimsQuery(m){let{policyId:g}=m;return(0,et.a)({queryKey:ec.a.claims.list(g),queryFn:async()=>{if(!g)throw Error("Policy ID is required");try{let fetchPage=async m=>{let v=await (0,es.h)(ef.W5,{method:"get",url:ei.Z.claims.v2.list(),params:{policy_id:g,page:m,page_size:100}},{decamelizeParams:!1});return v.data},m=await fetchPage(1);if(m.total_pages<=1)return m;let v=await Promise.all(Array.from({length:m.total_pages-1},(m,g)=>fetchPage(g+2))),x=[m.items,...v.map(m=>m.items)].flat();return{page:1,page_size:x.length,total_items:m.total_items,total_pages:1,items:x}}catch(m){(0,ep.zG)(m,"Error al cargar los siniestros")}},enabled:!!g,onError:ep.rj})}function useAllClaimsQuery(){return(0,et.a)({queryKey:ec.a.claims.all(),queryFn:async()=>{try{let fetchPage=async m=>{let g=await (0,es.h)(ef.W5,{method:"get",url:ei.Z.claims.v2.list(),params:{page:m,page_size:100}},{decamelizeParams:!1});return g.data},m=await fetchPage(1);if(m.total_pages<=1)return m;let g=await Promise.all(Array.from({length:m.total_pages-1},(m,g)=>fetchPage(g+2))),v=[m.items,...g.map(m=>m.items)].flat();return{page:1,page_size:v.length,total_items:m.total_items,total_pages:1,items:v}}catch(m){(0,ep.zG)(m,"Error al cargar los siniestros")}},onError:ep.rj})}},97443:function(m,g,v){"use strict";v.d(g,{XV:function(){return useAdminQuoteInvoiceQuery},Ml:function(){return useInvoicesQuery},rv:function(){return usePreviewPolicyDueDatesMutation},Fk:function(){return useUpdatePolicyDueDatesMutation}});var x=v(44994),k=v(67669),E=v(7040),T=v(62350),K=v(55830),et=v(13346),en=v(53538);let er=en.Ry({name:en.Z_(),breed:en.Z_().optional(),age_in_words:en.Z_().optional()}),ei=en.Ry({id:en.Z_(),document_number:en.Z_(),readable_id:en.Z_().optional(),pet_name:en.Z_().optional(),insurable_object:er.optional()}),es=en.Ry({id:en.Rx(),status:en.Km(["pending","pending_challenge","success","failed"]),error_message:en.Z_().nullable(),processor_status:en.Z_().nullable(),created_at:en.Z_(),updated_at:en.Z_()}),el=en.Ry({id:en.Rx(),fee_payment_number:en.Rx().nullable(),subscription:en.Rx().nullable(),is_paid:en.O7(),credit:en.Rx(),amount:en.Rx().nullable(),price:en.Rx().nullable(),price_clp:en.Rx().nullable(),paid_at:en.Z_().nullable(),created_at:en.Z_(),updated_at:en.Z_(),policy_id:en.Z_().nullable(),toku_invoice_id:en.Z_().nullable(),due_date:en.Z_().nullable(),is_free_invoice:en.O7().optional().default(!1),will_be_free:en.O7().optional().default(!1),free_available_date:en.Z_().nullable().optional(),discount_code:en.Z_().nullable().optional(),policy:ei.optional(),display_amount:en.Rx(),last_payment_intent:es.nullable().optional()}),ec=en.Ry({results:en.IX(el),count:en.Rx()}),eu=en.Ry({policy_id:en.Z_(),new_day_of_month:en.Rx().refine(m=>[1,5,28].includes(m),{message:"El d\xeda debe ser 1, 5 o 28"})}),ed=en.Ry({policy_id:en.Z_(),first_due_date:en.Z_().regex(/^\d{4}-\d{2}-\d{2}$/,"Formato de fecha inv\xe1lido (YYYY-MM-DD)")}),ep=en.Ry({policy_id:en.Z_(),current_dates:en.IX(en.Z_()),new_dates:en.IX(en.Z_()),total_invoices:en.Rx(),new_day_of_month:en.Rx(),first_due_date:en.Z_()}),em=en.Ry({message:en.Z_()});var ef=v(20463),eh=v(41690),eg=v(89644),ev=v(68344);let ey=en.Ry({amount:en.Rx().nullable(),credit:en.Rx(),fee_payment_number:en.Rx().nullable(),is_paid:en.O7(),paid_at:en.Z_().nullable(),policy_id:en.Z_().nullable(),subscription:en.Rx().nullable(),toku_invoice_id:en.Z_().nullable(),created_at:en.Z_(),updated_at:en.Z_().pipe(en.Z_().datetime({offset:!0})).pipe(en.oQ.date())});function useAdminQuoteInvoiceQuery(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{enabled:!0};return(0,E.a)({queryKey:k.a.quotes.adminInvoice(m),queryFn:async()=>
6{if(void 0===m)throw Error("quoteId is undefined");let g=await (0,x.h)(ey,{method:"get",url:et.Z.quotes.adminInvoice(m)});return g.data},enabled:void 0!==m&&g.enabled,retry:!1})}function useInvoicesQuery(){return(0,E.a)({queryKey:k.a.user.invoices.index(),queryFn:async()=>{let m=await (0,x.h)(ec,{method:"get",url:et.Z.user.invoices.index()});return m.data},onError:m=>{let g=(0,eh.nZ)();g.setTransactionName("useInvoicesQuery"),(0,ef.Tb)(m)}})}let usePreviewPolicyDueDatesMutation=()=>(0,T.D)({mutationFn:async m=>{try{let g=eu.parse(m),v=await (0,x.h)(ep,{method:"post",url:et.Z.user.invoices.previewPolicyDueDates(),data:g});return v.data}catch(m){throw(0,ef.Tb)(m),new ev.o("Error al obtener el preview. Por favor, intenta nuevamente")}}}),useUpdatePolicyDueDatesMutation=()=>{let m=(0,K.NL)();return(0,T.D)({mutationFn:async m=>{try{let g=ed.parse(m),v=await (0,x.h)(em,{method:"post",url:et.Z.user.invoices.updatePolicyDueDates(),data:g});return v.data}catch(m){if(m instanceof eg.AxiosError&&m.response){let g=m.response.status;if(400===g){let g=en.Ry({error:en.Z_()}).safeParse(m.response.data);if(g.success)throw new ev.o(g.data.error);throw new ev.o("Datos inv\xe1lidos")}}throw(0,ef.Tb)(m),new ev.o("Error al actualizar las fechas. Por favor, intenta nuevamente")}},onSuccess:()=>{m.invalidateQueries({queryKey:k.a.user.invoices.index()})}})}},65575:function(m,g,v){"use strict";v.d(g,{g:function(){return useMercadoPagoCustomerInfoQuery}});var x=v(7040),k=v(44994),E=v(13346),T=v(22908),K=v(67669);let useMercadoPagoCustomerInfoQuery=()=>(0,x.a)({queryKey:K.a.mercadopago.customerInfo(),queryFn:async()=>{let m=await (0,k.h)(T.Wx,{method:"get",url:E.Z.mercadopago.customerInfo()});return m.data}})},37133:function(m,g,v){"use strict";v.d(g,{Nt:function(){return usePetByCoverageBundleIdQuery},XD:function(){return usePetsQuery},ge:function(){return usePetQuery}});var x=v(67669),k=v(7040),E=v(14016),T=v(26512),K=v(44994),et=v(68717),en=v(53538),er=v(13346),ei=v(43889);let es=T.m.pick({preexisting_conditions_record:!0,skull_type:!0,name:!0,kind:!0,age_in_words:!0,gender:!0,breed:!0}).passthrough();function usePetQuery(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,k.a)({queryKey:x.a.pets.show(m.petId),enabled:!!m.petId,queryFn:async()=>{if(!m.petId)throw Error("No pet id");let g=await (0,K.h)(es,{method:"get",url:"".concat(et.O.NEXT_PUBLIC_BASE_URL,"/api/v2/user/pets/").concat(m.petId,"/")});return g.data},onError:E.rj,onSuccess:g.onSuccess})}let el=T.m.pick({active_policy:!0,preexisting_conditions_record:!0,skull_type:!0,name:!0,kind:!0,age_in_words:!0,gender:!0,breed:!0,user:!0}).passthrough();function usePetByCoverageBundleIdQuery(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,k.a)({queryKey:x.a.pets.showByCoverageBundleId(m.coverageBundleId),queryFn:async()=>{if(void 0===m.coverageBundleId)throw Error("No coverage bundle id");let g=await (0,K.h)(el,{method:"get",url:er.Z.pets.showByCoverageBundleId(m.coverageBundleId)});return g.data},enabled:!!m.coverageBundleId,onError:E.rj,onSuccess:g.onSuccess})}let ec=en.IX(T.m);function usePetsQuery(){let m=(0,ei.t)(m=>m.token);return(0,k.a)({queryKey:x.a.pets.index(),queryFn:async()=>{let m=await (0,K.h)(ec,{method:"get",url:"".concat(et.O.NEXT_PUBLIC_BASE_URL,"/api/v2/user/pets/")});return m.data},enabled:!!m,onError:E.rj})}},26991:function(m,g,v){"use strict";v.d(g,{e$:function(){return usePoliciesQuery},ej:function(){return useRenewalPolicyQuery},fh:function(){return useApproveRenewalMutation}});var x=v(15515),k=v(13346),E=v(7040),T=v(55830),K=v(62350),et=v(67669),en=v(14016),er=v(50361),ei=v.n(er),es=v(41690),el=v(44994),ec=v(53538);let eu=ec.Ry({policy:x.u5,proposal_html:ec.Z_().nullish()}),ed=ec.Ry({id:ec.Z_(),renewal_status:ec.i0("approved")});function useRenewalPolicyQuery(m,g){return(0,E.a)({queryKey:et.a.policies.show(m),queryFn:async()=>{if(void 0===m)throw Error("policyId is undefined");if(void 0===g)throw Error("renewalToken is undefined");try{let v=await (0,el.h)(eu,{method:"get",url:k.Z.policies.renewal.show(m),headers:{"Policy-Renewal-Token":g}});return v.data}
6catch(m){(0,en.zG)(m,"Error al cargar la informaci\xf3n de renovaci\xf3n")}},enabled:void 0!==m&&void 0!==g,refetchInterval:m=>(null==m?void 0:m.policy.renewal_status)!=="approved"&&1e4})}function useApproveRenewalMutation(){let m=(0,T.NL)();return(0,K.D)({mutationFn:async m=>{try{let g=await (0,el.h)(ed,{method:"post",url:k.Z.policies.renewal.approve(m.policyId),data:{},headers:{"Policy-Renewal-Token":m.renewalToken}});return g.data}catch(m){(0,en.zG)(m,"Error al aprobar la renovaci\xf3n")}},onSuccess:g=>{g&&(m.setQueryData(et.a.policies.show(g.id),m=>{if(void 0===m)return m;let g=ei()(m);return g.policy.renewal_status="approved",g}),m.setQueriesData(et.a.policies.index(),m=>void 0===m?m:m.map(m=>m.id===g.id?{...m,...g}:m)))},onError:en.rj})}let ep=ec.Ry({page:ec.Rx(),page_size:ec.Rx(),total_items:ec.Rx(),total_pages:ec.Rx(),items:ec.IX(x.j_)});function usePoliciesQuery(m){var g;let v=null!==(g=null==m?void 0:m.includeCancelled)&&void 0!==g&&g;return(0,E.a)({queryKey:[...et.a.policies.index(),{includeCancelled:v}],queryFn:async()=>{let fetchPage=async m=>{let g=await (0,el.h)(ep,{method:"get",url:k.Z.user.policies.v2.index(),params:{page:m,page_size:100,...v?{include_cancelled:!0}:{}}});return g.data},m=await fetchPage(1);if(m.total_pages<=1)return m.items;let g=await Promise.all(Array.from({length:m.total_pages-1},(m,g)=>fetchPage(g+2)));return[m.items,...g.map(m=>m.items)].flat()},staleTime:0,onError:m=>{let g=(0,es.nZ)();g.setTransactionName("usePoliciesQuery"),(0,en.rj)(m)}})}},65096:function(m,g,v){"use strict";v.d(g,{e_:function(){return usePublicBenefitCategoriesQuery},Gt:function(){return usePublicBenefitsQuery},Cf:function(){return usePublicCompanyBenefitsQuery}});var x=v(7040),k=v(53538),E=v(44994),T=v(13346),K=v(67669);let et=k.Ry({id:k.Rx(),description:k.Z_(),method:k.Z_(),url:k.Z_().nullable(),partnership_name:k.Z_(),category_name:k.Z_().nullable(),logo_url:k.Z_().nullable(),is_active:k.O7(),availability:k.Z_(),benefit_detail:k.Z_().nullable(),company_description:k.Z_().nullable(),end_date:k.Z_().nullable(),redemption_type:k.Z_(),is_new:k.O7(),company_id:k.Rx(),company_benefit_count:k.Rx()}),en=k.Ry({benefits:k.IX(et)}),er=k.Ry({company_id:k.Rx(),company_name:k.Z_(),logo_url:k.Z_().nullable(),company_description:k.Z_().nullable(),benefits:k.IX(et)}),ei=k.Ry({id:k.Z_(),name:k.Z_(),description:k.Z_()});function usePublicBenefitsQuery(m){return(0,x.a)({queryKey:K.a.publicBenefits.index(m),queryFn:async()=>{let g=new URLSearchParams;(null==m?void 0:m.search)&&g.set("search",m.search),(null==m?void 0:m.category)&&g.set("category",m.category);let v=g.toString(),x="".concat(T.Z.publicBenefits.index()).concat(v?"?".concat(v):""),{data:k}=await (0,E.h)(en,{method:"get",url:x});return k.benefits}})}function usePublicCompanyBenefitsQuery(m){return(0,x.a)({queryKey:K.a.publicBenefits.company(null!=m?m:0),queryFn:async()=>{let{data:g}=await (0,E.h)(er,{method:"get",url:T.Z.publicBenefits.company(m)});return g},enabled:!!m})}function usePublicBenefitCategoriesQuery(){return(0,x.a)({queryKey:K.a.publicBenefits.categories(),queryFn:async()=>{let{data:m}=await (0,E.h)(k.IX(ei),{method:"get",url:T.Z.publicBenefits.categories()});return m}})}},67669:function(m,g,v){"use strict";v.d(g,{a:function(){return k}});var x=v(96669);let k={adminBankChoices:{all:()=>["adminBankChoices"],list:m=>["adminBankChoices","list",m]},adminBenefits:{all:()=>["adminBenefits"],businessTypes:{all:()=>["adminBenefits","businessTypes"],list:m=>["adminBenefits","businessTypes","list",m],options:()=>["adminBenefits","businessTypes","options"]},categories:{all:()=>["adminBenefits","categories"],list:m=>["adminBenefits","categories","list",m],options:()=>["adminBenefits","categories","options"]},companies:{all:()=>["adminBenefits","companies"],list:m=>["adminBenefits","companies","list",m],options:()=>["adminBenefits","companies","options"]},partnerships:{all:()=>["adminBenefits","partnerships"],list:m=>["adminBenefits","partnerships","list",m],verificationCodes:m=>[...k.adminBenefits.partnerships.all(),"verificationCodes",m]}},adminCustomerPets:{all:()=>["adminCustomerPets"],byUser:m=>["adminCustomerPets","byUser",String(m)],byUserPaginated:(m,g,v)=>["adminCustomerPets","byUser",String(m),g,v]},adminCommissions:{all:()=>["adminCommissions"],list:m=>["adminCommissions","list",m],detail:m=>["adminCommissions","detail",m],changeHistory:m=>["adminCommissions","changeHistory",m],configs:()=>["adminCommissions","configs"],config:m=>["adminCommissions","config",m]},adminTrackedPolicies:{all:()=>["adminTrackedPolicies"],list:m=>["adminTrackedPolicies","list",m]},bciClaimsReconciliation:{report:m=>["bciClaimsReconciliation","report",m]}
6,companyReconciliation:{all:()=>["companyReconciliation"],cacttusProduction:m=>["companyReconciliation","cacttusProduction",m],conciliation:m=>["companyReconciliation","conciliation",m],detail:m=>["companyReconciliation","detail",m],lines:(m,g)=>["companyReconciliation","lines",m,g],list:m=>["companyReconciliation","list",m],npolenTimeline:m=>["companyReconciliation","npolenTimeline",m],policyTimeline:m=>["companyReconciliation","policyTimeline",m],summary:(m,g)=>["companyReconciliation","summary",m,g],v2PolicyConciliation:m=>["companyReconciliation","v2PolicyConciliation",m],v2ConciliationSummary:()=>["companyReconciliation","v2ConciliationSummary"],notificationBatches:m=>["companyReconciliation","notificationBatches",m],notificationBatchConciliations:m=>["companyReconciliation","notificationBatchConciliations",m],morosidadAdjustments:m=>["companyReconciliation","morosidadAdjustments",m]},claimCRM:{list:m=>["claimCRM","list",m]},adminGroups:{index:()=>["adminGroups","index"]},adminClaims:{changeHistory:m=>["adminClaims","changeHistory",m],customerView:(m,g)=>["adminClaims","customerView",m,g]},adminPolicies:{list:m=>["adminPolicies","list",m],detail:m=>["adminPolicies","detail",m],changeHistory:m=>["adminPolicies","changeHistory",m]},adminModuleGroups:()=>["adminModuleGroups"],adminPreferences:()=>["adminPreferences"],adminQuotes:{byBundle:m=>["adminQuotes","byBundle",m],detail:m=>["adminQuotes","detail",m],list:m=>["adminQuotes","list",m]},adminPromoCodes:{all:m=>["adminPromoCodes","all",m],list:m=>["adminPromoCodes","list",m],show:m=>["adminPromoCodes","show",m],usage:()=>["adminPromoCodes","usage"]},adminQuoteFlowExperiments:{list:()=>["adminQuoteFlowExperiments","list"]},adminRenewals:{list:m=>["adminRenewals","list",m]},adminWhatsapp:{all:()=>["adminWhatsapp"],history:(m,g)=>["adminWhatsapp","history",m,g],templates:()=>["adminWhatsapp","templates"]},renewalUploadHistory:()=>["renewalUploadHistory"],admin:{renewals:{uploadHistory:(m,g)=>["admin","renewals","uploadHistory",m,g]},cancellations:{uploadHistory:(m,g)=>["admin","cancellations","uploadHistory",m,g],defaultMapping:["admin","cancellations","defaultMapping"]},emissions:{uploadHistory:(m,g)=>["admin","emissions","uploadHistory",m,g],defaultMapping:["admin","emissions","defaultMapping"]},cancelledPolicyBalances:{list:m=>["admin","cancelledPolicyBalances","list",m]},dailyCharges:{list:m=>["admin","dailyCharges","list",m]},noMpCardReminders:{weekly:m=>["admin","noMpCardReminders","weekly",m],eligibleUsers:m=>["admin","noMpCardReminders","eligibleUsers",m],userNotifications:(m,g)=>["admin","noMpCardReminders","userNotifications",m,g]}},adminRewards:{list:m=>["adminRewards","list",m]},adminPayments:{list:m=>["adminPayments","list",m],show:m=>["adminPayments","show",m]},adminRefunds:{list:m=>["adminRefunds","list",m]},adminChargebacks:{list:m=>["adminChargebacks","list",m]},adminInvoices:{all:()=>["adminInvoices"],list:m=>["adminInvoices","list",m],show:m=>["adminInvoices","show",m]},adminUsers:{all:m=>["adminUsers","all",m],byEmail:m=>["adminUsers","byEmail",m],byId:m=>["adminUsers","byId",m],byPhone:m=>["adminUsers","byPhone",m],byRut:m=>["adminUsers","byRut",m],customerInfo:m=>["adminUsers","customerInfo",m],index:m=>["adminUsers","index",m],show:m=>["adminUsers","show",m],address:m=>["adminUsers","address",m],staffUsers:()=>["adminUsers","staffUsers"],customers:()=>["adminUsers","customers"],rewards:m=>["adminUsers","rewards",m]},adminEndorsements:{search:m=>["adminEndorsements","search",m],userEndorsements:m=>["adminEndorsements","userEndorsements",m]},adminEndorsementSettlements:{incoming:m=>["adminEndorsementSettlements","incoming",m],outgoing:m=>["adminEndorsementSettlements","outgoing",m],detail:m=>["adminEndorsementSettlements","detail",m],pendingOutgoing:m=>["adminEndorsementSettlements","pendingOutgoing",m],pendingPayout:m=>["adminEndorsementSettlements","pendingPayout",m],bankMovements:m=>["adminEndorsementSettlements","bankMovements",m],summary:()=>["adminEndorsementSettlements","summary"]},aiPrompts:{show:m=>["ai_prompts","show",m]},benefits:{authIndex:m=>["benefits","authIndex",m],company:m=>["benefits","company",m],index:()=>["benefits","index"],categories:()=>["benefits","categories"]},breeds:{index:()=>["breeds","index"],forSpecies:m=>["breeds",m]},dogBreeds:{all:()=>["dogBreeds"],list:m=>["dogBreeds","list",m],detail:m=>["dogBreeds","detail",m]},checkout:{last:()=>["checkoutLast","index"],show:m=>["checkout","show",m]},coverageBundles:{getPremiumFromPackageName:m=>["coverageBundles","getPremiumFromPackageName",m],show:m=>["coverageBundles","show",m]},quoteFlowAssignments:{all:()=>["quoteFlowAssignments"],byKeys:(m,g)=>["quoteFlowAssignments",m,[...g].sort()]},diagnoses:{index:()=>["diagnoses","index"]},partner:{commissions:m=>["partnerCommissions","list",m],report:m=>["partnerReport","index",m],supervisorReport:m=>["partnerSupervisorReport","index",m]},planChanges:{tasks:m=>["planChanges","tasks",m]},supervisorQuotesReport:{list:m=>["supervisorQuotesReport","list",m]},petPlanV2:{prices:{show:m=>["petPlanV2s/prices","show",m]},show:m=>["petPlanV2s","show",m]},pets:{index:()=>["pets","index"],show:m=>["pets","show",m],showByCoverageBundleId:m=>["pets","showByCoverageBundleId",m]},claims:{show:m=>["claims","show",m],list:m=>["claims","list",m],all:()=>["claims","all"]},policies:{index:()=>["policies","index"],show:m=>["policies","show",m]},publicBenefits:{all:()=>["publicBenefits"],categories:()=>["publicBenefits","categories"],company:m=>["publicBenefits","company",m],index:m=>m?["publicBenefits","index",m]:["publicBenefits","index"]},quotes:{adminInvoice:m=>["quotesAdminInvoice","show",m],invoice:m=>["quotesInvoice","show",m],update:m=>["quotesUpdate","show",m]},referral:{adminUserRewards:m=>["referral","adminUserRewards",m],rewards:()=>["referral","rewards"]},testimonials:{all:["testimonials"],featured:["testimonials","featured"],index:()=>["testimonials","index"],show:m=>["testimonials","show",m]},uf:{index:()=>["uf","index"]},user:{index:()=>["users","index"],invoices:{index:()=>["usersMeInvoices","index"]},pets:{index:()=>["usersMePets","index"]},policies:{index:()=>["usersMePolicies","index"]},quotes:{index:()=>["usersMeQuotes","index"]},self:()=>["user","me"],show:m=>["user","show",m]},users:{index:()=>["users","index"],show:m=>["users","show",m]},faqs:{all:["faqs"]},landingStats:{all:["landingStats"]},filterPresets:{list:m=>["filterPresets","list",m]},fraud:x.Y,businessStats:{all:["businessStats"]},cancellationRequests:{all:["cancellationRequests"],analytics:m=>["cancellationRequests","analytics",m],context:m=>["cancellationRequests","context",m],detail:m=>["cancellationRequests","detail",m],list:m=>["cancellationRequests","list",m],notes:m=>["cancellationRequests","notes",m],stats:()=>["cancellationRequests","stats"],timeline:m=>["cancellationRequests","timeline",m]},cancellationReasons:{index:()=>["cancellationReasons","index"]},cancellationSettings:{reasonCategories:()=>["cancellationSettings","reasonCategories"],reasonOptions:()=>["cancellationSettings","reasonOptions"],retentionActions:()=>["cancellationSettings","retentionActions"],retentionReasons:()=>["cancellationSettings","retentionReasons"],statuses:()=>["cancellationSettings","statuses"]},obligations:{all:()=>["obligations"],types:{index:()=>["obligations","types","index"]},index:m=>["obligations","index",m],summary:m=>["obligations","summary",m]},bankMovements:{all:()=>["bankMovements"],bankAccounts:()=>["bankMovements","bankAccounts"],index:m=>["bankMovements","index",m],summary:m=>["bankMovements","summary",m]},bankBalances:{all:()=>["bankBalances"],index:()=>["bankBalances","index"]},reconciliationGroups:{all:()=>["reconciliationGroups"]},policyEmissions:{all:["policyEmissions"],bciExport:()=>["policyEmissions","bciExport"],bciCancellationsExport:()=>["policyEmissions","bciCancellationsExport"],incomplete:m=>["policyEmissions","incomplete",m],pending:(m,g)=>["policyEmissions","pending",{startDateBefore:m,insuranceCompany:g}
6],pendingCancellations:(m,g)=>["policyEmissions","pendingCancellations",{cancelledBefore:m,insuranceCompany:g}],withoutDocuments:m=>["policyEmissions","withoutDocuments",{insuranceCompany:m}]},hiring:{status:m=>["hiring","status",m]},mercadopago:{customerInfo:()=>["mercadopago","customerInfo"],paymentStatus:m=>["mercadopago","paymentStatus",m]},planConfigurations:{active:m=>["planConfigurations","active",m],analytics:(m,g,v)=>["planConfigurations","analytics",m,...g||v?[null!=g?g:null,null!=v?v:null]:[]]},cancelledPolicyBalances:{list:m=>["cancelledPolicyBalances","list",m],positive:m=>["cancelledPolicyBalances","positive",m],negative:m=>["cancelledPolicyBalances","negative",m],ufValue:()=>["cancelledPolicyBalances","ufValue"]},documentNumberRanges:{list:()=>["documentNumberRanges","list"]},bankAccounts:{index:()=>["bankAccounts","index"]},bankChoices:{list:()=>["bankChoices","list"]},paymentSettlement:{all:()=>["paymentSettlements"],list:m=>["paymentSettlements","list",m],transbankImports:()=>["paymentSettlements","transbank","imports"],transbankImportDetail:m=>["paymentSettlements","transbank","imports",m],tokuImports:()=>["paymentSettlements","toku","imports"],tokuImportDetail:m=>["paymentSettlements","toku","imports",m],mercadopagoImports:()=>["paymentSettlements","mercadopago","imports"],mercadopagoImportDetail:m=>["paymentSettlements","mercadopago","imports",m],mercadopagoSchedule:()=>["paymentSettlements","mercadopago","schedule"]},settlementV2:{all:()=>["settlementV2"],byCompany:m=>["settlementV2","byCompany",m],byProcessor:m=>["settlementV2","byProcessor",m],collectionsBalance:m=>["settlementV2","collectionsBalance",m],dashboardBankMonthly:m=>["settlementV2","dashboardBankMonthly",m],dashboardMonthly:m=>["settlementV2","dashboardMonthly",m],dashboardOverview:m=>["settlementV2","dashboardOverview",m],dashboardRecentActivity:m=>["settlementV2","dashboardRecentActivity",m],detail:m=>["settlementV2","detail",m],invoices:(m,g,v)=>["settlementV2","invoices",m,g,v],kpis:m=>["settlementV2","kpis",m],list:m=>["settlementV2","list",m]},commandPaletteSearch:(m,g)=>["commandPaletteSearch",m,g],debtCollections:{monthlySummary:m=>["debtCollections","monthlySummary",m],morosidadBreakdown:m=>["debtCollections","morosidadBreakdown",m],processorMonitoring:()=>["debtCollections","processorMonitoring"],userNotifications:(m,g)=>["debtCollections","userNotifications",m,g]},adminClaimsFinance:{list:m=>["adminClaimsFinance","list",m]},tasks:{status:m=>["tasks","status",m]},adminTaskReports:{all:()=>["adminTaskReports"],aggregate:m=>["adminTaskReports","aggregate",m],timeseries:m=>["adminTaskReports","timeseries",m],results:(m,g,v,x)=>["adminTaskReports","results",m,g,v,null!=x?x:{}],detail:m=>["adminTaskReports","detail",m]},adminPeriodicTasks:{all:()=>["adminPeriodicTasks"],list:()=>["adminPeriodicTasks","list"]},adminCeleryHealth:{all:()=>["adminCeleryHealth"],snapshot:()=>["adminCeleryHealth","snapshot"]},claimMessageTemplates:{all:()=>["claim-message-templates"],categories:m=>["claim-message-templates","categories",null!=m?m:"all"],conditionKeys:()=>["claim-message-templates","condition-keys"],categoryDetail:m=>["claim-message-templates","categories",m],templates:m=>["claim-message-templates","templates",null!=m?m:{}],templateDetail:m=>["claim-message-templates","templates",m],settlementTemplate:(m,g)=>["claim-message-templates","settlement",m,null!=g?g:"auto"],variables:m=>["claim-message-templates","variables",null!=m?m:"all"],variableDetail:m=>["claim-message-templates","variables",m],variableFields:()=>["claim-message-templates","variable-fields"]}}},41904:function(m,g,v){"use strict";v.d(g,{lF:function(){return useAdminUserRewards},ZP:function(){return useMyRewards},zg:function(){return useReferrerQuery}});var x=v(7040),k=v(44994),E=v(53538),T=v(20463);let K=E.Ry({id:E.Rx(),redeemable_at:E.Z_().nullable(),is_redeemed:E.O7(),reward_type:E.Km(["free_invoice","free_third_invoice","other"]),related_policy:E.Ry({id:E.Z_(),readable_id:E.Z_(),document_number:E.Z_().nullable().optional(),pet_name:E.Z_().nullable().optional(),insured:E.Ry({id:E.Rx(),first_name:E.Z_(),last_name:E.Z_()})}).nullable(),is_owner:E.O7(),redeemed_value:E.Z_().nullable().optional(),redeemed_at:E.Z_().nullable().optional(),related_user:E.Ry({id:E.Rx(),name:E.Z_(),document_number:E.Z_().nullable()}).nullable().optional(),affected_invoice:E.Ry({id:E.Rx(),fee_payment_number:E.Rx().nullable(),due_date:E.Z_().nullable(),is_projected:E.O7(),policy_document_number:E.Z_().nullable().optional()}).nullable().optional()}),et=E.Ry({id:E.Z_(),readable_id:E.Z_(),document_number:E.Z_().nullable().optional(),insured_id:E.Rx(),insured_first_name:E.Z_(),insured_last_name:E.Z_(),pet_name:E.Z_().nullable().optional()}),en=E.Ry({id:E.Rx(),fee_payment_number:E.Rx().nullable(),due_date:E.Z_().nullable(),is_projected:E.O7(),amount:E.Rx().nullable().optional(),policy_document_number:E.Z_().nullable().optional()}),er=E.Ry({id:E.Rx(),name:E.Z_(),document_number:E.Z_().nullable().optional()}),ei=E.Ry({owner_id:E.Rx(),affiliate_id:E.Rx(),referrer_code:E.Z_().nullable().optional(),program_description:E.Z_().nullable().optional(),program_discount:E.O7(),program_type:E.Z_().nullable().optional(),program_discount_amount:E.Rx().nullable().optional(),first_name:E.Z_(),last_name:E.Z_()}),es=E.Ry({id:E.Rx(),source:E.Z_(),is_owner:E.O7(),reward_type:E.Z_(),reward_type_display:E.Z_(),c
6ode:E.Z_().nullable().optional(),program:E.Z_().nullable().optional(),created_at:E.Z_(),redeemable_at:E.Z_().nullable(),is_redeemed:E.O7(),is_expired:E.O7().optional().default(!1),redeemed_value:E.Z_().nullable().optional(),redeemed_at:E.Z_().nullable().optional(),projected_value:E.Rx().nullable().optional(),related_policy:et.nullable().optional(),related_user:er.nullable().optional(),affected_invoice:en.nullable().optional()}),el=E.Ry({total:E.Rx(),redeemed:E.Rx(),available:E.Rx(),pending:E.Rx(),expired:E.Rx().optional().default(0),total_redeemed_value:E.Z_()}),ec=E.Ry({rewards:E.IX(es),stats:el,referrer:ei.nullable()});var eu=v(13346),ed=v(67669);let ep=E.Ry({owner:E.Rx(),affiliate:E.Rx(),referrer_code:E.Z_(),first_name:E.Z_(),last_name:E.Z_()}).passthrough();function useReferrerQuery(m){return(0,x.a)({queryKey:["referrer",m],queryFn:async()=>{if(!m)throw Error("No user id");let g=await (0,k.h)(ep,{method:"get",url:"".concat(eu.Z.referral.ambassador(),"?code=").concat(m,"&checkout=true")});return g.data},enabled:!!m,retry:!1})}function useMyRewards(){return(0,x.a)({queryKey:ed.a.referral.rewards(),queryFn:async()=>{let m=await (0,k.h)(E.IX(K),{method:"get",url:eu.Z.referral.rewards()});return m.data},onError:m=>{(0,T.Tb)(m)}})}function useAdminUserRewards(m){return(0,x.a)({queryKey:ed.a.referral.adminUserRewards(m),queryFn:async()=>{let g=await (0,k.h)(ec,{method:"get",url:eu.Z.admin.referralRewards.userRewards(m)});return g.data},enabled:!!m,onError:m=>{(0,T.Tb)(m)}})}},64599:function(m,g,v){"use strict";v.d(g,{yQ:function(){return useUfQuery}});var x=v(7040),k=v(67669),E=v(14016),T=v(53538),K=v(44994),et=v(13346);let en=T.Ry({id:T.Rx(),date:T.Z_(),value:T.Rx(),created_at:T.Z_(),updated_at:T.Z_()}).passthrough();function useUfQuery(){return(0,x.a)({queryKey:k.a.uf.index(),queryFn:async()=>{let m=await (0,K.h)(en,{method:"get",url:et.Z.uf.index()});return m.data},onError:E.rj})}},31021:function(m,g,v){"use strict";v.d(g,{bT:function(){return useUserQuery},kD:function(){return useUpdateUserMutation},nd:function(){return useReferralUserQuery},ou:function(){return useUserAwarenessMutation}});var x=v(67669),k=v(13346),E=v(55830),T=v(7040),K=v(62350),et=v(35151),en=v(14016),er=v(44994),ei=v(53538),es=v(39776);function useUserQuery(m){let g=(0,E.NL)(),v=null==m?void 0:m.onSuccess;return(0,T.a)({queryKey:x.a.users.index(),queryFn:async()=>{let m=await g.fetchQuery(es.E),v=await et.Z.get(k.Z.user.addresses()).catch(m=>{var g;if((null===(g=m.response)||void 0===g?void 0:g.status)===404)return{data:null};throw m}),x=v.data,E=await et.Z.get(k.Z.user.card()).catch(m=>{var g;if((null===(g=m.response)||void 0===g?void 0:g.status)===404)return{data:null};throw m}),T=E.data;return{...m,address:x,card:T}},onError:en.rj,onSuccess:v})}function useUserAwarenessMutation(){let m=(0,E.NL)();return(0,K.D)({mutationFn:async m=>{let g=await et.Z.put(k.Z.user.update(),{awareness_source:m.awarenessSource,awareness_source_comment:m.awarenessSourceComment});return g.data},onSuccess:async()=>
6{await m.invalidateQueries(es.E)},onError:en.rj})}function useUpdateUserMutation(){let m=(0,E.NL)();return(0,K.D)({mutationFn:async m=>{try{let g=await et.Z.put(k.Z.user.update(),{first_name:m.firstName,last_name:m.lastName,email:m.email,phone:m.phone,birthdate:m.birthdate,identity_document_number:m.identityDocumentNumber||void 0,...m.rut?{rut:m.rut}:{}});return g.data}catch(m){(0,en.zG)(m,"No se pudieron guardar tus datos. Por favor, intenta nuevamente.")}},onSuccess:async()=>{await m.invalidateQueries(es.E)}})}function useReferralUserQuery(m,g){let v=null==g?void 0:g.onSuccess,E=!g||g.enabled;return(0,T.a)({queryKey:x.a.users.index(),queryFn:async()=>{if(!m)throw Error("Referral code is required");let g=await (0,er.h)(ei.Ry({first_name:ei.Z_()}),{method:"GET",url:k.Z.users.getByReferralCode(m)});return g.data},onError:en.rj,onSuccess:v,enabled:E})}},39776:function(m,g,v){"use strict";v.d(g,{E:function(){return er},a:function(){return useUser}});var x=v(55830),k=v(7040),E=v(43889),T=v(44994),K=v(6450),et=v(13346),en=v(89644);let er=["currentUser"],useUser=()=>{let m=(0,E.t)(m=>m.token),g=(0,E.t)(m=>m.logout),v=(0,x.NL)();return(0,k.a)(er,async()=>{let{data:m}=await (0,T.h)(K.Bh,{method:"get",url:et.Z.user.show()});return m},{enabled:!!m,staleTime:3e5,retry:!1,onError:m=>{var x;m instanceof en.AxiosError&&(null===(x=m.response)||void 0===x?void 0:x.status)===401&&(g(),v.setQueryData(er,null))}})}},8270:function(m,g,v){"use strict";v.d(g,{V:function(){return E},y:function(){return k}});var x=v(53538);let k=x.Ry({id:x.Rx(),code:x.Rx(),name:x.Z_(),is_active:x.O7(),sort_order:x.Rx()}),E=k.extend({shinkansen_code:x.Z_().nullable()})},17774:function(m,g,v){"use strict";v.d(g,{EQ:function(){return en},Vu:function(){return k},mj:function(){return T},uL:function(){return et},xW:function(){return E}});var x=v(53538);let k=x.Ry({name:x.Z_(),display_name:x.Z_(),benefit_type:x.Km(["partial_discount","other"]).nullable().optional()}),normalizeToArray=m=>Array.isArray(m)?m:m?[m]:[],E=x.Ry({price_uf:x.Rx(),price_clp:x.Rx(),installments:x.Rx(),interest_rate:x.Rx()}),T=x.Ry({annual:E,monthly:E,current:E}),K=x.Ry({discount:x.Rx().default(0),discount_rate:x.Rx().default(0),discount_reason:x.Z_().default(""),type:x.Km(["free_installments","partial_discount","other"]).nullable().default(null),num_installments:x.Rx().default(0),starting_from:x.Rx().default(1)}),et=x.Ry({is_purchased:x.O7(),id:x.Z_(),price:x.Rx(),current_price:x.Rx(),current_price_clp:x.Rx().optional(),current_fee_price_clp:x.Rx().optional(),current_fee_price_uf:x.Rx().optional(),installments_number:x.Rx().optional(),discount:x.Rx().nullable(),insurable_object:x.Ry({id:x.Rx(),name:x.Z_(),kind:x.Km(["D","C"]),gender:x.Km(["male","female"]),breed:x.Z_(),age_in_words:x.Z_(),birthdate:x.Z_(),chip:x.O7().optional(),preexisting_conditions_record:x.IX(x.Ry({last_symptoms:x.G0([x.IX(x.Z_()),x.Z_()]).transform(normalizeToArray),pet_conditions:x.G0([x.IX(x.Z_()),x.Z_()]).transform(normalizeToArray),unknown_categories:x.IX(x.Z_()).optional().default([]),created_at:x.Z_().nullish()}))}),coverage_bundle:x.Ry({id:x.Z_()}),quote_type_id:x.Rx(),pays_yearly:x.O7(),document:x.Z_().nullable(),policy_scheduled_start_date:x.Z_().nullable(),policy_start_date:x.Z_().nullable(),interest_calculation_method:x.Km(["simple","compound"]).default("simple"),payment_options:T.nullish(),discount_code:x.Z_().nullable().default(null),discount_info:K.nullish(),discount_provider:k.nullable().default(null),discount_display_label:x.Z_().nullable().optional(),referral_opted_out:x.O7().default(!1)}),en=x.Ry({id:x.Z_(),quote_set:x.IX(et)})},65864:function(m,g,v){"use strict";v.d(g,{U3:function(){return el},W5:function(){return ec},qj:function(){return T}});var x=v(53538);let k=x.G0([x.i0("processing"),x.i0("settled"),x.i0("denied"),x.i0("info_needed"),x.i0("paid"),x.i0("payment_error"),x.i0("further_investigation"),x.i0("processing_delayed"),x.i0("adjusted"),x.i0("appealed"),x.i0("appeal_response")]),E=x.Ry({id:x.Rx(),status:x.Rx(),status_name:x.Z_().nullable(),claim:x.Z_(),comment:x.Z_().nullable(),description:x.Z_().nullable(),created_at:x.Z_(),updated_at:x.Z_(),status_key:k.nullable(),rejection_category_name:x.Z_().default(""),report:x.Z_().nullable()}),T=x.Ry({id:x.Z_(),claim_int:x.Rx().nullable().optional(),policy:x.Z_().optional(),status:x.Rx().optional(),category:x.Rx().optional(),reason:x.Z_().optional(),diagnosis_name:x.Z_().default("No aplica"),total_amount:x.Rx().nullable().optional(),reimbursable_amount:x.Rx().nullable().optional(),amount_covered:x.Rx().nullable(),percentage_covered:x.Rx().optional(),claim_date:x.Z_(),event_date:x.Z_().nullish(),claim_history:x.IX(E).optional(),is_closed:x.O7().optional(),is_paid:x.O7().optional(),original_claim:x.Z_().nullable().optional(),last_claim_history:E.nullable().optional(),payable_amount:x.Rx().nullable().optional(),needs_re_adjusting:x.O7().default(!1),severity_level:x.dj(m=>""===m?null:m,x.Km(["better","same","worse","deceased"]).nullable()).optional()}).passthrough(),K=x.Ry({id:x.Rx(),amount:x.Rx(),is_paid:x.O7(),last_payment_status_key:x.Z_()}),et=x.Ry({id:x.Rx(),item:x.Z_(),item_detail:x.Z_().nullable(),unit_value:x.Rx(),quantity:x.Rx(),total:x.Rx(),coverable:x.O7(),justified:x.O7(),ai_coverable_explanation:x.Z_(),ai_justified_explanation:x.Z_(),ai_justification_document_filename:x.Z_(),provider_service_id:x.Rx().nullable(),document_emission_date:x.Z_()}),en=x.Ry({id:x.Rx(),status_key:x.Z_(),status_display:x.Z_(),comment:x.Z_().nullable(),created_at:x.Z_().nullable(),rejection_category_name:x.Z_(),report:x.Z_().nullable()}),er=x.Ry({id:x.Rx(),name:x.Z_(),unit_price:x.Rx(),quantity:x.Rx(),total_price:x.Rx(),coverable:x.O7(),justified:x.O7(),category_name:x.Z_().nullable()}),ei=x.Ry({id:x.Rx(),claim_id:x.Z_(),document_name:x.Z_(),document_url:x.Z_().nullable(),document_number:x.Z_(),file_type:x.Z_().nullable(),emission_date:x.Z_().nullable(),total_amount:x.Rx().nullable(),has_issues:x.O7(),issue_comment:x.Z_(),is_edited_by_user:x.O7(),is_duplicate_receipt:x.O7().nullable(),bypass_ai_validation:x.O7(),ai_extracted_data:x.G0([x.IM(x._4()),x.IX(x._4())]).nullable(),items:x.IX(er),previous_document_id:x.Rx().nullable(),next_document_ids:x.IX(x.Rx()),needs_budget:x.O7(),linked_budget_document_id:x.Rx().nullable(),created_at:x.Z_().nullable()}),es=x.Ry({justified_amount:x.Rx(),applied_deductible:x.Rx(),is_annual_deductible:x.O7().nullish(),percentage_covered:x.Rx(),coverage_c
6ap:x.Rx().nullish(),payable_amount:x.Rx()}),el=x.Ry({id:x.Z_(),policy_id:x.Z_(),claim_int:x.Rx().nullable(),category:x.Rx(),category_display:x.Z_(),reason:x.Z_(),status:x.Z_(),status_display:x.Z_(),event_date:x.Z_().nullable(),claim_date:x.Z_().nullable(),total_amount:x.Rx(),payable_amount:x.Rx(),amount_covered:x.Rx(),is_paid:x.O7(),is_closed:x.O7(),diagnosis:x.Ry({id:x.Rx(),name:x.Z_()}).nullable(),documents:x.IX(ei),claim_history:x.IX(en),last_claim_history:en.nullable(),original_claim_id:x.Z_().nullable(),reimbursable_items:x.IX(x.Z_()),severity_level:x.Z_(),written_declaration:x.Z_().nullable(),video_description:x.Z_().nullable(),needs_re_adjusting:x.O7(),created_at:x.Z_(),updated_at:x.Z_().nullable(),reimbursable_amount:x.Rx().nullable(),remaining_deductible:x.Rx().nullable(),coverage_remainder_amount:x.Rx().nullable(),movements:x.IX(K),claim_breakdown:x.IX(et).nullable(),settlement_summary:es.nullish()}),ec=x.Ry({page:x.Rx(),page_size:x.Rx(),total_items:x.Rx(),total_pages:x.Rx(),items:x.IX(el)})},27875:function(m,g,v){"use strict";v.d(g,{NO:function(){return en},Pd:function(){return et}});var x=v(84631),k=v(53538);let E=k.Ry({id:k.Z_(),coverage:k.Ry({id:k.Z_(),name:k.Km(["petplanv1","accidents","accidents_and_illnesses","liability","complementary_treatments","vaccines","preventive_exams","preventive_consultations","teleconsultations","chip_posture"])}),amount_limit:k.Rx().nullable(),amount_limit_per_event:k.Rx().nullable(),deductible:k.Rx(),is_annual_deductible:k.O7(),percentage_covered:k.Rx(),remaining_amount_covered:k.Rx().nullable()});var T=v(855);let K=x.ZP.object({id:x.ZP.string(),document_number:x.ZP.string().nullable(),readable_id:x.ZP.string(),type:x.ZP.string(),price:x.ZP.number(),start_date:x.ZP.string().nullable(),end_date:x.ZP.string().nullable(),is_active:x.ZP.boolean(),is_emitted:x.ZP.boolean()}),et=x.ZP.object({id:x.ZP.string(),product_id:x.ZP.number(),insurable_id:x.ZP.number(),user_id:x.ZP.number(),plan_configuration:T.E.nullable().optional(),items:x.ZP.array(E),health_item:E.nullable(),base_net_premium:x.ZP.number(),package_name:x.ZP.enum(["base+accidents+preventive","base+accidents+illnesses","base+accidents+illnesses+preventive","mini_deductible_4","mini_deductible_2","mini_deductible_0","care_deductible_4","care_deductible_2","care_deductible_0","care_preventive_deductible_4","care_preventive_deductible_2","care_preventive_deductible_0","care_plus_deductible_4","care_plus_deductible_2","care_plus_deductible_0","care_plus_preventive_deductible_4","care_plus_preventive_deductible_2","care_plus_preventive_deductible_0","catastrophic_deductible_20","catastrophic_deductible_12","catastrophic_deductible_6","catastrophic_preventive_deductible_20","catastrophic_preventive_deductible_12","catastrophic_preventive_deductible_6","catastrophic","catastrophic_preventive","mini_preventive_deductible_4","mini_preventive_deductible_2","mini_preventive_deductible_0"]).nullable(),has_preventive_package:x.ZP.boolean(),has_illnesses:x.ZP.boolean(),has_liability:x.ZP.boolean(),has_complementary_treatments:x.ZP.boolean(),has_accidents:x.ZP.boolean(),quote_id:x.ZP.string().optional().nullable(),quote_expires_at:x.ZP.string().nullish(),quote_is_expired:x.ZP.boolean().default(!1),policy_scheduled_start_date:x.ZP.string().optional().nullable(),has_policy:x.ZP.boolean().optional(),policy:K.nullable().optional()}),en=et.passthrough()},50202:function(m,g,v){"use strict";v.d(g,{Dq:function(){return T},Fb:function(){return k}});var x=v(53538);let k=x.Ry({message:x.Z_()}),E=x.Km(["validation","unauthorized","forbidden","not_found","conflict","external_service","internal"]);x.Ry({type:E,code:x.Rx(),message:x.Z_(),details:x.IM(x._4()).optional()});let T=x.Ry({type:x.Z_(),code:x.Rx(),message:x.Z_(),details:x.IM(x._4()).optional()})},15515:function(m,g,v){"use strict";v.d(g,{uY:function(){return ei},j_:function(){return es},u5:function(){return el}});var x=v(53538),k=v(26512),E=v(27875),T=v(17774),K=v(27484),et=v.n(K);let en=x.Ry({amount:x.Rx().nullable(),created_at:x.Z_().transform(m=>et()(m)),due_date:x.Z_().transform(m=>et()(m)),is_paid:x.O7(),is_free_invoice:x.O7()});var er=v(65864);let ei=k.m.pick({id:!0,name:!0,kind:!0,breed:!0,weight:!0,inscription_age:!0,age_in_words:!0,birthdate:!0,gender:!0,chip:!0,user:!0,preexisting_conditions:!0,preexisting_conditions_record:!0,formatted_preexisting_conditions:!0}).extend({breed:x.Z_().nullable(),kind:x.Km(["D","C"]).nullable(),birthdate:x.Z_().nullable(),gender:x.Km(["male","female"]).nullable(),age_in_words:x.Z_().nullable()}),es=x.Ry({id:x.Z_(),coverage_bundle:E.Pd.nullable(),is_cancelled:x.O7(),is_emitted:x.O7(),has_active_cancellation_request:x.O7().optional(),has_open_claims:x.O7().optional(),insurable_object:ei.nullable(),document:x.Z_().nullable().optional(),price:x.Rx().nullable().optional(),end_date:x.Z_().nullable().optional(),renewal_status:x.Km(["pending_approval","approved","renewed","rejected","superseded_by_plan_change"]).nullable().optional(),current_fee_price_clp:x.Rx().nullable().optional(),current_fee_price_uf:x.Rx().nullable().optional(),insurance_company:x.Km(["aspor","bci","test"]).nullable().optional(),readable_id:x.Z_().nullable().optional(),document_number:x.Z_().nullable().optional(),accidents_illnesses_reimbursed_amount_clp:x.Rx().nullable().optional(),annual_deductible_used_clp:x.Rx().nullable().optional(),start_date:x.Z_().optional(),created_at:x.Z_().nullish(),previous_policy:x.Z_().nullable().optional(),mobile_onboarding_completed:x.O7().optional(),is_renewal:x.O7().optional(),coverage_start_date:x.Z_().nullable().optional()}).passthrough(),el=es.extend({renewal_price:x.Rx(),renewal_price_multiplier:x.Rx(),invoice_set:x.IX(en),claim_set:x.IX(er.qj),renewal_quote:T.uL.extend({document:x.Z_().nullable(),insurable_object:T.uL.shape.insurable_object.optional()}),superseded_by_plan_change:x.O7().nullish()})},22908:function(m,g,v){"use strict";v.d(g,{Wx:function(){return E},hf:function(){return T}});var x=v(53538);let k=x.Ry({mp_card_id:x.Z_(),last_four_digits:x.Z_().nullable(),card_type:x.Z_().nullable()}),E=x.Ry({has_card:x.O7(),cards:x.IX(k),default_card:k.nullable()});x.Ry({token:x.Z_(),payment_method_id:x.Z_()});let T=x.Ry({success:x.i0(!0),message:x.Z_(),mp_card_id:x.Z_(),last_four_digits:x.Z_(),card_type:x.Z_()}),K=x.Ry({external_resource_url:x.Z_(),creq:x.Z_()});x.Ry({status:x.Z_(),message:x.Z_(),policy_created:x.O7(),invoice_id:x.Z_().nullable().optional(),payment_id:x.Z_().nullable().optional(),details:x.Z_().nullable().optional(),last_updated:x.Z_().nullable().optional(),three_ds_info:K.nullable().optional()})},26512:function(m,g,v){"use strict";v.d(g,{U:function(){return k},m:function(){return E}});var x=v(84631);let normalizeToArray=m=>Array.isArray(m)?m:m?[m]:[],k=x.ZP.object({created_at:x.ZP.string().nullish(),last_symptoms:x.ZP.union([x.ZP.array(x.ZP.string()),x.ZP.string()]).transform(normalizeToArray),pet_conditions:x.ZP.union([x.ZP.array(x.ZP.string()),x.ZP.string()]).transform(normalizeToArray),unknown_categories:x.ZP.array(x.ZP.string()).optional().default([])}).passthrough(),E=x.ZP.object({id:x.ZP.number(),birthdate:x.ZP.string(),breed:x.ZP.string(),weight:x.ZP.string().nullable(),gender:x.ZP.enum(["male","female"]),inscription_age:
6x.ZP.string().nullable(),age_in_words:x.ZP.string(),name:x.ZP.string(),kind:x.ZP.enum(["D","C"]),skull_type:x.ZP.enum(["dolicocef\xe1lico","mesocef\xe1lico","mestizo","braquicef\xe1lico","otro"]).nullable(),user:x.ZP.number().nullable().optional(),preexisting_conditions:x.ZP.string().nullable().optional(),preexisting_conditions_record:x.ZP.array(k).optional().default([]),formatted_preexisting_conditions:x.ZP.string().nullable().optional(),chip:x.ZP.boolean(),has_policy:x.ZP.boolean(),active_policy:x.ZP.boolean(),last_coverage_bundle_id:x.ZP.union([x.ZP.string(),x.ZP.undefined()])})},855:function(m,g,v){"use strict";v.d(g,{E:function(){return k},G:function(){return E}});var x=v(53538);let k=x.Ry({id:x.Rx().nullable(),name:x.Z_(),distribution_percentage:x.Rx().int().min(0).max(100),plan_ids:x.IX(x.Z_()),product_id:x.Rx(),is_active:x.O7()}),E=x.Ry({id:x.Rx(),name:x.Z_(),distribution_percentage:x.Rx().int().min(0).max(100),plan_ids:x.IX(x.Z_()),is_active:x.O7(),total_quotes:x.Rx(),purchased_quotes:x.Rx(),conversion_rate:x.Rx(),unique_users:x.Rx(),users_who_purchased:x.Rx(),user_conversion_rate:x.Rx(),created_at:x.Z_(),purchased_plans:x.IM(x.Z_(),x.Rx()).default({}),has_quotes:x.O7()})},47793:function(m,g,v){"use strict";v.d(g,{$j:function(){return E},PV:function(){return T},c8:function(){return k}});var x=v(53538);let k=x.Km(["A","B"]),E=x.IM(k),T=x.Ry({experiment_key:x.Z_(),variant:k,assigned_at:x.Z_(),completed_at:x.Z_().nullish()})},6450:function(m,g,v){"use strict";v.d(g,{Bh:function(){return T},G4:function(){return k},c2:function(){return E}});var x=v(53538);let k=x.Ry({id:x.Rx(),name:x.Z_()}),E=x.Ry({id:x.Rx(),email:x.Z_(),address:x.Ry({comuna:x.Z_(),street:x.Z_().nullable(),number:x.Z_().nullable(),formatted_address:x.Z_().nullable()}).passthrough().nullable().optional(),rut:x.Z_().nullable(),birthdate:x.Z_().datetime({offset:!0}).nullable(),phone:x.Rx().nullable(),referrer_code:x.Z_().nullable(),active_affiliates_count:x.Rx(),affiliates:x.IX(x.Ry({user:x.Ry({first_name:x.Z_(),last_name:x.Z_()}).passthrough(),is_active:x.O7()}).passthrough()).optional(),name:x.Z_(),first_name:x.Z_(),last_name:x.Z_().nullable(),second_last_name:x.Z_().nullable(),alias:x.Z_().nullable(),credittus:x.Rx().nullable(),awareness_source:x.Z_().nullable(),awareness_source_comment:x.Z_().nullable(),toku_customer_id:x.Z_().nullable(),toku_portal_url:x.Z_().nullable(),toku_dashboard_url:x.Z_().nullable(),groups:x.IX(k.pick({id:!0,name:!0})),partner_promo_code:x.Z_().nullable().optional(),is_tc_accepted:x.O7(),tc_accepted_at:x.Z_().datetime({offset:!0}).nullable(),is_mkt_accepted:x.O7(),mkt_accepted_at:x.Z_().datetime({offset:!0}).nullable(),is_superuser:x.O7(),is_staff:x.O7(),is_active:x.O7(),verified_email:x.O7(),verified_phone:x.O7(),identity_document_number:x.Z_().nullable().optional(),identity_document_status:x.Z_().nullable().optional(),identity_document_valid_until:x.Z_().nullable().optional(),created_at:x.Z_(),last_login:x.Z_().nullable(),intercom_id:x.Z_().nullable(),intercom_admin_id:x.Z_().nullable(),slack_user_id:x.Z_().nullable(),card:x.Ry({card_number:x.Z_().nullable(),card_type:x.Z_().nullable(),response_code:x.Rx().nullable(),created_at:x.Z_()}).nullable().optional()}).passthrough(),T=E.pick({id:!0,email:!0,address:!0,rut:!0,birthdate:!0,phone:!0,referrer_code:!0,active_affiliates_count:!0,affiliates:!0,name:!0,first_name:!0,last_name:!0,credittus:!0,awareness_source:!0,awareness_source_comment:!0,toku_customer_id:!0,toku_portal_url:!0,toku_dashboard_url:!0,groups:!0,partner_promo_code:!0,is_tc_accepted:!0,tc_accepted_at:!0,is_mkt_accepted:!0,mkt_accepted_at:!0,is_superuser:!0,is_staff:!0,card:!0,identity_document_number:!0,identity_document_status:!0,identity_document_valid_until:!0})},23551:function(m,g,v){"use strict";v.d(g,{Cn:function(){return eR},De:function(){return ex},IG:function(){return e$},IX:function(){return ej},JS:function(){return ek},Jc:function(){return eL},K_:function(){return eN},M1:function(){return e_},Mb:function(){return eC},Mt:function(){return eE},N1:function(){return el},N4:function(){return eb},NW:function(){return ew},O2:function(){return ef},OS:function(){return eZ},Pe:function(){return eB},Px:function(){return eh},Ry:function(){return ed},SY:function(){return eP},Uu:function(){return ec},VC:function(){return eD},WB:function(){return ey},Yy:function(){return es},bw:function(){return eS},c8:function(){return eg},dc:function(){return eT},fS:function(){return ep},ii:function(){return eA},jZ:function(){return eF},ot:function(){return eO},po:function(){return ev},tU:function(){return eu},vj:function(){return em},w2:function(){return eM}});var x=v(53538),k=v(17774);let E={meta:["meta","metaCustom"],tiktok:["tiktok"],ga4:["ga4"]};function defineEvent(m){for(let g of m.destinations){let v=E[g];if(v&&!v.some(g=>m[g]))throw Error('Analytics event "'.concat(m.name,'" targets ').concat(g," but has no ").concat(g," mapping"))}return m}let T=x.Km(["D","C"]),K=x.i0("CLP"),et=x.Ry({pet_name:x.Z_().optional(),pet_type:T.optional(),pet_age:x.Z_().optional(),pet_sex:x.Z_().optional(),pet_breed_type:x.Z_().optional(),pet_breed_detail
6:x.Z_().nullish()}),en=x.Ry({cart_total_value:x.Rx().optional(),basic_product_price:x.Rx().optional(),additional_product_added:x.O7().optional(),additional_product_price:x.Rx().optional(),discount_coupon_name:x.G0([x.Z_(),k.Vu]).nullish(),discount_coupon_value:x.Z_().nullish(),final_price:x.Rx().optional(),quote_id:x.Z_().nullish()}),er=x.Ry({content_ids:x.IX(x.Z_()),content_type:x.i0("product"),contents:x.IX(x.Ry({content_id:x.Z_(),price:x.Rx(),discount:x.Rx().optional()})),currency:K,quantity:x.Rx(),value:x.Rx()}),ei=x.Ry({platform:x.i0("web"),screen_name:x.Z_().optional(),user_agent:x.Z_().optional(),screen_resolution:x.Z_().optional(),viewport_size:x.Z_().optional(),url:x.Z_().optional(),referrer:x.Z_().optional()}),purchaseContentName=m=>"Seguro ".concat("D"===m.pet_type?"Perro":"Gato"," - ").concat(m.additional_product_added?"Premium":"B\xe1sico"),adsParams=m=>({content_ids:m.content_ids,content_type:"product",currency:"CLP",value:m.value}),ga4CommerceParams=m=>({currency:"CLP",value:m.value,items:[{item_id:m.content_ids[0],...m.pet_type?{item_name:purchaseContentName(m)}:{},price:m.value,quantity:1}]}),es=defineEvent({name:"User Signed Up",schema:x.Ry({id:x.Z_()}),destinations:["cio","meta","tiktok","ga4","posthog"],meta:{eventName:"Lead",params:()=>({})},tiktok:{eventName:"CompleteRegistration",params:()=>({})},ga4:{eventName:"sign_up",params:()=>({})}}),el=defineEvent({name:"Personal Information Completed",schema:x.Ry({}),destinations:["cio","posthog"]}),ec=defineEvent({name:"User Information Completed",schema:x.Ry({userId:x.Rx(),has_rut:x.O7(),has_phone:x.O7(),has_birthdate:x.O7(),age_range:x.Rx().optional()}),destinations:["cio","posthog"]}),eu=defineEvent({name:"Pet Information Completed",schema:x.Ry({pet_name:x.Z_().optional(),pet_type:T,pet_age_years:x.Rx().optional(),pet_age_months:x.Rx().optional(),pet_sex:x.Z_().optional(),pet_breed_type:x.Z_().optional(),pet_breed_detail
6:x.Z_().optional(),pet_id:x.Rx().optional()}),destinations:["cio","posthog"]}),ed=defineEvent({name:"PetQuote",schema:x.Ry({coverage_bundle_id:x.Z_(),quote_id:x.Z_().nullish(),pet_id:x.Rx().optional(),pet_type:T.optional(),pet_breed_id:x.Rx().optional(),value_clp:x.Rx().optional(),currency:K}),destinations:["cio","ga4","meta","posthog"],metaCustom:{eventName:"PetQuote",params:m=>adsParams({content_ids:[m.coverage_bundle_id],value:m.value_clp})},ga4:{eventName:"Cotizacion",params:()=>({})},dedupeKey:m=>"pet-quote:".concat(m.coverage_bundle_id)}),ep=defineEvent({name:"Plans Viewed",schema:x.Ry({coverage_bundle_id:x.Z_(),value_clp:x.Rx()}),destinations:["meta","tiktok","ga4","posthog"],meta:{eventName:"ViewContent",params:m=>adsParams({content_ids:[m.coverage_bundle_id],value:m.value_clp})},tiktok:{eventName:"ViewContent",params:m=>adsParams({content_ids:[m.coverage_bundle_id],value:m.value_clp})},ga4:{eventName:"view_item",params:m=>ga4CommerceParams({content_ids:[m.coverage_bundle_id],value:m.value_clp})}}),em=defineEvent({name:"Product Added",schema:er.merge(et).merge(en).extend({pet_age_years:x.Z_().optional()}),destinations:["cio","meta","tiktok","ga4","posthog"],meta:{eventName:"AddToCart",params:adsParams},tiktok:{eventName:"AddToCart",params:m=>({...adsParams(m),quantity:1})},ga4:{eventName:"add_to_cart",params:ga4CommerceParams}}),ef=defineEvent({name:"Accident Coverage Explanation",schema:x.Ry({coverageBundleId:x.Z_().optional(),petId:x.Rx().optional(),pet_type:T.optional(),pet_breed:x.Z_().optional(),quote_id:x.Z_().nullish()}),destinations:["cio","posthog"]}),eh=defineEvent({name:"Liability Coverage Explanation",schema:x.Ry({coverageBundleId:x.Z_().optional(),petId:x.Rx().optional(),pet_type:T.optional(),has_liability:x.O7().optional(),quote_id:x.Z_().nullish()}),destinations:["cio","posthog"]}),eg=defineEvent({name:"Non Coverables Explanation",schema:x.Ry({coverageBundleId:x.Z_().optional(),petId:x.Rx().optional(),quote_id:x.Z_().nullish()}),destinations:["cio","posthog"]}),ev=defineEvent({name:"Preventive Coverage Selection",schema:x.Ry({coverageBundleId:x.Z_().optional(),petId:x.Rx().optional(),has_preventive:x.O7(),quote_id:x.Z_().nullish()}),destinations:["cio","posthog"]}),ey=defineEvent({name:"Pet Health Information Completed",schema:x.Ry({pet_type:T,pet_breed:x.Z_(),pet_breed_details:x.Z_().nullable(),pet_sex:x.Z_(),pet_health_history:x.Km(["Si","No"]),health_history_time:x.Z_(),quote_id:x.Z_().nullish()}),destinations:["cio","posthog"]}),eb=defineEvent({name:"User Address Completed",schema:x.Ry({userId:x.Rx().optional(),comuna:x.Z_().optional(),quote_id:x.Z_().nullish()}),destinations:["cio","posthog"]}),ex=defineEvent({name:"Checkout Started",schema:er.merge(et).merge(en).extend({id:x.Z_(),coupon:x.Z_().nullish()}),destinations:["meta","tiktok","ga4","posthog"],meta:{eventName:"InitiateCheckout",params:adsParams},tiktok:{eventName:"InitiateCheckout",params:m=>({...adsParams(m),quantity:1})},ga4:{eventName:"begin_checkout",params:ga4CommerceParams},dedupeKey:m=>"checkout-started:".concat(m.content_ids[0])}),e_=defineEvent({name:"Purchase Error",schema:et.merge(en).extend({pet_health_history:x.Km(["Si","No"]).optional(),error_message:x.Z_(),failure_stage:x.Km(["start_payment","payment_status","three_ds"]),can_retry:x.O7(),attempt_number:x.Rx().int().positive()}),destinations:["cio","posthog"]}),ew=defineEvent({name:"payment_retry_started",schema:x.Ry({quote_id:x.Z_(),attempt_number:x.Rx().int().min(2),retry_source:x.Km(["checkout","card_update"])}),destinations:["posthog"]}),eS=defineEvent({name:"Claim Settlement Accepted",schema:x.Ry({}),destinations:["posthog"]}),eC=defineEvent({name:"claim_started",schema:x.Ry({claim_id:x.Z_(),policy_id:x.Z_(),claim_type:x.Km(["preventive","accident","illness","complementary_therapy","liability"]),is_addendum:x.O7()}),destinations:["posthog"],dedupeKey:m=>"claim-started:".concat(m.claim_id)}),ek=defineEvent({name:"claim_step_completed",schema:x.Ry({claim_id:x.Z_(),step:x.Km(["statement","documents","bank_account"]),method:x.Km(["video","written"]).optional(),document_count:x.Rx().int().nonnegative().optional()}),destinations:["posthog"],dedupeKey:m=>"claim-step-completed:".concat(m.claim_id,":").concat(m.step)}),eE=defineEvent({name:"claim_document_processing_failed",schema:x.Ry({claim_id:x.Z_(),stage:x.Km(["upload","analysis","save"]),reason:x.Km(["validation","conflict","network","server","timeout","unknown"])}),destinations:["posthog"]}),ej=defineEvent({name:"claim_submission_failed",schema:x.Ry({claim_id:x.Z_(),reason:x.Km(["validation","conflict","network","server","unknown"])}),destinations:["posthog"]}),eN=defineEvent({name:"Order Completed",schema:er.merge(et).merge
6(en).extend({id:x.Z_(),coupon:x.Z_().nullish(),tax:x.Rx(),pet_health_history:x.Km(["Si","No"]),quote_id:x.Z_()}),destinations:["meta","tiktok"],eventId:m=>m.quote_id,dedupeKey:m=>"order-completed:".concat(m.quote_id),dedupeStorage:"local",meta:{eventName:"Purchase",params:m=>({...adsParams(m),content_name:purchaseContentName(m)})},tiktok:{eventName:"CompletePayment",params:m=>({...adsParams(m),quantity:1})}}),eR=defineEvent({name:"Referral Link Shared",schema:x.Ry({source:x.Z_(),method:x.Km(["copy","whatsapp","email"])}),destinations:["cio","posthog"]}),eI=x.Ry({benefit_id:x.Rx(),benefit_name:x.Z_()}),eP=defineEvent({name:"Benefits Viewed",schema:ei,destinations:["cio","posthog"]}),eT=defineEvent({name:"Benefit Detail Viewed",schema:ei.merge(eI).extend({benefit_category:x.Z_(),benefit_company:x.Z_()}),destinations:["cio","posthog"]}),eO=defineEvent({name:"Benefit Navigation Back",schema:ei,destinations:["cio","posthog"]}),eA=defineEvent({name:"Benefit Card Clicked",schema:ei.merge(eI).extend({benefit_category:x.Z_()}),destinations:["cio","posthog"]}),eM=defineEvent({name:"Benefit Redeem Clicked",schema:ei.merge(eI).extend({discount_code:x.Z_().optional()}),destinations:["cio","posthog"]}),eD=defineEvent({name:"Benefit External Link Clicked",schema:ei.merge(eI).extend({external_url:x.Z_()}),destinations:["cio","posthog"]}),eL=defineEvent({name:"Benefit List Scrolled",schema:ei.extend({scroll_depth:x.Rx()}),destinations:["cio","posthog"]}),eF=defineEvent({name:"Benefit Company Link Clicked",schema:ei.extend({company_id:x.Rx(),company_name:x.Z_(),benefit_count:x.Rx()}),destinations:["cio","posthog"]}),eZ=defineEvent({name:"Company Benefits Viewed",schema:ei.extend({company_id:x.Rx(),company_name:x.Z_()}),destinations:["cio","posthog"]}),eB=defineEvent({name:"Benefit Load Error",schema:ei.extend({error_message:x.Z_()}),destinations:["cio","posthog"]}),e$=defineEvent({name:"quote_flow_experiment_assigned",schema:x.Ry({experiment_key:x.Z_(),variant:x.Km(["A","B"])}),destinations:["posthog"],dedupeKey:m=>"quote-flow-experiment-assigned:".concat(m.experiment_key,":").concat(m.variant)})},52284:function(m,g,v){"use strict";v.d(g,{bQ:function(){return getFlowFailureReason},d$:function(){return normalizeClaimType},vl:function(){return createPaymentAttemptTracker}});var x=v(68344);function getFlowFailureReason(m){return m instanceof x.o?void 0===m.statusCode?"network":409===m.statusCode?"conflict":[400,422].includes(m.statusCode)?"validation":m.statusCode>
6=500?"server":"unknown":"unknown"}function normalizeClaimType(m){return"sickness"===m?"illness":"complementary-therapy"===m?"complementary_therapy":"accident"===m||"liability"===m?m:"preventive"}function createPaymentAttemptTracker(){let m=0,g=!1;return{begin:v=>(m+=1,g=!1,{attemptNumber:m,retrySource:v}),currentAttemptNumber:()=>Math.max(m,1),shouldTrackFailure:v=>v===m&&!g&&(g=!0,!0)}}},28151:function(m,g,v){"use strict";v.d(g,{$A:function(){return identifyUser},Bc:function(){return tiktokIdentify},Kq:function(){return trackPage},Mo:function(){return bootIntercom},Z0:function(){return trackPageView},qw:function(){return trackInitialPageView}});var x=v(48943),k=v.n(x),E=v(20463),T=v(68717),K=v(81937),et=v(66226);let en=!1;function sendMetaPageView(m,g,v){let{fbc:x,fbp:k}=v;(0,K.s)({event_id:m,event_source_url:g,fbc:x,fbp:k})}let tiktokIdentify=m=>{try{var g,v;null===(v=window)||void 0===v||null===(g=v.ttq)||void 0===g||g.identify(m)}catch(m){(0,E.Tb)(m,{silent:!0})}};function trackPageView(m,g,v){if(v.pixel){var x,k;null===(x=(k=window).fbq)||void 0===x||x.call(k,"track","PageView",{},{eventID:m})}!function waitForMetaBrowserId(m,g){let v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,x=(0,et.Kf)(),{fbp:k}=x;if(k||en){sendMetaPageView(m,g,x);return}if(20===v){en=!0,sendMetaPageView(m,g,x);return}window.setTimeout(()=>waitForMetaBrowserId(m,g,v+1),100)}(m,g)}function trackInitialPageView(){if(!T.O.NEXT_PUBLIC_META_PIXEL_ID)return;let m=window.__META_PV_EID;if(!m){(0,E.Tb)(Error("__META_PV_EID not found, skipping initial PageView"),{silent:!0});return}trackPageView(m,window.location.href,{pixel:!1})}let trackPage=m=>{try{var g,v;null===(v=window)||void 0===v||null===(g=v.analytics)||void 0===g||g.page(m)}catch(m){(0,E.Tb)(m,{silent:!0})}};function bootIntercom(){try{k()({app_id:T.O.NEXT_PUBLIC_INTERCOM_ID})}catch(m){(0,E.Tb)(m,{silent:!0})}}function identifyUser(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{var v,x,K,et;m?(null===(x=window)||void 0===x||null===(v=x.analytics)||void 0===v||v.identify(m,g),k()({app_id:T.O.NEXT_PUBLIC_INTERCOM_ID,user_id:m.toString()})):null===(et=window)||void 0===et||null===(K=et.analytics)||void 0===K||K.identify(g)}catch(m){(0,E.Tb)(m,{silent:!0})}}},21524:function(m,g,v){"use strict";v.d(g,{j:function(){return track}});var x=v(38969),k=v(81937),E=v(20463),T=v(66226);let K="analytics:tracked:",et=new Set;function sendMeta(m,g,v,x,E){E("meta:pixel:".concat(g),()=>!!window.fbq&&(window.fbq(m,g,{...v},{eventID:x}),!0)),E("meta:capi:".concat(g),()=>{var m,E;let K=(0,T.Kf)();return(0,k.$)(g,{event_id:x,value:v.value,currency:null!==(m=v.currency)&&void 0!==m?m:"CLP",content_ids:null!==(E=v.content_ids)&&void 0!==E?E:[],fbc:K.fbc,fbp:K.fbp,event_source_url:window.location.href})})}function track(m,g){var v,k,T,en;let er=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},ei=m.schema.safeParse(g);if(!ei.success){(0,E.Tb)(Error('Invalid props for analytics event "'.concat(m.name,'"')),{silent:!0,extra:{issues:ei.error.issues}});return}let es=ei.data,el=null===(v=m.dedupeKey)||void 0===v?void 0:v.call(m,es),ec="local"===m.dedupeStorage;if(el&&!ec&&!function(m){try{let g=window.sessionStorage,v="".concat(K).concat(m);if(g.getItem(v))return!1;return g.setItem(v,new Date().toISOString()),!0}catch(m){return(0,E.Tb)(m,{silent:!0}),!0}}(el))return;if(el&&ec)try{if(window.localStorage.getItem("".concat(K).concat(el)))return}catch(g){(0,E.Tb)(g,{silent:!0,tags:{analytics_event:m.name}})}let deliver=(g,v)=>{let x=ec&&el?"".concat(el,":").concat(g):void 0;!function(m,g,v){let x=m?"".concat(K).concat(m):void 0;if(x){if(et.has(x))return;try{if(window.localStorage.getItem(x))return}catch(m){v(m)}et.add(x)}let complete=m=>{if(m&&x)try{window.localStorage.setItem(x,new Date().toISOString())}catch(m){v(m)}},release=()=>{x&&et.delete(x)};try{let m=g();if(m instanceof Promise){m.then(complete).catch(v).finally(release);return}complete(m)}catch(m){v(m)}release()}(x,v,v=>{(0,E.Tb)(v,{silent:!0,tags:{analytics_event:m.name,analytics_destination:g}})})},eu=null!==(en=null!==(T=null===(k=m.eventId)||void 0===k?void 0:k.call(m,es))&&void 0!==T?T:er.eventId)&&void 0!==en?en:(0,x.SK)();for(let g of m.destinations)try{!function(m,g,v,x,k,E){switch(m){case"cio":E(m,()=>!!window.analytics&&(window.analytics.track(g.name,v),!0));return;case"posthog":E(m,()=>!!window.posthog&&(k?window.posthog.capture(g.name,v,{timestamp:k}):window.posthog.capture(g.name,v),!0));return;case"ga4":E(m,()=>!!g.ga4&&!!window.gtag&&(window.gtag("event",g.ga4.eventName,g.ga4.params(v)),!0));return;case"tiktok":E(m,()=>!!g.tiktok&&!!window.ttq&&(window.ttq.track(g.tiktok.eventName,g.tiktok.params(v),{event_id:x}),!0));return;case"meta":g.meta&&sendMeta("track",g.meta.eventName,g.meta.params(v),x,E),g.metaCustom&&sendMeta("trackCustom",g.metaCustom.eventName,g.metaCustom.params(v),x,E);return}}(g,m,es,eu,er.timestamp,deliver)}
6catch(v){(0,E.Tb)(v,{silent:!0,tags:{analytics_event:m.name,analytics_destination:g}})}}},44994:function(m,g,v){"use strict";v.d(g,{h:function(){return apiFetcher}});var x=v(14016),k=v(35151),E=v(82799),T=v(89644),K=v(7685);let UnknownError=class UnknownError extends Error{constructor(m){var g;if(!(m instanceof Error))throw Error("UnknownError must be constructed with an Error object.");let v=null!==(g=m.message)&&void 0!==g?g:"An unknown error occured in the API.";super(v),this.name="API-UnkownError",Error.captureStackTrace&&Error.captureStackTrace(this,UnknownError)}};async function apiFetcher(m,g){var v,et,en;let er=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},ei=null===(v=er.failSilently)||void 0===v||v,es=null===(et=er.decamelizeParams)||void 0===et||et,el=null===(en=er.reportSchemaMismatch)||void 0===en||en;try{let v=g.params,E=v?es?(0,K.decamelizeKeys)(v):v:void 0,T=g.data,et=T?es?(0,K.decamelizeKeys)(T):T:void 0,en=await k.Z.request({...g,params:E,data:et}),er=m.safeParse(en.data);if(!er.success){if(console.log("axiosOptions:",g),console.log("data:",en.data),console.log("error:",er.error),el&&(0,x.rj)(er.error,{context:"apiFetcher.zodValidation",url:g.url}),ei)return{...en,data:en.data};throw er.error}return{...en,data:er.data}}catch(m){if(!(m instanceof T.AxiosError||m instanceof E.jm))throw new UnknownError(m);throw m}}},26228:function(m,g,v){"use strict";v.d(g,{P:function(){return deleteQuoteFromCheckout},g:function(){return getLastCheckout}});var x=v(89644),k=v(53538),E=v(44994),T=v(20463),K=v(68344),et=v(14016),en=v(17774),er=v(13346);let ei=en.EQ.passthrough(),es=k.Ry({id:k.Z_(),checkout:k.Z_().nullable().optional()}).passthrough();async function deleteQuoteFromCheckout(m){try{return await (0,E.h)(es,{method:"patch",url:er.Z.quotes.updateV2(m.quoteId),data:{checkout:null}},{decamelizeParams:!1}),!0}catch(v){let g=(0,T.nZ)();if(g.setTag("deleteQuoteFromCheckout","fail"),g.setTag("transaction","deleteQuoteFromCheckout"),g.setContext("delete quote from checkout payload",{payload:m}),g.setExtra("error",v),function(m){if(m instanceof x.AxiosError){var g;return(null===(g=m.response)||void 0===g?void 0:g.status)===409}return m instanceof K.o&&409===m.statusCode}(v))return!1;(0,et.zG)(v,"Error al desasociar la cotizaci\xf3n del checkout")}}async function getLastCheckout(){try{let m=await (0,E.h)(ei,{method:"get",url:er.Z.checkout.last()});if(m.data.quote_set.length>1){let g=await Promise.all(m.data.quote_set.slice(1).map(async m=>deleteQuoteFromCheckout({quoteId:m.id})));if(!g.some(m=>m))return m.data;let v=await getLastCheckout();return v}return m.data}catch(g){let m=(0,T.nZ)();throw m.setTag("getLastCheckout","fail"),m.setTag("transaction","getLastCheckout"),m.setExtra("error",g),(0,et.rj)(g),g}}},82819:function(m,g,v){"use strict";v.d(g,{D:function(){return function intercomEvent(){for(var m=arguments.length,g=Array(m),v=0;v<m;v++)g[v]=arguments[v];window&&window.Intercom?window.Intercom(...g):setTimeout(()=>{intercomEvent(...g)},1e3)}}})},13346:function(m,g,v){"use strict";var x=v(11168),k=v(8041);let E={admin:{aiPrompts:{get:m=>"".concat(x.yx,"/api/v2/admin/insurance/ai-prompts/by-name/").concat(m,"/"),upsert:()=>"".concat(x.yx,"/api/v2/admin/insurance/ai-prompts/upsert/")},bankChoices:{create:()=>"".concat(x.yx,"/api/v2/admin/users/bank-choices/"),delete:m=>"".concat(x.yx,"/api/v2/admin/users/bank-choices/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/users/bank-choices/"),update:m=>"".concat(x.yx,"/api/v2/admin/users/bank-choices/").concat(m,"/")},benefits:{businessTypes:{create:()=>"".concat(x.yx,"/api/v2/admin/partnerships/business-types/"),delete:m=>"".concat(x.yx,"/api/v2/admin/partnerships/business-types/").concat(m,"/"),index:()=>"".concat(x.yx,"/api/v2/admin/partnerships/business-types/"),options:()=>"".concat(x.yx,"/api/v2/admin/partnerships/business-types/options/"),show:m=>"".concat(x.yx,"/api/v2/admin/partnerships/business-types/").concat(m,"/"),update:m=>"".concat(x.yx,"/api/v2/admin/partnerships/business-types/").concat(m,"/")},categories:{create:()=>"".concat(x.yx,"/api/v2/admin/partnerships/categories/"),delete:m=>"".concat(x.yx,"/api/v2/admin/partnerships/categories/").concat(m,"/"),index:()=>"".concat(x.yx,"/api/v2/admin/partnerships/categories/"),options:()=>"".concat(x.yx,"/api/v2/admin/partnerships/categories/options/"),show:m=>"".concat(x.yx,"/api/v2/admin/partnerships/categories/").concat(m,"/"),update:m=>"".concat(x.yx,"/api/v2/admin/partnerships/categories/").concat(m,"/")},companies:{create:()=>"".concat(x.yx,"/api/v2/admin/partnerships/companies/"),delete:m=>"".concat(x.yx,"/api/v2/admin/partnerships/companies/").concat(m,"/"),index:()=>"".concat(x.yx,"/api/v2/admin/partnerships/companies/"),logoPresignedPost:m=>"".concat(x.yx,"/api/v2/admin/partnerships/companies/").concat(m,"/logo-presigned-post/"),options:()=>"".concat(x.yx,"/api/v2/admin/partnerships/companies/options/"),show:m=>"".concat(x.yx,"/api/v2/admin/partnerships/companies/").concat(m,"/"),update:m=>"".concat(x.yx,"/api/v2/admin/partnerships/companies/").concat(m,"/")},partnerships:{commissions:{approve:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/approve/"),bulkApprove:()=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/bulk-approve/"),bulkPay:()=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/bulk-pay/"),changeHistory:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/change-history/"),configs:{detail:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/configs/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/configs/"),upsert:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/configs/").concat(m,"/")},create:()=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/"),deleteEvidence:(m,g)=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/evidence/").concat(g,"/"),detail:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/"),document:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/document/"),evidence:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/evidence/"),export:()=>
6"".concat(x.yx,"/api/v2/admin/partnerships/commissions/export/"),list:()=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/"),pay:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/pay/"),reject:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/reject/"),update:m=>"".concat(x.yx,"/api/v2/admin/partnerships/commissions/").concat(m,"/")},create:()=>"".concat(x.yx,"/api/v2/admin/partnerships/benefits/"),delete:m=>"".concat(x.yx,"/api/v2/admin/partnerships/benefits/").concat(m,"/"),index:()=>"".concat(x.yx,"/api/v2/admin/partnerships/benefits/"),show:m=>"".concat(x.yx,"/api/v2/admin/partnerships/benefits/").concat(m,"/"),trackedPolicies:{list:()=>"".concat(x.yx,"/api/v2/admin/partnerships/tracked-policies/")},update:m=>"".concat(x.yx,"/api/v2/admin/partnerships/benefits/").concat(m,"/"),verificationCodes:m=>"".concat(x.yx,"/api/v2/admin/partnerships/").concat(m,"/benefit-verifications/")},promoCodeUsage:()=>"".concat(x.yx,"/api/admin/promo_codes/usage_report/")},billing:{monthlySummary:m=>{let g="".concat(x.yx,"/api/v2/admin/billing/monthly-summary/");if(!m)return g;let v=new URLSearchParams;Object.entries(m).forEach(m=>{let[g,x]=m;null!=x&&""!==x&&v.append(g,String(x))});let k=v.toString();return k?"".concat(g,"?").concat(k):g},morosidadBreakdown:m=>{let g="".concat(x.yx,"/api/v2/admin/billing/morosidad-breakdown/");if(!m)return g;let v=new URLSearchParams;Object.entries(m).forEach(m=>{let[g,x]=m;null!=x&&""!==x&&v.append(g,String(x))});let k=v.toString();return k?"".concat(g,"?").concat(k):g},processorMonitoring:()=>"".concat(x.yx,"/api/v2/admin/billing/processor-monitoring/")},blog:{categories:()=>"".concat(x.yx,"/api/v2/admin/blog/categories/"),category:m=>"".concat(x.yx,"/api/v2/admin/blog/categories/").concat(m,"/"),faq:m=>"".concat(x.yx,"/api/v2/admin/blog/faqs/").concat(m,"/"),faqCategories:()=>"".concat(x.yx,"/api/v2/admin/blog/faqs/categories/"),faqReorder:()=>"".concat(x.yx,"/api/v2/admin/blog/faqs/reorder/"),faqs:()=>"".concat(x.yx,"/api/v2/admin/blog/faqs/"),post:m=>"".concat(x.yx,"/api/v2/admin/blog/posts/").concat(m,"/"),postDraft:m=>"".concat(x.yx,"/api/v2/admin/blog/posts/").concat(m,"/draft/"),postPublish:m=>"".concat(x.yx,"/api/v2/admin/blog/posts/").concat(m,"/publish/"),postStats:()=>"".concat(x.yx,"/api/v2/admin/blog/posts/stats/"),posts:()=>"".concat(x.yx,"/api/v2/admin/blog/posts/"),postsGeneratePresignedPost:()=>"".concat(x.yx,"/api/v2/admin/blog/posts/generate_presigned_post/"),testimonial:m=>"".concat(x.yx,"/api/v2/admin/blog/testimonials/").concat(m,"/"),testimonialApprove:m=>"".concat(x.yx,"/api/v2/admin/blog/testimonials/").concat(m,"/approve/"),testimonialReject:m=>"".concat(x.yx,"/api/v2/admin/blog/testimonials/").concat(m,"/reject/"),testimonialStats:()=>"".concat(x.yx,"/api/v2/admin/blog/testimonials/stats/"),testimonialToggleFeatured:m=>"".concat(x.yx,"/api/v2/admin/blog/testimonials/").concat(m,"/toggle_featured/"),testimonials:()=>"".concat(x.yx,"/api/v2/admin/blog/testimonials/"),users:()=>
6"".concat(x.yx,"/api/v2/admin/blog/users/")},businessStats:{index:()=>"".concat(x.yx,"/api/insurance/admin/business_stats/")},cancellationRequests:{analytics:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/analytics/"),assign:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/assign/"),assignees:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/assignees/"),context:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/context/"),create:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/"),detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/"),execute:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/execute/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/"),notes:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/notes/"),registerRetention:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/retention/"),reschedule:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/reschedule/"),stats:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/stats/"),timeline:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/timeline/"),updateCancellationDate:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/cancellation-date/"),updateStatus:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/status/"),verifyReason:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/verify-reason/"),void:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-requests/").concat(m,"/void/")},cancellationSettings:{reasonCategories:{detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/reason-categories/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/reason-categories/")},reasonOptions:{detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/reason-options/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/reason-options/")},retentionActions:{detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/retention-actions/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/retention-actions/")},retentionReasons:{detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/retention-reasons/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/retention-reasons/")},statuses:{detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/statuses/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancellation-settings/statuses/")}},cancellations:{autoDetectMapping:()=>"".concat(x.yx,"/api/v2/admin/insurance/bulk-cancellations/auto-detect-mapping/"),defaultMapping:()=>"".concat(x.yx,"/api/v2/admin/insurance/bulk-cancellations/default-mapping/"),downloadErrors:m=>"".concat(x.yx,"/api/v2/admin/insurance/bulk-cancellations/upload-history/").concat(m,"/download-errors/"),uploadBulk:()=>"".concat(x.yx,"/api/v2/admin/insurance/bulk-cancellations/upload-bulk/"),uploadHistory:()=>"".concat(x.yx,"/api/v2/admin/insurance/bulk-cancellations/upload-history/"),uploadHistoryDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/bulk-cancellations/upload-history/").concat(m,"/")},cancelledPolicyBalances:m=>{var g;let v=new URLSearchParams;(null==m?void 0:null===(g=m.insurance_companies)||void 0===g?void 0:g.length)&&v.append("insurance_companies",m.insurance_companies.join(",")),(null==m?void 0:m.search_term)&&v.append("search_term",m.search_term),(null==m?void 0:m.balance_filter)&&v.append("balance_filter",m.balance_filter),(null==m?void 0:m.has_refundable_invoices)&&v.append("has_refundable_invoices","true"),(null==m?void 0:m.has_physical_refundable_invoices)&&v.append("has_physical_refundable_invoices","true"),(null==m?void 0:m.has_pending_endorsement)&&v.append("has_pending_endorsement","true"),(null==m?void 0:m.order_by)&&v.append("order_by",m.order_by),(null==m?void 0:m.order_direction)&&v.append("order_direction",m.order_direction),(null==m?void 0:m.cancelled_date_from)&&v.append("cancelled_date_from",m.cancelled_date_from),(null==m?void 0:m.cancelled_date_to)&&v.append("cancelled_date_to",m.cancelled_date_to),(null==m?void 0:m.page)&&v.a
6ppend("page",m.page.toString()),(null==m?void 0:m.page_size)&&v.append("page_size",m.page_size.toString());let k=v.toString();return"".concat(x.yx,"/api/v2/admin/insurance/cancelled-policy-balances/").concat(k?"?".concat(k):"")},cancelledPolicyBalancesExport:()=>"".concat(x.yx,"/api/v2/admin/insurance/cancelled-policy-balances/export/"),chargebacks:{list:m=>{let g="".concat(x.yx,"/api/v2/admin/chargebacks/");if(!m)return g;let v=new URLSearchParams;Object.entries(m).forEach(m=>{let[g,x]=m;null!=x&&""!==x&&v.append(g,String(x))});let k=v.toString();return k?"".concat(g,"?").concat(k):g},recoveryTarget:m=>"".concat(x.yx,"/api/v2/admin/chargebacks/").concat(m,"/recovery-target/"),resolve:m=>"".concat(x.yx,"/api/v2/admin/chargebacks/").concat(m,"/resolve/")},claimComments:{create:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/comments/")},claimDocumentItems:{create:(m,g)=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/documents/").concat(g,"/items/"),delete:(m,g,v)=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/documents/").concat(g,"/items/").concat(v,"/"),update:(m,g,v)=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/documents/").concat(g,"/items/").concat(v,"/")},claimDocuments:{create:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/documents/"),delete:(m,g)=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/documents/").concat(g,"/"),duplicate:m=>"".concat(x.yx,"/api/insurance/claim_documents/").concat(m,"/duplicate/"),duplicates:m=>"".concat(x.yx,"/api/insurance/claim_documents/").concat(m,"/duplicate_claim_documents/"),extractItems:m=>"".concat(x.yx,"/api/insurance/claim_documents/").concat(m,"/extract_items/"),update:(m,g)=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/documents/").concat(g,"/"),upload:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/documents/upload/")},claimHistory:{create:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/history/")},claimMessageTemplates:{categories:()=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/categories/"),categoryChangeStatus:m=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/categories/").concat(m,"/change-status/"),categoryDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/categories/").concat(m,"/"),conditionKeys:()=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/categories/condition-keys/"),templateChangeStatus:m=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/").concat(m,"/change-status/"),templateDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/").concat(m,"/"),templates:()=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/"),variableChangeStatus:m=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/variables/").concat(m,"/change-status/"),variableDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/variables/").concat(m,"/"),variableFields:()=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/variable-fields/"),variables:()=>"".concat(x.yx,"/api/v2/admin/insurance/claim-message-templates/variables/")},claimSettlements:{claimsPendingPayment:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/claims_pending_payment/"),claimsPendingPaymentCount:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/claims_pending_payment/count/"),claimsWithoutIncomingSettlement:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/claims_without_incoming_settlement/"),claimsWithoutIncomingSettlementCount:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/claims_without_incoming_settlement/count/"),createIncomingFromBciExcel:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/create_incoming_from_bci_excel/"),createIncomingFromClaims:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/create_incoming_from_claims/"),createIncomingFromFilters:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/create_incoming_from_filters/"),createIncomingFromUnreportedFilters:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/create_incoming_from_unreported_filters/"),delete:m=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/").concat(m,"/"),detail:m=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/").concat(m,"/detail/"),downloadClaimsPendingPayment:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/claims_pending_payment/download/"),downloadClaimsWithoutIncomingSettlement:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/claims_without_incoming_settlement/download/"),downloadDetail:m=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/").concat(m,"/download/"),downloadIncoming:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/incoming/download/"),downloadUnreportedClaims:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/unreported_claims/download/"),exportClaimsWithoutIncomingSettlement:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/claims_without_incoming_settlement/export/"),exportUnreportedClaims:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/unreported_claims/export/"),incoming:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/incoming/"),index:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/"),unreportedClaims:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/unreported_claims/"),unreportedClaimsCount:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/unreported_claims/count/")},claims:{bciReconciliationReport:()=>"".concat(x.yx,"/api/insurance/admin/claims/bci/reconciliation-report/"),changeHistory:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/change-history/"),closeExternalAdjuster:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/close-external-adjuster/"),convertImages:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/convert-images/"),create:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/"),createSettlementReport:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/create-settlement-report/"),customerView:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/customer-view/"),delete:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/"),deleteExternalClaimId:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/delete-external-claim-id/"),downloadBciTemplate:()=>"".concat(x.yx,"/api/insurance/admin/claims/bci/get_aspor_claim_id_template/"),downloadFiles:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/download-files/"),duplicate:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/dupl
6icate-and-reset-status/"),exportAll:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/export/all/"),exportFiltered:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/export/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/"),markAsPaidManually:m=>"".concat(x.yx,"/api/insurance/admin/claim/").concat(m,"/mark_as_paid_manually/"),pay:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/pay/"),preSettlementHistory:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/pre-settlement-history/"),provisionBciClaims:()=>"".concat(x.yx,"/api/v2/admin/insurance/claim-homologation/provision/"),revertSettlement:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/revert-settlement/"),reviewWithAI:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/review-with-ai/"),sendDocumentsByEmail:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/send-documents-by-email/"),setOriginalClaim:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/set-original-claim/"),settlementTemplate:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/settlement-template/"),show:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/"),update:m=>"".concat(x.yx,"/api/v2/admin/insurance/claims/").concat(m,"/"),uploadBciAsporIds:()=>"".concat(x.yx,"/api/insurance/admin/claims/bci/set_aspor_claim_id_from_excel/")},claimsCatalog:{diagnoses:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/diagnoses/"),documentItemCategories:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/document-item-categories/"),fileTypes:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/file-types/"),historyStatuses:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/history-statuses/"),medicalSpecialties:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/medical-specialties/"),reasons:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/reasons/")},claimsFinance:{export:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims-finance/export/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims-finance/")},communes:{archive:m=>"".concat(x.yx,"/api/v2/admin/content/communes/").concat(m,"/archive/"),create:()=>"".concat(x.yx,"/api/v2/admin/content/communes/"),delete:m=>"".concat(x.yx,"/api/v2/admin/content/communes/").concat(m,"/"),detail:m=>"".concat(x.yx,"/api/v2/admin/content/communes/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/content/communes/"),unarchive:m=>"".concat(x.yx,"/api/v2/admin/content/communes/").concat(m,"/unarchive/"),update:m=>"".concat(x.yx,"/api/v2/admin/content/communes/").concat(m,"/")},companyReconciliation:{adjustPremium:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/lines/").concat(m,"/adjust-premium/"),autoDetectMapping:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/auto-detect-mapping/"),bulkResolve:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/lines/bulk-resolve/"),cacttusProduction:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/cacttus-production/"),cancelPolicy:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/lines/").concat(m,"/cancel-policy/"),conciliation:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/conciliation/"),detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/").concat(m,"/"),exportMissing:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/export-missing/"),exportMissingCancellations:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/export-missing-cancellations/"),exportNotInCacttus:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/export-not-in-cacttus/"),lines:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/lines/"),linesExport:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/lines/export/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/"),listSheets:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/list-sheets/"),morosidadAdjustments:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/morosidad-adjustments/"),notificationBatchConciliations:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/notification-batches/").concat(m,"/conciliations/"),notificationBatchDelete:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/notification-batches/").concat(m,"/"),notificationBatchDownload:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/notification-batches/").concat(m,"/download/"),notificationBatches:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/notification-batches/"),npolenTimeline:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/npolen-timeline/").concat(m,"/"),policyT
6imeline:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/policy-timeline/").concat(m,"/"),preview:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/preview/"),process:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/process/"),rehabilitate:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/lines/").concat(m,"/rehabilitate/"),reprocess:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/").concat(m,"/reprocess/"),resolveLine:(m,g)=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/").concat(m,"/lines/").concat(g,"/resolve/"),summary:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/summary/"),upload:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/upload/"),v2PolicyConciliation:{bulkResolve:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/v2/policy-conciliation/bulk-resolve/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/v2/policy-conciliation/"),movements:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/v2/policy-conciliation/").concat(m,"/movements/"),resolve:m=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/v2/policy-conciliation/").concat(m,"/resolve/"),summary:()=>"".concat(x.yx,"/api/v2/admin/insurance/company-reconciliation/v2/conciliation-summary/")}},crm:{claims:()=>"".concat(x.yx,"/api/v2/admin/insurance/claims/")},customerPets:{delete:m=>"".concat(x.yx,"/api/v2/admin/pet/customer-pets/").concat(m,"/delete/"),listByUser:m=>"".concat(x.yx,"/api/v2/admin/pet/customer-pets/by-user/").concat(m,"/"),merge:()=>"".concat(x.yx,"/api/v2/admin/pet/customer-pets/merge/"),restore:m=>"".concat(x.yx,"/api/v2/admin/pet/customer-pets/").concat(m,"/restore/")},documentNumberRanges:{create:()=>"".concat(x.yx,"/api/insurance/admin/document-number-ranges/"),delete:m=>"".concat(x.yx,"/api/insurance/admin/document-number-ranges/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/insurance/admin/document-number-ranges/"),update:m=>"".concat(x.yx,"/api/insurance/admin/document-number-ranges/").concat(m,"/")},dogBreeds:{archive:m=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/").concat(m,"/archive/"),create:()=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/"),delete:m=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/").concat(m,"/"),detail:m=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/"),unarchive:m=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/").concat(m,"/unarchive/"),update:m=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/").concat(m,"/"),uploadImage:m=>"".concat(x.yx,"/api/v2/admin/pet/dog-breeds/").concat(m,"/upload-image/")},earlyCollection:{bulkNotify:()=>"".concat(x.yx,"/api/v2/admin/early-collection/bulk-notify/"),preview:()=>"".concat(x.yx,"/api/v2/admin/early-collection/preview/"),userNotifications:function(m){let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:90;return"".concat(x.yx,"/api/v2/admin/early-collection/users/").concat(m,"/notifications/?days_back=").concat(g)}},emissions:{autoDetectMapping:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/auto-detect-mapping/"),bciCancellationsExport:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/bci-cancellations-export/"),bciExport:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/bci-export/"),defaultMapping:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/default-mapping/"),downloadErrors:m=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/upload-history/").concat(m,"/download-errors/"),downloadOriginal:m=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/upload-history/").concat(m,"/download-original/"),incomplete:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/incomplete/"),pending:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/pending/"),pendingCancellations:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/pending-cancellations/"),repair:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/repair/"),updateCancellationStatus:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/update-cancellation-status/"),updateStatus:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/update-status/"),uploadBulk:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/upload-bulk/"),uploadHistory:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/upload-history/"),uploadHistoryDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/upload-history/").concat(m,"/"),withoutDocuments:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/without-documents/")},endorsements:{search:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsements/search/"),uploadClaim:()=>"".concat(x.yx,"/api/v2/admin/insurance/claim-homologation/upload-claim/"),userEndorsements:m=>"".concat(x.yx,"/api/v2/admin/insurance/endorsements/users/").concat(m,"/endorsements/")},filterPresets:{create:()=>
6"".concat(x.yx,"/api/v2/admin/filter-presets/"),delete:m=>"".concat(x.yx,"/api/v2/admin/filter-presets/").concat(m,"/"),list:m=>"".concat(x.yx,"/api/v2/admin/filter-presets/?page_key=").concat(encodeURIComponent(m)),update:m=>"".concat(x.yx,"/api/v2/admin/filter-presets/").concat(m,"/")},fraud:k.U,groups:{destroy:m=>"".concat(x.yx,"/api/v2/admin/groups/").concat(m,"/"),index:()=>"".concat(x.yx,"/api/v2/admin/groups/")},health:{celery:()=>"".concat(x.yx,"/api/v2/admin/health/celery/")},invoices:{bulkChargePreview:()=>"".concat(x.yx,"/api/v2/admin/invoices/bulk-charge-preview/"),bulkRetryCharge:()=>"".concat(x.yx,"/api/v2/admin/invoices/bulk-retry-charge/"),history:m=>"".concat(x.yx,"/api/v2/admin/invoices/").concat(m,"/history/"),list:m=>{let g="".concat(x.yx,"/api/v2/admin/invoices/");if(!m)return g;let v=new URLSearchParams;Object.entries(m).forEach(m=>{let[g,x]=m;null!=x&&""!==x&&v.append(g,String(x))});let k=v.toString();return k?"".concat(g,"?").concat(k):g},markPaidByTransfer:m=>"".concat(x.yx,"/api/v2/admin/invoices/").concat(m,"/mark-paid-by-transfer/"),retryCharge:m=>"".concat(x.yx,"/api/v2/admin/invoices/").concat(m,"/retry-charge/"),show:m=>"".concat(x.yx,"/api/v2/admin/invoices/").concat(m,"/")},moduleGroups:()=>"".concat(x.yx,"/api/v2/admin/module-groups/"),noMpCardReminders:{eligibleUserIds:()=>"".concat(x.yx,"/api/v2/admin/no-mp-card-reminders/eligible-users/ids/"),eligibleUsers:()=>"".concat(x.yx,"/api/v2/admin/no-mp-card-reminders/eligible-users/"),send:()=>"".concat(x.yx,"/api/v2/admin/no-mp-card-reminders/send/"),userNotifications:m=>"".concat(x.yx,"/api/v2/admin/no-mp-card-reminders/users/").concat(m,"/notifications/"),weekly:()=>"".concat(x.yx,"/api/v2/admin/no-mp-card-reminders/weekly/")},partners:{supervisorQuotesReport:()=>"".concat(x.yx,"/api/admin/partners/supervisor-quotes-report/"),supervisorQuotesReportDownload:()=>"".concat(x.yx,"/api/admin/partners/supervisor-quotes-report/download/")},payments:{list:m=>{let g="".concat(x.yx,"/api/v2/admin/payments/");if(!m)return g;let v=new URLSearchParams;Object.entries(m).forEach(m=>{let[g,x]=m;null!=x&&""!==x&&v.append(g,String(x))});let k=v.toString();return k?"".concat(g,"?").concat(k):g},show:m=>"".concat(x.yx,"/api/v2/admin/payments/").concat(m,"/")},periodicTasks:{list:()=>"".concat(x.yx,"/api/v2/admin/periodic-tasks/"),run:m=>"".concat(x.yx,"/api/v2/admin/periodic-tasks/").concat(m,"/run/"),update:m=>"".concat(x.yx,"/api/v2/admin/periodic-tasks/").concat(m,"/")},policies:{changeHistory:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/change-history/"),changePlanEligibility:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/change-plan-eligibility/"),detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/policies/"),sendDocumentEmail:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/send-document-email/"),startRehabilitation:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/start-rehabilitation/"),uncancel:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/uncancel/"),update:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/")},preferences:()=>"".concat(x.yx,"/api/v2/admin/preferences/"),promoCodes:{applyToPolicy:()=>"".concat(x.yx,"/api/admin/promo_codes/apply_to_policy/"),create:()=>"".concat(x.yx,"/api/admin/promo_codes/"),delete:m=>"".concat(x.yx,"/api/admin/promo_codes/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/admin/promo_codes/"),removeFromPolicy:()=>"".concat(x.yx,"/api/admin/promo_codes/remove_from_policy/"),show:m=>"".concat(x.yx,"/api/admin/promo_codes/").concat(m,"/"),update:m=>"".concat(x.yx,"/api/admin/promo_codes/").concat(m,"/")},quoteFlowExperiments:{list:()=>"".concat(x.yx,"/api/v2/admin/quote-flow/experiments/"),resolve:m=>"".concat(x.yx,"/api/v2/admin/quote-flow/experiments/").concat(m,"/resolve/"),update:m=>"".concat(x.yx,"/api/v2/admin/quote-flow/experiments/").concat(m,"/")},quotes:{applyDiscount:m=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/").concat(m,"/apply-discount/"),detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/"),payByTransfer:m=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/").concat(m,"/pay-by-transfer/"),removeDiscount:m=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/").concat(m,"/remove-discount/"),update:m=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/").concat(m,"/")},reconciliation:{mercadopago:()=>"".concat(x.yx,"/api/v2/reconciliation/mercadopago/"),mercadopagoSync:()=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/mercadopago-sync/"),mercadopagoSyncImportDetail
6:m=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/mercadopago-sync/imports/").concat(m,"/"),mercadopagoSyncImports:()=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/mercadopago-sync/imports/"),mercadopagoSyncSchedule:()=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/mercadopago-sync/schedule/"),toku:()=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/toku/"),tokuDetail:m=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/toku/").concat(m,"/"),tokuDetectColumns:()=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/toku/detect-columns/"),tokuDiagnosePayment:m=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/toku/diagnose/payment/").concat(m,"/"),tokuDiagnoseRefund:m=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/toku/diagnose/refund/").concat(m,"/"),tokuPreview:()=>"".concat(x.yx,"/api/v2/oneclick/reconciliation/toku/preview/"),transbank:()=>"".concat(x.yx,"/api/v2/reconciliation/transbank/"),transbankDetail:m=>"".concat(x.yx,"/api/v2/reconciliation/transbank/").concat(m,"/"),transbankDetectColumns:()=>"".concat(x.yx,"/api/v2/reconciliation/transbank/detect-columns/"),transbankPreview:()=>"".concat(x.yx,"/api/v2/reconciliation/transbank/preview/")},referralRewards:{userRewards:m=>"".concat(x.yx,"/api/v2/admin/referral/rewards/users/").concat(m,"/")},refunds:{create:()=>"".concat(x.yx,"/api/v2/admin/refunds/"),createChargeback:()=>"".concat(x.yx,"/api/v2/admin/refunds/chargeback/"),createMp:()=>"".concat(x.yx,"/api/v2/admin/refunds/mercadopago/"),delete:m=>"".concat(x.yx,"/api/v2/admin/refunds/").concat(m,"/"),list:m=>{let g="".concat(x.yx,"/api/v2/admin/refunds/");if(!m)return g;let v=new URLSearchParams;Object.entries(m).forEach(m=>{let[g,x]=m;null!=x&&""!==x&&v.append(g,String(x))});let k=v.toString();return k?"".concat(g,"?").concat(k):g}},renewals:{applyDiscount:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/price-inconsistencies/").concat(m,"/apply-discount/"),applySkullTypeFix:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/price-inconsistencies/").concat(m,"/apply-skull-type-fix/"),autoDetectMapping:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/auto-detect-mapping/"),coverageOptions:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/").concat(m,"/coverage-options/"),discountEligibility:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/price-inconsistencies/").concat(m,"/discount-eligibility/"),downloadErrors:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/upload-history/").concat(m,"/download-errors/"),downloadOriginal:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/upload-history/").concat(m,"/download-original/"),export:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/export/"),generateLinks:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/generate-links/"),generateSingleLink:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/").concat(m,"/generate-link/"),history:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/").concat(m,"/history/"),list:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/"),multiplierHistory:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/").concat(m,"/multiplier-history/"),notifications:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/").concat(m,"/notifications/"),previewBulk:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/preview-bulk/"),priceInconsistencies:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/price-inconsistencies/"),priceInconsistencyDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/price-inconsistencies/").concat(m,"/"),undoRenewal:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/").concat(m,"/undo/"),updateStatus:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/"),uploadBulk:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/upload-bulk/"),uploadHistory:()=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/upload-history/"),uploadHistoryDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/upload-history/").concat(m,"/")},rewards:{list:()=>"".concat(x.yx,"/api/v2/admin/referral/rewards/")},subsidies:{createRefundSettlement:()=>"".concat(x.yx,"/api/v2/admin/subsidies/refund-settlements/"),createSettlement:()=>"".concat(x.yx,"/api/v2/admin/subsidies/settlements/"),createSettlementByFilters:()=>"".concat(x.yx,"/api/v2/admin/subsidies/settlements/by-filters/"),payments:()=>"".concat(x.yx,"/api/v2/admin/subsidies/payments/"),refunds:()=>"".concat(x.yx,"/api/v2/admin/subsidies/refunds/"),settlementPreview:()=>"".concat(x.yx,"/api/v2/admin/subsidies/settlements/preview/"),settlements:()=>"".concat(x.yx,"/api/v2/admin/subsidies/settlements/"),stats:()=>"".concat(x.yx,"/api/v2/admin/subsidies/stats/")},taskReports:{aggregate:()=>
6"".concat(x.yx,"/api/v2/admin/task-reports/"),resultDetail:m=>"".concat(x.yx,"/api/v2/admin/task-reports/results/").concat(m,"/"),results:()=>"".concat(x.yx,"/api/v2/admin/task-reports/results/"),timeseries:()=>"".concat(x.yx,"/api/v2/admin/task-reports/timeseries/")},tasks:{status:m=>"".concat(x.yx,"/api/v2/admin/tasks/").concat(m,"/")},teleconsultations:{upload:()=>"".concat(x.yx,"/api/v2/admin/insurance/teleconsultations/upload/")},users:{address:m=>"".concat(x.yx,"/api/v2/users/").concat(m,"/address/"),all:()=>"".concat(x.yx,"/api/v2/admin/users/management/all/"),byEmail:m=>"".concat(x.yx,"/api/admin/users/by-email/").concat(encodeURIComponent(m),"/"),byPhone:m=>"".concat(x.yx,"/api/admin/users/by-phone/").concat(m,"/"),customerInfo:m=>"".concat(x.yx,"/api/v2/admin/users/customers/").concat(encodeURIComponent(m),"/"),customers:()=>"".concat(x.yx,"/api/admin/customers/"),customersList:()=>"".concat(x.yx,"/api/v2/admin/users/customers/"),deleteCard:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/delete-card/"),deleteMercadoPagoCard:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/delete-mercadopago-card/"),groups:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/groups/"),index:()=>"".concat(x.yx,"/api/v2/admin/users/management/"),sendQuoteEmail:()=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/send-email/"),show:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/"),staffUsers:()=>"".concat(x.yx,"/api/v2/admin/users/management/staff-users/"),toggleStaff:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/toggle-staff/"),toggleStatus:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/toggle-status/"),toggleSuperuser:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/toggle-superuser/"),update:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/"),updateBankAccount:m=>"".concat(x.yx,"/api/v2/admin/users/").concat(m,"/bankaccounts/"),updateFields:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/update-fields/")},validationPayments:{createRefunds:()=>"".concat(x.yx,"/api/v2/admin/validation-payments/create-refunds/"),pendingRefunds:()=>"".concat(x.yx,"/api/v2/admin/validation-payments/pending-refunds/"),retryRefund:m=>"".concat(x.yx,"/api/v2/admin/validation-payments/retry-refund/").concat(m,"/")},veterinaries:{archive:m=>"".concat(x.yx,"/api/v2/admin/content/veterinaries/").concat(m,"/archive/"),create:()=>"".concat(x.yx,"/api/v2/admin/content/veterinaries/"),delete:m=>"".concat(x.yx,"/api/v2/admin/content/veterinaries/").concat(m,"/"),detail:m=>"".concat(x.yx,"/api/v2/admin/content/veterinaries/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/admin/content/veterinaries/"),unarchive:m=>"".concat(x.yx,"/api/v2/admin/content/veterinaries/").concat(m,"/unarchive/"),update:m=>"".concat(x.yx,"/api/v2/admin/content/veterinaries/").concat(m,"/")},whatsapp:{history:()=>"".concat(x.yx,"/api/v2/admin/whatsapp/messages/"),listTemplates:()=>"".concat(x.yx,"/api/v2/admin/whatsapp/templates/"),send:()=>"".concat(x.yx,"/api/v2/admin/whatsapp/messages/")}},auth:{adminChangePassword:()=>"".concat(x.yx,"/api/v2/admin/auth/change-password/"),adminResetPassword:()=>"".concat(x.yx,"/api/v2/admin/auth/reset-password/"),changeEmail:()=>"".concat(x.yx,"/api/v2/auth/change-email/"),changeEmailVerify:()=>"".concat(x.yx,"/api/v2/auth/change-email/verify/"),changePhone:()=>"".concat(x.yx,"/api/v2/auth/change-phone/"),changePhoneVerify:()=>"".concat(x.yx,"/api/v2/auth/change-phone/verify/"),checkPasswordChange:()=>"".concat(x.yx,"/api/v2/admin/auth/check-password-change/"),magicTokenVerify:()=>"".concat(x.yx,"/api/v2/auth/magic-token/verify/"),markPasswordChanged:()=>"".concat(x.yx,"/api/v2/admin/auth/mark-password-changed/"),passwordLogin:()=>"".concat(x.yx,"/api/v2/auth/password-login/"),requestNewCode:()=>"".concat(x.yx,"/api/v2/auth/new-code")},bankChoices:{list:()=>"".concat(x.yx,"/api/v2/bank-choices/")},bankReconciliation:{bankBalances:{index:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/bank-balances/"),sync:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/bank-balances/sync/")},bankMovements:{bankAccounts:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/bank-movements/bank-accounts/"),export:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/bank-movements/export/"),index:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/bank-movements/"),summary:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/bank-movements/summary/"),sync:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/bank-movements/sync/")},obligationTypes:{create:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligation-types/"),index:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligation-types/"),show:m=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligation-types/").concat(m,"/")},obligations:{addBankMovementsToReconciliationGroup:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/add-bank-movements-to-reconciliation-group/"),bankMovements:{detectChargeReturnPairs:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/detect-charge-return-pairs/"),detectDuplicates:"".concat(x.yx,"/api/v2/bank-movements/detect-duplicates/"),mergeDuplicates:"".concat(x.yx,"/api/v2/bank-movements/merge-duplicates/"),verifyInClay:m=>"".concat(x.yx,"/api/v2/bank-movements/").concat(m,"/verify-in-clay/")},create:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/"),export:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/export/"),index:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/"),reconcileAccountTransfer:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/reconcile-account-transfer/"),reconcileClaimPayments:()=>"".concat(x.yx,"/api/v2/admin/obligations/reconcile-claim-payments"),reconcileClaimPaymentsStatus:m=>"".concat(x.yx,"/api/v2/admin/obligations/reconcile-claim-payments/").concat(m),reconcileIncomingClaimSettlement:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/reconcile-incoming-claim-settlement/"),reconcileIncomingEndorsementSettlement:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/reconcile-incoming-endorsement-settlement/"),reconcileIncomingPaymentSettlements:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/reconcile-incoming-payment-settlements/"),reconcileObligations:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/reconcile-obligations/"),reconcileOutgoingEndorsementSettlement:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/reconcile-outgoing-endorsement-settlement/"),reconcileOutgoingPaymentSettlement:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/reconcile-outgoing-payment-settlement/"),removeBankMovementsFromReconciliationGroup:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/remove-bank-movements-from-reconciliation-group/"),show:m=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/").concat(m,"/"),summary:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/summary/"),unreconcileObligations:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/obligations/unreconcile-obligations/")},reconciliationGroups:{show:m=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/reconciliation-groups/").concat(m,"/")}
6,reconciliationLines:{export:()=>"".concat(x.yx,"/api/v2/admin/bank-reconciliation/reconciliation-lines/export/")}},benefits:{authIndex:()=>"".concat(x.yx,"/api/v2/partnership/benefits/"),categories:()=>"".concat(x.yx,"/api/benefits/categories/"),company:m=>"".concat(x.yx,"/api/v2/partnership/benefits/companies/").concat(m,"/"),generateCode:m=>"".concat(x.yx,"/api/v2/partnership/benefits/").concat(m,"/generate-code/"),index:()=>"".concat(x.yx,"/api/benefits/"),show:m=>"".concat(x.yx,"/api/benefits/").concat(m,"/"),verify:()=>"".concat(x.yx,"/api/v2/benefits/verify/")},blog:{categories:()=>"".concat(x.yx,"/api/categories/"),categoryPosts:m=>"".concat(x.yx,"/api/categories/").concat(m,"/posts/"),index:()=>"".concat(x._O,"/blog"),postDetail:function(m){let g=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!0===g?"".concat(x.yx,"/api/posts/").concat(m,"/?preview=true"):"".concat(x.yx,"/api/posts/").concat(m,"/")},v2:{categories:()=>"".concat(x.yx,"/api/v2/blog/categories/"),categoryDetail:m=>"".concat(x.yx,"/api/v2/blog/categories/").concat(m,"/"),faqs:()=>"".concat(x.yx,"/api/v2/blog/faqs/"),postDetail:m=>"".concat(x.yx,"/api/v2/blog/posts/").concat(m,"/"),posts:m=>{let g="".concat(x.yx,"/api/v2/blog/posts/");if(!m)return g;let v=new URLSearchParams;return m.page&&v.append("page",m.page.toString()),m.page_size&&v.append("page_size",m.page_size.toString()),m.category&&v.append("category",m.category),v.toString()?"".concat(g,"?").concat(v.toString()):g},postsFeatured:()=>"".concat(x.yx,"/api/v2/blog/posts/featured/"),postsRelated:m=>"".concat(x.yx,"/api/v2/blog/posts/").concat(m,"/related/"),testimonials:()=>"".concat(x.yx,"/api/v2/blog/testimonials/"),testimonialsFeatured:()=>"".concat(x.yx,"/api/v2/blog/testimonials/featured/")}},cancellationReasons:{index:()=>"".concat(x.yx,"/api/v2/insurance/cancellation-reasons/")},checkout:{last:()=>"".concat(x.yx,"/api/v2/oneclick/checkouts/last/"),show:m=>"".concat(x.yx,"/api/v2/oneclick/checkouts/").concat(m,"/")},claimDocumentItems:{create:m=>"".concat(x.yx,"/api/insurance/claim_documents/").concat(m,"/claim_document_items/"),delete:m=>"".concat(x.yx,"/api/insurance/claim_document_items/").concat(m,"/"),update:m=>"".concat(x.yx,"/api/insurance/claim_document_items/").concat(m,"/")},claims:{v2:{addHistory:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/history/"),create:()=>"".concat(x.yx,"/api/v2/insurance/claims/"),delete:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/"),documents:{analysisStatus:(m,g)=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/analysis/").concat(g,"/"),analyze:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/analyze/"),create:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/"),delete:(m,g)=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/").concat(g,"/"),linkBudget:(m,g)=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/").concat(g,"/link-budget/"),show:(m,g)=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/").concat(g,"/"),update:(m,g)=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/").concat(g,"/"),uploadUrl:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/documents/upload-url/")},list:()=>"".concat(x.yx,"/api/v2/insurance/claims/"),show:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/"),submit:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/submit/"),update:m=>"".concat(x.yx,"/api/v2/insurance/claims/").concat(m,"/")}},coverageBundles:{create:()=>"".concat(x.yx,"/api/v2/insurance/coverage-bundles/"),getPremiumFromPackageName:()=>"".concat(x.yx,"/api/v2/insurance/coverage-bundles/premium-from-package-name/"),show:m=>"".concat(x.yx,"/api/v2/insurance/coverage-bundles/").concat(m,"/"),updatePackage:m=>"".concat(x.yx,"/api/v2/insurance/coverage-bundles/").concat(m,"/update-package/")},frontend:{accidentCoverage:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/accidentCoverage",query:{coverageBundleId:m}}),admin:{benefits:()=>"/admin/partner/benefits/",claimReview:m=>({pathname:"/admin/claims/review/[slug]",query:{slug:m}})},checkout:{index:()=>"/checkout"},liabilityCoverage:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/liabilityCoverage",query:{coverageBundleId:m}}),nonCoverables:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/nonCoverables",query:{coverageBundleId:m}}),onboarding:{userAddress:()=>"/pet/onboarding/userAddress",userInfo:()=>"/pet/onboarding/userInfo"},partner:{index:()=>"/partner"},petHealth:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/petHealth",query:{coverageBundleId:m}}),policies:{show:m=>({pathname:"/policies/[id]",query:{id:m}})},preventiveCoverage:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/preventiveCoverage",query:{coverageBundleId:m}}),productObsolete:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/product-obsolete",query:{coverageBundleId:m}}),quoteExpired:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/quote-expired",query:{coverageBundleId:m}}),quoteSummary:m=>({pathname:"/pet/onboarding/v2/[coverageBundleId]/quoteSummary",query:{coverageBundleId:m}})},hiring:{startPayment:()=>"".concat(x.yx,"/api/v2/insurance/hiring/start-payment/"),status:m=>"".concat(x.yx,"/api/v2/insurance/hiring/status/").concat(m,"/")},index:()=>"/",insurance:{claimSettlements:{index:()=>"".concat(x.yx,"/api/insurance/admin/claim_settlements/")},endorsementSettlements:{bankMovements:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/bank-movements/"),createOutgoingFromFilters:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/create-outgoing/"),deleteIncoming:m=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/").concat(m,"/"),detail:m=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/").concat(m,"/detail/"),incoming:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/incoming/"),index:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/incoming/"),markAsPaidFromFilters:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/mark-as-paid/"),markAsPaidManually:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/mark-as-paid-manually/"),outgoing:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/outgoing/"),pendingOutgoing:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/pending-outgoing/"),pendingPayout:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/pending-payout/"),summary:()=>"".concat(x.yx,"/api/v2/admin/insurance/endorsement-settlements/summary/")},llamadapro:{petHealthCompleted:()=>"".concat(x.yx,"/api/insurance/llamadapro/pet-health-completed/"),planSelected:()=>"".concat(x.yx,"/api/insurance/llamadapro/plan-selected/")},policyEmissions:{bciCancellationsExport:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/bci-cancellations-export/"),bciExport:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/bci-export/"),pending:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/pending/"),pendingCancellations:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/pending-cancellations/"),updateCancellationStatus:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/update-cancellation-status/"),updateStatus:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/update-status/"),withoutDocuments:()=>"".concat(x.yx,"/api/v2/admin/insurance/emissions/without-documents/")}},landing:{stats:()=>"".concat(x.yx,"/api/v2/landing/stats/")},mercadopago:{customerInfo:()=>"".concat(x.yx,"/api/v2/oneclick/payment-method/"),paymentStatus:m=>"".concat(x.yx,"/api/v2/oneclick/invoices/").concat(m,"/payment-status/"),saveC
6ard:()=>"".concat(x.yx,"/api/v2/oneclick/payment-method/"),webhooks:()=>"".concat(x.yx,"/api/mercadopago/webhooks/")},oneclick:{admin:{dailyCharges:{list:m=>{let g="".concat(x.yx,"/api/v2/admin/oneclick/daily-charges/");if(!m)return g;let v=new URLSearchParams;Object.entries(m).forEach(m=>{let[g,x]=m;null!=x&&""!==x&&v.append(g,String(x))});let k=v.toString();return k?"".concat(g,"?").concat(k):g}},invoice:{changeDueDate:()=>"".concat(x.yx,"/api/v2/admin/invoices/change-due-date/"),previewPolicyDueDates:()=>"".concat(x.yx,"/api/v2/admin/invoices/preview-policy-due-dates/"),updatePolicyDueDates:()=>"".concat(x.yx,"/api/v2/admin/invoices/update-policy-due-dates/")}},paymentSettlements:{agedPayments:()=>"".concat(x.yx,"/api/payment_settlements/aged_payments/"),bankMovements:()=>"".concat(x.yx,"/api/payment_settlements/bank_movements/"),cacttusSubsidies:()=>"".concat(x.yx,"/api/payment_settlements/cacttus_subsidies/"),cacttusSubsidySettlements:()=>"".concat(x.yx,"/api/payment_settlements/cacttus_subsidy_settlements/"),company:()=>"".concat(x.yx,"/api/payment_settlements/company/"),createFromCacttus:()=>"".concat(x.yx,"/api/payment_settlements/create_from_cacttus/"),incoming:()=>"".concat(x.yx,"/api/payment_settlements/incoming/"),incomingPayments:()=>"".concat(x.yx,"/api/payment_settlements/incoming_payments/"),incomingPaymentsNoInvoice:()=>"".concat(x.yx,"/api/payment_settlements/incoming_payments_without_invoice/"),incomingRefunds:()=>"".concat(x.yx,"/api/payment_settlements/incoming_refunds/"),index:()=>"".concat(x.yx,"/api/payment_settlements/"),invoices:()=>"".concat(x.yx,"/api/payment_settlements/invoices/"),settleInvoices:()=>"".concat(x.yx,"/api/payment_settlements/settle_invoices/"),unsettledCacttusPayments:()=>"".concat(x.yx,"/api/payment_settlements/unsettled_cacttus_payments/")},paymentSettlementsV2:{byCompany:()=>"".concat(x.yx,"/api/v2/admin/settlements/summary/by-company/"),byProcessor:()=>"".concat(x.yx,"/api/v2/admin/settlements/summary/by-processor/"),collectionsBalance:()=>"".concat(x.yx,"/api/v2/admin/settlements/collections-balance/"),dashboardBankMonthly:()=>"".concat(x.yx,"/api/v2/admin/settlements/dashboard/bank-monthly-series/"),dashboardMonthly:()=>"".concat(x.yx,"/api/v2/admin/settlements/dashboard/monthly-series/"),dashboardOverview:()=>"".concat(x.yx,"/api/v2/admin/settlements/dashboard/overview/"),dashboardRecentActivity:()=>"".concat(x.yx,"/api/v2/admin/settlements/dashboard/recent-activity/"),detail:m=>"".concat(x.yx,"/api/v2/admin/settlements/").concat(m,"/"),export:m=>"".concat(x.yx,"/api/v2/admin/settlements/").concat(m,"/export/"),exportAll:()=>"".concat(x.yx,"/api/v2/admin/settlements/export/"),invoices:m=>"".concat(x.yx,"/api/v2/admin/settlements/").concat(m,"/invoices/"),kpis:()=>"".concat(x.yx,"/api/v2/admin/settlements/kpis/"),list:()=>"".concat(x.yx,"/api/v2/admin/settlements/"),settleInvoices:()=>"".concat(x.yx,"/api/v2/admin/settlements/settle-invoices/"),settleInvoicesSync:()=>"".concat(x.yx,"/api/v2/admin/settlements/settle-invoices-sync/")},pendingInvoices:{exportCsv:()=>"".concat(x.yx,"/api/v2/admin/invoices/pending-settlement/export-csv/"),invalidInvoicesDetail:()=>"".concat(x.yx,"/api/v2/admin/settlements/invalid-invoices-detail/"),list:()=>"".concat(x.yx,"/api/v2/admin/invoices/pending-settlement/"),preview:()=>"".concat(x.yx,"/api/v2/admin/invoices/settlement-preview/"),selectAll:()=>"".concat(x.yx,"/api/v2/admin/invoices/pending-settlement/select-all/"),settleByFilters:()=>"".concat(x.yx,"/api/v2/admin/settlements/settle-invoices-by-filters/"),validateByFilters:()=>"".concat(x.yx,"/api/v2/admin/settlements/validate-invoices-by-filters/"),validateInvoices:()=>"".concat(x.yx,"/api/v2/admin/settlements/validate-invoices/")}},partnership:{commissions:{list:()=>"".concat(x.yx,"/api/v2/partnership/commissions/")},partner:{report:()=>"".concat(x.yx,"/api/v2/partnership/partner/report/")},signUp:()=>"".concat(x.yx,"/api/v2/partnership/sign-up/"),supervisor:{report:()=>"".concat(x.yx,"/api/v2/partnership/supervisor/report/")}},pet:{new:{index:()=>"/pet/new",petAgeAndGender:()=>"/pet/new/petAgeAndGender",petBreed:()=>"/pet/new/petBreed",petKind2:()=>"/pet/new/petKind2",petName:()=>"/pet/new/petName",userInfo:()=>"/pet/new/userInfo"}}
6,petPlanV2:{getPrice:()=>"".concat(x.yx,"/api/v2/pet/plans/get-price/")},pets:{admin:{update:m=>"".concat(x.yx,"/api/v2/admin/pet/customer-pets/").concat(m,"/update/")},breedOptions:m=>"".concat(x.yx,"/api/v2/insurance/breed-options/?species=").concat(m),breedsV2:{detail:m=>"".concat(x.yx,"/api/v2/breeds/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/breeds/")},communesV2:{detail:m=>"".concat(x.yx,"/api/v2/communes/").concat(m,"/"),list:()=>"".concat(x.yx,"/api/v2/communes/")},delete:m=>"".concat(x.yx,"/api/admin/pets/").concat(m,"/"),listByUserId:m=>"".concat(x.yx,"/api/admin/pets/by-user/").concat(m,"/"),showByCoverageBundleId:m=>"".concat(x.yx,"/api/v2/insurance/coverage-bundles/").concat(m,"/pet/"),veterinariesV2:{list:()=>"".concat(x.yx,"/api/v2/veterinaries/")}},planChanges:{cancelTask:m=>"".concat(x.yx,"/api/v2/admin/insurance/policy-tasks/").concat(m,"/cancel/"),checkEligibility:m=>"".concat(x.yx,"/api/v2/admin/insurance/policies/").concat(m,"/change-plan-eligibility/"),coverageOptions:m=>"".concat(x.yx,"/api/v2/admin/insurance/renewals/").concat(m,"/coverage-options/"),createTask:()=>"".concat(x.yx,"/api/v2/admin/insurance/policy-tasks/create-plan-change/"),listTasks:()=>"".concat(x.yx,"/api/v2/admin/insurance/policy-tasks/"),retryTask:m=>"".concat(x.yx,"/api/v2/admin/insurance/policy-tasks/").concat(m,"/retry/"),taskDetail:m=>"".concat(x.yx,"/api/v2/admin/insurance/policy-tasks/").concat(m,"/")},planConfigurations:{active:m=>"".concat(x.yx,"/api/v2/insurance/plan-configurations/active/?product_id=").concat(m),analytics:(m,g,v)=>{let k=new URLSearchParams({product_id:String(m)});return g&&k.append("date_from",g),v&&k.append("date_to",v),"".concat(x.yx,"/api/v2/insurance/plan-configurations/analytics/?").concat(k.toString())},create:()=>"".concat(x.yx,"/api/v2/insurance/plan-configurations/"),delete:m=>"".concat(x.yx,"/api/v2/insurance/plan-configurations/").concat(m,"/"),setActive:()=>"".concat(x.yx,"/api/v2/insurance/plan-configurations/set-active/"),toggle:m=>"".concat(x.yx,"/api/v2/insurance/plan-configurations/").concat(m,"/toggle/")},policies:{renewal:{approve:m=>"".concat(x.yx,"/api/v2/insurance/renewals/").concat(m,"/approve/"),reject:m=>"".concat(x.yx,"/api/v2/insurance/renewals/").concat(m,"/reject/"),show:m=>"".concat(x.yx,"/api/v2/insurance/renewals/").concat(m,"/")}},profile:{index:m=>({pathname:"/profile",query:{tab:null!=m?m:"policies"}})},publicBenefits:{categories:()=>"".concat(x.yx,"/api/v2/benefits/categories/"),company:m=>"".concat(x.yx,"/api/v2/benefits/companies/").concat(m,"/"),index:()=>"".concat(x.yx,"/api/v2/benefits/"),show:m=>"".concat(x.yx,"/api/v2/benefits/").concat(m,"/")},quoteFlow:{assignments:()=>"".concat(x.yx,"/api/v2/quote-flow/assignments/"),completeAssignment:m=>"".concat(x.yx,"/api/v2/quote-flow/assignments/").concat(m,"/complete/"),mergeAssignments:()=>"".concat(x.yx,"/api/v2/quote-flow/assignments/merge/")},quotes:{adminInvoice:m=>"".concat(x.yx,"/api/v2/admin/invoices/by-quote/").concat(m,"/"),applyDiscountCode:m=>"".concat(x.yx,"/api/v2/insurance/quotes/").concat(m,"/apply-discount-code/"),create:()=>"".concat(x.yx,"/api/v2/insurance/quotes/"),pdf:m=>"".concat(x.yx,"/api/v2/insurance/quotes/").concat(m,"/pdf/"),removeDiscountCode:m=>"".concat(x.yx,"/api/v2/insurance/quotes/").concat(m,"/remove-discount-code/"),updateV2:m=>"".concat(x.yx,"/api/v2/insurance/quotes/").concat(m,"/")},referral:{ambassador:()=>"".concat(x.yx,"/api/v2/referral/ambassador/"),rewards:()=>"".concat(x.yx,"/api/v2/referral/rewards/")},saludtech:{generateUrl:m=>"".concat(x.yx,"/api/insurance/policies/tele-health/url/").concat(m,"/")},signup:{index:()=>"/signup"},tracking:{metaAddToCart:()=>"".concat(x.yx,"/api/v2/tracking/meta-add-to-cart/"),metaCustom:()=>"".concat(x.yx,"/api/v2/tracking/meta-custom/"),metaInitiateCheckout:()=>"".concat(x.yx,"/api/v2/tracking/meta-initiate-checkout/"),metaLead:()=>"".concat(x.yx,"/api/v2/tracking/meta-lead/"),metaPageView:()=>"".concat(x.yx,"/api/v2/tracking/meta-page-view/"),metaPurchase:()=>"".concat(x.yx,"/api/v2/tracking/meta-purchase/"),metaViewContent:()=>"".concat(x.yx,"/api/v2/tracking/meta-view-content/")},uf:{index:()=>"".concat(x.yx,"/api/v2/uf/")},user:{address:{create:()=>"".concat(x.yx,"/api/v2/user/address/"),show:m=>"".concat(x.yx,"/api/v2/user/address/").concat(m,"/"),update:m=>"".concat(x.yx,"/api/v2/user/address/").concat(m,"/")},addresses:()=>"".concat(x.yx,"/api/v2/user/addresses/"),bankAccount:{get:()=>"".concat(x.yx,"/api/v2/user/bank-accounts/"),upsert:()=>"".concat(x.yx,"/api/v2/user/bank-accounts/")},card:()=>"".concat(x.yx,"/api/v2/user/card/"),financialSummary:()=>"".concat(x.yx,"/api/v2/user/financial-summary/"),googlePlaces:{autocomplete:()=>"".concat(x.yx,"/api/v2/google-places/autocomplete/"),details:()=>"".concat(x.yx,"/api/v2/google-places/details/")},invoices:{index:()=>"".concat(x.yx,"/api/v2/invoices/"),previewPolicyDueDates:()=>"".concat(x.yx,"/api/v2/invoices/preview_policy_due_dates/"),updatePolicyDueDates:()=>"".concat(x.yx,"/api/v2/invoices/update_policy_due_dates/")},pets:{create:()=>"".concat(x.yx,"/api/v2/user/pets/"),update:m=>"".concat(x.yx,"/api/v2/user/pets/").concat(m,"/")},policies:{completeOnboarding:m=>"".concat(x.yx,"/api/insurance/users/me/policies/").concat(m,"/complete_onboarding/"),index:()=>"".concat(x.yx,"/api/insurance/users/me/policies/"),show:m=>"".concat(x.yx,"/api/insurance/users/me/policies/").concat(m),v2:{cancel:m=>"".concat(x.yx,"/api/v2/insurance/policies/").concat(m,"/cancel/"),index:()=>"".concat(x.yx,"/api/v2/insurance/policies/"),show:m=>"".concat(x.yx,"/api/v2/insurance/policies/").concat(m,"/"),voidCancellation:m=>"".concat(x.yx,"/api/v2/insurance/policies/").concat(m,"/void-cancellation/")},voidCancellation:m=>"".concat(x.yx,"/api/insurance/users/me/policies/").concat(m,"/void_cancellation/")},saveRequestMetadata:()=>"".concat(x.yx,"/api/v2/user/save-request-metadata/"),show:()=>"".concat(x.yx,"/api/v2/user/"),update:()=>"".concat(x.yx,"/api/v2/user/")},users:{admin:{all:()=>"".concat(x.yx,"/api/v2/admin/users/management/all/"),byEmail:m=>"".concat(x.yx,"/api/admin/users/by-email/").concat(encodeURIComponent(m),"/"),byPhone:m=>"".concat(x.yx,"/api/admin/users/by-phone/").concat(m,"/"),customerInfo:m=>"".concat(x.yx,"/api/v2/admin/users/customers/").concat(encodeURIComponent(m),"/"),customers:()=>"".concat(x.yx,"/api/admin/customers/"),customersList:()=>
6"".concat(x.yx,"/api/v2/admin/users/customers/"),deleteCard:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/delete-card/"),deleteMercadoPagoCard:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/delete-mercadopago-card/"),index:()=>"".concat(x.yx,"/api/v2/admin/users/management/"),sendQuoteEmail:()=>"".concat(x.yx,"/api/v2/admin/insurance/quotes/send-email/"),show:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/"),staffUsers:()=>"".concat(x.yx,"/api/v2/admin/users/management/staff-users/"),update:m=>"".concat(x.yx,"/api/v2/admin/users/management/").concat(m,"/"),updateBankAccount:m=>"".concat(x.yx,"/api/v2/admin/users/").concat(m,"/bankaccounts/")},getByReferralCode:m=>"".concat(x.yx,"/api/v2/referral/referrers/").concat(m,"/"),index:()=>"".concat(x.yx,"/api/v2/users/")}};g.Z=E},32765:function(m,g,v){"use strict";let x,k,E,T,K;v.d(g,{um:function(){return identifyPostHogUser},IR:function(){return initPostHog},Qo:function(){return posthogAnonymousDistinctId},Ec:function(){return registerQuoteFlowExperiment},mo:function(){return resetPostHogUser},Jj:function(){return syncSessionRecording}});let et="u">typeof window?window:void 0,en="u">typeof globalThis?globalThis:et,er=null==en?void 0:en.navigator,ei=null==en?void 0:en.document,es=null==en?void 0:en.location,el=null==en?void 0:en.fetch,ec=(null==en?void 0:en.XMLHttpRequest)&&"withCredentials"in new en.XMLHttpRequest?en.XMLHttpRequest:void 0,eu=null==en?void 0:en.AbortController,ed=null==en?void 0:en.CompressionStream,ep=null==er?void 0:er.userAgent;function h(){return!(!et||!1===et.navigator.onLine)}let em="undefined"!=typeof globalThis?globalThis:et;em&&"undefined"==typeof self&&(em.self=em),em&&"undefined"==typeof File&&(em.File=function(){});let ef=null!=et?et:{},eh={DEBUG:!1,LIB_VERSION:"0.8.2",LIB_NAME:"browser-common"};var eg,ev,ey,eb,ex=((ev={}).AnonymousId="anonymous_id",ev.DistinctId="distinct_id",ev.Props="props",ev.EnablePersonProcessing="enable_person_processing",ev.PersonMode="person_mode",ev.FeatureFlagDetails="feature_flag_details",ev.FeatureFlags="feature_flags",ev.FeatureFlagPayloads="feature_flag_payloads",ev.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",ev.BootstrapFeatureFlags="bootstrap_feature_flags",ev.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",ev.OverrideFeatureFlags="override_feature_flags",ev.Queue="queue",ev.AiQueue="ai_queue",ev.AiCaptureQueue="ai_capture_queue",ev.LogsQueue="logs_queue",ev.OptedOut="opted_out",ev.SessionId="session_id",ev.SessionStartTimestamp="session_start_timestamp",ev.SessionLastTimestamp="session_timestamp",ev.PersonProperties="person_properties",ev.GroupProperties="group_properties",ev.InstalledAppBuild="installed_app_build",ev.InstalledAppVersion="installed_app_version",ev.SessionReplay="session_replay",ev.PushRegistered="push_registered",ev.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",ev.SurveyLastSeenDate="survey_last_seen_date",ev.SurveysSeen="surveys_seen",ev.Surveys="surveys",ev.RemoteConfig="remote_config",ev.FlagsEndpointWasHit="flags_endpoint_was_hit",ev.DeviceId="device_id",ev),e_=((ey={}).GZipJS="gzip-js",ey.Base64="base64",ey);let ew=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],eS=["token"];function b(m,g){return -1!==m.indexOf(g)}let y=function(m){return m.trim()},w=function(m){return m.replace(/^\$/,"")};function S(m){var g;let v=[];return null!==(g=JSON.stringify(m,function(m,g){if("bigint"==typeof g)return g.toString();if("function"!=typeof g&&"symbol"!=typeof g){if(g instanceof Error)return{name:g.name,message:g.message,stack:g.stack};if(g&&"object"==typeof g){for(;v.length>0&&v[v.length-1]!==this;)v.pop();if(v.includes(g))return"[Circular]";v.push(g)}return g}}))&&void 0!==g?g:"null"}let eC=Object.prototype,ek=eC.hasOwnProperty,eE=eC.toString,ej=Array.isArray||function(m){return"[object Array]"===eE.call(m)},P=m=>"function"==typeof m,C=m=>m===Object(m)&&!ej(m),R=m=>{if(C(m)){for(let g in m)if(ek.call(m,g))return!1;return!0}return!1},O=m=>void 0===m,I=m=>"[object String]"==eE.call(m),F=m=>I(m)&&0===m.trim().length,A=m=>null===m,M=m=>O(m)||A(m),D=m=>"[object Number]"==eE.call(m)&&m==m,N=m=>D(m)&&m>0,j=m=>"[object Boolean]"===eE.call(m),L=m=>b(ew,m),B=m=>b(eS,m);function U(m){return null===m||"object"!=typeof m}function z(m,g){return({}).toString.call(m)===`[object ${g}]`}function H(m){switch(({}
6).toString.call(m)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return V(m,Error)}}function q(m){return"u">typeof Event&&V(m,Event)}function V(m,g){try{return m instanceof g}catch(m){return!1}}let eN=[!0,"true",1,"1","yes"],G=m=>b(eN,m),eR=[!1,"false",0,"0","no"];function J(m,g,v,x,k,E,T){try{var K=m[E](T),et=K.value}catch(m){return void v(m)}K.done?g(et):Promise.resolve(et).then(x,k)}function Y(m){return function(){var g=this,v=arguments;return new Promise(function(x,k){var E=m.apply(g,v);function o(m){J(E,x,k,o,l,"next",m)}function l(m){J(E,x,k,o,l,"throw",m)}o(void 0)})}}let eI=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Q=function(m,g=[]){if(!m)return!1;let v=m.toLowerCase();return eI.concat(g).some(m=>{let g=m.toLowerCase();return -1!==v.indexOf(g)})};function Z(m,g,v,x,k){return g>v&&(x.warn("min cannot be greater than max."),g=v),D(m)?m>v?(x.warn(" cannot be  greater than max: "+v+". Using max value instead."),v):g>m?(x.warn(" cannot be less than min: "+g+". Using min value instead."),g):m:(x.warn(" must be a number. using max or fallback. max: "+v+", fallback: "+k),Z(null!=k?k:v,g,v,x))}var eP=class{constructor(m){this.C={},this.I=m.I,this.R=Z(m.bucketSize,0,100,m.$),this.A=Z(m.refillRate,0,this.R,m.$),this.O=Z(m.refillInterval,0,864e5,m.$)}F(m,g){let v=Math.floor((g-m.lastAccess)/this.O);v>0&&(m.tokens=Math.min(m.tokens+v*this.A,this.R),m.lastAccess=m.lastAccess+v*this.O)}consumeRateLimit(m){var g;let v=Date.now(),x=String(m),k=this.C[x];return k?this.F(k,v):(k={tokens:this.R,lastAccess:v},this.C[x]=k),0===k.tokens||(k.tokens--,0===k.tokens&&(null===(g=this.I)||void 0===g||g.call(this,m)),0===k.tokens)}stop(){this.C={}}};let eT="Mobile",eO="Android",eA="Tablet",eM="Android Tablet",eD="iPad",eL="Apple Watch",eF="Safari",eZ="BlackBerry",eB="Samsung Internet",e$="Chrome",eU="Chrome iOS",ez="Internet Explorer",eV="Internet Explorer Mobile",eq="Opera",eH="Microsoft Edge",eW="Firefox",eK="Firefox iOS",eG="Nintendo",eQ="PlayStation",eY="Xbox",eX="Android Mobile",eJ="Mobile Safari",e0="Windows",e1="Windows Phone",e2="Nokia",e3="Ouya",e5="Generic "+eT.toLowerCase(),e4="Generic "+eA.toLowerCase(),e6="Konqueror",e7="Oculus Browser",e8="Vivaldi",e9="Yandex",tt="Whale",tn="DuckDuckGo",tr="Pale Moon",ts="Waterfox",to="Brave",tl="Claude",tc="Codex",tu="ChatGPT",td="Google Search App",tp=RegExp("Version/(\\d+(\\.\\d+)?)"),tm=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),tf=RegExp(eY,"i"),th=RegExp("PlayStation \\w+","i"),tg=RegExp("Nintendo \\w+","i"),tv=RegExp("BlackBerry|PlayBook|BB10","i"),ty={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Jt=function(m,g,v,x){var k;g=g||"";let E=(null==v?void 0:v.brave)?to:null;return E||((null==x?void 0:x.detectGoogleSearchApp)&&b(m,"GSA/")?td:b(m," OPR/")&&b(m,"Mini")?"Opera Mini":b(m," OPR/")?eq:tv.test(m)?eZ:b(m,"IEMobile")||b(m,"WPDesktop")?eV:b(m,"OculusBrowser")?e7:b(m,"SamsungBrowser")?eB:b(m,"Edge")||b(m,"Edg/")?eH:b(m,"Vivaldi/")?e8:b(m,"YaBrowser/")?e9:b(m,"Whale/")?tt:b(m,"DuckDuckGo/")||b(m,"Ddg/")?tn:b(m,"Claude/")?tl:b(m,"Codex/")?tc:b(m,"ChatGPT/")?tu:b(m,"FBIOS")?"Facebook Mobile":b(m,"UCWEB")||b(m,"UCBrowser")?"UC Browser":b(m,"CriOS")?eU:b(m,"CrMo")||b(m,e$)?e$:b(m,eO)&&b(m,eF)?eX:b(m,"FxiOS")?eK:b(m.toLowerCase(),e6.toLowerCase())?e6:b(m,"Brave/")?to:(k=g)&&b(k,"Apple")||b(m,eF)&&!b(m,e$)&&!b
6(m,eO)?b(m,eT)?eJ:eF:b(m,"PaleMoon/")?tr:b(m,"Waterfox/")?ts:b(m,eW)?eW:b(m,"MSIE")||b(m,"Trident/")?ez:b(m,"Gecko")?eW:"")},tb={[eV]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[eH]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[e$]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[eU]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[eF]:[tp],[eJ]:[tp],[eq]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[eW]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[eK]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[e6]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[eZ]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),tp],[eX]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[eB]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[e7]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[e8]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[e9]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[tt]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[to]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[tl]:[tm],[tc]:[tm],[tu]:[tm],[tn]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[tr]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[ts]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[td]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ez]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},Xt=function(m,g,v,x){let k=Jt(m,g,v,x),E=tb[k];if(O(E))return null;for(let g=0;E.length>g;g++){let v=m.match(E[g]);if(v)return parseFloat(v[v.length-2])}return null},tx=[[RegExp("Xbox; Xbox (.*?)[);]","i"),m=>[eY,m&&m[1]||""]],[RegExp(eG,"i"),[eG,""]],[RegExp(eQ,"i"),[eQ,""]],[tv,[eZ,""]],[RegExp(e0,"i"),(m,g)=>{if(/Phone/.test(g)||/WPDesktop/.test(g))return[e1,""];if(new RegExp(eT).test(g)&&!/IEMobile\b/.test(g))return["Windows Mobile",""];let v=/Windows NT ([0-9.]+)/i.exec(g);if(v&&v[1]){let m=ty[v[1]]||"";return/arm/i.test(g)&&(m="RT"),[e0,m]}return[e0,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,m=>m&&m[3]?["iOS",[m[3],m[4],m[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,m=>{let g="";return m&&m.length>=3&&(g=O(m[2])?m[3]:m[2]),["watchOS",g]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),m=>m&&m[2]?[eO,[m[2],m[3],m[4]||"0"].join(".")]:[eO,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,m=>{let g=["Mac OS X",""];return m&&m[1]&&(g[1]=[m[1],m[2],m[3]||"0"].join(".")),g}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Zt=function(m){for(let g=0;tx.length>g;g++){let[v,x]=tx[g],k=v.exec(m),E=k&&(P(x)?x(k,m):x);if(E)return E}return["",""]},ti=function(m){return tg.test(m)?eG:th.test(m)?eQ:tf.test(m)?eY:RegExp(e3,"i").test(m)?e3:RegExp("(Windows Phone|WPDesktop)","i").test(m)?e1:/iPad/.test(m)?eD:/iPod/.test(m)?"iPod Touch":/iPhone/.test(m)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(m)?eL:tv.test(m)?eZ:/(kobo)\s(ereader|touch)/i.test(m)?"Kobo":RegExp(e2,"i").test(m)?e2:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(m)||/(kf[a-z]+)( bui|\)).+silk\//i.test(m)?"Kindle Fire":/(Android|ZTE)/i.test(m)?new RegExp(eT).test(m)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(m)||/pixel[\daxl ]{1,6}/i.test(m)&&!/pixel c/i.test(m)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(m)||/lmy47v/i.test(m)&&!/QTAQZ3/i.test(m)?eO:eM:RegExp("(pda|Mobile)","i").test(m)?e5:RegExp(eA,"i").test(m)&&!RegExp("Tablet pc","i").test(m)?e4:""},ii=function(m,g){var v,x,k,E;let T=ti(m);return T===eD||T===eM||"Kobo"===T||"Kindle Fire"===T||T===e4?eA:T===eG||T===eY||T===eQ||T===e3?"Console":T===eL?"Wearable":T?eT:"Android"===(null==g?void 0:g.userAgentDataPlatform)&&(null!==(E=null==g?void 0:g.maxTouchPoints)&&void 0!==E?E:0)>0?600>Math.min(null!==(v=null==g?void 0:g.screenWidth)&&void 0!==v?v:0,null!==(x=null==g?void 0:g.screenHeight)&&void 0!==x?x:0)/(null!==(k=null==g?void 0:g.devicePixelRatio)&&void 0!==k?k:1)?eT:eA:"Desktop"},t_=/\bFBAV\/(\d+(?:\.\d+)*)/i,tw=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",t_],[/\bFBAN\/EMA\b/i,"Facebook Lite",t_],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",t_],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?
6:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],tS="[Truncated]",tC="[Unserializable]";function oi(m){let g="";for(let v=0;m.length>v;v++){let x=m.charCodeAt(v);if(55296>x||x>56319)g+=56320>x||x>57343?m[v]:"�";else{let x=m.charCodeAt(v+1);56320>x||x>57343?g+="�":(g+=m[v]+m[v+1],v++)}}return g}let tk=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ai(m,g){return"string"==typeof m&&tk.test(m)?m:g()}function ui(m,g){let v=Error(g);try{Object.defineProperty(v,"name",{value:m,writable:!0,enumerable:!0,configurable:!0})}catch(m){}return v}function hi(m){return m?m.split("#")[0]:m}function di(m,g){let v=setTimeout(m,g);return null!=v&&v.unref&&(null==v||v.unref()),v}function ci(m,g,v){return vi.apply(this,arguments)}function vi(){return(vi=Y(function*(m,g,v){let x;try{return yield Promise.race([m,new Promise((m,k)=>{x=di(()=>{try{null==v||v(),m()}catch(m){k(m)}},g)})])}finally{clearTimeout(x)}})).apply(this,arguments)}function mi(m){return(mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(m)}function yi(m,g){var v=Object.keys(m);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(m);g&&(x=x.filter(function(g){return Object.getOwnPropertyDescriptor(m,g).enumerable})),v.push.apply(v,x)}return v}function wi(m){for(var g=1;arguments.length>g;g++){var v=null!=arguments[g]?arguments[g]:{};g%2?yi(Object(v),!0).forEach(function(g){!function(m,g,v){var x;(x=function(m){if("object"!=mi(m)||!m)return m;var g=m[Symbol.toPrimitive];if(void 0!==g){var v=g.call(m,"string");if("object"!=mi(v))return v;throw TypeError("@@toPrimitive must return a primitive value.")}return String(m)}(g),(g="symbol"==mi(x)?x:x+"")in m)?Object.defineProperty(m,g,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[g]=v}(m,g,v[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(v)):yi(Object(v)).forEac
6h(function(g){Object.defineProperty(m,g,Object.getOwnPropertyDescriptor(v,g))})}return m}var tE=class{constructor(m,g,v=[]){this.coercers=m,this.stackParser=g,this.modifiers=v}buildFromUnknown(m,g={}){let v=g&&g.mechanism||{handled:!0,type:"generic"},x=this.buildCoercingContext(v,g,0).apply(m),k=this.buildParsingContext(g),E=this.parseStacktrace(x,k);return{$exception_list:this.convertToExceptionList(E,v),$exception_level:"error"}}modifyFrames(m){var g=this;return Y(function*(){for(let v of m)v.stacktrace&&v.stacktrace.frames&&ej(v.stacktrace.frames)&&(v.stacktrace.frames=yield g.applyModifiers(v.stacktrace.frames));return m})()}coerceFallback(m){var g;return{type:"Error",value:"Unknown error",stack:null===(g=m.syntheticException)||void 0===g?void 0:g.stack,synthetic:!0}}parseStacktrace(m,g){let v,x;return null!=m.cause&&(v=this.parseStacktrace(m.cause,g)),""!=m.stack&&null!=m.stack&&(x=this.applyChunkIds(this.stackParser(m.stack,m.synthetic?g.skipFirstLines:0),g.chunkIdMap)),wi(wi({},m),{},{cause:v,stack:x})}applyChunkIds(m,g){return m.map(m=>(m.filename&&g&&(m.chunk_id=g[m.filename]),m))}applyCoercers(m,g){for(let v of this.coercers)if(v.match(m))return v.coerce(m,g);return this.coerceFallback(g)}applyModifiers(m){var g=this;return Y(function*(){let v=m;for(let m of g.modifiers)v=yield m(v);return v})()}convertToExceptionList(m,g){var v,x,k;let E={type:m.type,value:m.value,mechanism:{type:null!==(v=g.type)&&void 0!==v?v:"generic",handled:null===(x=g.handled)||void 0===x||x,synthetic:null!==(k=m.synthetic)&&void 0!==k&&k}};m.stack&&(E.stacktrace={type:"raw",frames:m.stack});let T=[E];return null!=m.cause&&T.push(...this.convertToExceptionList(m.cause,wi(wi({},g),{},{handled:!0}))),T}buildParsingContext(m){var g;return{chunkIdMap:function(m){let g=globalThis._posthogChunkIds;if(!g)return;let v=Object.keys(g);return E&&v.length===k||(k=v.length,E=v.reduce((v,k)=>{x||(x={});let E=x[k];if(E)v[E[0]]=E[1];else{let E=m(k);for(let m=E.length-1;m>=0;m--){let T=E[m],K=null==T?void 0:T.filename,et=g[k];if(K&&et){v[K]=et,x[k]=[K,et];break}}}return v},{})),E}(this.stackParser),skipFirstLines:null!==(g=m.skipFirstLines)&&void 0!==g?g:1}}buildCoercingContext(m,g,v=0){let s=(v,x)=>{if(4>=x){let k=this.buildCoercingContext(m,g,x);return this.applyCoercers(v,k)}};return wi(wi({},g),{},{syntheticException:0==v?g.syntheticException:void 0,mechanism:m,apply:m=>s(m,v),next:m=>s(m,v+1)})}};function Si(m,g,v,x,k){let E={platform:m,filename:g,function:"<anonymous>"===v?"?":v,in_app:!!g&&!g.startsWith("webkit-masked-url://")&&"<anonymous>"!==g};return O(x)||(E.lineno=x),O(k)||(E.colno=k),E}let xi=(m,g)=>{let v=-1!==m.indexOf("safari-extension"),x=-1!==m.indexOf("safari-web-extension");return v||x?[-1!==m.indexOf("@")?m.split("@")[0]:"?",v?`safari-extension:${g}`:`safari-web-extension:${g}`]:[m,g]},tj=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tN=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tR=/\((\S*)(?::(\d+))(?::(\d+))\)/,Pi=(m,g)=>{let v=tj.exec(m);if(v){let[,m,x,k]=v;return Si(g,m,"?",+x,+k)}let x=tN.exec(m);if(x){if(x[2]&&0===x[2].indexOf("eval")){let m=tR.exec(x[2]);m&&(x[2]=m[1],x[3]=m[2],x[4]=m[3])}let[m,v]=xi(x[1]||"?",x[2]);return Si(g,v,m,x[3]?+x[3]:void 0,x[4]?+x[4]:void 0)}},tI=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tP=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Oi=(m,g)=>{let v=tI.exec(m);if(v){if(v[3]&&v[3].indexOf(" > eval")>-1){let m=tP.exec(v[3]);m&&(v[1]=v[1]||"eval",v[3]=m[1],v[4]=m[2],v[5]="")}let m=v[3],x=v[1]||"?";return[x,m]=xi(x,m),Si(g,m,x,v[4]?+v[4]:void 0,v[5]?+v[5]:void 0)}},tT=/\(error: (.*)\)/;function Fi(m,g){return m.filename===g.filename&&m.function===g.function&&m.module===g.module&&m.lineno===g.lineno&&m.colno===g.colno}function Di(m,g){let v=g.start;for(;v>0&&Fi(m[v-1],m[v-1+g.length]);)v--;return g.start-v}function Ni(m,g){let v=g.start+g.length,x=v;for(;m.length>x&&Fi(m[x],m[x-g.length]);)x++;return x-v}var tO=class{match(m){return this.isDOMException(m)||this.isDOMError(m)}coerce(m,g){let v=I(m.stack);return{type:this.getType(m),value:this.getValue(m),stack:v?m.stack:void 0,cause:m.cause?g.next(m.cause):void 0,synthetic:!1}}getType(m){return this.isDOMError(m)?"DOMError":"DOMException"}getValue(m){let g=m.name||(this.isDOMError(m)?"DOMError":"DOMException");return m.message?`${g}: ${m.message}`:g}isDOMException(m){return z(m,"DOMException")}isDOMError(m){return z(m,"DOMError")}},tA=class{match(m){return H(m)}coerce(m,g){var v;let x=this.getStack(m);return{type:this.getType(m),value:this.getMessage(m,g),stack:null!=x?x:null===(v=g.syntheticException)||void 0===v?void 0:v.stack,cause:m.cause?g.next(m.cause):void 0,synthetic:void 0===x}}getType(m){return m.name||m.constructor.name}getMessage(m,g){let v=m.message;return String(v.error&&"string"==typeof v.error.message?v.error.message:v)}getStack(m){return m.stacktrace||m.stack||void 0}},tM=class{match(m){return!!z(m,"ErrorEvent")&&(null!=m.error||this.sr(m))}coerce(m,g){var v;if(null!=m.error)return g.apply(m.error);let x=g.apply(m.message);return wi(wi({},x),{},{stack:null!==(v=this.ar(m))&&void 0!==v?v:x.stack,synthetic:!0})}sr(m){return I(m.message)&&m.message.length>0}ar(m){var g,v;let x=null!==(g=m.lineno)&&void 0!==g?g:0,k=null!==(v=m.colno)&&void 0!==v?v:0;if(I(m.filename)&&0!==m.filename.length&&0!==x)return`Error
7    at ${m.filename}:${x}:${k}`}};let tD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var tL=class{match(m){return"string"==typeof m}coerce(m,g){var v;let[x,k]=this.getInfos(m);return{type:null!=x?x:"Error",value:null!=k?k:m,stack:null===(v=g.syntheticException)||void 0===v?void 0:v.stack,synthetic:!0}}getInfos(m){let g="Error",v=m,x=m.match(tD);return x&&(g=x[1],v=x[2]),[g,v]}};let tF=["fatal","error","warning","log","info","debug"];
7function Wi(m,g=40){let v=Object.keys(m);if(v.sort(),!v.length)return"[object has no keys]";for(let m=v.length;m>0;m--){let x=v.slice(0,m).join(", ");if(g>=x.length)return m===v.length?x:x.length>g?`${x.slice(0,g)}...`:x}return""}var tZ=class{match(m){return"object"==typeof m&&null!==m}coerce(m,g){var v,x;let k=this.getErrorPropertyFromObject(m);return k?g.apply(k):{type:this.getType(m),value:this.getValue(m),stack:null!==(v=this.getStack(m))&&void 0!==v?v:null===(x=g.syntheticException)||void 0===x?void 0:x.stack,level:this.isSeverityLevel(m.level)?m.level:"error",synthetic:!0}}getType(m){if(q(m))return m.constructor.name;let g="name"in m?m.name:void 0;return I(g)&&!F(g)?g:"Error"}getValue(m){if("name"in m&&"string"==typeof m.name){let g=`'${m.name}' captured as exception`;return"message"in m&&"string"==typeof m.message&&(g+=` with message: '${m.message}'`),g}if("message"in m&&"string"==typeof m.message)return m.message;let g=this.getObjectClassName(m);return`${g&&"Object"!==g?`'${g}'`:"Object"} captured as exception with keys: ${Wi(m)}`}isSeverityLevel(m){return I(m)&&!F(m)&&tF.indexOf(m)>=0}getStack(m){try{return I(m.stacktrace)&&m.stacktrace.length>0?m.stacktrace:I(m.stack)&&m.stack.length>0?m.stack:void 0}catch(m){return}}getErrorPropertyFromObject(m){for(let g in m)if(({}).hasOwnProperty.call(m,g)){let v=m[g];if(H(v))return v}}getObjectClassName(m){try{let g=Object.getPrototypeOf(m);return g?g.constructor.name:void 0}catch(m){return}}},tB=class{match(m){return q(m)}coerce(m,g){var v;let x=m.constructor.name;return{type:x,value:`${x} captured as exception with keys: ${Wi(m)}`,stack:null===(v=g.syntheticException)||void 0===v?void 0:v.stack,synthetic:!0}}},t$=class{match(m){return U(m)}coerce(m,g){var v;return{type:"Error",value:`Primitive value captured as exception: ${String(m)}`,stack:null===(v=g.syntheticException)||void 0===v?void 0:v.stack,synthetic:!0}}},tU=class{match(m){return z(m,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(m)}isCustomEventWrappingRejection(m){if(!q(m))return!1;try{let g=m.detail;return null!=g&&"object"==typeof g&&"reason"in g}catch(m){return!1}}coerce(m,g){var v;let x=this.getUnhandledRejectionReason(m);return U(x)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(x)}`,stack:null===(v=g.syntheticException)||void 0===v?void 0:v.stack,synthetic:!0}:g.apply(x)}getUnhandledRejectionReason(m){try{if("reason"in m)return m.reason;if("detail"in m&&null!=m.detail&&"object"==typeof m.detail&&"reason"in m.detail)return m.detail.reason}catch(m){}return m}};let tz="$message",tV="$timestamp",tq=new Set([tz,tV]),tH={enabled:!0,max_bytes:32768};function ie(m){var g;return m?{enabled:null!==(g=m.enabled)&&void 0!==g?g:tH.enabled,max_bytes:function(m,g){if(!D(m)||1/0===m||-1/0===m)return g;let v=Math.floor(m);return 0>v?g:v}(m.max_bytes,tH.max_bytes)}:wi({},tH)}var tW=class{constructor(m){this.ts=[],this.es=0,this.Sr=ie(m)}setConfig(m){this.Sr=ie(m),this.ns()}add(m){let g=function(m){let g;try{g=S(m)}catch(m){return}try{let m=JSON.parse(g);if(!C(m))return;let v=m[tz],x=m[tV];if(!I(v)||0===v.trim().length||!I(x)&&!D(x))return;return{step:m,json:g}}catch(m){return}}(m);if(!g)return;let v=function(m){if("u">typeof TextEncoder)return(new TextEncoder).encode(m).length;let g=encodeURIComponent(m),v=0;for(let m=0;g.length>m;m++)"%"===g[m]?(v+=1,m+=2):v+=1;return v}(g.json);v>this.Sr.max_bytes||(this.ts.push({step:g.step,bytes:v}),this.es+=v,this.ns())}getAttachable(){return this.ts.map(m=>m.step)}clear(){this.ts=[],this.es=0}size(){return this.ts.length}ns(){for(;this.es>this.Sr.max_bytes&&this.ts.length>0;){let m=this.ts.shift();m&&(this.es-=m.bytes)}}};let ne=m=>{if("string"!=typeof m)return m;try{return JSON.parse(m)}catch(g){return m}};function re(m){return"string"==typeof m||m}function oe(m){return"string"==typeof m?m:void 0}let tK=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],tG
7="NativeGzipValidationError",ue=m=>m.length>=2&&31===m[0]&&139===m[1],he=(m,g)=>m===e_.GZipJS||g===e_.GZipJS||"gzip"===g,de=m=>!(!m||"object"!=typeof m)&&"NotReadableError"===("name"in m?String(m.name):""),ve=m=>{throw ui(tG,`Native gzip produced invalid output: ${m}`)},tQ=(eb=Y(function*(m,g){18>m.size&&ve("too-short");let v=new Uint8Array((yield m.slice(0,10).arrayBuffer()));ue(v)&&8===v[2]||ve("invalid-header");let x=new DataView((yield m.slice(m.size-8).arrayBuffer()));x.getUint32(0,!0)!==(m=>{let g=(()=>{if(T)return T;T=[];for(let m=0;256>m;m++){let g=m;for(let m=0;8>m;m++)g=1&g?3988292384^g>>>1:g>>>1;T[m]=g>>>0}return T})(),v=4294967295;for(let x=0;m.length>x;x++)v=g[255&(v^m[x])]^v>>>8;return(4294967295^v)>>>0})(g)&&ve("invalid-crc");let k=g.length>>>0;x.getUint32(4,!0)!==k&&ve("invalid-size")}),function(m,g){return eb.apply(this,arguments)});function _e(){return(_e=Y(function*(m,g=!0,v){var x;try{let g=(new TextEncoder).encode(m),v=new globalThis.CompressionStream("gzip"),k=v.writable.getWriter(),E=k.write(g).then(()=>k.close()).catch((x=Y(function*(m){try{yield k.abort(m)}catch(m){}throw m}),function(m){return x.apply(this,arguments)})),T=new Response(v.readable).blob(),[K]=yield Promise.all([T,E]);return yield tQ(K,g),K}catch(m){if(null==v?void 0:v.rethrow)throw m;return g&&console.error("Failed to gzip compress data",m),null}})).apply(this,arguments)}function ge(m,g){if(null==m)return{};var v,x,k=function(m,g){if(null==m)return{};var v={};for(var x in m)if(({}).hasOwnProperty.call(m,x)){if(g.includes(x))continue;v[x]=m[x]}return v}(m,g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);for(x=0;E.length>x;x++)g.includes(v=E[x])||({}).propertyIsEnumerable.call(m,v)&&(k[v]=m[v])}return k}let tY={}.propertyIsEnumerable;function be(m,g){try{return function $e(m,g,v,x){let k=[];for(let E in m)if(tY.call(m,E)){if(!E){null==g||g.debug("Dropping an attribute with an empty key");continue}if(k.length>=1e3||0>=v.remainingNodes){null==g||g.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let T=m[E];if(A(T)||O(T))continue;k.push({key:oi(E),value:function ye(m,g,v,x){if(0>=v.remainingNodes)return{stringValue:tS};if(v.remainingNodes--,j(m))return{boolValue:m};if("bigint"==typeof m)return function(m,g){let v=m.toString(),x=BigInt("9223372036854775808");return m>=x||-x>m?(null==g||g.debug(`Attribute ${v} is outside the int64 range; encoding it as a string`),{stringValue:v}):{intValue:v}}(m,g);if("number"==typeof m){if(!Number.isFinite(m))return{stringValue:String(m)};if(Number.isInteger(m)){if(Number.isSafeInteger(m))return{intValue:String(m)};if(typeof BigInt>"u")return{stringValue:String(m)};let v=BigInt(m).toString();return m>=0x7fffffffffffffff||-0x8000000000000000>m?(null==g||g.debug(`Attribute ${v} is outside the int64 range; encoding it as a string`),{stringValue:v}):{intValue:v}}return{doubleValue:m}}if("string"==typeof m)return{stringValue:oi(m)};if("function"==typeof m)return{stringValue:"[Function]"};if("symbol"==typeof m)return{stringValue:String(m)};if("object"==typeof m&&null!==m){if(v.ancestors.has(m))return{stringValue:"[Circular]"};if(x>=20)return{stringValue:tS};if(m instanceof Date){let g=m.getTime(),v=Number.isFinite(g)?m.toISOString():String(m);return{stringValue:"string"==typeof v?oi(v):String(v)}}v.ancestors.add(m);try{try{let k=m.toJSON;if("function"==typeof k)return ye(k.call(m),g,v,x+1)}catch(m){}return ej(m)?{arrayValue:{values:function(m,g,v,x){let k=[],E=Math.min(m.length,1e3),T=0;for(;E>T&&v.remainingNodes>0;T++)try{let E=T in m?m[T]:void 0;if(M(E))continue;k.push(ye(E,g,v,x))}catch(m){k.push({stringValue:tC})}return m.length>T&&k.push({stringValue:tS}),k}(m,g,v,x+1)}}:{kvlistValue:{values:$e(m,g,v,x+1)}}}finally{v.ancestors.delete(m)}}return{stringValue:oi(String(m))}}(T,g,v,x)})}catch(m){k.push({key:oi(E),value:{stringValue:tC}})}}return k}(m,g,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(m){return[]}}function Se(m,g,v){return wi(wi(wi(wi({},m.resourceAttributes),{},{"service.name":m.serviceName||"unknown_service"},m.environment&&{"deployment.environment":m.environment}),m.serviceVersion&&{"service.version":m.serviceVersion}),{},{"telemetry.sdk.name":g,"telemetry.sdk.version":v})}let tX={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"},tJ={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},t0=tJ.info;function Re(m,g,v,x){return{resourceLogs:[{resource:{attributes:be(g)},scopeLogs:[{scope:{name:v,version:x},logRecords:m}]}]}}var t1=class{constructor(m,g,v,x,k,E=()=>Promise.resolve(),T){var K;this._instance=m,this.Sr=g,this.$=v,this.ss=x,this.rs=k,this.ls=E,this.us=T,this.hs=null,this.cs=0,this.ds=0,this.vs=0,this.fs=0,this.ps=0,this.gs=!1,this.ys=g.maxBufferSize,this.bs=Math.max(null!==(K=g.maxQueueSize)&&void 0!==K?K:g.maxBufferSize,g.maxBufferSize),this._s=g.flushIntervalMs,this.ws=g.maxBatchRecordsPerPost,this.ks=g.rateCapWindowMs,this.Ss=g.maxLogsPerInterval}clearQueue(){this.ds++,this._instance.setPersistedProperty(ex.LogsQueue,[])}reset(){this.xs(),this.fs=0,this.ps=0,this.gs=!1,this.vs=0,this.ws=this.Sr.maxBatchRecordsPerPost}onReconnect(){this.vs=0,this.Cs()}captureLog(m,g){var v;if(this._instance.isDisabled||this._instance.optedOut||!(null==m?void 0:m.body))return;let x=this.$s(m);if(null===x)return;if(!x.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ts())return;let k={record:function(m,g,v,x){let k=m.level||"info",{text:E,number:T}=tJ[k]||t0,K=function(m=Date.now()){return String(m)+"000000"}(D(x)?x:void 0),et={};g.distinctId&&(et.posthogDistinctId=g.distinctId),g.sessionId&&(et.sessionId=g.sessionId),g.windowId&&(et["window.id"]=g.windowId),M(g.sessionStartTimestamp)||(et.sessionStartTimestamp=String(g.sessionStartTimestamp)),M(g.lastActivityTimestamp)||(et.lastActivityTimestamp=String(g.lastActivityTimestamp)),g.currentUrl&&(et["url.full"]=g.currentUrl),g.screenName&&(et["screen.name"]=g.screenName),g.appState&&(et["app.state"]=g.appState),g.activeFeatureFlags&&g.activeFeatureFlags.length>0&&(et.feature_flags=g.activeFeatureFlags);let en=wi({},et),er=m.attributes;if(er){let m=[];try{m=Object.keys(er)}catch(g){m=[]}for(let g of m){let m;try{m=er[g]}catch(g){m=tC}Object.defineProperty(en,g,{value:m,enumerable:!0,writable:!0,configurable:!0})}}let ei={timeUnixNano:K,observedTimeUnixNano:K,severityNumber:T,severityText:E,body:{stringValue:function(m){try{return oi(String(m))}catch(m){return tC}}(m.body)},attributes:be(en,v)};return m.trace_id&&(ei.traceId=m.trace_id),m.span_id&&(ei.spanId=m.span_id),O(m.trace_flags)||(ei.flags=m.trace_flags),ei}(x,null!==(v=null==g?void 0:g.context)&&void 0!==v?v:this.ss(),this.$,null==g?void 0:g.occurredAtMs)};this.rs(()=>this.Is(k))}$s(m){let g=this.Sr.beforeSend;if(!g)return m;let v=ej(g)?g:[g],x=m;for(let m of v)try{let g=m(x);if(!g)return this.$.info("Log was rejected in beforeSend function"),null;x=g}catch(m){return this.$.error("Error in beforeSend function for log:",m),null}return x}Ts(){if(void 0===this.Ss)return!0;let m=Date.now(),g=m-this.fs;return this.ks>g&&g>=0||(this.fs=m,this.ps=0,this.gs=!1),this.Ss>this.ps?(this.ps++,!0):(this.gs||(this.$.warn(`captureLog dropping logs: exceeded ${this.Ss} logs per ${this.ks}ms`),this.gs=!0),!1)}flush(){var m=this;return Y(function*(){if(!m._instance.isDisabled)return m.hs||(m.hs=m.Ms().finally(()=>{m.hs=null})),m.hs})()}Ms(){var m=this;return Y(function*(){var g,v,x;m.xs();let k=null!==(g=m._instance.getPersistedProperty(ex.LogsQueue))&&void 0!==g?g:[];if(0===k.length)return;let E=k.length,T=0;for(;k.length>0&&E>T;){let g=m.ds;m.cs=0;let E=Math.min(k.length,m.ws),K=k.slice(0,E),et=Re(K.map(m=>m.record),m.Es(),null!==(v=m.us)&&void 0!==v?v:m._instance.getLibraryId(),m._instance.getLibraryVersion()),en=yield m._instance.Ps(et);if(m.ds!==g)return;if("too-large"===en.kind&&K.length>1)m.ws=Math.max(1,Math.floor(K.length/2)),m.$.warn(`Received 413 when sending logs batch of size ${K.length}, reducing batch size to ${m.ws}`);else if("retry-later"===en.kind||("too-large"===en.kind?m.$.warn("Dropping a single log record after 413 with batch size 1 — the record 
7is larger than the server cap and cannot be split further."):"ok"===en.kind&&m.Sr.maxBatchRecordsPerPost>m.ws&&(m.ws=Math.min(m.Sr.maxBatchRecordsPerPost,m.ws+1)),yield m.Rs(K.length),k=null!==(x=m._instance.getPersistedProperty(ex.LogsQueue))&&void 0!==x?x:[],T+=K.length,"fatal"===en.kind))throw en.error}})()}Rs(m){var g=this;return Y(function*(){var v;let x=Math.max(0,m-g.cs),k=null!==(v=g._instance.getPersistedProperty(ex.LogsQueue))&&void 0!==v?v:[];g._instance.setPersistedProperty(ex.LogsQueue,k.slice(x)),yield g.ls()})()}Es(){return Se(this.Sr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Is(m){var g;if(this._instance.optedOut)return;let v=null!==(g=this._instance.getPersistedProperty(ex.LogsQueue))&&void 0!==g?g:[];this.bs>v.length||(v.shift(),this.cs++,this.$.info("Logs queue is full, dropping oldest record.")),v.push(m),this._instance.setPersistedProperty(ex.LogsQueue,v),this.ys>v.length?this.As():this.Cs()}As(m=this._s){this.Fs||(this.Fs=di(()=>{this.Fs=void 0,this.Cs()},m))}Os(){let m=Math.min(Math.max(0,this.vs-1),6);return this._s*Math.pow(2,m)}Ds(){let m=this._instance.getPersistedProperty(ex.LogsQueue);return!!m&&m.length>0}shutdown(m){var g=this;return Y(function*(){g.xs();let v=g.flush().catch(()=>{});void 0!==m?yield ci(v,m):yield v})()}flushWithTimeout(m){var g=this;return Y(function*(){let v=g.flush();yield ci(v,m,()=>{v.catch(()=>{})})})()}Cs(){this.flush().then(()=>{this.vs=0},m=>{this.vs++,this.$.error("PostHog logs flush failed:",m)}).finally(()=>{!this._instance.isDisabled&&this.Ds()&&this.As(this.Os())})}xs(){this.Fs&&(clearTimeout(this.Fs),this.Fs=void 0)}};let t2=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Fe(m){return String(m)+"000000"}function Ae(m,g,v,x){let k="";return x&&(k=Object.keys(x).sort().map(m=>`${JSON.stringify(m)}:${JSON.stringify(x[m])}`).join(",")),`${m}\0${g}\0${null!=v?v:""}\0${k}`}var t3=class{constructor(m,g,v){this._instance=m,this.Sr=g,this.$=v,this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Bs=0}count(m,g=1,v){this.Hs({name:m,type:"count",value:g,unit:null==v?void 0:v.unit,attributes:null==v?void 0:v.attributes})}gauge(m,g,v){this.Hs({name:m,type:"gauge",value:g,unit:null==v?void 0:v.unit,attributes:null==v?void 0:v.attributes})}histogram(m,g,v){this.Hs({name:m,type:"histogram",value:g,unit:null==v?void 0:v.unit,attributes:null==v?void 0:v.attributes})}flush(){var m,g=this;let v=this.hs,x=(m=Y(function*(){v&&(yield v.catch(()=>{})),yield g.zs()}),function(){return m.apply(this,arguments)})().finally(()=>{this.hs===x&&(this.hs=null)});return this.hs=x,x}drainWindow(){if(0===this.Ls.size)return null;let m=this.Ls;return this.Ls=new Map,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Us(m)}reset(){this.Bs++,this.xs(),this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set}Hs(m){let g,v;if(this._instance.isDisabled||this._instance.optedOut)return;let x=this.$s(m);if(null===x)return;if(!x.name||"string"!=typeof x.name)return void this.$.warn("Dropping metric with empty name");if("number"!=typeof x.value||!Number.isFinite(x.value))return void this.$.warn(`Dropping metric '${x.name}': value must be a finite number`);if("count"===x.type&&0>x.value)return void this.$.warn(`Dropping count '${x.name}': counters are monotonic, value must be >= 0`);try{g=x.attributes?wi({},x.attributes):void 0,v=Ae(x.type,x.name,x.unit,g)}catch(m){return void this.$.warn(`Dropping metric '${x.name}': attributes could not be serialized`,m)}let k=this.Ls.get(v);if(!k){if(!this.Ws())return;k={name:x.name,type:x.type,unit:x.unit,attributes:g,windowStartMs:Date.now()},this.Ls.set(v,k)}let E=this.qs.get(x.name);void 0===E?this.qs.set(x.name,x.type):E===x.type||this.js.has(x.name)||(this.js.add(x.name),this.$.warn(`Metric name '${x.name}' is already used as a ${E}; recording it as a ${x.type} too will blend both series in charts. Use a distinct name.`)),this.Vs(k,x.value),this.As()}Ws(){return this.Sr.maxSeriesPerFlush>this.Ls.size||(this.Ns||(this.Ns=!0,this.$.warn(`Metric series cap reached (${this.Sr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Vs(m,g){switch(m.type){case"count":var v;m.total=(null!==(v=m.total)&&void 0!==v?v:0)+g;break;case"gauge":m.last=g;break;case"histogram":{m.hist||(m.hist={count:0,sum:0,min:g,max:g,bucketCounts:Array(t2.length+1).fill(0)});let v=m.hist;v.count+=1,v.sum+=g,v.min=Math.min(v.min,g),v.max=Math.max(v.max,g),v.bucketCounts[function(m,g){for(let v=0;g.length>v;v++)if(g[v]>=m)return v;return g.length}(g,t2)]+=1}}}$s(m){let g=this.Sr.beforeSend;if(!g)return m;let v=ej(g)?g:[g],x=m;for(let m of v)try{let g=m(x);if(!g)return this.$.info("Metric was rejected in beforeSend function"),null;x=g}catch(m){return this.$.error("Error in beforeSend function for metric:",m),null}return x}As(){this.Fs||(this.Fs=di(()=>{this.Fs=void 0,this.flush().catch(m=>{this.$.error("Metrics flush failed:",m)})},this.Sr.flushIntervalMs))}xs(){this.Fs&&(clearTimeout(this.Fs),this.Fs=void 0)}zs(){var m=this;return Y(function*(){if(0===m.Ls.size)return;let g=m.Ls;m.Ls=new Map,m.Ns=!1,m.qs=new Map,m.js=new Set;let v=m.Bs,x=yield m._instance.Gs(m.Us(g));if(v===m.Bs)switch(x.kind){case"ok":return;case"retry-later":return m.Zs(g),void m.As();case"too-large":return void m.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void m.$.error("Failed to send metrics batch:",x.error)}})()}Us(m){var g,v,x,k;return g=this.Qs(m),v=Se(this.Sr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),x=this._instance.getLibraryId(),
7k=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:be(v)},scopeMetrics:[{scope:{name:x,version:k},metrics:g}]}]}}Qs(m){let g=Fe(Date.now()),v=new Map;for(let T of m.values()){var x,k,E;let m=Ae(T.type,T.name,T.unit,void 0),K=v.get(m);K||(K=wi({name:T.name},T.unit&&{unit:T.unit}),"count"===T.type?K.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===T.type?K.gauge={dataPoints:[]}:K.histogram={aggregationTemporality:1,dataPoints:[]},v.set(m,K));let et=be(null!==(x=T.attributes)&&void 0!==x?x:{},this.$),en=Fe(T.windowStartMs);if("count"===T.type){let m={attributes:et,startTimeUnixNano:en,timeUnixNano:g,asDouble:null!==(k=T.total)&&void 0!==k?k:0};K.sum.dataPoints.push(m)}else if("gauge"===T.type){let m={attributes:et,timeUnixNano:g,asDouble:null!==(E=T.last)&&void 0!==E?E:0};K.gauge.dataPoints.push(m)}else T.hist&&K.histogram.dataPoints.push({attributes:et,startTimeUnixNano:en,timeUnixNano:g,count:T.hist.count,sum:T.hist.sum,min:T.hist.min,max:T.hist.max,bucketCounts:T.hist.bucketCounts,explicitBounds:t2})}return Array.from(v.values())}Zs(m){for(let[x,k]of m){let m=this.Ls.get(x);if(m)switch(m.windowStartMs=Math.min(m.windowStartMs,k.windowStartMs),m.type){case"count":var g,v;m.total=(null!==(g=m.total)&&void 0!==g?g:0)+(null!==(v=k.total)&&void 0!==v?v:0);break;case"gauge":break;case"histogram":if(k.hist){if(m.hist){m.hist.count+=k.hist.count,m.hist.sum+=k.hist.sum,m.hist.min=Math.min(m.hist.min,k.hist.min),m.hist.max=Math.max(m.hist.max,k.hist.max);for(let g=0;m.hist.bucketCounts.length>g;g++)m.hist.bucketCounts[g]+=k.hist.bucketCounts[g]}else m.hist=k.hist}}else this.Ws()&&this.Ls.set(x,k)}}};let De=(m,{debugEnabled:g}={})=>{let v={N(v,...x){et&&(eh.DEBUG||et.POSTHOG_DEBUG||g)&&!O(et.console)&&et.console&&("__rrweb_original__"in et.console[v]?et.console[v].__rrweb_original__:et.console[v])(m,...x)},debug(...m){v.N("debug",...m)},info(...m){v.N("log",...m)},warn(...m){v.N("warn",...m)},error(...m){v.N("error",...m)},critical(...g){console.error(m,...g)},uninitializedWarning(m){v.error(`You must initialize PostHog before calling ${m}`)},createLogger:(g,v)=>De(`${m} ${g}`,v)};return v},t5=De("[PostHog.js]"),t4=t5.createLogger,t6=t4("[ExternalScriptsLoader]"),Be=m=>{let g=null==ei?void 0:ei.querySelectorAll("script");if(g){for(let v=0;g.length>v;v++)if(g[v].src===m||g[v].getAttribute("src")===m)return g[v]}},Ue=(m,g,v)=>{if(m.config.disable_external_dependency_loading)return t6.warn(`${g} was requested but loading of external scripts is disabled.`),v("Loading of external scripts is disabled");let x=Be(g);if(x){if(x.__posthog_loading_callback_fired)return v();let m=x.__posthog_loading_error;return m?v(m):(x.addEventListener("load",m=>{x.__posthog_loading_callback_fired=!0,v(void 0,m)}),void x.addEventListener("error",m=>{x.__posthog_loading_error=m,v(m)}))}let r=()=>{if(!ei)return v("document not found");if(Be(g))return Ue(m,g,v);let x=ei.createElement("script");if(x.type="text/javascript",x.crossOrigin="anonymous",x.src=g,x.onload=m=>{x.__posthog_loading_callback_fired=!0,v(void 0,m)},x.onerror=m=>{x.__posthog_loading_error=m,v(m)},m.config.prepare_external_dependency_script&&(x=m.config.prepare_external_dependency_script(x)),!x)return v("prepare_external_dependency_script returned null");if("head"===m.config.external_scripts_inject_target)ei.head.appendChild(x);else{var k;let m=ei.querySelectorAll("body > script");m.length>0?null===(k=m[0].parentNode)||void 0===k||k.insertBefore(x,m[0]):ei.body.appendChild(x)}};(null==ei?void 0:ei.body)?r():null==ei||ei.addEventListener("DOMContentLoaded",r)},t7={},He=(m,g)=>{let v=`/static/${g}.js?v=${m.version}`;return"toolbar"===g&&(v=`${v}&t=${3e5*Math.floor(Date.now()/3e5)}`),m.requestRouter.endpointFor("assets",v)};ef.__PosthogExtensions__=ef.__PosthogExtensions__||{},ef.__PosthogExtensions__.loadExternalDependency=(m,g,v)=>{if("remote-config"===g){let g=m.requestRouter.endpointFor("assets",`/array/${m.config.token}/config.js`);return void Ue(m,g,v)}let x=m.config.strict_script_versioning;if(x){let k=m.requestRouter.endpointFor("assets",`/static/${m.ver
7sion}/${g}.js`),E=t7[k];if("fallback"===x&&E){if(Be(E))return void Ue(m,E,v);delete t7[k]}return void Ue(m,k,"fallback"===x?(x,E)=>{if(x){if("string"==typeof x)v(x);else{var T;let x=He(m,g);t7[k]=x;let E=Be(k);null==E||null===(T=E.parentNode)||void 0===T||T.removeChild(E),Ue(m,x,v)}}else v(void 0,E)}:v)}Ue(m,He(m,g),v)},ef.__PosthogExtensions__.loadSiteApp=(m,g,v)=>{let x=m.requestRouter.endpointFor("api",g);Ue(m,x,v)},eh.DEBUG=!1,eh.LIB_VERSION="1.429.2",eh.LIB_NAME="web";let t8="distinct_id",t9="$device_id",nt="$device_model",nn="__alias",nr="$fbc",ni="$fbc_persistence",na="__timers",ns="$autocapture_disabled_server_side",no="$heatmaps_enabled_server_side",nl="$exception_capture_enabled_server_side",nc="$error_tracking_suppression_rules",nd="$error_tracking_capture_extension_exceptions",np="$web_vitals_enabled_server_side",nm="$dead_clicks_enabled_server_side",nf="$product_tours_enabled_server_side",ng="$logs_capture_enabled_server_side",nv="$web_vitals_allowed_metrics",ny="$session_recording_remote_config",nb="$sesid",nx="$session_is_sampled",n_="$enabled_feature_flags",nw="$active_feature_flags",nS="$early_access_features",nC="$feature_flag_details",nk="$feature_flag_payloads",nE="$feature_flag_request_id",nj="$minimal_flag_called_events",nN="$override_feature_flags",nR="$override_feature_flag_payloads",nI="$stored_person_properties",nP="$stored_group_properties",nT="$groups",nO="$surveys",nA="$surveys_loaded_at",nM="$surveys_activated",nD="$surveys_activated_session",nL="$surveys_activated_timestamps",nF="ph_product_tours",nZ="$flag_call_reported",nB="$flag_call_reported_session_id",n$="$feature_flag_errors",nU="$feature_flag_evaluated_at",nz="$user_state",nV="$client_session_props",nq="$initial_campaign_params",nH="$initial_referrer_info",nW="$initial_person_info",nK="$epp",nG="$posthog_cookieless",nQ="$cookieless_mode",nY="$sdk_debug_extensions_init_method",nX="$sdk_debug_extensions_init_time_ms",nJ="$sdk_debug_recording_script_not_loaded",n0="PostHog loadExternalDependency extension not found.",n1="anonymous",n2="identified",n3="identified_only",n5="visibilitychange",n4="beforeunload",n6="$pageview",n7="$pageleave",n8="$identify",n9="$groupidentify";function Cn(m,g){ej(m)&&m.forEach(g)}
7function Rn(m,g){if(!M(m)){if(ej(m))m.forEach(g);else if(m instanceof FormData)m.forEach((m,v)=>g(m,v));else for(let v in m)ek.call(m,v)&&g(m[v],v)}}let On=function(m,...g){for(let v of g)for(let g in v)void 0!==v[g]&&(m[g]=v[g]);return m};function In(m){let g=Object.keys(m),v=g.length,x=Array(v);for(;v--;)x[v]=[g[v],m[g[v]]];return x}let Fn=function(m){try{return m()}catch(m){return}},An=function(m){return function(...g){try{return m.apply(this,g)}catch(m){t5.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t5.critical(m)}}},Mn=function(m){let g={};return Rn(m,function(m,v){(I(m)&&m.length>0||D(m))&&(g[v]=m)}),g};function Dn(m){let g=wi({},m);for(let v of["name","message","stack","cause","errors"])try{v in m&&(g[v]=m[v])}catch(m){}return g}let rt=["herokuapp.com","vercel.app","netlify.app"];function Ln(m,g,v,x){let{capture:k=!1,passive:E=!0}=null!=x?x:{};null==m||m.addEventListener(g,v,{capture:k,passive:E})}function Bn(m){return"ph_toolbar_internal"===m.name}let Un=m=>{if(ei){try{let g=m+"=",v=ei.cookie.split(";").filter(m=>m.length);for(let m=0;v.length>m;m++){let x=v[m];for(;" "==x.charAt(0);)x=x.substring(1,x.length);if(0===x.indexOf(g))return decodeURIComponent(x.substring(g.length,x.length))}}catch(m){}return null}};Math.trunc||(Math.trunc=function(m){return 0>m?Math.ceil(m):Math.floor(m)}),Number.isInteger||(Number.isInteger=function(m){return D(m)&&isFinite(m)&&Math.floor(m)===m});var rn=class t{constructor(m){if(this.bytes=m,16!==m.length)throw TypeError("not 128-bit length")}static fromFieldsV7(m,g,v,x){if(!Number.isInteger(m)||!Number.isInteger(g)||!Number.isInteger(v)||!Number.isInteger(x)||0>m||0>g||0>v||0>x||m>0xffffffffffff||g>4095||v>1073741823||x>4294967295)throw RangeError("invalid field value");let k=new Uint8Array(16);
7return k[0]=m/1099511627776,k[1]=m/4294967296,k[2]=m/16777216,k[3]=m/65536,k[4]=m/256,k[5]=m,k[6]=112|g>>>8,k[7]=g,k[8]=128|v>>>24,k[9]=v>>>16,k[10]=v>>>8,k[11]=v,k[12]=x>>>24,k[13]=x>>>16,k[14]=x>>>8,k[15]=x,new t(k)}toString(){let m="";for(let g=0;this.bytes.length>g;g++)m=m+(this.bytes[g]>>>4).toString(16)+(15&this.bytes[g]).toString(16),3!==g&&5!==g&&7!==g&&9!==g||(m+="-");if(36!==m.length)throw Error("Invalid UUIDv7 was generated");return m}clone(){return new t(this.bytes.slice(0))}equals(m){return 0===this.compareTo(m)}compareTo(m){for(let g=0;16>g;g++){let v=this.bytes[g]-m.bytes[g];if(0!==v)return Math.sign(v)}return 0}},ri=class{generate(){let m=this.generateOrAbort();if(!O(m))return m;{this.Ct=0;let m=this.generateOrAbort();if(O(m))throw Error("Could not generate UUID after timestamp reset");return m}}generateOrAbort(){let m=(()=>{let m=Date.now();return D(m)&&isFinite(m)?Math.min(Math.max(Math.floor(m),0),0xffffffffffff):0})();if(m>this.Ct)this.Ct=m,this.Mt();else{if(this.Ct>=m+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return rn.fromFieldsV7(this.Ct,Math.trunc(this.It/1073741824),1073741823&this.It,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new rs}};let qn=m=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(let g=0;m.length>g;g++)m[g]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return m};et&&!O(et.crypto)&&crypto.getRandomValues&&(qn=m=>crypto.getRandomValues(m));var rs=class{nextUint32(){return this.Rt.length>this.$t||(qn(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let Gn=()=>Kn().toString(),Kn=()=>(K||(K=new ri)).generate(),ro="",rl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,rc=null,rd={Et(){if(!A(rc))return rc;if(rc=!1,ei)try{let m=`__ph_cookie_support_${Gn()}`;rd.At(m,"xyz"),rc='"xyz"'===Un(m),rd.Lt(m)}catch(m){rc=!1}return rc},Pt(m){t5.error("cookieStore error: "+m)},Ot:Un,Dt(m){let g;try{g=JSON.parse(rd.Ot(m))||{}}catch(m){}return g},At(m,g,v,x,k){if(!ei)return!1;try{let E="",T="",K=function(m,g){if(g){let g=function(m,g=ei){if(ro)return ro;if(!g||["localhost","127.0.0.1"].includes(m))return"";let v=m.split("."),x=Math.min(v.length,8),k="dmn_chk_"+Gn();for(;!ro&&x--;){let m=v.slice(x).join("."),E=k+"=1;domain=."+m+";path=/";g.cookie=E+";max-age=3",g.cookie.includes(k)&&(g.cookie=E+";max-age=0",ro=m)}return ro}(m);if(!g){let v=(m=>{let g=m.match(rl);return g?g[0]:""})(m);v!==g&&t5.info("Warning: cookie subdomain discovery mismatch",v,g),g=v}return g?"; domain=."+g:""}return""}(ei.location.hostname,x);if(v){let m=new Date;m.setTime(m.getTime()+864e5*v),E="; expires="+m.toUTCString()}k&&(T="; secure");let et=m+"="+encodeURIComponent(JSON.stringify(g))+E+"; SameSite=Lax; path=/"+K+T;return et.length>3686.4&&t5.warn("cookieStore warning: large cookie, len="+et.length),ei.cookie=et,!0}catch(m){return!1}},Lt(m,g){if(null==ei?void 0:ei.cookie)try{rd.At(m,"",-1,g)}catch(m){return}}},rp=null,rm={Et(){if(!A(rp))return rp;let m=!0;if(O(et))m=!1;
7else try{let g="__mplssupport__";rm.At(g,"xyz"),'"xyz"'!==rm.Ot(g)&&(m=!1),rm.Lt(g)}catch(g){m=!1}return m||t5.error("localStorage unsupported; falling back to cookie store"),rp=m,m},Pt(m){t5.error("localStorage error: "+m)},Ot(m){try{return null==et?void 0:et.localStorage.getItem(m)}catch(m){rm.Pt(m)}return null},Dt(m){try{return JSON.parse(rm.Ot(m))||{}}catch(m){}return null},At(m,g){try{return null==et||et.localStorage.setItem(m,JSON.stringify(g)),!0}catch(m){rm.Pt(m)}return!1},Lt(m){try{null==et||et.localStorage.removeItem(m)}catch(m){rm.Pt(m)}}},rf=[nI,nw,n_,nC,nk,nE,nU,n$,nZ],rg=[t9,t8,nb,nx,nK,nW,ni,nz],sr=m=>m+"_cpm",rv=["__proto__","constructor","prototype"],rr=m=>{if(!C(m))return{};let g={};return Object.keys(m).forEach(v=>{-1===rv.indexOf(v)&&(g[v]=m[v])}),g},or=(m,g=[])=>{let v={};return[...rg,...g].forEach(g=>{let x=m[g];O(x)||A(x)||""===x||(v[g]=x)}),v},lr=m=>{let g=5381,v=2166136261;for(let x=0;m.length>x;x++){let k=m.charCodeAt(x);g=33*g^k,v=Math.imul(v^k,16777619)}return m.length.toString(36)+"."+(g>>>0).toString(36)+"."+(v>>>0).toString(36)},ar=(m,g)=>({p:g,f:lr(JSON.stringify(m))}),ur=(m,g)=>{if(!g)return{properties:[],isValid:!1};try{let v=rd.Dt(sr(m)),x=(null==v?void 0:v.f)===lr(g)&&ej(v.p);return{properties:x?v.p:[],isValid:x}}catch(m){return{properties:[],isValid:!1}}},hr=(m,g)=>g+"|"+(rd.Ot(sr(m))||""),ry={},rb={Et:()=>!0,Pt(m){t5.error("memoryStorage error: "+m)},Ot:m=>m in ry?ry[m]:null,Dt:m=>m in ry?ry[m]:null,At:(m,g)=>(ry[m]=g,!0),Lt(m){delete ry[m]}},rx=null,r_={Et(){if(!A(rx))return rx;if(rx=!0,O(et))rx=!1;else try{let m="__support__";r_.At(m,"xyz"),'"xyz"'!==r_.Ot(m)&&(rx=!1),r_.Lt(m)}catch(m){rx=!1}return rx},Pt(m){t5.error("sessionStorage error: ",m)},Ot(m){try{return null==et?void 0:et.sessionStorage.getItem(m)}catch(m){r_.Pt(m)}return null},Dt(m){try{return JSON.parse(r_.Ot(m))||null}catch(m){}return null},At(m,g){try{return null==et||et.sessionStorage.setItem(m,JSON.stringify(g)),!0}catch(m){r_.Pt(m)}return!1},Lt(m){try{null==et||et.sessionStorage.removeItem(m)}catch(m){r_.Pt(m)}}};var rw=class{constructor(m){this._instance=m}get Sr(){return this._instance.config}get consent(){return this.xo()?0:this.Co}isOptedOut(){return"always"===this.Sr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Sr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Sr.opt_out_capturing_by_default}optInOut(m){this.$o.At(this.To,m?1:0,this.Sr.cookie_expiration,this.Sr.cross_subdomain_cookie,this.Sr.secure_cookie)}reset(){this.$o.Lt(this.To,this.Sr.cross_subdomain_cookie)}get To(){let{token:m,opt_out_capturing_cookie_prefix:g,consent_persistence_name:v}=this._instance.config;return v||(g?g+m:"__ph_opt_in_out_"+m)}get Co(){let m=this.$o.Ot(this.To);return G(m)?1:b(eR,m)?0:-1}get $o(){let m=this.Sr.opt_out_capturing_persistence_type,g="localStorage"===m?rm:rd,v=g.Et()?g:rb;if(!this.Io||this.Io!==v){this.Io=v;let g="localStorage"===m?rd:rm;g.Ot(this.To)&&(this.Io.Ot(this.To)||this.optInOut(G(g.Ot(this.To))),g.Lt(this.To,this.Sr.cross_subdomain_cookie))}return this.Io}xo(){return!!this.Sr.respect_dnt&&[null==er?void 0:er.doNotTrack,null==er?void 0:er.msDoNotTrack,ef.doNotTrack,null==er?void 0:er.globalPrivacyControl].some(m=>G(m))}};function _r(m,g){var v;let x=null==m||null===(v=m.config)||void 0===v?void 0:v.get_current_url;if(!P(x))return g;try{let m=x(g);return I(m)&&m?m:g}catch(m){return t5.error("Error in get_current_url, falling back to window.location.href",m),g}}function gr(m){var g;return m instanceof Element&&("__POSTHOG_TOOLBAR__"===m.id||!!(null===(g=m.closest)||void 0===g?void 0:g.call(m,".toolbar-global-fade-container")))}function mr(m){return!!m&&1===m.nodeType}function br(m,g){return!!m&&!!m.tagName&&m.tagName.toLowerCase()===g.toLowerCase()}function yr(m){return!!m&&3===m.nodeType}function wr(m){return!!m&&11===m.nodeType&&mr(m.host)}function $r(m){return m?y(m).split(/\s+/):[]}function Sr(m,g){let v=function(m){var g;let v=null==et||null===(g=et.location)||void 0===g?void 0:g.href;return O(v)?void 0:_r(m,v)}(g);return!!(v&&m&&m.some(m=>v.match(m)))}function xr(m){let g="";switch(typeof m.className){case"string":g=m.className;break;case"object":g=(m.className&&"baseVal"in m.className?m.className.baseVal:null)||m.getAttribute("class")||"";break;default:g=""}return $r(g)}function Er(m){return M(m)?null:y(m).split(/(\s+)/).filter(m=>Yr(m)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function kr(m){let g="";return Ur(m)&&!zr(m)&&m.childNodes&&m.childNodes.length&&Rn(m.childNodes,function(m){var v;yr(m)&&m.textContent&&(g+=null!==(v=Er(m.textContent))&&void 0!==v?v:"")}
7),y(g)}function Tr(m){var g;return O(m.target)?m.srcElement||null:(null===(g=m.target)||void 0===g?void 0:g.shadowRoot)?m.composedPath()[0]||null:m.target||null}let rS=["a","button","form","input","select","textarea","label"];function Cr(m,g){let v=m.matches||m.matchesSelector||m.msMatchesSelector||m.mozMatchesSelector||m.webkitMatchesSelector||m.oMatchesSelector;try{return!!v&&v.call(m,g)}catch(m){return!1}}function Rr(m,g){if(O(g))return!0;for(let v of m)if(g.some(m=>Cr(v,m)))return!0;return!1}function Or(m){let g=m.parentNode;return!(!g||!mr(g))&&g}let rC=[".ph-no-autocapture","[data-ph-no-autocapture]"],rk=["next","previous","prev",">","<"],rE=[...rk,"+","-","−","–"],Mr=(m,g)=>/[a-z0-9]/i.test(g)?m.includes(g):m===g,rj=[".ph-no-rageclick",".ph-no-capture"],rN=["","text","search","email","password","url","tel","number"];function jr(m,g){var v,x,k;let E,T,K;if(!et||Lr(m)||(j(g)?(E=!!g&&rj,T=void 0,K=!1):(E=null!==(v=null==g?void 0:g.css_selector_ignorelist)&&void 0!==v?v:rj,T=null==g?void 0:g.content_ignorelist,K=null!==(x=null==g?void 0:g.ignore_text_selection)&&void 0!==x&&x),!1===E)||K&&!(!(k=m)||!mr(k))&&(br(k,"textarea")||(br(k,"input")?b(rN,(k.getAttribute("type")||"").toLowerCase()):function(m){var g;if(m.isContentEditable)return!0;let v=null===(g=m.getAttribute)||void 0===g?void 0:g.call(m,"contenteditable");return"true"===v||""===v}(k))))return!1;let{targetElementList:en}=Br(m,!1);return!function(m,g){let v;if(!1===m||O(m))return!1;if(!0===m)v=rk;else{if(!ej(m))return!1;if(m.length>10)return t5.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;v=m.map(m=>m.toLowerCase())}return g.some(({safeText:m,ariaLabel:g})=>v.some(v=>Mr(m,v)||Mr(g,v)))}(T,en.map(m=>{var g;return{safeText:kr(m).toLowerCase(),ariaLabel:(null===(g=m.getAttribute("aria-label"))||void 0===g?void 0:g.toLowerCase().trim())||""}}))&&!Rr(en,E)}let Lr=m=>!m||br(m,"html")||!mr(m),Br=(m,g)=>{if(!et||Lr(m))return{parentIsUsefulElement:!1,targetElementList:[]};let v=!1,x=[m],k=m;for(;k.parentNode&&!br(k,"body");){if(wr(k.parentNode)){x.push(k.parentNode.host),k=k.parentNode.host;continue}let m=Or(k);if(!m)break;if(g||rS.indexOf(m.tagName.toLowerCase())>-1)v=!0;else try{let g=et.getComputedStyle(m);g&&"pointer"===g.getPropertyValue("cursor")&&(v=!0)}catch(m){}x.push(m),k=m}return{parentIsUsefulElement:v,targetElementList:x}};function Ur(m){let g=new Set,v=0;for(let x=m;x.parentNode&&!br(x,"body");x=x.parentNode){if(v++>=1e3||g.has(x))return!1;g.add(x);let m=xr(x);if(b(m,"ph-sensitive")||b(m,"ph-no-capture"))return!1}if(b(xr(m),"ph-include"))return!0;let x=m.type||"";if(I(x))switch(x.toLowerCase()){case"hidden":case"password":return!1}let k=m.name||m.id||"";return!I(k)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(k.replace(/[^a-zA-Z0-9]/g,""))}function zr(m){return!!(br(m,"input")&&!["button","checkbox","submit","reset"].includes(m.type)||br(m,"select")||br(m,"textarea")||"true"===m.getAttribute("contenteditable"))}let rR=RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),rI=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rP=[16,15,14,13],rT=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),rO=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rA=/[0-9A-Za-z_]/;function Yr(m,g=!0){return!(M(m)||I(m)&&(m=y(m),(g?rR.test((m||"").replace(/[- ]/g,"")):function(m){let g;for(rI.lastIndex=0;g=rI.exec(m);){let m=g[2];if(!m)continue;let v=m.replace(/[- ]/g,"");for(let m=0;v.length>m;m++)for(let g of rP){let x=m+g;if(v.length>=x){let g=v.slice(m,x);if(rR.test(g)&&function(m){let g=0,v=!1;for(let x=m.length-1;x>=0;x--){let k=m.charCodeAt(x)-48;v&&(k*=2)>9&&(k-=9),g+=k,v=!v}return g%10==0}(g))return!0}}}return!1}(m))||(g?rT.test(m):function(m){let g;for(rO.lastIndex=0;g=rO.exec(m);){let m=g[1],v=g[3];if(!(m&&v&&rA.test(m)&&rA.test(v)))return!0}return!1}(m))))}function Xr(m){let g=kr(m);return Yr(g=`${g} ${(function Qr(m){let g="";return m&&m.childNodes&&m.childNodes.length&&Rn(m.childNodes,function(m){var v;if(m&&"span"===(null===(v=m.tagName)||void 0===v?void 0:v.toLowerCase()))try{let v=kr(m);g=`${g} ${v}`.trim(),m.childNodes&&m.childNodes.length&&(g=`${g} ${Qr(m)}`.trim())}catch(m){t5.error("[AutoCapture]",m)}
7}),g})(m)}`.trim())?g:""}function Zr(m){return m.replace(/"|\\"/g,'\\"')}let rM=t4("[Dead Clicks]"),eo=()=>!0,so=m=>{var g;let v=!!(null===(g=m.instance.persistence)||void 0===g?void 0:g.get_property(nm)),x=m.instance.config.capture_dead_clicks;return j(x)?x:!!C(x)||v};var rD=class{get lazyLoadedDeadClicksAutocapture(){return this.Mo}constructor(m,g,v){this.instance=m,this.isEnabled=g,this.onCapture=v,this.startIfEnabledOrStop()}onRemoteConfig(m){if(!m.ok)return;let g=m.config;"captureDeadClicks"in g&&(this.instance.persistence&&this.instance.persistence.register({[nm]:g.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Eo(()=>{this.Po()}):this.stop()}Eo(m){var g,v,x;(null===(g=ef.__PosthogExtensions__)||void 0===g?void 0:g.initDeadClicksAutocapture)?m():null===(v=ef.__PosthogExtensions__)||void 0===v||null===(x=v.loadExternalDependency)||void 0===x||x.call(v,this.instance,"dead-clicks-autocapture",g=>{g?rM.error("failed to load script",g):m()})}Po(){var m;if(ei){if(!this.Mo&&(null===(m=ef.__PosthogExtensions__)||void 0===m?void 0:m.initDeadClicksAutocapture)){let m=C(this.instance.config.capture_dead_clicks)?wi({},this.instance.config.capture_dead_clicks):{};m.__onCapture=this.onCapture,this.onCapture&&(m.capture_dead_swipes=!1),this.Mo=ef.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,m),this.Mo.start(ei),rM.info("starting...")}}else rM.error("`document` not found. Cannot start.")}stop(){this.Mo&&(this.Mo.stop(),this.Mo=void 0,rM.info("stopping..."))}};let rL=t4("[SegmentIntegration]");function oo(m,g,v=!0){let x=m.config.segment;if(!x)return g();let{analytics:k,filterProperties:E}=P(x.register)?{analytics:x}:x;!function(m,g,v,x){let n=g=>{let n=()=>g.anonymousId()||Gn();m.config.get_device_id=n,x&&g.id()&&(m.register({distinct_id:g.id(),$device_id:n()}),m.persistence.set_property(nz,n2)),v(x?void 0:g.anonymousId()||void 0)},k=g.user();"then"in k&&P(k.then)?k.then(n):n(k)}(m,k,v=>{k.register(((m,g,{filterProperties:v}={})=>{"undefined"!=typeof Promise&&Promise.resolve||rL.warn("This browser does not have Promise support, and can not use the segment integration");let s=(x,k)=>{if(!k)return x;let E=!!g&&x.event.anonymousId===g&&!x.event.userId;E||x.event.userId||x.event.anonymousId===m.get_distinct_id()||(rL.info("No userId set, resetting PostHog"),m.reset()),E||(g=void 0),x.event.userId&&x.event.userId!==m.get_distinct_id()&&(rL.info("UserId set, identifying with PostHog"),m.identify(x.event.userId));let T=m.calculateEventProperties(k,x.event.properties);if(!M(v)){let m=x.event.properties||{},g={};for(let v of Object.keys(T))ek.call(m,v)||(g[v]=T[v]);let k=((m,g)=>{let v=ej(m)?m:[m],x=wi({},g);for(let m of v)try{if(x=m(x),M(x))return null}catch(m){return rL.error("Error in Segment filterProperties:",m),null}return x})(v,g);if(M(k))return x;T=k}return x.event.properties=Object.assign({},T,x.event.properties),x};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:m=>s(m,m.event.event),page:m=>s(m,n6),identify:m=>s(m,n8),screen:m=>s(m,"$screen")}})(m,v,{filterProperties:E})).then(()=>{g()},m=>{rL.error("Failed to register the Segment integration",m),g()})},v)}let rF="posthog-js";function ao(m,{organization:g,projectId:v,prefix:x,severityAllowList:k=["error"],sendExceptionsToPostHog:E=!0}={}){return T=>{var K,et,en,er,ei,es;if("*"!==k&&!k.includes(T.level)||!m.__loaded)return T;T.tags||(T.tags={});let el=m.requestRouter.endpointFor("ui",`/project/${m.config.token}/person/${m.get_distinct_id()}`);T.tags["PostHog Person URL"]=el,m.sessionRecordingStarted()&&(T.tags["PostHog Recording URL"]=m.get_session_replay_url({withTimestamp:!0}));let ec=(null===(K=T.exception)||void 0===K?void 0:K.values)||[],eu=ec.map(m=>wi(wi({},m),{},{stacktrace:m.stacktrace?wi(wi({},m.stacktrace),{},{type:"raw",frames:(m.stacktrace.frames||[]).map(m=>wi(wi({},m),{},{platform:"web:javascript"}))}):void 0})),ed={$exception_message:(null===(et=ec[0])||void 0===et?void 0:et.value)||T.message,$exception_type:null===(en=ec[0])||void 0===en?void 0:en.type,$exception_level:T.level,$exception_list:eu,$sentry_event_id:T.event_id,$sentry_exception:T.exception,$sentry_exception_message:(null===(er=ec[0])||void 0===er?void 0:er.value)||T.message,$sentry_exception_type:null===(ei=ec[0])||void 0===ei?void 0:ei.type,$sentry_tags:T.tags};return g&&v&&(ed.$sentry_url=(x||"https://sentry.io/organizations/")+g+"/issues/?project="+v+"&query="+T.event_id),E&&(null===(es=m.exceptions)||void 0===es||es.sendExceptionEvent(ed)),T}}var rZ=class{constructor(m,g,v,x,k,E){this.name=rF,this.setupOnce=function(T){T(ao(m,{organization:g,projectId:v,prefix:x,severityAllowList:k,sendExceptionsToPostHog:null==E||E}))}}},rB=class{constructor(m){this.Ro=(m,g,v)=>{v&&(v.noSessionId||v.activityTimeout||v.sessionPastMaximumLength||v.crossTabAdoption)&&(t5.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:m,changeReason:v}),this.Ao=void 0,this._instance.scrollManager.resetContext())},this._instance=m,this.Fo()}Fo(){var m;this.Oo=null===(m=this._instance.sessionManager)||void 0===m?void 0:m.onSessionId(this.Ro)}destroy(){var m;null===(m=this.Oo)||void 0===m||m.call(this),this.Oo=void 0}doPageView(m,g){var v;let x=this.Do(m,g);return this.Ao={pathname:null!==(v=null==et?void 0:et.location.pathname)&&void 0!==v?v:"",pageViewId:g,timestamp:m},this._instance.scrollManager.resetContext(),x}doPageLeave(m){var g;return this.Do(m,null===(g=this.Ao)||void 0===g?void 0:g.pageViewId)}doEvent(){var m;return{$pageview_id:null===(m=this.Ao)||void 0===m?void 0:m.pageViewId}}Do(m,g){let v=this.Ao;if(!v)return{$pageview_id:g};let x={$pageview_id:g,$prev_pageview_id:v.pageViewId},k=this._instance.scrollManager.getContext();if(k&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:m,lastScrollY:g,maxScrollY:v,maxContentHeight:E,lastContentY:T,maxContentY:K}=k;if(!(O(m)||O(g)||O(v)||O(E)||O(T)||O(K))){m=Math.ceil(m),g=Math.ceil(g),v=Math.ceil(v),E=Math.ceil(E),T=Math.ceil(T),K=Math.ceil(K);let k=m>1?Z(g/m,0,1,t5):1,et=m>1?Z(v/m,0,1,t5):1,en=E>1?Z(T/E,0,1,t5):1,er=E>1?Z(K/E,0,1,t5):1;x=On(x,{$prev_pageview_last_scroll:g,$prev_pageview_last_scroll_percentage:k,$prev_pageview_max_scroll:v,$prev_pageview_max_scroll_percentage:et,$prev_pageview_last_content:T,$prev_pageview_last_content_percentage:en,$prev_pageview_max_content:K,$prev_pageview_max_content_percentage:er})}}return v.pathname&&(x.$prev_pageview_pathname=v.pathname),v.timestamp&&(x.$prev_pageview_duration=(m.getTime()-v.timestamp.getTime())/1e3),x}};let r$=["flags","surveys"],rU={$people_distinct_id:{exposure:"hidden"},[nn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[na]:{exposure:"hidden"},[ni]:{exposure:"hidden"},[ns]:{exposure:"event"},[no]:{exposure:"hidden"},[ng]:{exposure:"hidden"},[nl]:{exposure:"event"},[nc]:{exposure:"hidden"},[nd]:{exposure:"event"}
7,[np]:{exposure:"event"},[nm]:{exposure:"event"},[nf]:{exposure:"hidden"},[nv]:{exposure:"event"},[ny]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[nb]:{exposure:"hidden"},[nx]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:m=>A(m)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[n_]:{exposure:"hidden",storageGroup:"flags"},[nw]:{exposure:"hidden",storageGroup:"flags"},[nS]:{exposure:"hidden"},[nC]:{exposure:"hidden",storageGroup:"flags"},[nk]:{exposure:"hidden",storageGroup:"flags"},[nE]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[nj]:{exposure:"hidden",storageGroup:"flags"},[nN]:{exposure:"hidden"},[nR]:{exposure:"hidden"},[nI]:{exposure:"hidden"},[nP]:{exposure:"hidden"},[nO]:{exposure:"hidden",storageGroup:"surveys"},[nA]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[nM]:{exposure:"event"},[nD]:{exposure:"hidden"},[nL]:{exposure:"hidden"},[nF]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[nZ]:{exposure:"hidden"},[nB]:{exposure:"hidden"},[nT]:{exposure:"event"},[n$]:{exposure:"hidden"},[nU]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[nz]:{exposure:"hidden"},[nV]:{exposure:"hidden"},$capture_rate_limit:{exposure:"hidden"},[nq]:{exposure:"hidden"},[nH]:{exposure:"hidden"},[nW]:{exposure:"hidden"},[nK]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[nY]:{exposure:"event"},[nX]:{exposure:"event"},[nJ]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
7,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rz=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],po=m=>{let g=rU[m];if(g)return g;for(let[g,v]of rz)if(0===m.indexOf(g))return v},_o=(m,g)=>{try{let v;return JSON.stringify(m,(m,g)=>{var x;return H(g)?(null!==(x=v)&&void 0!==x||(v=new WeakMap),v.has(g)||v.set(g,Dn(g)),v.get(g)):"bigint"==typeof g?g.toString():g},g)}catch(g){return S(m)}},go=m=>{let g=null==ei?void 0:ei.createElement("a");return O(g)?null:(g.href=m,g)},mo=function(m,g){let v;let x=((m.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");for(let m=0;x.length>m;m++){let k=x[m].split("=");if(k[0]===g){v=k;break}}if(!ej(v)||2>v.length)return"";{let m=v[1];try{m=decodeURIComponent(m)}catch(g){t5.error("Skipping decoding for malformed query param: "+m)}return m.replace(/\+/g," ")}},bo=function(m,g,v){if(!m||!g||!g.length)return m;let x=m.split("#"),k=x[1],E=(x[0]||"").split("?"),T=E[1],K=E[0],et=(T||"").split("&"),en=[];for(let m=0;et.length>m;m++){let x=et[m].split("=");ej(x)&&(g.includes(x[0])?en.push(x[0]+"="+v):en.push(et[m]))}let er=K;return null!=T&&(er+="?"+en.join("&")),null!=k&&(er+="#"+k),er},yo=function(m,g){let v=m.match(RegExp(g+"=([^&]*)"));return v?v[1]:null},wo=(m,g)=>m>=g&&h(),$o=(m,g,v,x)=>{if(0===m){if(h()){let m=g+1;return m===v&&x(),m}return g}return 0},rV=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rq=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rV],rH="<masked>",rW=["li_fat_id"];function To(m,g,v){if(!ei)return{};let x=g?[...rV,...v||[]]:[],k=Po(bo(ei.URL,x,rH),m),E=function(){let m={};return Rn(rW,function(g){let v=Un(g);m[g]=v||null}),m}();return On(E,k)}function Po(m,g){let v=rq.concat(g||[]),x={};return Rn(v,function(g){let v=mo(m,g);x[g]=v||null}),x}function Co(m){let g=m?0===m.search("https?://(.*)google.([^/?]*)")?"google":0===m.search("https?://(.*)bing.com")?"bing":0===m.search("https?://(.*)yahoo.com")?"yahoo":0===m.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null,v="yahoo"!=g?"q":"p",x={};if(!A(g)){x.$search_engine=g;let m=ei?mo(ei.referrer,v):"";m.length&&(x.ph_keyword=m)}return x}function Ro(){return navigator.language||navigator.userLanguage}let rK="$direct";function Fo(){return(null==ei?void 0:ei.referrer)||rK}function Ao(m,g,v=!1){let x=m?[...rV,...g||[]]:[],k=v?hi(null==es?void 0:es.href):null==es?void 0:es.href,E=null==k?void 0:k.substring(0,1e3);return{r:Fo().substring(0,1e3),u:E?bo(E,x,rH):void 0}}function Mo(m,g=!1){var v;let{r:x,u:k}=m,E=g?hi(k):k,T={$referrer:x,$referring_domain:null==x?void 0:x==rK?rK:null===(v=go(x))||void 0===v?void 0:v.host};if(E){T.$current_url=E;let m=go(E);T.$host=null==m?void 0:m.host,T.$pathname=null==m?void 0:m.pathname;let g=Po(E);On(T,g)}if(x){let m=Co(x);On(T,m)}return T}function Do(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(m){return}}let rG={flags:nU,surveys:nA},rQ=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Bo=m=>`${m}_cookie_identity_change_pending`,Uo=m=>{let g="",v=0;for(let x of m){let m=encodeURIComponent(JSON.stringify(x).slice(1,-1)).length;if(v+m>1e3)break;g+=x,v+=m}return g},rY="main",rX=[n_,nw,nC,nk,nE,nU,nj,nI],qo=m=>-1!==rX.indexOf(m),Vo=(m,g)=>{try{return JSON.stringify(m)===JSON.stringify(g)}catch(v){return m===g}},Wo=m=>{if(!m)return{};let g=JSON.parse(m);return C(g)?g:{}},Go=(m,g)=>{Rn(m,(v,x)=>{let k=po(x);k&&"event"!==k.exposure||({}).hasOwnProperty.call(g,x)||delete m[x]})};var rJ=class{constructor(m,g,v=!0){let x;if(this.Lo={},this.No=!1,this.qo=!1,this.jo=!1,this.Bo=!1,this.Ho=!1,this.zo=new Map,this.Uo=!1,this.Wo=!1,this.Vo=!1,this.Go=!1,this.Zo=new Set,this.Sr=m,this.Qo=v,this.props={},this.Jo=void 0,this.Ko=(x="",m.token&&(x=m.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),m.persistence_name?"ph_"+m.persistence_name:"ph_"+x+"_posthog"),this.$o=this.Yo(m),this.jo=this.Xo(m),this.load(),this.tl(),m.debug&&t5.info("Persistence loaded",m.persistence,wi({},this.props)),this.update_config(m,m,g),this.save(),et){let i=()=>this.flush();Ln(et,"beforeunload",i,{capture:!1}),Ln(et,"pagehide",i,{capture:!1}),this.el=m=>{if(this.No&&(!m.storageArea||m.storageArea===(null==et?void 0:et.localStorage))&&m.key){if(m.key!==this.Ko){if(this.jo){let g=r$.find(g=>m.key===this.il(g));g&&this.nl(m.key,g)}}else this.nl(m.key,rY)}},Ln(et,"storage",this.el)}}markCrossTabFeatureFlagChanges(m){Object.entries(m).forEach(([m,g])=>{let v=this.zo.get(m);
7if(!qo(m)||!0===v)return;if(!0===g)return void this.sl(m,!0);let x=new Set(v||[]);g.forEach(m=>x.add(m)),x.size&&this.sl(m,x)})}onCrossTabFeatureFlagChange(m){return this.Zo.add(m),()=>this.Zo.delete(m)}destroy(){this.el&&et&&(et.removeEventListener("storage",this.el),this.el=void 0),this.Zo.clear()}nl(m,g,v=!0){let x,k;if(this.pi)return!1;try{if(k=rm.Ot(m),A(k)){let m=this.rl(g);return m.storageValue=null,g!==rY&&(m.persisted=!1),!1}x=Wo(k)}catch(m){return!1}let E=g===rY?x:rm.Dt(this.Ko);if(E&&this.ol(E))return!1;let T=this.ll(x,g,v);return g===rY&&this.jo&&!Vo(this.al().main,x)||this.ul(x,g,!0,k),T}ol(m){let g=this.props[t8],v=m[t8];return!O(g)&&!O(v)&&g!==v}ul(m,g,v,x){let k=this.rl(g);k.storageValue=x,g!==rY&&(k.persisted=v);try{k.fingerprint=this.hl(m,g)}catch(m){k.fingerprint=void 0}}ll(m,g,v){let x=!1;return rX.forEach(v=>{var k;let E=null===(k=po(v))||void 0===k?void 0:k.storageGroup;if(g===rY&&this.jo&&E||g!==rY&&E!==g)return;let T=v in m,K=this.cl(v,T?m[v]:void 0),et=this.zo.has(v)?v in this.props:T;et===v in this.props&&Vo(K,this.props[v])||(et?this.dl(v,K,!1):this.vl(v,!1),x=!0)}),x&&v&&this.Zo.forEach(m=>m()),x}fl(){if(!this.No)return!1;try{this.Vo=!1;let m=rm.Ot(this.Ko),g=this.rl(rY),v,x=!1,k=!1;if(m!==g.storageValue){if(A(m))g.storageValue=null;else{if(v=Wo(m),this.Vo=!this.Wo&&this.ol(v),this.Vo)return!1;k=this.ll(v,rY,!1),!this.jo||Vo(this.al().main,v)?this.ul(v,rY,!0,m):g.storageValue=m,x=!0}}return this.jo&&r$.forEach(m=>{let g=rm.Ot(this.il(m)),E=this.rl(m),T=v||{},K=x&&rX.some(g=>{var v;return(null===(v=po(g))||void 0===v?void 0:v.storageGroup)===m&&g in T});if(g===E.storageValue&&!K)return;if(A(g))return E.storageValue=null,E.persisted=!1,void(K&&(k=this.ll(T,m,!1)||k));let et=Wo(g);k=this.ll(et,m,!1)||k,this.ul(et,m,!0,g)}),k}catch(m){return!1}}sl(m,g){this.zo.set(m,g);let v=po(m);(null==v?void 0:v.volatile)||(this.rl((this.jo?null==v?void 0:v.storageGroup:void 0)||rY).fingerprint=void 0,this.pl(m))}gl(){rX.forEach(m=>this.zo.set(m,!0))}tl(){if(this.No)try{let m=rm.Ot(this.Ko),g=Wo(m);this.rl(rY).storageValue=m,rX.forEach(m=>{var v;let x=this.jo?null===(v=po(m))||void 0===v?void 0:v.storageGroup:void 0,k=x?rm.Ot(this.il(x)):null;if(x){let m=this.rl(x);m.storageValue=k,m.persisted=!A(k)}let E=x&&!A(k)?Wo(k):g;m in this.props?this.ml(m,E[m],this.props[m]):m in E&&this.sl(m,!0)})}catch(m){}}cl(m,g){let v=this.zo.get(m);if(!v)return g;if(!0===v)return this.props[m];if("$active_feature_flags"===m){let x=new Set(ej(g)?g:[]),k=new Set(ej(this.props[m])?this.props[m]:[]);return v.forEach(m=>k.has(m)?x.add(m):x.delete(m)),Array.from(x)}let x=C(g)?wi({},g):{},k=C(this.props[m])?this.props[m]:{};return v.forEach(m=>{m in k?x[m]=k[m]:delete x[m]}),x}ml(m,g,v){if(!qo(m))return;let x=this.zo.get(m);if(!0===x)return;let k=g;if(this.No)try{var E;let g=this.jo?null===(E=po(m))||void 0===E?void 0:E.storageGroup:void 0,v=g?this.il(g):this.Ko;k=Wo(rm.Ot(v))[m]}catch(m){}let T=new Set(x||[]);if("$active_feature_flags"===m){if(!O(g)&&!ej(g)||!O(k)&&!ej(k)||!ej(v))return void this.sl(m,!0);let x=new Set(g||[]),E=new Set(k||[]),K=new Set(v);new Set([...x,...K]).forEach(m=>{x.has(m)!==K.has(m)&&T.add(m)}),T.forEach(m=>{E.has(m)===K.has(m)&&T.delete(m)})}else{if(!C(v))return void(Vo(k,v)?this.zo.delete(m):this.sl(m,!0));{if(!O(g)&&!C(g)||O(g)&&R(v)&&O(k))return void this.sl(m,!0);let x=C(g)?g:{},E=C(k)?k:{};new Set([...Object.keys(x),...Object.keys(v)]).forEach(m=>{m in x==m in v&&Vo(x[m],v[m])||T.add(m)}),T.forEach(m=>{m in E==m in v&&Vo(E[m],v[m])&&T.delete(m)})}}T.size?this.sl(m,T):this.zo.delete(m)}yl(){var m;let g=null===(m=this.Sr)||void 0===m?void 0:m.persistence_save_debounce_ms;return D(g)&&g>0?g:0}bl(m){if(this.Sr.cookieWinsOnConflict&&"localstorage+cookie"===this.Sr.persistence.toLowerCase()){if(m)try{let g=or(m,this.Sr.cookie_persisted_properties||[]),v=ar(g,this.Sr.cookie_persisted_properties||[]),x=JSON.stringify(g)+"|"+JSON.stringify(v),k=rd.Ot(this.Ko)||void 0;k&&hr(this.Ko,k)===x&&(this._l=x,this.wl=k)}catch(m){}else try{let m=rd.Ot(this.Ko)||void 0;this._l=m?hr(this.Ko,m):void 0,this.wl=m}catch(m){}}}syncCookieProperties(){return this.kl(this.Sr)}kl(m,g=!1){let v,x;
7if(this.pi&&!g||this.Ho||!m.cookieWinsOnConflict||"localstorage+cookie"!==m.persistence.toLowerCase())return!1;try{v=rd.Ot(this.Ko)||void 0}catch(m){}if(!v||v===this.wl)return!1;let k=hr(this.Ko,v);try{x=rr(JSON.parse(v))}catch(m){return!1}if((rd.Ot(this.Ko)||void 0)!==v)return!1;this._l=k,this.wl=v;let E=ur(this.Ko,v),T=[...rg,...E.properties],K={};if(Object.keys(x).forEach(m=>{let g=x[m];(O(g)||A(g)||""===g||"$user_state"===m&&"anonymous"!==g&&"identified"!==g)&&(K[m]=!0,delete x[m])}),R(x))return!1;let et="distinct_id"in x||"anonymous"===x.$user_state||"identified"===x.$user_state,en=this.props,er=en[t8],ei=en[nz],es=On({},en);[...rg,...m.cookie_persisted_properties||[]].forEach(m=>{if(-1!==T.indexOf(m)&&!(m in x)&&!K[m]&&(et||"distinct_id"!==m&&"$user_state"!==m)){let g=es[m];(E.isValid||-1===rg.indexOf(m)||!1!==g&&0!==g)&&delete es[m]}}),this.props=On(es,x),rX.forEach(m=>{let g=m in this.props;m in en===g&&Vo(en[m],this.props[m])||(g?this.ml(m,en[m],this.props[m]):this.sl(m,!0))}),!et||"$user_state"in x||"$user_state"in this.props||this.dl(nz,n1);let el=this.props[t8],ec=this.props[nz];return et&&(el!==er||ec!==ei)&&(this.Wo=!0,this.Bo=!0,r_.At(Bo(this.Ko),!0),this.vl(nI),this.vl(nw),this.vl(n_),this.vl(nC),this.vl(nk),this.vl(nE),this.vl(nU),this.vl(n$),this.vl(nZ),"anonymous"!==ec||"identified"!==ei&&"anonymous"!==x.$user_state&&(O(er)||el===er)||(Go(this.props,x),this.vl(nP)),"identified"===ec?this.props.$user_id=el:delete this.props.$user_id,this.vl(nn)),!0}
7consumeCookieIdentityChange(){let m=Bo(this.Ko),g=this.Bo||!!r_.Ot(m);return this.Bo=!1,g&&r_.Lt(m),g}Sl(m=!1){return!(this.Ho||this.pi&&!m||!this.Sr.cookieWinsOnConflict||"localstorage+cookie"!==this.Sr.persistence.toLowerCase()||(this.Ho=!0,0))}xl(){this.Ho&&(O(this.Cl)||(clearTimeout(this.Cl),this.Cl=void 0),delete this.Lo[rY],this.$l(!0))}Tl(m=!0){if(this.Ho)try{m?this.xl():O(this.Cl)||(clearTimeout(this.Cl),this.Cl=void 0)}finally{this.Ho=!1}}isDisabled(){return!!this.pi}Yo(m){-1===rQ.indexOf(m.persistence.toLowerCase())&&(t5.critical("Unknown persistence type "+m.persistence+"; falling back to localStorage+cookie"),m.persistence="localStorage+cookie");let g=((m=[],g=!1)=>{let v=[...rg,...m];return wi(wi({},rm),{},{Dt(m){try{let k,E,T={};try{T=(E=rd.Ot(m)||void 0)?rr(JSON.parse(E)):{}}catch(m){}let K=JSON.parse(rm.Ot(m)||"{}");if(g){let g=ur(m,E),et=[...rg,...g.properties],en={};Object.keys(T).forEach(m=>{let g=T[m];A(g)||""===g||"$user_state"===m&&"anonymous"!==g&&"identified"!==g||(en[m]=g)});let er="distinct_id"in en||"anonymous"===en.$user_state||"identified"===en.$user_state;if(Object.keys(en).length>0){var x;let m=K[t8],k=null!==(x=K.$user_state)&&void 0!==x?x:n1;v.forEach(m=>{if(-1!==et.indexOf(m)&&!(m in T)&&(er||"distinct_id"!==m&&"$user_state"!==m)){let v=K[m];(g.isValid||-1===rg.indexOf(m)||!1!==v&&0!==v)&&delete K[m]}}),!er||"$user_state"in T||"$user_state"in K||(K[nz]=n1),er&&(("distinct_id"in en?en[t8]:K[t8])!==m||("$user_state"in en?en[nz]:K[nz])!==k)&&(rf.forEach(m=>delete K[m]),"identified"===en.$user_state&&"distinct_id"in en?K.$user_id=en[t8]:delete K.$user_id,"identified"!==en.$user_state&&(delete K[nT],delete K[nP]),delete K.__alias)}k=On(K,en)}else k=On(T,K);return rm.At(m,k),k}catch(m){}return null},At(v,x,k,E,T,K){let et=rm.At(v,x,void 0,void 0,K);try{let en=or(x,m);if(Object.keys(en).length){if(g){let g=sr(v),er=ar(en,m);if(rd.At(g,er,k,E,T,K),rd.Ot(g)!==JSON.stringify(er)){rd.Lt(g,E);let m=or(x);return rd.At(v,m,k,E,T,K),et}}rd.At(v,en,k,E,T,K)}}catch(m){rm.Pt(m)}return et},Lt(m,g){try{null==et||et.localStorage.removeItem(m),rd.Lt(m,g),rd.Lt(sr(m),g)}catch(m){rm.Pt(m)}}})})(m.cookie_persisted_properties||[],m.cookieWinsOnConflict),v,x=!1,k=!1,E=m.persistence.toLowerCase();return"localstorage"===E&&rm.Et()?(v=rm,k=!0):"localstorage+cookie"===E&&g.Et()?(v=g,k=!0,x=!0):"sessionstorage"===E&&r_.Et()?v=r_:"memory"===E?v=rb:"cookie"===E&&rd.Et()?(v=rd,x=!0):g.Et()?(v=g,k=!0,x=!0):rd.Et()?(v=rd,x=!0):v=rb,this.No=k,this.qo=x,v}il(m){return`${this.Ko}__${m}`}Xo(m){return this.No&&!!m.split_storage}properties(){let m={};return Rn(this.props,(g,v)=>{let x=po(v);if(!x||"event"===x.exposure){var k;if(null==x||null===(k=x.shouldSkipFromEventProperties)||void 0===k?void 0:k.call(x,g))return;m[v]=g}}),m}load(m=!1){if(this.pi&&!m)return;let g=this.Sr.cookieWinsOnConflict&&"localstorage+cookie"===this.Sr.persistence.toLowerCase(),v=g?rm.Dt(this.Ko):null,x={};if(g)try{x=rr(rd.Dt(this.Ko)),Rn(x,(m,g)=>{(O(m)||A(m)||""===m)&&delete x[g]})}catch(m){}let k=this.$o.Dt(this.Ko);if(k&&(this.props=On({},k)),this.jo&&this.Il(),g&&k){var E,T;let m=null==v?void 0:v[t8],g=null!==(E=null==v?void 0:v.$user_state)&&void 0!==E?E:n1,K=k[t8],et=null!==(T=k.$user_state)&&void 0!==T?T:n1;if(K!==m||et!==g){this.Bo=!0,r_.At(Bo(this.Ko),!0);let v=On({},this.props);rf.forEach(m=>delete v[m]),"anonymous"!==et||"identified"!==g&&"anonymous"!==x.$user_state&&(O(m)||K===m)||(Go(v,x),delete v[nP]),this.props=v;let k=new Set;rf.forEach(m=>{var g;let v=null===(g=po(m))||void 0===g?void 0:g.storageGroup;v&&k.add(v)}),k.forEach(m=>{let g={};Rn(this.props,(v,x)=>{var k;(null===(k=po(x))||void 0===k?void 0:k.storageGroup)===m&&(g[x]=v)}),R(g)?(rm.Lt(this.il(m)),this.Lo[m]={}):rm.At(this.il(m),g)&&(this.Lo[m]={persisted:!0,fingerprint:this.hl(g,m)})})}}r_.Ot(Bo(this.Ko))&&(this.Bo=!0)}Il(){for(let m of r$){let g=rm.Dt(this.il(m));if(g&&!R(g)){let v=this.rl(m);v.persisted=!0,this.Ml(m)||(v.fingerprint=this.hl(g,m)),this.El(m,g)||On(this.props,g)}}}Ml(m){return Object.keys(this.props).some(g=>{var v;return(null===(v=po(g))||void 0===v?void 0:v.storageGroup)===m})}El(m,g){let v=rG[m];if(!v)return!1;let x=g[v],k=this.props[v];return D(x)&&D(k)&&k>x}refreshKey(m){var g;if(this.pi||"$fbc_persistence"===m&&this.Go)return;let v=this.jo?null===(g=po(m))||void 0===g?void 0:g.storageGroup:void 0,x=v?rm.Dt(this.il(v)):this.$o.Dt(this.Ko);if(x&&m in x)this.dl(m,x[m],!1);else{if(v){let g=this.$o.Dt(this.Ko);if(g&&m in g)return void this.dl(m,g[m],!1)}this.vl(m,!1)}}save(){if(this.pi)return;let m=this.yl();m>0?O(this.Cl)&&(this.Cl=setTimeout(()=>{this.Cl=void 0,this.$l()},m)):this.$l()}flush(){O(this.Cl)||(clearTimeout(this.Cl),this.Cl=void 0,this.$l())}$l(m=!1){if(this.pi||this.Ho&&!m)return;m||(this.syncCookieProperties(),this.Go||this.Sr.cookieWinsOnConflict&&"localstorage+cookie"===this.Sr.persistence.toLowerCase()||this.refreshKey(ni));let g=!m&&!this.Uo;g||(this.Vo=!1);let v=!!g&&this.fl();if(this.Vo)return void(this.Sr.debug&&t5.warn("skipping persistence write because storage belongs to a different distinct ID"));
7if(this.jo)return this.Pl(),void(v&&this.Zo.forEach(m=>m()));let x=this.Rl(this.$o,this.Ko,this.props,rY);"written"===x&&this.bl(this.props),"failed"!==x&&(this.zo.clear(),this.Wo=!1,this.Go=!1),v&&this.Zo.forEach(m=>m())}Pl(){let{main:m,groups:g}=this.al(),v=this.Rl(this.$o,this.Ko,m,rY);for(let k of("written"===v&&this.bl(m),"failed"!==v&&(this.Wo=!1,this.Go=!1,rX.forEach(m=>{var g;(null===(g=po(m))||void 0===g?void 0:g.storageGroup)||this.zo.delete(m)})),r$)){var x;let m=g[k];if(R(m)&&!(null===(x=this.Lo[k])||void 0===x?void 0:x.persisted)){rX.forEach(m=>{var g;(null===(g=po(m))||void 0===g?void 0:g.storageGroup)===k&&this.zo.delete(m)});continue}let v=this.Rl(rm,this.il(k),m,k);"failed"!==v&&rX.forEach(m=>{let g=po(m);(null==g?void 0:g.storageGroup)!==k||"written"!==v&&g.volatile||this.zo.delete(m)})}}al(){let m={},g={flags:{},surveys:{}};return Rn(this.props,(v,x)=>{var k;let E=null===(k=po(x))||void 0===k?void 0:k.storageGroup;E?g[E][x]=v:m[x]=v}),{main:m,groups:g}}hl(m,g){if(g===rY)return JSON.stringify(m)+"|"+this.Al+"|"+this.Fl+"|"+this.Ol;let v={};return Rn(m,(m,g)=>{var x;v[g]=(null===(x=po(g))||void 0===x?void 0:x.volatile)?"__volatile__":m}),JSON.stringify(v)}Rl(m,g,v,x){let k;let E=this.rl(x);if(x!==rY&&!E.dirty&&!O(E.fingerprint))return"skipped";try{if((k=this.hl(v,x))===E.fingerprint)return E.dirty=!1,"skipped"}catch(m){k=void 0}return m.At(g,v,this.Al,this.Fl,this.Ol,this.Sr.debug)?(E.dirty=!1,x!==rY&&(E.persisted=!0),O(k)||(E.fingerprint=k),this.No&&(E.storageValue=rm.Ot(g)),"written"):(this.Sr.debug&&t5.warn(`failed to persist storage entry "${g}"; will retry on next save`),"failed")}remove({keepGroupEntries:m=!1}={}){if(this.gl(),O(this.Cl)||(clearTimeout(this.Cl),this.Cl=void 0),this.$o.Lt(this.Ko,!1),this.$o.Lt(this.Ko,!0),!m&&this.Qo)for(let m of r$)rm.Lt(this.il(m));m?delete this.Lo[rY]:this.Lo={},this._l=void 0,this.wl=void 0}clear(){this.remove(),this.props={}}register_once(m,g,v){if(C(m)){this.syncCookieProperties(),O(g)&&(g="None"),this.Al=O(v)?this.Dl:v;let x=!1;if(Rn(m,(m,v)=>{this.props.hasOwnProperty(v)&&this.props[v]!==g||(this.dl(v,m),x=!0)}),x)return this.save(),!0}return!1}register(m,g){if(C(m)){this.syncCookieProperties(),this.Al=O(g)?this.Dl:g;let v=!1;if(Rn(m,(g,x)=>{m.hasOwnProperty(x)&&(this.props[x]!==g||C(g)||ej(g))&&(this.dl(x,g),v=!0)}),v)return this.save(),!0}return!1}unregister(m){this.syncCookieProperties();let g=!1;for(let v of"string"==typeof m?[m]:m)v in this.props&&(this.vl(v),g=!0);g&&this.save()}update_campaign_params(){let m=null==ei?void 0:ei.URL;if(m===this.Jo)return;let g=To(this.Sr.custom_campaign_params,this.Sr.mask_personal_data_properties,this.Sr.custom_personal_data_properties),v=!R(Mn(g));return v&&this.register(g),this.Jo=m,v?g:void 0}update_search_keyword(){this.register(function(){let m=null==ei?void 0:ei.referrer;return m?Co(m):{}}())}update_referrer_info(){var m;this.register_once({$referrer:Fo(),$referring_domain:(null==ei?void 0:ei.referrer)&&(null===(m=go(ei.referrer))||void 0===m?void 0:m.host)||rK},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;let m=Ao(this.Sr.mask_personal_data_properties,this.Sr.custom_personal_data_properties,this.Sr.disable_capture_url_hashes);this.register_once({[nW]:this.qo?{r:Uo(m.r),u:m.u?Uo(m.u):void 0}:m},void 0)}get_initial_props(){let m={};Rn([nH,nq],g=>{let v=this.props[g];v&&Rn(v,function(g,v){m["$initial_"+w(v)]=g})});let g=this.props[nW];if(g){let v=function(m,g=!1){let v=Mo(m,g),x={};return Rn(v,function(m,g){x[`$initial_${w(g)}`]=m}),x}(g,this.Sr.disable_capture_url_hashes);On(m,v)}return m}safe_merge(m){return Rn(this.props,function(g,v){v in m||(m[v]=g)}),m}update_config(m,g,v){let x=m.persistence!==g.persistence,k=!((m,g)=>{if(m.length!==g.length)return!1;let v=[...m].sort(),x=[...g].sort();return v.every((m,g)=>m===x[g])})(m.cookie_persisted_properties||[],g.cookie_persisted_properties||[]),E=x||k,T=m.cookieWinsOnConflict!==g.cookieWinsOnConflict,K=m.disable_persistence||!!v,et=!!this.pi&&!K;K||this.kl(g,et),this.Sr=m,!K&&(x||k||T)&&(this._l=void 0,this.wl=void 0,this.kl(wi(wi({},m),{},{cookie_persisted_properties:g.cookie_persisted_properties}),et));let en=E||T?this.Yo(m):this.$o;this.Ll();let er=this.Xo(m),ei=E||er!==this.jo,es=!K&&(ei||m.cross_subdomain_cookie!==this.Fl||m.secure_cookie!==this.Ol)&&this.Sl(et);this.Uo=ei;try{if(this.Dl=this.Al=m.cookie_expiration,this.set_disabled(K),this.set_cross_subdomain(m.cross_subdomain_cookie),this.set_secure(m.secure_cookie),ei){let m=this.props;this.clear(),this.$o=en,this.jo=er,this.props=m,this.save()}else T&&(this.$o=en,K||(delete this.Lo[rY],this.$l()))}finally{this.Uo=!1,es&&this.Tl()}}Ll(){let m=this.props[nW];if(!this.qo||!C(m)||"string"!=typeof m.r)return;let g=Uo(m.r),v="string"==typeof m.u?Uo(m.u):m.u;g===m.r&&v===m.u||this.dl(nW,wi(wi({},m),{},{r:g,u:v}))}set_disabled(m){this.pi=m,this.pi?this.remove():this.save()}set_cross_subdomain(m){m!==this.Fl&&(this.Fl=m,this.remove({keepGroupEntries:!0}),this.save())}set_secure(m){m!==this.Ol&&(this.Ol=m,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(m,g){let v=this.props.__timers||{};v[m]=g,this.dl(na,v),this.save()}remove_event_timer(m){let g=this.props.__timers||{},v=g[m];return O(v)||(delete g[m],this.dl(na,g),this.save()),v}get_property(m){return this.props[m]}set_property(m,g){this.dl(m,g),this.save()}dl(m,g,v=!0){var x;let k=this.props[m];this.props[m]=g,v&&("distinct_id"!==m&&"$user_state"!==m||k===g||(this.Wo=!0),"$fbc_persistence"!==m||Vo(k,g)||(this.Go=!0),this.ml(m,k,g),(null===(x=po(m))||void 0===x?void 0:x.volatile)||this.pl(m))}vl(m,g=!0){delete this.props[m],g&&(qo(m)&&this.sl(m,!0),"$fbc_persistence"===m&&(this.Go=!0),this.pl(m))}pl(m){var g;let v=null===(g=po(m))||void 0===g?void 0:g.storageGroup;v&&(this.rl(v).dirty=!0)}rl(m){return this.Lo[m]||(this.Lo[m]={})}};let r0={GZipJS:"gzip-js",Base64:"base64"},r1={Activation:"events",Cancellation:"cancelEvents"},r2={Popover:"popover",API:"api",Widget:"widget"},r3={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},r5={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},r4={Popover:"popover",Inline:"inline"};function ll(m){let g=!0;return{dispose(){if(g){g=!1;let v=m();v&&P(v.then)&&v.then(void 0,()=>{})}}}}let r6={SHOWN:"product tour shown"},r7={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},r8=t4("[RateLimiter]");var r9=class{constructor(m){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=m=>{let g=m.text;
vendor: 9,574 bytes, line 7
7if(g&&g.length)try{(JSON.parse(g).quota_limited||[]).forEach(m=>{r8.info(`${m||"events"} is quota limited.`),this.serverLimits[m]=(new Date).getTime()+6e4})}catch(m){return void r8.warn(`could not rate limit - continuing. Error: "${null==m?void 0:m.message}"`,{text:g})}},this.instance=m,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var m;return(null===(m=this.instance.config.rate_limiting)||void 0===m?void 0:m.events_per_second)||10}get captureEventsBurstLimit(){var m;return Math.max((null===(m=this.instance.config.rate_limiting)||void 0===m?void 0:m.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(m=!1){var g,v,x;let{captureEventsBurstLimit:k,captureEventsPerSecond:E}=this,T=(new Date).getTime(),K=null!==(g=null===(v=this.instance.persistence)||void 0===v?void 0:v.get_property("$capture_rate_limit"))&&void 0!==g?g:{tokens:k,last:T};K.tokens+=(T-K.last)/1e3*E,K.last=T,K.tokens>k&&(K.tokens=k);let et=1>K.tokens;if(et||m||(K.tokens=Math.max(0,K.tokens-1)),et&&!m){let m=(D(K.dropped)?K.dropped:0)+1;K.dropped=m,!this.lastEventRateLimited&&this.Nl(m)&&(K.dropped=0)}return this.lastEventRateLimited=et,null===(x=this.instance.persistence)||void 0===x||x.set_property("$capture_rate_limit",K),{isRateLimited:et,remainingTokens:K.tokens}}ql(m){let g=this.instance.config.property_denylist;return!ej(g)||!g.includes(m)}jl(){var m;if(this.ql("$current_url")&&this.ql("$pathname")&&(null==es?void 0:es.pathname))return`${null!==(m=es.origin)&&void 0!==m?m:""}${es.pathname}`}Nl(m){var g,v;let{captureEventsBurstLimit:x,captureEventsPerSecond:k}=this,E=this.jl(),T=this.ql("$session_id")?null===(g=(v=this.instance).get_session_id)||void 0===g?void 0:g.call(v):void 0,K=[`${m} event(s) dropped since the last warning`,E?`triggered on ${E}`:void 0,T?`session ${T}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${K}. Config is set to ${k} events per second and ${x} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(m){let g=this.serverLimits[m||"events"]||!1;return!1!==g&&(new Date).getTime()<g}};let it=t4("[RemoteConfig]");var ir=class{constructor(m){this._instance=m}get remoteConfig(){var m;return null===(m=ef._POSTHOG_REMOTE_CONFIG)||void 0===m||null===(m=m[this._instance.config.token])||void 0===m?void 0:m.config}Bl(m){var g,v,x;(null===(g=ef.__PosthogExtensions__)||void 0===g?void 0:g.loadExternalDependency)?null===(v=ef.__PosthogExtensions__)||void 0===v||null===(x=v.loadExternalDependency)||void 0===x||x.call(v,this._instance,"remote-config",()=>m(this.remoteConfig)):m()}Hl(m){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:m})}load(){try{if(this.remoteConfig)return it.info("Using preloaded remote config",this.remoteConfig),void this.zl(this.remoteConfig);if(this._instance.Ul())return void it.warn("Remote config is disabled. Falling back to local config.");this.Bl(m=>{if(!m)return it.info("No config found after loading remote JS config. Falling back to JSON."),void this.Hl(m=>{this.zl(m.json,m)});this.zl(m)})}catch(m){it.error("Error loading remote config",m),this.zl()}}zl(m,g){!m&&g&&(0===g.statusCode?g.error||it.warn("Failed to fetch remote config from PostHog."):it.error("Failed to fetch remote config from PostHog."));try{this._instance.zl(m?{ok:!0,config:m}:{ok:!1})}catch(m){it.error("Error applying remote config",m)}if(!1!==(null==m?void 0:m.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var v;null===(v=this._instance.featureFlags)||void 0===v||v.ensureFlagsLoaded()}catch(m){it.error("Error loading feature flags",m)}}},is=Uint8Array,io=Uint16Array,il=Uint32Array,ic=new is([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),iu=new is([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),id=new is([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$l=function(m,g){for(var v=new io(31),x=0;31>x;++x)v[x]=g+=1<<m[x-1];var k=new il(v[30]);for(x=1;30>x;++x)for(var E=v[x];v[x+1]>E;++E)k[E]=E-v[x]<<5|x;return[v,k]},ip=$l(ic,2),im=ip[1];ip[0][28]=258,im[258]=28;for(var ih=$l(iu,0)[1],ig=new io(32768),iv=0;32768>iv;++iv){var iy=(43690&iv)>>>1|(21845&iv)<<1;ig[iv]=((65280&(iy=(61680&(iy=(52428&iy)>>>2|(13107&iy)<<2))>>>4|(3855&iy)<<4))>>>8|(255&iy)<<8)>>>1}var Cl=function(m,g,v){for(var x=m.length,k=0,E=new io(g);x>k;++k)++E[m[k]-1];var T,K=new io(g);for(k=0;g>k;++k)K[k]=K[k-1]+E[k-1]<<1;if(v){T=new io(1<<g);var et=15-g;for(k=0;x>k;++k)if(m[k])for(var en=k<<4|m[k],er=g-m[k],ei=K[m[k]-1]++<<er,es=ei|(1<<er)-1;es>=ei;++ei)T[ig[ei]>>>et]=en}else for(T=new io(x),k=0;x>k;++k)T[k]=ig[K[m[k]-1]++]>>>15-m[k];return T},ib=new is(288);for(iv=0;144>iv;++iv)ib[iv]=8;for(iv=144;256>iv;++iv)ib[iv]=9;for(iv=256;280>iv;++iv)ib[iv]=7;for(iv=280;288>iv;++iv)ib[iv]=8;var ix=new is(32);for(iv=0;32>iv;++iv)ix[iv]=5;var i_=Cl(ib,9,0),iw=Cl(ix,5,0),Al=function(m){return(m/8|0)+(7&m&&1)},Ml=function(m,g,v){(null==g||0>g)&&(g=0),(null==v||v>m.length)&&(v=m.length);var x=new(m instanceof io?io:m instanceof il?il:is)(v-g);return x.set(m.subarray(g,v)),x},Dl=function(m,g,v){var x=g/8|0;m[x]|=v<<=7&g,m[x+1]|=v>>>8},Nl=function(m,g,v){var x=g/8|0;m[x]|=v<<=7&g,m[x+1]|=v>>>8,m[x+2]|=v>>>16},jl=function(m,g){for(var v=[],x=0;m.length>x;++x)m[x]&&v.push({s:x,f:m[x]});var k=v.length,E=v.slice();if(!k)return[new is(0),0];if(1==k){var T=new is(v[0].s+1);return T[v[0].s]=1,[T,1]}v.sort(function(m,g){return m.f-g.f}),v.push({s:-1,f:25001});var K=v[0],et=v[1],en=0,er=1,ei=2;for(v[0]={s:-1,f:K.f+et.f,l:K,r:et};er!=k-1;)K=v[v[ei].f>v[en].f?en++:ei++],et=v[en!=er&&v[ei].f>v[en].f?en++:ei++],v[er++]={s:-1,f:K.f+et.f,l:K,r:et};var es=E[0].s;for(x=1;k>x;++x)E[x].s>es&&(es=E[x].s);var el=new io(es+1),ec=Ll(v[er-1],el,0);if(ec>g){x=0;var eu=0,ed=ec-g,ep=1<<ed;for(E.sort(function(m,g){return el[g.s]-el[m.s]||m.f-g.f});k>x;++x){var em=E[x].s;if(g>=el[em])break;eu+=ep-(1<<ec-el[em]),el[em]=g}for(eu>>>=ed;eu>0;){var ef=E[x].s;g>el[ef]?eu-=1<<g-el[ef]++-1:++x}for(;x>=0&&eu;--x){var eh=E[x].s;el[eh]==g&&(--el[eh],++eu)}ec=g}return[new is(el),ec]},Ll=function(m,g,v){return -1==m.s?Math.max(Ll(m.l,g,v+1),Ll(m.r,g,v+1)):g[m.s]=v},Bl=function(m){for(var g=m.length;g&&!m[--g];);for(var v=new io(++g),x=0,k=m[0],E=1,o=function(m){v[x++]=m},T=1;g>=T;++T)if(m[T]==k&&T!=g)++E;else{if(!k&&E>2){for(;E>138;E-=138)o(32754);E>2&&(o(E>10?E-11<<5|28690:E-3<<5|12305),E=0)}else if(E>3){for(o(k),--E;E>6;E-=6)o(8304);E>2&&(o(E-3<<5|8208),E=0)}for(;E--;)o(k);E=1,k=m[T]}return[v.subarray(0,x),g]},Ul=function(m,g){for(var v=0,x=0;g.length>x;++x)v+=m[x]*g[x];return v},zl=function(m,g,v){var x=v.length,k=Al(g+2);m[k]=255&x,m[k+1]=x>>>8,m[k+2]=255^m[k],m[k+3]=255^m[k+1];for(var E=0;x>E;++E)m[k+E+4]=v[E];return 8*(k+4+x)},Hl=function(m,g,v,x,k,E,T,K,et,en,er){Dl(g,er++,v),++k[256];for(var ei=jl(k,15),es=ei[0],el=ei[1],ec=jl(E,15),eu=ec[0],ed=ec[1],ep=Bl(es),em=ep[0],ef=ep[1],eh=Bl(eu),eg=eh[0],ev=eh[1],ey=new io(19),eb=0;em.length>eb;++eb)ey[31&em[eb]]++;for(eb=0;eg.length>eb;++eb)ey[31&eg[eb]]++;for(var ex=jl(ey,7),e_=ex[0],ew=ex[1],eS=19;eS>4&&!e_[id[eS-1]];--eS);var eC,ek,eE,ej,eN=en+5<<3,eR=Ul(k,ib)+Ul(E,ix)+T,eI=Ul(k,es)+Ul(E,eu)+T+14+3*eS+Ul(ey,e_)+(2*ey[16]+3*ey[17]+7*ey[18]);if(eR>=eN&&eI>=eN)return zl(g,er,m.subarray(et,et+en));if(Dl(g,er,1+(eR>eI)),er+=2,eR>eI){eC=Cl(es,el,0),ek=es,eE=Cl(eu,ed,0),ej=eu;var eP=Cl(e_,ew,0);for(Dl(g,er,ef-257),Dl(g,er+5,ev-1),Dl(g,er+10,eS-4),er+=14,eb=0;eS>eb;++eb)Dl(g,er+3*eb,e_[id[eb]]);er+=3*eS;for(var eT=[em,eg],eO=0;2>eO;++eO){var eA=eT[eO];for(eb=0;eA.length>eb;++eb)Dl(g,er,eP[eM=31&eA[eb]]),er+=e_[eM],eM>15&&(Dl(g,er,eA[eb]>>>5&127),er+=eA[eb]>>>12)}}else eC=i_,ek=ib,eE=iw,ej=ix;for(eb=0;K>eb;++eb)if(x[eb]>255){Nl(g,er,eC[257+(eM=x[eb]>>>18&31)]),er+=ek[eM+257],eM>7&&(Dl(g,er,x[eb]>>>23&31),er+=ic[eM]);var eM,eD=31&x[eb];Nl(g,er,eE[eD]),er+=ej[eD],eD>3&&(Nl(g,er,x[eb]>>>5&8191),er+=iu[eD])}else Nl(g,er,eC[x[eb]]),er+=ek[x[eb]];return Nl(g,er,eC[256]),er+ek[256]},iS=new il([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),iC=new is(0),ik=function(){for(var m=new il(256),g=0;256>g;++g){for(var v=g,x=9;--x;)v=(1&v&&3988292384)^v>>>1;m[g]=v}return m}(),Gl=function(m,g,v){for(;v;++g)m[g]=v,v>>>=8};let iE=!!ec||!!el,ij="text/plain",iN=!1,Ql=(m,g)=>{let[v,x]=m.split("#"),[k,E]=v.split("?");if(!E)return m;let T=E.split("&").filter(m=>m.split("=")[0]!==g).join("&");return`${k}${T?`?${T}`:""}${x?`#${x}`:""}`},Zl=(m,g,v=!0)=>{var x;let[k,E]=m.split("?"),T=wi({},g),K=null!==(x=null==E?void 0:E.split("&").map(m=>{var g;let[x,k]=m.split("="),E=v&&null!==(g=T[x])&&void 0!==g?g:k;return delete T[x],`${x}=${E}`}))&&void 0!==x?x:[],et=function(m,g="&"){let v,x;let k=[];return Rn(m,function(m,g){O(m)||O(g)||"undefined"===g||(v=encodeURIComponent(m instanceof File?m.name:m.toString()),x=encodeURIComponent(g),k[k.length]=x+"="+v)}),k.join(g)}(T);return et&&K.push(et),K.length>0?`${k}?${K.join("&")}`:k},ta=m=>{var g,v,x,k,E,T,K,et,en,er;if(m.Wl)return m.Wl;let{data:ei,compression:es}=m;if(!ei)return;if(es===r0.GZipJS){let m=(g=function(m){var g=m.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(m);for(var v=new is(m.length+(m.length>>>1)),x=0,n=function(m){v[x++]=m},k=0;g>k;++k){if(x+5>v.length){var E=new is(x+8+(g-k<<1));E.set(v),v=E}var T=m.charCodeAt(k);128>T?n(T):(2048>T?n(192|T>>>6):(T>55295&&57344>
7T?(n(240|(T=65536+(1047552&T)|1023&m.charCodeAt(++k))>>>18),n(128|T>>>12&63)):n(224|T>>>12),n(128|T>>>6&63)),n(128|63&T))}return Ml(v,0,x)}(_o(ei)),v={mtime:0},x=4294967295,k={p(m){for(var g=x,v=0;m.length>v;++v)g=ik[255&g^m[v]]^g>>>8;x=g},d:()=>4294967295^x},E=g.length,k.p(g),en=(T=10+(v.filename&&v.filename.length+1||0),et=function(m,g,v,x,k,E){var T=m.length,K=new is(x+T+5*(1+Math.floor(T/7e3))+k),et=K.subarray(x,K.length-k),en=0;if(!g||8>T)for(var er=0;T>=er;er+=65535){var ei=er+65535;T>ei?en=zl(et,en,m.subarray(er,ei)):(et[er]=E,en=zl(et,en,m.subarray(er,T)))}else{for(var es=iS[g-1],el=es>>>13,ec=8191&es,eu=(1<<v)-1,ed=new io(32768),ep=new io(eu+1),em=Math.ceil(v/3),ef=2*em,y=function(g){return(m[g]^m[g+1]<<em^m[g+2]<<ef)&eu},eh=new il(25e3),eg=new io(288),ev=new io(32),ey=0,eb=0,ex=(er=0,0),e_=0,ew=0;T>er;++er){var eS=y(er),eC=32767&er,ek=ep[eS];if(ed[eC]=ek,ep[eS]=eC,er>=e_){var eE=T-er;if((ey>7e3||ex>24576)&&eE>423){en=Hl(m,et,0,eh,eg,ev,eb,ex,ew,er-ew,en),ex=ey=eb=0,ew=er;for(var ej=0;286>ej;++ej)eg[ej]=0;for(ej=0;30>ej;++ej)ev[ej]=0}var eN=2,eR=0,eI=ec,eP=eC-ek&32767;if(eE>
72&&eS==y(er-eP))for(var eT=Math.min(el,eE)-1,eO=Math.min(32767,er),eA=Math.min(258,eE);eO>=eP&&--eI&&eC!=ek;){if(m[er+eN]==m[er+eN-eP]){for(var eM=0;eA>eM&&m[er+eM]==m[er+eM-eP];++eM);if(eM>eN){if(eN=eM,eR=eP,eM>eT)break;var eD=Math.min(eP,eM-2),eL=0;for(ej=0;eD>ej;++ej){var eF=er-eP+ej+32768&32767,eZ=eF-ed[eF]+32768&32767;eZ>eL&&(eL=eZ,ek=eF)}}}eP+=(eC=ek)-(ek=ed[eC])+32768&32767}if(eR){eh[ex++]=268435456|im[eN]<<18|ih[eR];var eB=31&im[eN],e$=31&ih[eR];eb+=ic[eB]+iu[e$],++eg[257+eB],++ev[e$],e_=er+eN,++ey}else eh[ex++]=m[er],++eg[m[er]]}}en=Hl(m,et,E,eh,eg,ev,eb,ex,ew,er-ew,en),E||(en=zl(et,en,iC))}return Ml(K,0,x+Al(en)+k)}(g,null==v.level?6:v.level,null==v.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(g.length)))):12+v.mem,T,8,!K)).length,function(m,g){var v=g.filename;if(m[0]=31,m[1]=139,m[2]=8,m[8]=2>g.level?4:9==g.level?2:0,m[9]=3,0!=g.mtime&&Gl(m,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){m[3]=8;for(var x=0;v.length>=x;++x)m[x+10]=v.charCodeAt(x)}}(et,v),Gl(et,en-8,k.d()),Gl(et,en-4,E),et);return{contentType:ij,body:m.buffer.slice(m.byteOffset,m.byteOffset+m.byteLength),estimatedSize:m.byteLength}}if(es===r0.Base64){let m=(er=_o(ei))?btoa(encodeURIComponent(er).replace(/%([0-9A-F]{2})/g,(m,g)=>String.fromCharCode(parseInt(g,16)))):er,g="data="+encodeURIComponent("string"==typeof m?m:_o(m));return{contentType:"application/x-www-form-urlencoded",body:g,estimatedSize:new Blob([g]).size}}let el=_o(ei);return{contentType:"application/json",body:el,estimatedSize:new Blob([el]).size}},ia=m=>{var g;let v;let i=()=>"sendBeacon"===m.transport?{url:Zl(m.url,{compression:r0.Base64}),encodedBody:ta(wi(wi({},m),{},{compression:r0.Base64,Wl:void 0}))}:{url:Ql(m.url,"compression"),encodedBody:ta(wi(wi({},m),{},{compression:void 0,Wl:void 0}))};try{v=ta(m)}catch(g){if(he(m.compression,mo(m.url,"compression")))return t5.error("Failed to gzip request body, sending uncompressed payload",g),i();throw g}return!(v&&he(m.compression,mo(m.url,"compression")))||((g=v.body)instanceof ArrayBuffer?ue(new Uint8Array(g)):ArrayBuffer.isView(g)&&ue(new Uint8Array(g.buffer,g.byteOffset,g.byteLength)))?{url:m.url,encodedBody:v}:(iN=!0,i())},ea=m=>{try{return ia(m)}catch(v){var g;return t5.error(v),void(null===(g=m.callback)||void 0===g||g.call(m,{statusCode:0,error:v}))}},iR=(eg=Y(function*(m){let g=yield function(m){return _e.apply(this,arguments)}(_o(m.data),eh.DEBUG,{rethrow:!0});if(!g)return m;let v=yield g.arrayBuffer();return wi(wi({},m),{},{Wl:{contentType:ij,body:v,estimatedSize:v.byteLength}})}),function(m){return eg.apply(this,arguments)}),iI=/Failed to fetch|NetworkError|Load failed/i,ra=m=>"TypeError"===(null==m?void 0:m.name)&&iI.test((null==m?void 0:m.message)||""),oa=m=>{let g=ea(m);if(!g)return;let v=new ec,{url:x,encodedBody:k}=g;v.open(m.method||"GET",x,!0);let{contentType:E,body:T}=null!=k?k:{};Rn(m.headers,function(m,g){v.setRequestHeader(g,m)}),E&&v.setRequestHeader("Content-Type",E),m.timeout&&(v.timeout=m.timeout),v.onreadystatechange=()=>{if(4===v.readyState){var g;let x={statusCode:v.status,text:v.responseText};if(200===v.status)try{x.json=JSON.parse(v.responseText)}catch(m){}null===(g=m.callback)||void 0===g||g.call(m,x)}},v.send(T)},la=m=>{let g=ea(m);if(!g)return;let{url:v,encodedBody:x}=g,{contentType:k,body:E,estimatedSize:T}=null!=x?x:{},K=new Headers;Rn(m.headers,function(m,g){K.append(g,m)}),k&&K.append("Content-Type",k);let et=null,en=!1;if(eu){let g=new eu;et={signal:g.signal,timeout:setTimeout(()=>{var v;en=!0,g.abort(ui("AbortError","PostHog request timed out"+((v=m.timeout)?` after ${v}ms`:"")))},m.timeout)}}let c=g=>{var v;en&&"AbortError"===(null==g?void 0:g.name)||ra(g)?t5.warn(g):t5.error(g),null===(v=m.callback)||void 0===v||v.call(m,{statusCode:0,error:g})};try{el(v,wi({method:(null==m?void 0:m.method)||"GET",headers:K,keepalive:"POST"===m.method&&!m.Vl&&52428.8>(T||0),body:E,signal:null==et?void 0:et.signal},m.fetchOptions)).then(g=>g.text().then(v=>{var x;let k={statusCode:g.status,text:v};if(200===g.status)try{k.json=JSON.parse(v)}catch(m){t5.error(m)}null===(x=m.callback)||void 0===x||x.call(m,k)})).catch(c).finally(()=>et?clearTimeout(et.timeout):null)}catch(m){et&&clearTimeout(et.timeout),c(m)}},aa=m=>{try{var g;let{url:v,encodedBody:x}=ia(m),{contentType:k,body:E,estimatedSize:T}=null!=x?x:{};if(!E)return;let K=E instanceof Blob?E:new Blob([E],{type:k}
7);if(er.sendBeacon(v,K))return;let et=ej(m.data)?m.data:null===(g=m.data)||void 0===g?void 0:g.batch;if(ej(et)&&et.length>1&&(null!=T?T:0)>16384){let g=Math.ceil(et.length/2),e=g=>ej(m.data)?g:wi(wi({},m.data),{},{batch:g});return aa(wi(wi({},m),{},{data:e(et.slice(0,g))})),void aa(wi(wi({},m),{},{data:e(et.slice(g))}))}t5.warn(`Beacon of ~${null!=T?T:0} bytes was rejected by the browser, falling back to ${el?"fetch":"XHR"}`),el?la(wi(wi({},m),{},{Vl:!0})):oa(m)}catch(m){t5.warn("Beacon send failed",m)}},ua=(m,g,v,x)=>{let k="query"===x?"POST"===g?"sent_at":"_":void 0;return Zl(v===r0.GZipJS?Ql(m,"compression"):m,wi(wi({},k?{[k]:Date.now().toString()}:{}),v===r0.GZipJS?{}:{compression:v}))},iP=(()=>{let m=[];return el&&m.push({transport:"fetch",method:la}),ec&&m.push({transport:"XHR",method:oa}),(null==er?void 0:er.sendBeacon)&&m.push({transport:"sendBeacon",method:aa}),m})();var iT=class{constructor(m,g){this.Gl=!0,this.Zl=[],this.Ql=Z((null==g?void 0:g.flush_interval_ms)||3e3,250,5e3,t5.createLogger("flush interval"),3e3),this.Jl=m}enqueue(m){this.Zl.push(m),this.Kl||this.Yl()}unload(){this.Xl();let m=this.Zl.length>0?this.ta():{},g=Object.values(m);[...g.filter(m=>0===m.url.indexOf("/e")),...g.filter(m=>0!==m.url.indexOf("/e"))].map(m=>{this.ea(wi(wi({},m),{},{transport:"sendBeacon"}))})}enable(){this.Gl=!1,this.Yl()}Yl(){this.Gl||(this.Kl=setTimeout(()=>{if(this.Xl(),this.Zl.length>0){let m=this.ta();for(let g in m){let v=m[g],x=(new Date).getTime();v.data&&ej(v.data)&&Rn(v.data,m=>{m.offset=Math.abs(m.timestamp-x),delete m.timestamp}),this.ea(v)}}},this.Ql))}ea(m){try{this.Jl(m)}catch(m){t5.error(m)}}Xl(){clearTimeout(this.Kl),this.Kl=void 0}ta(){let m={};return Rn(this.Zl,g=>{var v;let x=(g?g.batchKey:null)||g.url;O(m[x])&&(m[x]=wi(wi({},g),{},{data:[]})),null===(v=m[x].data)||void 0===v||v.push(g.data)}),this.Zl=[],m}};let iO=["retriesPerformedSoFar"];var iA=class{constructor(m){this._instance=m,this.ia=!1,this.na=3e3,this.Zl=[],this.Zl=[],this.sa=!0,this.resume()}resume(){!O(et)&&"onLine"in et.navigator&&(this.sa=et.navigator.onLine,this.ra||(this.ra=()=>{this.sa=!0,this.oa()},this.la=()=>{this.sa=!1},Ln(et,"online",this.ra),Ln(et,"offline",this.la)))}get length(){return this.Zl.length}retriableRequest(m){let{retriesPerformedSoFar:g}=m,v=ge(m,iO);N(g)&&(v.url=Zl(v.url,{retry_count:g})),this._instance._send_request(wi(wi({},v),{},{callback:m=>{var x;if(200!==m.statusCode&&(400>m.statusCode||m.statusCode>=500)){if((0===m.statusCode?3:10)>(null!=g?g:0))return void this.Is(wi({retriesPerformedSoFar:g},v));0===m.statusCode&&t5.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${null!=g?g:0} retries.`)}null===(x=v.callback)||void 0===x||x.call(v,m)}}))}Is(m){let g=m.retriesPerformedSoFar||0;m.retriesPerformedSoFar=g+1;let v=function(m){let g=3e3*Math.pow(2,m),v=Math.min(18e5,g),x=(Math.random()-.5)*(v-g/2);return Math.ceil(v+x)}(g),x=Date.now()+v;this.Zl.push({retryAt:x,requestOptions:m});let k=`Enqueued failed request for retry in ${v}`;navigator.onLine||(k+=" (Browser is offline)"),t5.warn(k),this.ia||(this.ia=!0,this.aa())}aa(){if(this.ua&&clearTimeout(this.ua),0===this.Zl.length)return this.ia=!1,void(this.ua=void 0);this.ua=setTimeout(()=>{this.sa&&this.Zl.length>0&&this.oa(),this.aa()},this.na)}oa(){let m=Date.now(),g=[],v=this.Zl.filter(v=>m>v.retryAt||(g.push(v),!1));if(this.Zl=g,v.length>0)for(let{requestOptions:m}of v)this.retriableRequest(m)}unload(){for(let{requestOptions:m}of(this.ua&&(clearTimeout(this.ua),this.ua=void 0),this.ia=!1,O(et)||(this.ra&&(et.removeEventListener("online",this.ra),this.ra=void 0),this.la&&(et.removeEventListener("offline",this.la),this.la=void 0)),this.Zl))try{this._instance._send_request(wi(wi({},m),{},{transport:"sendBeacon"}))}catch(m){t5.error(m)}this.Zl=[]}},iM=class{constructor(m){this._instance=m,this.ha=()=>{var m,g,v,x;this.ca||(this.ca={});let k=this.scrollElement(),E=this.scrollY(),T=k?Math.max(0,k.scrollHeight-k.clientHeight):0,K=E+((null==k?void 0:k.clientHeight)||0),et=(null==k?void 0:k.scrollHeight)||0;this.ca.lastScrollY=Math.ceil(E),this.ca.maxScrollY=Math.max(E,null!==(m=this.ca.maxScrollY)&&void 0!==m?m:0),this.ca.maxScrollHeight=Math.max(T,null!==(g=this.ca.maxScrollHeight)&&void 0!==g?g:0),this.ca.lastContentY=K,this.ca.maxContentY=Math.max(K,null!==(v=this.ca.maxContentY)&&void 0!==v?v:0),this.ca.maxContentHeight=Math.max(et,null!==(x=this.ca.maxContentHeight)&&void 0!==x?x:0)}}get da(){return this._instance.config.scroll_root_selector}getContext(){return this.ca}resetContext(){let m=this.ca;return setTimeout(this.ha,0),m}startMeasuringScrollPosition(){Ln(et,"scroll",this.ha,{capture:!0}),Ln(et,"scrollend",this.ha,{capture:!0}),Ln(et,"resize",this.ha)}scrollElement(){var m,g;if(this.da){let g=ej(this.da)?this.da:[this.da];for(let v of g){let g=null==et||null===(m=et.document)||void 0===m?void 0:m.querySelector(v);
7if(g)return g}return}return null==et||null===(g=et.document)||void 0===g?void 0:g.documentElement}va(m){var g,v;if(this.da){let g=this.scrollElement();return g&&g["y"===m?"scrollTop":"scrollLeft"]||0}return et?"y"===m?et.scrollY||et.pageYOffset||(null===(g=et.document)||void 0===g||null===(g=g.documentElement)||void 0===g?void 0:g.scrollTop)||0:et.scrollX||et.pageXOffset||(null===(v=et.document)||void 0===v||null===(v=v.documentElement)||void 0===v?void 0:v.scrollLeft)||0:0}scrollY(){return this.va("y")}scrollX(){return this.va("x")}};let pa=m=>Ao(null==m?void 0:m.config.mask_personal_data_properties,null==m?void 0:m.config.custom_personal_data_properties,null==m?void 0:m.config.disable_capture_url_hashes);var iD=class{constructor(m,g,v,x){this.je=m=>{let g=this.fa();if(g&&g.sessionId===m)return;let v={sessionId:m,props:this.pa(this._instance)};this.ga.register({[nV]:v})},this._instance=m,this.ma=g,this.ga=v,this.pa=x||pa,this.ma.onSessionId(this.je)}fa(){return this.ga.props[nV]}getSetOnceProps(){var m;let g=null===(m=this.fa())||void 0===m?void 0:m.props;return g?"r"in g?Mo(g,this._instance.config.disable_capture_url_hashes):{$referring_domain:g.referringDomain,$pathname:g.initialPathName,utm_source:g.utm_source,utm_campaign:g.utm_campaign,utm_medium:g.utm_medium,utm_content:g.utm_content,utm_term:g.utm_term}:{}}getSessionProps(){let m={};return Rn(Mn(this.getSetOnceProps()),(g,v)=>{"$current_url"===v&&(v="url"),m[`$session_entry_${w(v)}`]=g}),m}},iL=class{on(m,g){return this.ya[m]||(this.ya[m]=[]),this.ya[m].push(g),()=>{this.ya[m]=this.ya[m].filter(m=>m!==g)}}emit(m,g){for(let v of this.ya[m]||[])v(g);for(let v of this.ya["*"]||[])v(m,g)}constructor(){this.ya={}}};let iF=t4("[SessionId]");var iZ=class{on(m,g){return this.ba.on(m,g)}constructor(m,g,v){var x;if(this._a=null,this.wa=null,this.ka=[],this.Sa=void 0,this.xa=!1,this.ba=new iL,this.Ca=(m,g)=>!(!N(m)||!N(g))&&Math.abs(m-g)>this.sessionTimeoutMs,!m.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===m.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Sr=m.config,this.ga=m.persistence,this.Be=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.$a=void 0,this._sessionActivityTimestamp=null,this.Ta=g||Gn,this.Ia=v||Gn;let k=this.Sr.persistence_name||this.Sr.token;if(this._sessionTimeoutMs=1e3*Z(this.Sr.session_idle_timeout_seconds||1800,60,36e3,iF.createLogger("session_idle_timeout_seconds"),1800),m.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ma(),this.Ea="ph_"+k+"_window_id",this.Pa="ph_"+k+"_primary_window_exists",this.Ra()){let m=r_.Dt(this.Ea),g=r_.Dt(this.Pa);m&&!g?this.Be=m:r_.Lt(this.Ea),r_.At(this.Pa,!0)}(null===(x=this.Sr.bootstrap)||void 0===x?void 0:x.sessionID)&&this.setBootstrapSessionId(this.Sr.bootstrap.sessionID),this.Aa()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(m){return O(this.ka)&&(this.ka=[]),this.ka.push(m),this.Xt&&m(this.Xt,this.Be),()=>{this.ka=this.ka.filter(g=>g!==m)}}Ra(){return"memory"!==this.Sr.persistence&&!this.ga.pi&&r_.Et()}Fa(m){m!==this.Be&&(this.Be=m,this.Ra()&&r_.At(this.Ea,m))}Oa(){return this.Be?this.Be:this.Ra()?r_.Dt(this.Ea):null}Da(m){let g=this._a;return!A(g)&&!A(m)&&5e3>Math.abs(m-g)}La(m,g,v){let x=g!==this._sessionActivityTimestamp,k=!(m!==this.Xt||v!==this._sessionStartTimestamp);this._sessionStartTimestamp=v,this._sessionActivityTimestamp=g,this.Xt=m,k&&!x||k&&this.Da(g)||(this._a=g,this.ga.register({[nb]:[g,m,v]}))}Na(){var m;let g=null===(m=this.Sr)||void 0===m?void 0:m.persistence_save_debounce_ms;return N(g)&&g>0}qa(){this.Na()?this.ga.refreshKey(nb):(this.ga.flush(),this.ga.load())}ja(){var m;if(A(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this._a)return;this.qa();let[,g,v]=this.Ba();g===this.Xt&&v===this._sessionStartTimestamp&&(this._a=this._sessionActivityTimestamp,this.ga.register({[nb]:[this._sessionActivityTimestamp,null!==(m=this.Xt)&&void 0!==m?m:null,this._sessionStartTimestamp]}),this.ga.flush())}Ha(){let[m]=this.Ba(),g=N(m)?m:0,v=N(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(g,v)}za(m){return this.qa(),this.Ca(m,this.Ha())}Ba(){let m=this.ga.props[nb];return ej(m)&&2===m.length&&m.push(m[0]),m||[0,null,0]}resetSessionId(){this._a=null,this.$a=void 0,clearTimeout(this.Ua),this.Ua=void 0,this.La(null,null,null)}setBootstrapSessionId(m,g=!1){let v=((m,g=(new Date).getTime())=>{try{let v=(m=>{let g=m.replace(/-/g,"");if(32!==g.length)throw Error("Not a valid UUID");if("7"!==g[12])throw Error("Not a UUIDv7");return parseInt(g.substring(0,12),16)})(m);return v>g+6e4?void iF.error("Bootstrap sessionID cannot be in the future"):v}catch(m){return void iF.error("Invalid sessionID in bootstrap",m)}})(m);
7return!O(v)&&(g?this.$a={sessionId:m,sessionStartTimestamp:v}:this.La(m,(new Date).getTime(),v),!0)}destroy(){this.xa=!0,this.ja(),clearTimeout(this.Ua),this.Ua=void 0,this.Sa&&et&&(et.removeEventListener(n4,this.Sa,{capture:!1}),this.Sa=void 0),this.ka=[]}Aa(){this.Sa=()=>{this.ja(),this.Ra()&&r_.Lt(this.Pa)},Ln(et,n4,this.Sa,{capture:!1})}checkAndGetSessionAndWindowId(m=!1,g=null,v=!1){if("always"===this.Sr.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');let x=g||(new Date).getTime(),k=this.Xt;if(v)this.wa=x;else if(A(this.wa)||this.wa>x||x-this.wa>=1e3){var E,T;null===(E=(T=this.ga).syncCookieProperties)||void 0===E||E.call(T),this.wa=x}let[,K,et]=this.Ba(),en=!O(k)&&K!==k,er=this.Ha(),ei=this.Oa(),es=this.$a,el=!!es&&(es.sessionStartTimestamp>x+6e4||x-es.sessionStartTimestamp>864e5),ec=es?el:N(et)&&Math.abs(x-et)>864e5,eu=!1,ed=en,ep=!K||!!es,em=K,ef=!ep&&!m&&this.Ca(x,er);if(ef&&((ef=this.za(x))||iF.info("cross-tab refresh kept the session alive",{sessionId:K}),[,K,et]=this.Ba()),ep||ef||ec){ed=!1;let m=es&&!el;K=m?es.sessionId:this.Ta(),ei=this.Ia(),iF.info("new session ID assigned",{sessionId:K,windowId:ei,bootstrapped:!!m,changeReason:{noSessionId:ep,activityTimeout:ef,sessionPastMaximumLength:ec}}),et=m?es.sessionStartTimestamp:x,this.$a=void 0,eu=!0}else ei||(ei=this.Ia(),eu=!0),(ed=ed||K!==em)&&(iF.info("adopted cross-tab session id",{sessionId:K,windowId:ei}),eu=!0);let eh=N(er)&&m&&!ec?er:x,eg=N(et)?et:(new Date).getTime();this.Fa(ei),this.La(K,eh,eg),m||this.Ma();let ev={noSessionId:ep,activityTimeout:ef,sessionPastMaximumLength:ec,crossTabAdoption:ed};return eu&&this.ka.forEach(m=>m(K,ei,ev)),{sessionId:K,windowId:ei,sessionStartTimestamp:eg,changeReason:eu?ev:void 0,lastActivityTimestamp:er}}Ma(){this.xa||(clearTimeout(this.Ua),this.Ua=setTimeout(()=>{if(!this.xa){if(this.za((new Date).getTime())){let m=this.Xt;this.resetSessionId(),this.ba.emit("forcedIdleReset",{idleSessionId:m})}else this.Ma()}},1.1*this.sessionTimeoutMs))}};let wa=function(m,g){if(!m)return!1;let v=m.userAgent;if(v&&Q(v,g))return!0;try{let v=null==m?void 0:m.userAgentData;if((null==v?void 0:v.brands)&&v.brands.some(m=>Q(null==m?void 0:m.brand,g)))return!0}catch(m){}return!!m.webdriver};function $a(){return($a=Y(function*(){let m=null==er?void 0:er.userAgentData;if(null==m?void 0:m.getHighEntropyValues)try{let g=yield m.getHighEntropyValues(["model"]),v=null==g?void 0:g.model;return I(v)&&v.length>0?v:void 0}catch(m){return void t5.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",m)}})).apply(this,arguments)}function xa(m){var g;return!!(null===(g=m.conditions)||void 0===g||null===(g=g.events)||void 0===g||null===(g=g.values)||void 0===g?void 0:g.length)}let Ea=(m,g)=>{if(!(m=>{try{new RegExp(m)}catch(m){return!1}return!0})(g))return!1;try{return new RegExp(g).test(m)}catch(m){return!1}},ka=m=>m.toLowerCase(),iB={exact:(m,g)=>g.some(g=>m.some(m=>g===m)),is_not:(m,g)=>g.every(g=>m.every(m=>g!==m)),regex:(m,g)=>g.some(g=>m.some(m=>Ea(g,m))),not_regex:(m,g)=>g.every(g=>m.every(m=>!Ea(g,m))),icontains:(m,g)=>g.map(ka).some(g=>m.map(ka).some(m=>g.includes(m))),not_icontains:(m,g)=>g.map(ka).every(g=>m.map(ka).every(m=>!g.includes(m))),gt:(m,g)=>g.some(g=>{let v=parseFloat(g);return!isNaN(v)&&m.some(m=>v>parseFloat(m))}),lt:(m,g)=>g.some(g=>{let v=parseFloat(g);return!isNaN(v)&&m.some(m=>v<parseFloat(m))})};function Pa(m,g){return!m||Object.entries(m).every(([m,v])=>{let x=null==g?void 0:g[m];if(null==x)return!1;let k=iB[v.operator];return!!k&&k(v.values,[String(x)])})}function Ca(m,g,v){return _o({distinct_id:m,userPropertiesToSet:g,userPropertiesToSetOnce:v})}let i$="custom",iU="i.posthog.com",iz=/^\/static\//,iV=["/s/","/e/","/i/"];var iq=class{constructor(m){this.Wa={},this.instance=m}get apiHost(){let m=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===m?"https://us.i.posthog.com":m}get flagsApiHost(){let m=this.instance.config.flags_api_host;return m?m.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var m;let g=null===(m=this.instance.config.ui_host)||void 0===m?void 0:m.replace(/\/$/,"");return g||(g=this.apiHost.replace(`.${iU}`,".posthog.com")),"https://app.posthog.com"===g?"https://us.posthog.com":g}get region(){return this.Wa[this.apiHost]||(this.Wa[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":i$),this.Wa[this.apiHost]}Va(m){if(!iz.test(m))return;let g=this.instance.config.asset_host;return"string"==typeof g&&g.trim().replace(/\/$/,"")||void 0}Ga(m){let g=go(m);return g?g.protocol+"//"+g.host+g.pathname:void 0}Za(m,g,v){if("ui"===m)return v;let x=v,k=this.instance.config.rewriteRequestPath;if(k){var E;let m=(null===(E=go(v))||void 0===E?void 0:E.href)||v;x=k(new URL(m)).toString()}if(k&&"api"===m&&iV.some(m=>0===g.indexOf(m))){let m=this.Ga(x);if(m){let g=this.apiHost,v=this.Qa;(null==v?void 0:v.apiHost)===g&&v.rewriteRequestPath===k||(v={apiHost:g,rewriteRequestPath:k,urls:new Set},this.Qa=v),v.urls.add(m)}}return x}isIngestionEndpoint(m){let g=this.Qa,v=this.Ga(m);return(null==g?void 0:g.apiHost)===this.apiHost&&g.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!v&&g.urls.has(v)}endpointFor(m,g=""){if(g&&(g="/"===g[0]?g:`/${g}`),"ui"===m)return this.Za(m,g,this.uiHost+g);if("flags"===m)return this.Za(m,g,this.flagsApiHost+g);if("assets"===m){let v=this.Va(g);if(v)return this.Za(m,g,`${v}${g}`)}if(this.region===i$)return this.Za(m,g,this.apiHost+g);let v=iU+g;switch(m){case"assets":return this.Za(m,g,`https://${this.region}-assets.${v}`);case"api":return this.Za(m,g,`https://${this.region}.${v}`)}}};let iH=t4("[Surveys]"),Da=m=>{try{let g=`seenSurvey_${m.current_iteration&&m.current_iteration>0?`${m.id}_${m.current_iteration}`:m.id}`;if(localStorage.getItem(g))return;localStorage.setItem(g,"true")}catch(m){iH.error("Failed to persist survey seen state",m)}},iW=[r2.Popover,r2.Widget,r2.API],iK={ignoreConditions:!1,ignoreDelay:!1,displayType:r4.Popover}
7,iG=t4("[PostHog ExternalIntegrations]"),iQ={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var iY=class{constructor(m){this._instance=m}Eo(m,g){var v,x;null===(v=ef.__PosthogExtensions__)||void 0===v||null===(x=v.loadExternalDependency)||void 0===x||x.call(v,this._instance,m,m=>{if(m)return iG.error("failed to load script",m);g()})}startIfEnabledOrStop(){var m,g,v,x;for(let[k,E]of Object.entries(null!==(m=this._instance.config.integrations)&&void 0!==m?m:{}))!E||(null===(g=ef.__PosthogExtensions__)||void 0===g||null===(g=g.integrations)||void 0===g?void 0:g[k])||this.Eo(iQ[k],()=>{var m;null===(m=ef.__PosthogExtensions__)||void 0===m||null===(m=m.integrations)||void 0===m||null===(m=m[k])||void 0===m||m.start(this._instance)}),!E&&(null===(v=ef.__PosthogExtensions__)||void 0===v||null===(v=v.integrations)||void 0===v?void 0:v[k])&&(null===(x=ef.__PosthogExtensions__)||void 0===x||null===(x=x.integrations)||void 0===x||null===(x=x[k])||void 0===x||x.stop())}},iX=class{constructor(m,g){this.$=m,this.lo=g,this.Ja=new Map,this.fo=!1}add(m){var g=this;return Y(function*(){if(g.fo)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(g.Ja.has(m.name))throw Error(`Browser extension "${m.name}" is already registered`);g.Ja.set(m.name,m);try{let v=m.setup(g.lo);v&&(yield v)}catch(x){let v=g.Ja.get(m.name)===m;v&&g.Ja.delete(m.name),g.$.error(`Failed to set up browser extension "${m.name}
7"`,x),v&&g.Ka(m)}})()}getExtension(m){return this.Ja.get(m)}dispose(){if(this.fo)return;this.fo=!0;let m=Array.from(this.Ja.values()).reverse();for(let g of(this.Ja.clear(),m))this.Ka(g)}Ka(m){try{var g;let v=null===(g=m.dispose)||void 0===g?void 0:g.call(m);v&&P(v.then)&&v.then(void 0,g=>{this.$.error(`Failed to dispose browser extension "${m.name}"`,g)})}catch(g){this.$.error(`Failed to dispose browser extension "${m.name}"`,g)}}},iJ=class{constructor(m){this._instance=m}initialize(){}get(m){let g=this._instance.persistence;if("string"==typeof m)return null==g?void 0:g.get_property(m);let v={};for(let x of m){let m=null==g?void 0:g.get_property(x);O(m)||(v[x]=m)}return v}set(m,g){var v;null===(v=this._instance.persistence)||void 0===v||v.register("string"==typeof m?{[m]:g}:m)}remove(m){var g;null===(g=this._instance.persistence)||void 0===g||g.unregister(m)}};let i0="extensionsRemoteConfig";var i1=class{constructor(m){this.instance=m,this.fo=!1,this.$=t5,this.Ya=m.Xa,this.kv=new iJ(m),this.onEvent=m=>ll(this.instance.on("eventCaptured",g=>{try{m({event:g.event,properties:g.properties})}catch(m){this.$.error("Browser extension event listener failed",m)}})),this.onRemoteConfig=m=>{if(this.fo)return ll(()=>{});let i=g=>{try{m(g)}catch(m){this.$.error("Browser extension remote config listener failed",m)}},g=this.instance.tu.on(i0,i);return this.Ya&&i(this.Ya),ll(g)},this.eu=new iX(t5.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var m;return null!==(m=this.instance.get_property("$device_id"))&&void 0!==m?m:this.distinctId}get deviceId(){let m=this.instance.get_property(t9);return"string"==typeof m?m:void 0}get library(){return{name:eh.LIB_NAME,version:eh.LIB_VERSION}}get initialPersonProperties(){var m,g;return null!==(m=null===(g=this.instance.persistence)||void 0===g?void 0:g.get_initial_props())&&void 0!==m?m:{}}get groups(){return this.instance.getGroups()}get session(){try{var m,g,v,x;let k=null===(m=this.instance.sessionManager)||void 0===m?void 0:m.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(g=null==k?void 0:k.sessionId)&&void 0!==g?g:"",windowId:null!==(v=null==k?void 0:k.windowId)&&void 0!==v?v:"",sessionStartTimestamp:null!==(x=null==k?void 0:k.sessionStartTimestamp)&&void 0!==x?x:0}}catch(m){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(m){return this.eu.add(m)}getExtension(m){return this.eu.getExtension(m)}capture(m,g,v){var x=this;return Y(function*(){v?x.instance.capture(m,g,{timestamp:v.timestamp,uuid:v.uuid,$set:v.set,$set_once:v.setOnce}):x.instance.capture(m,g)})()}registerDynamicEventProperties(m){return ll(this.instance.iu(m))}handleRemoteConfig(m){this.fo||(this.Ya=m,this.instance.tu.emit(i0,m))}sendRequest(m){var g=this;return Y(function*(m,v={}){var x;let k=g.instance.requestRouter.endpointFor(null!==(x=v.target)&&void 0!==x?x:"api",m),E={method:v.method,url:v.query?Zl(k,v.query):k,data:v.body,headers:v.headers,timeout:v.timeoutMs,fireCallbackOnDrop:!0,transport:v.transport,compression:v.compression,compressionFallback:"flags"===v.target&&"best-available"===v.compression?e_.Base64:void 0,timestampMode:v.sentAt};return"sendBeacon"===v.transport?(g.instance._send_request(E),{statusCode:202}):new Promise(m=>{E.callback=m,g.instance._send_request(E)})}).apply(this,arguments)}dispose(){this.fo||(this.fo=!0,this.eu.dispose())}};let i2={},i3=0,Ka=()=>{},i5='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',i4="Surveys module not available",i6="sanitize_properties is deprecated. Use before_send instead",i7="Invalid value for property_denylist config: ",i8=/^[A-Za-z0-9_-]{1,400}$/,i9=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,ae=["token","distinct_id",nQ],an="posthog",as=!iE&&-1===(null==ep?void 0:ep.indexOf("MSIE"))&&-1===(null==ep?void 0:ep.indexOf("Mozilla")),nu=m=>{let g={};return m&&"unset"!==m&&("2025-11-30">m||(g.strictMinimumDuration=!0),"2026-05-30">m||(g.canvasCapture={resolutionScale:.6}),"2026-06-25">
7m||(g.streamNetworkBody=!0),"2026-08-30">m||(g.captureJsonLd=!0)),g},ru=m=>{var g;return wi({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(m){let g=null==m?void 0:m.hostname;if(!I(g))return!1;let v=g.split(".").slice(-2).join(".");for(let m of rt)if(v===m)return!1;return!0}(null==ei?void 0:ei.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ka,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=m?m:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:es&&I(null==es?void 0:es.search)&&-1!==es.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==et||null===(g=et.location)||void 0===g?void 0:g.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(m){t5.error("Bad HTTP status: "+m.statusCode+" "+m.text)},get_device_id:m=>m,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:n3,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Ka},{rageclick:m&&m>="2026-05-30"?{content_ignorelist:rE,ignore_text_selection:!0}
7:!m||"2025-11-30">m||{content_ignorelist:!0},capture_pageview:!m||"2025-05-24">m||"history_change",session_recording:nu(m),external_scripts_inject_target:m&&m>="2026-01-30"?"head":"body",internal_or_test_user_hostname:m&&m>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:m&&m>="2026-05-30"?250:0,split_storage:!(!m||"2026-05-30">m),detect_google_search_app:!(!m||"2026-05-30">m),disable_capture_url_hashes:!(!m||"2026-06-25">m),cookieWinsOnConflict:!(!m||"unset"===m||"2026-08-29">m)})},al=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],lu=m=>{let g={};for(let[v,x]of al)O(m[v])||(g[x]=m[v]);let v=On({},g,m),x=m.__preview_external_dependency_versioned_paths;return O(x)||(O(m.strict_script_versioning)&&(v.strict_script_versioning=!!x),I(x)&&O(m.asset_host)&&(v.asset_host=x)),ej(m.property_blacklist)&&(O(m.property_denylist)?v.property_denylist=m.property_blacklist:ej(m.property_denylist)?v.property_denylist=[...m.property_blacklist,...m.property_denylist]:t5.error(i7+m.property_denylist)),v};var ac=class{constructor(){this.__forceAllowLocalhost=!1}get nu(){return this.__forceAllowLocalhost}set nu(m){t5.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=m}},au=class i{su(m){if(!m)return;let g=this.Ja.indexOf(m);-1!==g&&this.Ja.splice(g,1)}ru(m,g){var v;return this.su(m),this.Ja.push(g),null===(v=g.initialize)||void 0===v||v.call(g),g}ou(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}lu(){let m,g,v;if(this.au||this.config.reuseAnonymousId||this.config.segment||this.ou())return;let x="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(x||this.config.disable_persistence)&&(this.uu||(x?(m=`persistence is set to '${this.config.persistence}'`,g="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",v="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(m="persistence is disabled (disable_persistence is true)",g="on every page load",v="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.au=!0,console.warn("[PostHog.js]",`${m} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${g}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${v}`)))}hu(){if(this.ou()||"$posthog_cookieless"!==this.get_distinct_id())return;let m=this.persistence;if(!m)return;this.cu()||m.load(!0);let g=this.get_distinct_id();if(!g||"$posthog_cookieless"===g){let g=this.config.get_device_id(Gn());this.register({distinct_id:g,$device_id:g}),m.set_property(nz,n1)}this.du()}get decideEndpointWasHit(){var m,g;return null!==(m=null===(g=this.featureFlags)||void 0===g?void 0:g.hasLoadedFlags)&&void 0!==m&&m}get flagsEndpointWasHit(){var m,g;return null!==(m=null===(g=this.featureFlags)||void 0===g?void 0:g.hasLoadedFlags)&&void 0!==m&&m}constructor(){var m;this.vu=!1,this.fu=!1,this.webPerformance=new ac,this.pu=!1,this.version=eh.LIB_VERSION,this.gu=new Set,this.mu="",this.tu=new iL,this.Ja=[],this.yu=[],this.uu=!1,this.au=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ru(),this.SentryIntegration=rZ,this.sentryIntegration=m=>(function(m,g){let v=ao(m,g);return{name:rF,processEvent:m=>v(m)}})(this,m),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bu=!1,this._u=null,this.wu=null,this.ku=null,this.scrollManager=new iM(this),this.pageViewM
7anager=new rB(this),this.rateLimiter=new r9(this),this.requestRouter=new iq(this),this.consent=new rw(this),this.externalIntegrations=new iY(this);let g=null!==(m=i.__defaultExtensionClasses)&&void 0!==m?m:{};this.featureFlags=g.featureFlags&&new g.featureFlags(this),this.toolbar=g.toolbar&&new g.toolbar(this),this.surveys=g.surveys&&new g.surveys(this),this.conversations=g.conversations&&new g.conversations(this),this.logs=g.logs&&new g.logs(this),this.metrics=g.metrics&&new g.metrics(this),this.experiments=g.experiments&&new g.experiments(this),this.exceptions=g.exceptions&&new g.exceptions(this),this.people={set:(m,g,v)=>{let x=I(m)?{[m]:g}:m;this.setPersonProperties(x),null==v||v({})},set_once:(m,g,v)=>{let x=I(m)?{[m]:g}:m;this.setPersonProperties(void 0,x),null==v||v({})}},this.on("eventCaptured",m=>t5.info(`send "${null==m?void 0:m.event}"`,m))}init(m,g,v){if(v&&v!==an){var x;let k=null!==(x=i2[v])&&void 0!==x?x:new i;return k._init(m,g,v),i2[v]=k,i2[an][v]=k,k}return this._init(m,g,v)}_init(m,g={},v){var x,k,E,T;let K=I(m)?m.trim():"";if(!K)return t5.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return K!==(null===(T=this.config)||void 0===T?void 0:T.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${K}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ru(g.defaults),g.debug=this.Su(g.debug),this.xu=g,this.Cu=[],g.person_profiles?this.wu=g.person_profiles:g.process_person&&(this.wu=g.process_person);let en=ru(g.defaults),er=lu(g),ei=On({},en,er,{name:v,token:K});C(en.rageclick)&&C(er.rageclick)&&(ei.rageclick=On({},en.rageclick,er.rageclick)),C(en.session_recording)&&C(er.session_recording)&&(ei.session_recording=On({},en.session_recording,er.session_recording)),this.set_config(ei),this.config.on_xhr_error&&t5.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=g.disable_compression?void 0:r0.GZipJS;let es=this.cu();if(this.persistence=new rJ(this.config,es),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rJ(wi(wi({},this.config),{},{persistence:"sessionStorage"}),es,!1),this.mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!es&&r_.Et()){let m=r_.Dt(this.mu);ej(m)&&m.forEach(m=>{I(m)&&this.gu.add(m)})}else r_.Lt(this.mu);let el=wi({},this.persistence.props),ec=wi({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.$u=new iT(m=>this.Tu(m),this.config.request_queue_config),this.Iu=new iA(this),this.__request_queue=[];let eu=this.ou();eu||(this.sessionManager=new iZ(this),this.sessionPropsManager=new iD(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((m,g,v)=>{((null==v?void 0:v.activityTimeout)||(null==v?void 0:v.sessionPastMaximumLength)||(null==v?void 0:v.crossTabAdoption))&&this.Mu()})),this.Eu(),this.config.__preview_deferred_init_extensions?(t5.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Pu(eu)},0)):(t5.info("Initializing extensions synchronously"),this.Pu(eu)),eh.DEBUG=eh.DEBUG||this.config.debug,eh.DEBUG&&t5.info("Starting in debug mode",{this:this,config:g,thisC:wi({},this.config),p:el,s:ec}),!this.config.identity_distinct_id||(null===(x=g.bootstrap)||void 0===x?void 0:x.distinctID)||(g.bootstrap=wi(wi({},g.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));let ed=null===(k=g.bootstrap)||void 0===k?void 0:k.distinctID;if(this.uu=!!ed&&!F(ed),void 0!==(null===(E=g.bootstrap)||void 0===E?void 0:E.distinctID)
vendor: 4,415 bytes, line 7
7){let m=g.bootstrap.distinctID,v=this.get_distinct_id(),x=this.persistence.get_property(nz);if(g.bootstrap.isIdentifiedID&&null!=v&&v!==m&&"anonymous"===x)this.identify(m);else if(g.bootstrap.isIdentifiedID&&null!=v&&v!==m&&"identified"===x)t5.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{let v=this.config.get_device_id(Gn()),x=g.bootstrap.isIdentifiedID?v:m;this.persistence.set_property(nz,g.bootstrap.isIdentifiedID?n2:n1),this.register({distinct_id:m,$device_id:x})}}if(eu)this.register_once({distinct_id:nG,$device_id:null},"");else if(!this.get_distinct_id()){let m=this.config.get_device_id(Gn());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(nz,n1)}return Ln(et,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Ln(et,"pageshow",()=>{var m;this.vu=!1,this.fu||null===(m=this.Iu)||void 0===m||m.resume()}),g.segment?oo(this,()=>this.Ru()):this.Ru(),P(this.config._onCapture)&&this.config._onCapture!==Ka&&(t5.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",m=>this.config._onCapture(m.event,m))),this.config.ip&&t5.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return $a.apply(this,arguments)})().then(m=>{m&&this.register({[nt]:m})}).catch(Ka),this}Au(m){return I(m.name)&&P(m.setup)}Fu(m,g){this.Au(m)?g.push(()=>{this.Ou().add(m).catch(()=>{var g;return null===(g=m.dispose)||void 0===g?void 0:g.call(m)}).catch(g=>{t5.error(`Failed to dispose browser extension "${m.name}"`,g)})}):this.Ja.push(m)}Eu(){var m,g,v,x,k,E;let T=null!==(m=null===(g=this.config.__extensionClasses)||void 0===g?void 0:g.featureFlags)&&void 0!==m?m:null===(v=i.__defaultExtensionClasses)||void 0===v?void 0:v.featureFlags;T&&(this.featureFlags&&this.featureFlags instanceof T||(null===(x=this.Du)||void 0===x||x.call(this),this.Du=void 0,this.featureFlags=new T(this)),P(this.featureFlags.onReloading)&&P(this.featureFlags.setup)?this.Du||(this.Du=this.featureFlags.onReloading(()=>{this.tu.emit("featureFlagsReloading",!0)}),this.Ou().add(this.featureFlags)):null===(k=(E=this.featureFlags).initialize)||void 0===k||k.call(E))}Pu(m){var g,v,x,k,E,T,K;let et=performance.now(),en=wi(wi({},i.__defaultExtensionClasses),this.config.__extensionClasses),er=[];en.exceptions&&this.Ja.push(this.exceptions=null!==(g=this.exceptions)&&void 0!==g?g:new en.exceptions(this)),en.historyAutocapture&&this.Ja.push(this.historyAutocapture=new en.historyAutocapture(this)),en.tracingHeaders&&this.Ja.push(this.tracingHeaders=new en.tracingHeaders(this)),en.siteApps&&this.Ja.push(this.siteApps=new en.siteApps(this)),en.sessionRecording&&!m&&this.Ja.push(this.sessionRecording=new en.sessionRecording(this)),this.config.disable_scroll_properties||er.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),en.autocapture&&this.Fu(this.autocapture=new en.autocapture(this),er),en.surveys&&this.Fu(this.surveys=null!==(v=this.surveys)&&void 0!==v?v:new en.surveys(this),er),en.logs&&this.Fu(this.logs=null!==(x=this.logs)&&void 0!==x?x:new en.logs(this),er),en.metrics&&this.Ja.push(this.metrics=null!==(k=this.metrics)&&void 0!==k?k:new en.metrics(this)),en.conversations&&this.Ja.push(this.conversations=null!==(E=this.conversations)&&void 0!==E?E:new en.conversations(this)),en.productTours&&this.Ja.push(this.productTours=new en.productTours(this)),en.heatmaps&&this.Ja.push(this.heatmaps=new en.heatmaps(this)),en.webVitalsAutocapture&&this.Ja.push(this.webVitalsAutocapture=new en.webVitalsAutocapture(this)),en.exceptionObserver&&this.Ja.push(this.exceptionObserver=new en.exceptionObserver(this)),en.deadClicksAutocapture&&this.Ja.push(this.deadClicksAutocapture=new en.deadClicksAutocapture(this,so)),en.toolbar&&this.Ja.push(this.toolbar=null!==(T=this.toolbar)&&void 0!==T?T:new en.toolbar(this)),en.experiments&&this.Ja.push(this.experiments=null!==(K=this.experiments)&&void 0!==K?K:new en.experiments(this)),this.Ja.forEach(m=>{m.initialize&&er.push(()=>{var g;null===(g=m.initialize)||void 0===g||g.call(m)})}),er.push(()=>
7{if(this.Lu){let m=this.Lu;this.Lu=void 0,this.Ja.forEach(g=>{var v;return null===(v=g.onRemoteConfig)||void 0===v?void 0:v.call(g,m)})}}),this.Nu(er,et)}Nu(m,g){for(;m.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-g>=30&&m.length>0)return void setTimeout(()=>{this.Nu(m,g)},0);let v=m.shift();if(v)try{v()}catch(m){t5.error("Error initializing extension:",m)}}let v=Math.round(performance.now()-g);this.register_for_session({[nY]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[nX]:v}),this.config.__preview_deferred_init_extensions&&t5.info(`PostHog extensions initialized (${v}ms)`)}zl(m){var g,v;if(!ei||!ei.body)return t5.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.zl(m)},500);if(this.config.__preview_deferred_init_extensions&&(this.Lu=m),this.Xa=m,this.compression=void 0,m.ok){let g=m.config;g.supportedCompression&&!this.config.disable_compression&&(this.compression=b(g.supportedCompression,r0.GZipJS)?r0.GZipJS:b(g.supportedCompression,r0.Base64)?r0.Base64:void 0),(null===(v=g.analytics)||void 0===v?void 0:v.endpoint)&&(this.analyticsDefaultEndpoint=g.analytics.endpoint)}this.set_config({person_profiles:this.wu?this.wu:n3}),null===(g=this.qu)||void 0===g||g.handleRemoteConfig(m),this.Ja.forEach(g=>{var v;return null===(v=g.onRemoteConfig)||void 0===v?void 0:v.call(g,m)})}Ru(){try{this.config.loaded(this)}catch(m){t5.critical("`loaded` function failed",m)}if(this.ju(),this.config.internal_or_test_user_hostname&&(null==es?void 0:es.hostname)){let m=es.hostname,g=this.config.internal_or_test_user_hostname;("string"==typeof g?m===g:g.test(m))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.ou())&&this.Bu()},1),this.Hu=new ir(this),this.Hu.load()}ju(){var m;this.is_capturing()&&this.config.request_batching&&(null===(m=this.$u)||void 0===m||m.enable())}_dom_loaded(){this.is_capturing()&&Cn(this.__request_queue,m=>this.Tu(m)),this.__request_queue=[],this.ju()}_handle_unload(){var m,g,v,x,k,E;this.vu=!0,null===(m=this.surveys)||void 0===m||null===(g=m.handlePageUnload)||void 0===g||g.call(m),null===(v=this.metrics)||void 0===v||v.flush("sendBeacon"),this.config.request_batching?(this.zu()&&this.capture(n7),null===(x=this.logs)||void 0===x||x.flushLogs("sendBeacon"),null===(k=this.$u)||void 0===k||k.unload(),null===(E=this.Iu)||void 0===E||E.unload()):this.zu()&&this.capture(n7,null,{transport:"sendBeacon"})}_send_request(m){var g,v,x;this.__loaded?as?this.__request_queue.push(m):this.rateLimiter.isServerRateLimited(m.batchKey)?m.fireCallbackOnDrop&&(null===(v=m.callback)||void 0===v||v.call(m,{statusCode:429})):(m.transport=m.transport||this.config.api_transport,m.headers=wi(wi({},this.config.request_headers),m.headers),m.compression="best-available"===m.compression?null!==(g=this.compression)&&void 0!==g?g:m.compressionFallback:m.compression,(O(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(m.disableTransport=["sendBeacon"]),m.fetchOptions=m.fetchOptions||this.config.fetch_options,(m=>{var g,v,x;let k=wi({},m);k.timeout=k.timeout||6e4;let E=null!==(g=k.transport)&&void 0!==g?g:"fetch";"sendBeacon"===E&&O(k.compression)&&k.data&&(k.compression=r0.Base64),"POST"===k.method&&k.data&&("capture-body"===k.timestampMode?k.data=(m=>{var g,v;let x=(ej(m)?m:[m]).map(m=>wi(wi({},m),m.timestamp instanceof Date&&!isNaN(m.timestamp.getTime())?{timestamp:m.timestamp.toISOString()}:{})),k=x[0];return{api_key:null!==(g=null==k||null===(v=k.properties)||void 0===v?void 0:v.token)&&void 0!==g?g:null==k?void 0:k.token,batch:x,sent_at:(new Date).toISOString()}})(k.data):"body"===k.timestampMode&&(k.data=((m,g=(new Date).toISOString())=>ej(m)?m.map(m=>wi(wi({},m),{},{sent_at:g})):wi(wi({},m),{},{sent_at:g}))(k.data))),k.url=ua(k.url,k.method,k.compression,k.timestampMode);let T=iP.filter(m=>!k.disableTransport||!m.transport||!k.disableTransport.includes(m.transport)),K=null!==(v=null===(x=function(m,g){for(let v=0;m.length>v;v++)if(g(m[v]))return m[v]}(T,m=>m.transport===E))||void 0===x?void 0:x.method)&&void 0!==v?v:T[0].method;if(!K)throw Error("No available transport method");let u=m=>{try{K(m)}catch(m){var g;ra(m)?t5.warn(m):t5.error(m),null===(g=k.callback)||void 0===g||g.call(k,{statusCode:0,error:m})}};"sendBeacon"!==E&&k.data&&k.compression===r0.GZipJS&&ed&&"undefined"!=typeof Promise&&!iN?iR(k).then(m=>{u(m)}).catch(g=>{if(de(g))return iN=!0,void u(wi(wi({},k),{},{compression:void 0,url:ua(m.url,m.method,void 0,m.timestampMode)}));(m=>{if(!m||"object"!=typeof m)return!1;
7let g="name"in m?String(m.name):"";return de(m)||g===tG})(g)&&(iN=!0),u(k)}):K(k)})(wi(wi({},m),{},{callback:g=>{var v,x,k;this.rateLimiter.checkForLimiting(g),400>g.statusCode||null===(x=(k=this.config).on_request_error)||void 0===x||x.call(k,g),null===(v=m.callback)||void 0===v||v.call(m,g)}}))):m.fireCallbackOnDrop&&(null===(x=m.callback)||void 0===x||x.call(m,{statusCode:0}))}Tu(m){this.Iu?this.Iu.retriableRequest(m):this._send_request(m)}_execute_array(m){i3++;try{let g;let v=[],x=[],k=[];Cn(m,m=>{if(m){if(g=m[0],ej(g))k.push(m);else if(P(m))try{m.call(this)}catch(g){t5.error("Error executing queued PostHog call",m,g)}else ej(m)&&"alias"===g?v.push(m):ej(m)&&-1!==g.indexOf("capture")&&P(this[g])?k.push(m):x.push(m)}});let r=function(m,g){Cn(m,function(m){try{if(ej(m[0])){let v=g;Rn(m,function(m){v=v[m[0]].apply(v,m.slice(1))})}else g[m[0]].apply(g,m.slice(1))}catch(g){t5.error("Error executing queued PostHog call",m,g)}})};r(v,this),r(x,this),r(k,this)}finally{i3--}}push(m){if(i3>0&&ej(m)&&I(m[0])){let g=i.prototype[m[0]];return void(P(g)&&g.apply(this,m.slice(1)))}this._execute_array([m])}Uu(){var m;let g=null===(m=this.persistence)||void 0===m?void 0:m.get_property(ni);return I(g)&&i9.test(g)?{value:g,delivered:!1}:C(g)&&I(g.value)&&i9.test(g.value)?{value:g.value,delivered:!0===g.delivered}:void 0}Wu(m,g,v,x){if(!this.persistence)return;this.persistence.refreshKey(ni);let k=this.Uu();if(!x){if(v)return I(g)&&i9.test(g)?(g!==(null==k?void 0:k.value)&&this.persistence.register({[ni]:{value:g,delivered:!1}}),{value:g,pending:g!==(null==k?void 0:k.value)||!k.delivered}):void this.persistence.unregister(ni);if(I(m)&&i8.test(m)){if((null==k?void 0:k.value.split(".")[3])===m)return{value:k.value,pending:!k.delivered};let g=`fb.1.${Date.now()}.${m}`;return this.persistence.register({[ni]:{value:g,delivered:!1}}),{value:g,pending:!0}}return k?{value:k.value,pending:!k.delivered}:void 0}this.persistence.unregister(ni)}Vu(m){if(!this.persistence)return;this.persistence.refreshKey(ni);let g=this.Uu();(null==g?void 0:g.value)!==m||g.delivered||this.persistence.register({[ni]:{value:m,delivered:!0}})}capture(m,g,v){var x,k,E,T,K,et,en,er,ei;let es;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$u))return void t5.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(O(m)||!I(m))return void t5.error("No event name provided to posthog.capture");this.hu();let el=!this.config.opt_out_useragent_filter&&this._is_bot();if(el&&!this.config.__preview_capture_bot_pageviews)return;let ec=(null==v?void 0:v.skip_client_rate_limiting)?void 0:this.rateLimiter.clientRateLimitContext();if(null==ec?void 0:ec.isRateLimited)return void t5.critical("This capture call is ignored due to client rate limiting.");(null==g?void 0:g.$current_url)&&!I(null==g?void 0:g.$current_url)&&(t5.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==g||delete g.$current_url),"$exception"!==m||(null==v?void 0:v.Gu)||t5.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(es=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();let eu=new Date,ed=(null==v?void 0:v.timestamp)||eu,ep=ai(null==v?void 0:v.uuid,Gn),em={uuid:ep,event:m,properties:this.calculateEventProperties(m,g||{},ed,ep)};"$pageview"===m&&this.config.__preview_capture_bot_pageviews&&el&&(em.event="$bot_pageview",em.properties.$browser_type="bot"),ec&&(em.properties.$lib_rate_limit_remaining_tokens=ec.remainingTokens);let ef="$feature_flag_called"===m&&!1===em.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");(null==v?void 0:v.$set)&&!ef&&(em.$set=null==v?void 0:v.$set);let eh=C(null==g?void 0:g.$set)?g.$set:void 0,eg=!!(null==v?void 0:v.$set)&&"$fbc"in v.$set,ev=eg||!!eh&&"$fbc"in eh,ey=eg?null==v||null===(x=v.$set)||void 0===x?void 0:x[nr]:null==eh?void 0:eh[nr],eb=ej(null==g?void 0:g.$unset)?g.$unset:[],ex=(null==v?void 0:v.$unset)||[],e_=-1!==eb.indexOf("$fbc")||-1!==ex.indexOf("$fbc"),ew=this.Wu(null==es?void 0:es.fbclid,ey,ev,e_);
7ew&&!0===em.properties.$process_person_profile&&ew.pending&&!ev&&!ef&&(em.$set=wi({[nr]:ew.value},em.$set));let eS=null==v?void 0:v.$unset;eS&&(em.$unset=eS);let eC=ef?void 0:this.Zu(null==v?void 0:v.$set_once,m!==n9,m===n8);if(eC&&(em.$set_once=eC),(null==v?void 0:v._noTruncate)||(et=this.config.properties_string_max_length,em=function(m,g){let v=new Set;return function t(m,x){let k;if(m!==Object(m))return g?g(m):m;if(!v.has(m)){if(v.add(m),ej(m))k=[],Cn(m,m=>{k.push(t(m))});else{let g={};Rn(H(m)?Dn(m):m,(m,x)=>{v.has(m)||(g[x]=t(m,x))}),k=g}return k}}(m)}(em,m=>I(m)?m.slice(0,et):m)),em.timestamp=ed,O(null==v?void 0:v.timestamp)||(em.properties.$event_time_override_provided=!0,em.properties.$event_time_override_system_time=eu),ef&&(em.properties=((m,g=[])=>{let v={},s=g=>{void 0!==m[g]&&(v[g]=m[g])};return tK.forEach(s),g.forEach(s),v})(em.properties,ae)),m===r3.DISMISSED||m===r3.SENT){let v;let x=null==g?void 0:g[r5.SURVEY_ID],k=null==g?void 0:g[r5.SURVEY_ITERATION];Da({id:x,current_iteration:k}),em.$set=wi(wi({},em.$set),{},{[(er={id:x,current_iteration:k},ei=m===r3.SENT?"responded":"dismissed",v=`$survey_${ei}/${er.id}`,er.current_iteration&&er.current_iteration>0&&(v=`$survey_${ei}/${er.id}/${er.current_iteration}`),v)]:!0})}else m===r3.SHOWN&&(em.$set=wi(wi({},em.$set),{},{[r5.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(m===r6.SHOWN){let m=null==g?void 0:g[r7.TOUR_TYPE];m&&(em.$set=wi(wi({},em.$set),{},{[`${r7.TOUR_LAST_SEEN_DATE}/${m}`]:(new Date).toISOString()}))}let ek=wi(wi({},em.properties.$set),em.$set);if(R(ek)||this.setPersonPropertiesForFlags(ek),!M(this.config.before_send)){let m=this.$s(em);if(!m)return;(em=m).uuid=ai(em.uuid,Gn)}let eE=null!==(k=null===(E=em.$set)||void 0===E?void 0:E.$fbc)&&void 0!==k?k:C(null===(T=em.properties)||void 0===T?void 0:T.$set)?em.properties.$set[nr]:void 0,eN=(null==ew?void 0:ew.pending)&&eE===ew.value?ew.value:void 0;this.tu.emit("eventCaptured",em);let eR=null!==(K=null==v?void 0:v._url)&&void 0!==K?K:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),eI=wi(wi({method:"POST",url:eR,data:em,compression:"best-available",timestampMode:"recordings"===(null==v?void 0:v._batchKey)||/\/s\/(?:\?|$)/.test(eR)?"body":"capture-body",batchKey:null==v?void 0:v._batchKey},(null==v?void 0:v.transport)?{transport:v.transport}:{}),eN?{fireCallbackOnDrop:!0,callback:m=>{m.statusCode>=200&&300>m.statusCode&&this.Vu(eN)}}:{});return!this.config.request_batching||v&&!(null==v?void 0:v._batchKey)||(null==v?void 0:v.send_instantly)||eN?(!eI.transport&&!eI.callback&&R(null!==(en=this.config.request_headers)&&void 0!==en?en:{})&&this.vu&&(eI.transport="sendBeacon"),this.Tu(eI)):this.$u.enqueue(eI),em}_addCaptureHook(m){return this.on("eventCaptured",g=>m(g.event,g))}getExtension(m){var g;return null===(g=this.qu)||void 0===g?void 0:g.getExtension(m)}Ou(){var m;return null!==(m=this.qu)&&void 0!==m?m:this.qu=new i1(this)}iu(m){this.yu.push(m);let g=!0;return()=>{if(!g)return;g=!1;let v=this.yu.indexOf(m);-1!==v&&this.yu.splice(v,1)}}Qu(m=!0){var g,v,x;return!!(null===(g=this.persistence)||void 0===g?void 0:g.consumeCookieIdentityChange())&&(this.ku=null,"anonymous"===this.persistence.get_property("$user_state")&&(null===(x=this.sessionPersistence)||void 0===x||x.clear(),this.gu.clear(),this.Ju()),null===(v=this.featureFlags)||void 0===v||v.reset(),m&&this.reloadFeatureFlags(),!0)}calculateEventProperties(m,g,v,x,k){let E;if(v=v||new Date,!this.persistence||!this.sessionPersistence)return g;this.persistence.syncCookieProperties(),this.Qu();let T=k?void 0:this.persistence.remove_event_timer(m),K=wi({},g);if(K.token=this.config.token,K.$config_defaults=this.config.defaults,this.ou()&&(K[nQ]=!0),"$snapshot"===m){let m=wi(wi({},this.persistence.properties()),this.sessionPersistence.properties());return K.distinct_id=m.distinct_id,(!I(K.distinct_id)&&!D(K.distinct_id)||F(K.distinct_id))&&t5.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),K}let en=function(m,g,v,x=!1){var k,E,T,K;if(!ep)return{};let en=m?[...rV,...g||[]]:[],[er,ei]=Zt(ep),[el,ec]=function(m){for(let g=0;tw.length>g;g++){let[v,x,k]=tw[g],E=m.match(v);if(E){let g=k&&m.match(k)||E;return[x,(null==g?void 0:g[1])||""]}
7}return["",""]}(ep),eu=function(){let m="u">typeof navigator?navigator:void 0;return(null==m?void 0:m.brave)?{brave:!0}:{}}(),ed={};O(v)||(ed.detectGoogleSearchApp=v);let em={},ef=null===(k=navigator)||void 0===k||null===(k=k.userAgentData)||void 0===k?void 0:k.platform,eg=null===(E=navigator)||void 0===E?void 0:E.maxTouchPoints,ev=null==et||null===(T=et.screen)||void 0===T?void 0:T.width,ey=null==et||null===(K=et.screen)||void 0===K?void 0:K.height,eb=null==et?void 0:et.devicePixelRatio;O(ef)||(em.userAgentDataPlatform=ef),O(eg)||(em.maxTouchPoints=eg),O(ev)||(em.screenWidth=ev),O(ey)||(em.screenHeight=ey),O(eb)||(em.devicePixelRatio=eb);let ex=On(Mn({$os:er,$os_version:ei,$browser:Jt(ep,navigator.vendor,eu,ed),$webview_app:el,$webview_app_version:ec,$device:ti(ep),$device_type:ii(ep,em),$timezone:Do(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(m){return}}()}),{$current_url:bo(x?hi(null==es?void 0:es.href):null==es?void 0:es.href,en,rH),$host:null==es?void 0:es.host,$pathname:null==es?void 0:es.pathname,$raw_user_agent:ep.length>1e3?ep.substring(0,997)+"...":ep,$browser_version:Xt(ep,navigator.vendor,eu,ed),$browser_language:Ro(),$browser_language_prefix:function(){let m=Ro();return"string"==typeof m?m.split("-")[0]:void 0}(),$screen_height:null==et?void 0:et.screen.height,$screen_width:null==et?void 0:et.screen.width,$viewport_height:null==et?void 0:et.innerHeight,$viewport_width:null==et?void 0:et.innerWidth,$lib:eh.LIB_NAME,$lib_version:eh.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return eh.SDK_DIST_CHANNEL&&(ex.$sdk_dist_channel=eh.SDK_DIST_CHANNEL),ex}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){let{sessionId:m,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(k,v.getTime(),!0);K.$session_id=m,K.$window_id=g}this.sessionPropsManager&&On(K,this.sessionPropsManager.getSessionProps());try{var er;this.sessionRecording&&On(K,this.sessionRecording.sdkDebugProperties),K.$sdk_debug_retry_queue_size=null===(er=this.Iu)||void 0===er?void 0:er.length}catch(m){K.$sdk_debug_error_capturing_properties=String(m)}if(this.requestRouter.region===i$&&(K.$lib_custom_api_host=this.config.api_host),E="$pageview"!==m||k?"$pageleave"!==m||k?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(v):this.pageViewManager.doPageView(v,x),K=On(K,E),"$pageview"===m&&ei&&(K.title=ei.title),!O(T)){let m=v.getTime()-T;K.$duration=parseFloat((m/1e3).toFixed(3))}ep&&this.config.opt_out_useragent_filter&&(K.$browser_type=this._is_bot()?"bot":"browser");let el=this.persistence.properties(),ec=this.sessionPersistence.properties(),eu=K.$groups,ed=el.$groups;C(eu)&&!R(eu)&&(K.$groups=wi(wi({},C(ed)?ed:{}),eu)),Rn(["$referrer","$referring_domain"],m=>{m in el&&delete ec[m]});let em={};if(this.yu.length>0)for(let m of this.yu.slice())try{On(em,m())}catch(m){t5.error("Failed to produce browser extension event properties",m)}(K=On({},en,el,ec,wi(wi({},em),K))).$is_identified=this._isIdentified(),ej(this.config.property_denylist)?Rn(this.config.property_denylist,function(m){delete K[m]}):t5.error(i7+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let ef=this.config.sanitize_properties;ef&&(t5.error(i6),K=ef(K,m));let eg=this.Ku();return K.$process_person_profile=eg,eg&&!k&&this.Yu("_calculate_event_properties"),K}Zu(m,g=!0,v=!1){var x;if(!this.persistence||!this.Ku()||this.pu&&!v)return m;let k=this.persistence.get_initial_props(),E=null===(x=this.sessionPropsManager)||void 0===x?void 0:x.getSetOnceProps(),T=On({},k,E||{},m||{}),K=this.config.sanitize_properties;return K&&(t5.error(i6),T=K(T,"$set_once")),g&&(this.pu=!0),R(T)?void 0:T}register(m,g){var v;null===(v=this.persistence)||void 0===v||v.register(m,g)}register_once(m,g,v){var x;null===(x=this.persistence)||void 0===x||x.register_once(m,g,v)}register_for_session(m){var g,v;null===(g=this.persistence)||void 0===g||g.syncCookieProperties(),this.Qu(),null===(v=this.sessionPersistence)||void 0===v||v.register(m),Object.keys(m).forEach(m=>this.gu.add(m)),this.Ju()}unregister(m){var g;null===(g=this.persistence)||void 0===g||g.unregister(m)}unregister_for_session(m){var g;null===(g=this.sessionPersistence)||void 0===g||g.unregister(m),this.gu.delete(m),this.Ju()}Xu(m,g){this.register({[m]:g})}Mu(){this.gu.forEach(m=>{var g;null===(g=this.sessionPersistence)||void 0===g||g.unregister(m)}),this.gu.clear(),this.Ju()}Ju(){var m;if(!this.mu)return;if("memory"===this.config.persistence||(null===(m=this.sessionPersistence)||void 0===m?void 0:m.pi)||!r_.Et())return void r_.Lt(this.mu);let g=[];this.gu.forEach(m=>g.push(m)),g.length>0?r_.At(this.mu,g):r_.Lt(this.mu)}getFeatureFlag(m,g){var v;return null===(v=this.featureFlags)||void 0===v?void 0:v.getFeatureFlag(m,g)}getFeatureFlagPayload(m){var g;return null===(g=this.featureFlags)||void 0===g?void 0:g.getFeatureFlagPayload(m)}getFeatureFlagResult(m,g){var v;return null===(v=this.featureFlags)||void 0===v?void 0:v.getFeatureFlagResult(m,g)}getAllFeatureFlags(){var m,g;return null!==(m=null===(g=this.featureFlags)||void 0===g?void 0:g.getAllFeatureFlags())&&void 0!==m?m:[]}isFeatureEnabled(m,g){var v,x;return null!==(v=null===(x=this.featureFlags)||void 0===x?void 0:x.isFeatureEnabled(m,g))&&void 0!==v?v:null==g?void 0:g.defaultValue}reloadFeatureFlags(){var m;null===(m=this.featureFlags)||void 0===m||m.reloadFeatureFlags()}updateFlags(m,g,v){var x;null===(x=this.featureFlags)||void 0===x||x.updateFlags(m,g,v)}updateEarlyAccessFeatureEnrollment(m,g,v){var x;null===(x=this.featureFlags)||void 0===x||x.updateEarlyAccessFeatureEnrollment(m,g,v)}getEarlyAccessFeatures(m,g=!1,v){var x;return null===(x=this.featureFlags)||void 0===x?void 0:x.getEarlyAccessFeatures(m,g,v)}on(m,g){return this.tu.on(m,g)}onFeatureFlags(m){return this.featureFlags?this.featureFlags.onFeatureFlags(m):(m([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(m){return this.surveys?this.surveys.onSurveysLoaded(m):(m([],{isLoaded:!1,error:i4}),()=>{})}onSessionId(m){var g,v;return null!==(g=null===(v=this.sessionManager)||void 0===v?void 0:v.onSessionId(m))&&void 0!==g?g:()=>{}}getSurveys(m,g=!1){this.surveys?this.surveys.getSurveys(m,g):m([],{isLoaded:!1,error:i4})}getActiveMatchingSurveys(m,g=!1){this.surveys?this.surveys.getActiveMatchingSurveys(m,g):m([],{isLoaded:!1,error:i4})}renderSurvey(m,g){var v;
7null===(v=this.surveys)||void 0===v||v.renderSurvey(m,g)}displaySurvey(m,g=iK){var v;null===(v=this.surveys)||void 0===v||v.displaySurvey(m,g)}cancelPendingSurvey(m){var g;null===(g=this.surveys)||void 0===g||g.cancelPendingSurvey(m)}canRenderSurvey(m){var g,v;return null!==(g=null===(v=this.surveys)||void 0===v?void 0:v.canRenderSurvey(m))&&void 0!==g?g:{visible:!1,disabledReason:i4}}canRenderSurveyAsync(m,g=!1){var v,x;return null!==(v=null===(x=this.surveys)||void 0===x?void 0:x.canRenderSurveyAsync(m,g))&&void 0!==v?v:Promise.resolve({visible:!1,disabledReason:i4})}th(m){return!m||F(m)?(t5.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===m?(t5.critical(`The string "${m}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(m.toLowerCase())&&!["undefined","null"].includes(m.toLowerCase())||(t5.critical(`The string "${m}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(m,g,v){if(!this.__loaded||!this.persistence)return t5.uninitializedWarning("posthog.identify");if(D(m)&&(m=m.toString(),t5.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.th(m)||!this.Yu("posthog.identify"))return;this.hu();let x=this.get_distinct_id(),k=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==x,E=this.Qu(!1),T=this.persistence.Sl(),K=!1;try{let x=this.get_distinct_id();this.register({$user_id:m}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:x},""),m!==x&&m!==this.get_property("__alias")&&(this.unregister(nn),this.register({distinct_id:m}));let T=(this.persistence.get_property("$user_state")||"anonymous")===n1,en=m!==x,er=!en&&T;if(en&&T){var et;let k=this.config.reuseAnonymousId?{distinct_id:m}:{distinct_id:m,$anon_distinct_id:x};this.persistence.set_property(nz,n2),this.setPersonPropertiesForFlags({$set:g||{},$set_once:v||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.xl(),this.capture(n8,k,{$set:g||{},$set_once:v||{}}),this.ku=Ca(m,g,v),null===(et=this.featureFlags)||void 0===et||et.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:x)}else if(er){this.persistence.set_property(nz,n2);let x=g||{},k=v||{};this.setPersonPropertiesForFlags({$set:x,$set_once:k},!1),this.config.cookieWinsOnConflict&&this.persistence.xl(),this.capture("$set",{$set:x,$set_once:k}),this.ku=Ca(m,g,v)}else(g||v)&&this.setPersonProperties(g,v);en||k||E?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(nZ)):er&&(g||v)&&this.reloadFeatureFlags(),K=!0}finally{T&&this.persistence.Tl(K)}}setPersonProperties(m,g){if(!m&&!g||!this.Yu("posthog.setPersonProperties"))return;let v=Ca(this.get_distinct_id(),m,g);this.ku!==v?(this.setPersonPropertiesForFlags({$set:m||{},$set_once:g||{}},!0),this.capture("$set",{$set:m||{},$set_once:g||{}}),this.ku=v):t5.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(m){var g;let v=(ej(m)?m:[m]).filter(m=>I(m)&&m.length>0);0!==v.length&&this.Yu("posthog.unsetPersonProperties")&&(null===(g=this.featureFlags)||void 0===g||g.unsetPersonPropertiesForFlags(v,!0),this.capture("$set",{$unset:v}),this.ku=null)}group(m,g,v){var x;if(!m||!g)return void t5.error("posthog.group requires a group type and group key");null===(x=this.persistence)||void 0===x||x.syncCookieProperties(),this.Qu();let k=this.getGroups(),E=k[m]!==g;if(E&&this.resetGroupPropertiesForFlags(m),this.register({$groups:wi(wi({},k),{},{[m]:g})}),(E||v)&&this.Ku()){let x={$group_type:m,$group_key:g};v&&(x.$group_set=v),this.capture(n9,x)}v&&this.setGroupPropertiesForFlags({[m]:v}),E&&!v&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(m,g=!0){var v;null===(v=this.featureFlags)||void 0===v||v.setPersonPropertiesForFlags(m,g)}resetPersonPropertiesForFlags(m=!0){var g;null===(g=this.featureFlags)||void 0===g||g.resetPersonPropertiesForFlags(m)}setGroupPropertiesForFlags(m,g=!0){var v;this.Yu("posthog.setGroupPropertiesForFlags")&&(null===(v=this.featureFlags)||void 0===v||v.setGroupPropertiesForFlags(m,g))}resetGroupPropertiesForFlags(m){var g;null===(g=this.featureFlags)||void 0===g||g.resetGroupPropertiesForFlags(m)}reset(m){let g=j(m)?m:null==m?void 0:m.resetDeviceID,v=j(m)||null==m?void 0:m.bootstrap;this.eh(g,!1,v)}eh(m,g=!1,v){var x,k,E,T,K,et,en,er,ei,es,el,ec,eu,ed,ep,em,ef,eh,eg,ev,ey;if(t5.info("reset"),!this.__loaded)return t5.uninitializedWarning("posthog.reset");let eb=null==v?void 0:v.sessionID;this.config.bootstrap=v||(null===(x=this.xu)||void 0===x?void 0:x.bootstrap)||{},null===(k=this.featureFlags)||void 0===k||null===(E=k.updateConfig)||void 0===E||E.call(k,this.config,this.Ul());let ex=this.get_property(t9),e_=this.get_property(nt),ew=this.get_property(ny);null===(T=this.sessionRecording)||void 0===T||T.flushBeforeIdentityReset();let eS=this.is_capturing();this.consent.reset(),g||!eS||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");
7let eC=null===(K=this.persistence)||void 0===K||null===(et=K.Sl)||void 0===et?void 0:et.call(K),ek=!1;try{if(null===(en=this.persistence)||void 0===en||en.clear(),null===(er=this.sessionPersistence)||void 0===er||er.clear(),this.gu.clear(),this.Ju(),O(ew)||null===(em=this.persistence)||void 0===em||em.register({$session_recording_remote_config:ew}),null===(ei=this.surveys)||void 0===ei||ei.reset(),null===(es=this.featureFlags)||void 0===es||es.reset(),null===(el=this.conversations)||void 0===el||el.reset(),null===(ec=this.logs)||void 0===ec||ec.reset(),null===(eu=this.metrics)||void 0===eu||eu.reset(),null===(ed=this.persistence)||void 0===ed||ed.set_property("$user_state","anonymous"),null===(ep=this.sessionManager)||void 0===ep||ep.resetSessionId(),this.ku=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:nG,$device_id:null},"");else{let g=this.config.get_device_id(Gn());this.register_once({distinct_id:g,$device_id:m?g:ex},""),m||O(e_)||this.register({[nt]:e_})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),v&&(void 0===v.distinctID||this.ou()||(null===(eg=this.persistence)||void 0===eg||eg.set_property("$user_state",v.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:v.distinctID})),null===(ef=this.featureFlags)||void 0===ef||ef.initialize(),!O(eb)&&!(null===(eh=this.sessionManager)||void 0===eh?void 0:eh.setBootstrapSessionId(eb,!0)))){let m=wi({},v);delete m.sessionID,this.config.bootstrap=m}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,ek=!0}finally{eC&&(null===(ev=this.persistence)||void 0===ev||null===(ey=ev.Tl)||void 0===ey||ey.call(ev,ek))}this.reloadFeatureFlags()}shutdown(m){var g=this;return Y(function*(){var m,v,x,k,E,T,K,et;if(g.__loaded){g.fu=!0,g.Ou().dispose(),null===(m=g.sessionRecording)||void 0===m||m.dispose(),null===(v=g.logs)||void 0===v||v.flushLogs("sendBeacon"),null===(x=g.metrics)||void 0===x||x.flush("sendBeacon"),null===(k=g.$u)||void 0===k||k.unload(),null===(E=g.Iu)||void 0===E||E.unload();try{null===(et=g.featureFlags)||void 0===et||et.destroy()}catch(m){t5.error("Error while destroying feature flags",m)}null===(T=g.persistence)||void 0===T||T.destroy(),null===(K=g.sessionPersistence)||void 0===K||K.destroy()}else t5.uninitializedWarning("posthog.shutdown")})()}setIdentity(m,g){var v;delete this.config.identity_claims,this.config.identity_distinct_id=m,this.config.identity_hash=g,this.alias(m),null===(v=this.conversations)||void 0===v||v.ih()}clearIdentity(){var m;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null===(m=this.conversations)||void 0===m||m.nh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var m,g;return null!==(m=null===(g=this.sessionManager)||void 0===g?void 0:g.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==m?m:""}get_session_replay_url(m){if(!this.sessionManager)return"";let{sessionId:g,sessionStartTimestamp:v}=this.sessionManager.checkAndGetSessionAndWindowId(!0),x=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${g}`);if((null==m?void 0:m.withTimestamp)&&v){var k;let g=null!==(k=m.timestampLookBack)&&void 0!==k?k:10;if(!v)return x;x+=`?t=${Math.max(Math.floor(((new Date).getTime()-v)/1e3)-g,0)}`}return x}alias(m,g){return m===this.get_property("$people_distinct_id")?(t5.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yu("posthog.alias")?(O(g)&&(g=this.get_distinct_id()),m!==g?(this.Xu(nn,m),this.capture("$create_alias",{alias:m,distinct_id:g})):(t5.warn("alias matches current distinct_id - skipping api call."),this.identify(m),-1)):void 0}set_config(m){let g=wi({},this.config);if(C(m)){var v,x,k,E,T,K,et,en,er,ei,es,el,ec,eu;On(this.config,lu(m));let ed=this.cu();null===(v=this.persistence)||void 0===v||v.update_config(this.config,g,ed),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rJ(wi(wi({},this.config),{},{persistence:"sessionStorage"}),ed,!1);let ep=this.Su(this.config.debug);j(ep)&&(this.config.debug=ep),j(this.config.debug)&&(this.config.debug?(eh.DEBUG=!0,rm.Et()&&rm.At("ph_debug",!0),t5.info("set_config",{config:m,oldConfig:g,newConfig:wi({},this.config)})):(eh.DEBUG=!1,rm.Et()&&rm.Lt("ph_debug"))),null===(x=this.featureFlags)||void 0===x||null===(k=x.updateConfig)||void 0===k||k.call(x,this.config,this.Ul()),null===(E=this.exceptionObserver)||void 0===E||E.onConfigChange(),null===(T=this.exceptions)||void 0===T||T.onConfigChange(),null===(K=this.sessionRecording)||void 0===K||K.startIfEnabledOrStop(),null===(et=this.tracingHeaders)||void 0===et||et.startIfEnabledOrStop(),null===(en=this.autocapture)||void 0===en||en.startIfEnabled(),null===(er=this.heatmaps)||void 0===er||er.startIfEnabled(),("capture_pageview"in m||"disable_capture_url_hashes"in m)&&(null===(eu=this.historyAutocapture)||void 0===eu||eu.startIfEnabledOrStop()),null===(ei=this.exceptionObserver)||void 0===ei||ei.startIfEnabledOrStop(),null===(es=this.deadClicksAutocapture)||void 0===es||es.startIfEnabledOrStop(),null===(el=this.surveys)||void 0===el||el.loadIfEnabled(),this.du(),null===(ec=this.externalIntegrations)||void 0===ec||ec.startIfEnabledOrStop(),!g.
7segment&&this.config.segment&&this.persistence&&oo(this,Ka,!1)}}_overrideSDKInfo(m,g){eh.LIB_NAME=m,eh.LIB_VERSION=g}startSessionRecording(m){var g,v,x,k,E;let T=!0===m,K={sampling:T||!!(null==m?void 0:m.sampling),linked_flag:T||!!(null==m?void 0:m.linked_flag),url_trigger:T||!!(null==m?void 0:m.url_trigger),event_trigger:T||!!(null==m?void 0:m.event_trigger)};Object.values(K).some(Boolean)&&(null===(g=this.sessionManager)||void 0===g||g.checkAndGetSessionAndWindowId(),K.sampling&&(null===(v=this.sessionRecording)||void 0===v||v.overrideSampling()),K.linked_flag&&(null===(x=this.sessionRecording)||void 0===x||x.overrideLinkedFlag()),K.url_trigger&&(null===(k=this.sessionRecording)||void 0===k||k.overrideTrigger("url")),K.event_trigger&&(null===(E=this.sessionRecording)||void 0===E||E.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var m;return!!(null===(m=this.sessionRecording)||void 0===m?void 0:m.started)}captureException(m,g){try{if(!this.exceptions)return;let v=this.exceptions.buildProperties(m,{handled:!0,syntheticException:Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(wi(wi({},v),g))}catch(m){return}}addExceptionStep(m,g){var v;null===(v=this.exceptions)||void 0===v||v.addExceptionStep(m,g)}captureLog(m){var g;null===(g=this.logs)||void 0===g||g.captureLog(m)}get logger(){var m,g;return null!==(m=null===(g=this.logs)||void 0===g?void 0:g.logger)&&void 0!==m?m:i.sh}startExceptionAutocapture(m){this.set_config({capture_exceptions:null==m||m})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(m){var g,v;return null!==(g=null===(v=this.toolbar)||void 0===v?void 0:v.loadToolbar(m))&&void 0!==g&&g}get_property(m){var g;return null===(g=this.persistence)||void 0===g?void 0:g.props[m]}getSessionProperty(m){var g;return null===(g=this.sessionPersistence)||void 0===g?void 0:g.props[m]}toString(){var m;let g=null!==(m=this.config.name)&&void 0!==m?m:an;return g!==an&&(g="posthog."+g),g}_isIdentified(){var m,g;return"identified"===(null===(m=this.persistence)||void 0===m?void 0:m.get_property("$user_state"))||"identified"===(null===(g=this.sessionPersistence)||void 0===g?void 0:g.get_property("$user_state"))}Ku(){var m,g;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&R(this.getGroups())&&!(null===(m=this.persistence)||void 0===m||null===(m=m.props)||void 0===m?void 0:m.__alias)&&!(null===(g=this.persistence)||void 0===g||null===(g=g.props)||void 0===g?void 0:g.$epp))}zu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Ku()||this.Yu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yu(m){return"never"===this.config.person_profiles?(t5.error(m+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.lu(),this.Xu(nK,!0),!0)}cu(){if("always"===this.config.cookieless_mode)return!0;let m=this.consent.isOptedOut();return this.config.disable_persistence||m&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}du(){var m,g,v,x,k;let E=this.cu();return this.is_capturing()||null===(v=this.logs)||void 0===v||v.rh(),(null===(m=this.persistence)||void 0===m?void 0:m.pi)!==E&&(null===(x=this.persistence)||void 0===x||x.set_disabled(E)),(null===(g=this.sessionPersistence)||void 0===g?void 0:g.pi)!==E&&(null===(k=this.sessionPersistence)||void 0===k||k.set_disabled(E)),E&&(this.gu.clear(),this.Ju()),E}opt_in_capturing(m){var g,v,x,k,E,T,K,et,en,er,ei;if("always"!==this.config.cookieless_mode){if(this.ou()){null===(v=this.sessionRecording)||void 0===v||v.dispose({discardBufferedEvents:!0}),this.eh(!0,!0),null===(x=this.sessionManager)||void 0===x||x.destroy(),null===(k=this.pageViewM
7anager)||void 0===k||k.destroy(),this.sessionManager=new iZ(this),this.pageViewManager=new rB(this),this.persistence&&(this.sessionPropsManager=new iD(this,this.sessionManager,this.persistence));let m=null!==(E=null===(T=this.config.__extensionClasses)||void 0===T?void 0:T.sessionRecording)&&void 0!==E?E:null===(K=i.__defaultExtensionClasses)||void 0===K?void 0:K.sessionRecording;m&&(this.sessionRecording=this.ru(this.sessionRecording,new m(this)),this.Xa&&(null===(et=this.sessionRecording)||void 0===et||null===(en=et.onRemoteConfig)||void 0===en||en.call(et,this.Xa)))}this.consent.optInOut(!0),this.du(),this.ju(),null===(g=this.sessionRecording)||void 0===g||g.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null===(er=this.surveys)||void 0===er||er.loadIfEnabled()),(O(null==m?void 0:m.captureEventName)||(null==m?void 0:m.captureEventName))&&this.capture(null!==(ei=null==m?void 0:m.captureEventName)&&void 0!==ei?ei:"$opt_in",null==m?void 0:m.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Bu()}else t5.warn(i5)}opt_out_capturing(){var m,g;if("always"===this.config.cookieless_mode)return void t5.warn(i5);let v="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==v||v.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.eh(!0,!0),this.consent.optInOut(!1),this.du(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:nG,$device_id:null}),this.su(v),this.sessionRecording=void 0,null===(m=this.sessionManager)||void 0===m||m.destroy(),null===(g=this.pageViewManager)||void 0===g||g.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Bu(),this.ju())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){let m=this.consent.consent;return 1===m?"granted":0===m?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.du()}_is_bot(){return er?wa(er,this.config.custom_blocked_useragents):void 0}Bu(){ei&&("visible"===ei.visibilityState?this.bu||(this.bu=!0,this.capture(n6,{title:ei.title},{send_instantly:!0}),this._u&&(ei.removeEventListener(n5,this._u),this._u=null)):this._u||(this._u=this.Bu.bind(this),Ln(ei,n5,this._u)))}debug(m){!1===m?(null==et||et.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==et||et.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ul(){let m=this.xu||{};return"advanced_disable_flags"in m?!!m.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(t5.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(m,g,v,x,k){let E=g in m&&!M(m[g]),T=v in m&&!M(m[v]);return E?m[g]:!!T&&(k&&k.warn(`Config field '${v}' is deprecated. Please use '${g}' instead. The old field will be removed in a future major version.`),m[v])}(m,"advanced_disable_flags","advanced_disable_decide",0,t5)}$s(m){var g;if(M(this.config.before_send))return m;let v=Object.keys(null!==(g=m.properties)&&void 0!==g?g:{}).filter(B),x=ej(this.config.before_send)?this.config.before_send:[this.config.before_send],k=m;for(let g of x)try{if(k=g(k),M(k)){let g=`Event '${m.event}' was rejected in beforeSend function`;return L(m.event)?t5.warn(`${g}. This can cause unexpected behavior.`):t5.info(g),null}k.properties&&!R(k.properties)||t5.warn(`Event '${m.event}' has no properties after beforeSend function, this is likely an error.`)}catch(g){return t5.error(`Error in beforeSend function for event '${m.event}':`,g),null}for(let g of v)if(k.properties&&M(k.properties[g]))return t5.warn(`Event '${m.event}' had its '${g}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return k}getPageViewId(){var m;
7return null===(m=this.pageViewManager.Ao)||void 0===m?void 0:m.pageViewId}captureTraceFeedback(m,g){this.capture("$ai_feedback",{$ai_trace_id:String(m),$ai_feedback_text:g})}captureTraceMetric(m,g,v){this.capture("$ai_metric",{$ai_trace_id:String(m),$ai_metric_name:g,$ai_metric_value:String(v)})}Su(m){let g=j(m)&&!m,v=rm.Et()&&"true"===rm.Ot("ph_debug");return!g&&(!!v||m)}};au.__defaultExtensionClasses={},au.sh=(()=>{let t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(m,g){for(let v=0;g.length>v;v++)m.prototype[g[v]]=An(m.prototype[g[v]])}(au,["identify"]);var ad=class{constructor(m){this.disabled=!1===m;let g=C(m)?m:{};this.thresholdPx=g.threshold_px||30,this.timeoutMs=g.timeout_ms||1e3,this.clickCount=g.click_count||3,this.clicks=[]}isRageClick(m,g,v){if(this.disabled)return!1;let x=this.clicks[this.clicks.length-1];if(x&&Math.abs(m-x.x)+Math.abs(g-x.y)<this.thresholdPx&&this.timeoutMs>v-x.timestamp){if(this.clicks.push({x:m,y:g,timestamp:v}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:m,y:g,timestamp:v}];return!1}};let ap="$copy_autocapture",am=t4("[AutoCapture]");function vu(m,g){return g.length>m?g.slice(0,m)+"...":g}var af=class{Js(){this.Ks=void 0,clearTimeout(this.Ys),this.Ys=void 0}Xs(m){var g;if(!Ur(m))return!0;let v=null!==(g=this.so().css_selector_ignorelist)&&void 0!==g?g:rC,x=new Set,k=m;for(;k;){if(x.size>=1e3||x.has(k))return!0;x.add(k);let m=k,g=xr(m);if(b(g,"ph-no-capture")||b(g,"ph-sensitive")||zr(m)||v.some(g=>Cr(m,g)))return!0;let E=k.parentNode;k=wr(E)?E.host:E&&mr(E)?E:null}return!1}oo(m){if(!this.isEnabled||"pointercancel"===m.type)return void this.Js();if("pointerdown"===m.type){var g;this.Js();let v=Tr(m);return void(m.isPrimary&&0===m.button&&!m.ctrlKey&&v&&mr(v)&&(this.Ks={target:v,excluded:this.Xs(v),id:m.pointerId,x:m.clientX,y:m.clientY,released:!1,distinctId:null===(g=this.lo)||void 0===g?void 0:g.distinctId}))}let v=this.Ks;v&&(m.pointerId!==v.id||Math.abs(m.clientX-v.x)>5||Math.abs(m.clientY-v.y)>5?this.Js():"pointerup"===m.type&&(v.released=!0,this.Ys=setTimeout(()=>this.Js(),0)))}ao(m){var g,v;let x=this.Ks;this.Js();let k=Tr(m);if((null==x?void 0:x.released)&&x.target.isConnected&&x.distinctId===(null===(g=this.lo)||void 0===g?void 0:g.distinctId)&&m.pointerId===x.id&&(m.detail>0||"touch"===m.pointerType||"pen"===m.pointerType)&&0===m.button&&5>=Math.abs(m.clientX-x.x)&&5>=Math.abs(m.clientY-x.y)&&k&&(br(k,"html")||br(k,"body"))){if(x.excluded)return null;let m=null!==(v=this.so().css_selector_ignorelist)&&void 0!==v?v:rC;return[k,null==ei?void 0:ei.documentElement,null==ei?void 0:ei.body].some(g=>{if(!g)return!1;let v=xr(g);return b(v,"ph-no-capture")||b(v,"ph-sensitive")||!Ur(g)||zr(g)||m.some(m=>Cr(g,m))})?null:x.target}}constructor(m){this.uo=m,this.name="autocapture",this.ho=!1,this.co=null,this.do=!1,this.vo=!1,this.Sr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.fo=!1,this.uo.refresh(this.Sr),this.rageclicks=new ad(this.Sr.rageclick),this.po=null}setup(m){this.mo(),this.lo=m;let g=m.onRemoteConfig(this.onRemoteConfig.bind(this));this.fo?g.dispose():(this.yo=g,this.startIfEnabled())}dispose(){var m;this.fo||(this.fo=!0,this.lo=void 0,null===(m=this.yo)||void 0===m||m.dispose(),this.yo=void 0,this.bo())}so(){return this.uo.refresh(this.Sr),this.Sr}mo(){var m,g;return this.so(),this.Sr.url_allowlist=null===(m=this.Sr.url_allowlist)||void 0===m?void 0:m.map(m=>new RegExp(m)),this.Sr.url_ignorelist=null===(g=this.Sr.url_ignorelist)||void 0===g?void 0:g.map(m=>new RegExp(m)),this.Sr}_o(){if(!this.isBrowserSupported())return void am.info("Disabling Automatic Event Collection because this browser is not supported");if(!et||!ei)return;let m=this.wo=m=>{m=m||(null==et?void 0:et.event);try{if("blur"===m.type)return void this.Js();if(0===m.type.indexOf("pointer"))return void this.oo(m);let g="click"===m.type?this.ao(m):void 0;if(A(g))return;this.ko(m,"$autocapture",g)}catch(m){am.error("Failed to capture event",m)}};if(Ln(et,"blur",m),Ln(ei,"submit",m,{capture:!0}),Ln(ei,"change",m,{capture:!0}),Ln(ei,"click",m,{capture:!0}),Rn(["pointerdown","pointermove","pointerup","pointercancel"],g=>{Ln(ei,g,m,{capture:!0})}),this.so().capture_copied_text){let m=this.So=m=>{m=m||(null==et?void 0:et.event);try{this.ko(m,ap)}catch(m){am.error("Failed to capture clipboard event",m)}};Ln(ei,"copy",m,{capture:!0}),Ln(ei,"cut",m,{capture:!0}),Ln(ei,"paste",m,{capture:!0})}}bo(){this.Js(),this.wo&&(null==et||et.removeEventListener("blur",this.wo),Rn(["pointerdown","pointermove","pointerup","pointercancel"],m=>{null==ei||ei.removeEventListener(m,this.wo,!0)}
7),null==ei||ei.removeEventListener("submit",this.wo,!0),null==ei||ei.removeEventListener("change",this.wo,!0),null==ei||ei.removeEventListener("click",this.wo,!0),this.wo=void 0),this.So&&(null==ei||ei.removeEventListener("copy",this.So,!0),null==ei||ei.removeEventListener("cut",this.So,!0),null==ei||ei.removeEventListener("paste",this.So,!0),this.So=void 0),this.ho=!1}startIfEnabled(){this.isEnabled||this.Js(),!this.fo&&this.lo&&this.isEnabled&&!this.ho&&(this._o(),this.ho=!0)}onRemoteConfig(m){var g;if(this.fo)return;if(this.do=!0,!m.ok)return void this.startIfEnabled();let v=m.config;v.elementsChainAsString&&(this.vo=v.elementsChainAsString);let x=v.autocapture_opt_out;j(x)&&(null===(g=this.lo)||void 0===g||g.kv.set("$autocapture_disabled_server_side",x),this.co=x),this.startIfEnabled()}setElementSelectors(m){this.po=m}getElementSelectors(m,g){var v;let x=[];return null===(v=this.po)||void 0===v||v.forEach(v=>{let k=null==ei?void 0:ei.querySelectorAll(v);null==k||k.forEach(k=>{m!==k&&g!==k||b(x,v)||x.push(v)})}),x}get isEnabled(){var m,g;if(this.fo)return!1;let v=null===(m=this.lo)||void 0===m?void 0:m.kv.get(ns),x=this.co,k=this.so();if(!k.remoteRequestsDisabled&&!this.do)return!1;let E=k.remoteRequestsDisabled&&!this.do;if(A(x)&&!j(v)&&!E)return!1;let T=null!==(g=this.co)&&void 0!==g?g:!!v;return!!k.enabled&&!T}ko(m,g="$autocapture",v){var x,k,E,T;if(!this.isEnabled)return void this.Js();let K=v||Tr(m);yr(K)&&(K=K.parentNode||null);let en=this.mo();"$autocapture"===g&&"click"===m.type&&m instanceof MouseEvent&&en.rageclick&&(null===(x=this.rageclicks)||void 0===x?void 0:x.isRageClick(m.clientX,m.clientY,m.timeStamp||(new Date).getTime()))&&jr(K,en.rageclick)&&this.ko(m,"$rageclick",v);let er=g===ap,ei=er?wi(wi({},en),{},{dom_event_allowlist:void 0}):en;if(K&&function(m,g,v,x,k,E){var T;if(!et||Lr(m)||(null==v?void 0:v.url_allowlist)&&!Sr(v.url_allowlist,E)||(null==v?void 0:v.url_ignorelist)&&Sr(v.url_ignorelist,E))return!1;if(null==v?void 0:v.dom_event_allowlist){let m=v.dom_event_allowlist;if(m&&!m.some(m=>g.type===m))return!1}let{parentIsUsefulElement:K,targetElementList:en}=Br(m,x);if(!function(m,g){let v=null==g?void 0:g.element_allowlist;if(O(v))return!0;for(let g of m)if(v.some(m=>g.tagName.toLowerCase()===m))return!0;return!1}(en,v)||!Rr(en,null==v?void 0:v.css_selector_allowlist)||Rr(en,null!==(T=null==v?void 0:v.css_selector_ignorelist)&&void 0!==T?T:rC))return!1;try{let v=et.getComputedStyle(m);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===g.type)return!0}catch(m){}let er=m.tagName.toLowerCase();switch(er){case"html":return!1;case"form":return(k||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(k||["change","click"]).indexOf(g.type)>=0;default:return K?(k||["click"]).indexOf(g.type)>=0:(k||["click"]).indexOf(g.type)>=0&&(rS.indexOf(er)>-1||"true"===m.getAttribute("contenteditable"))}}(K,m,ei,er,er?["copy","cut","paste"]:void 0,{config:{get_current_url:en.getCurrentUrl}})){let{props:v,explicitNoCapture:x,target:er}=function(m,{e:g,maskAllElementAttributes:v,maskAllText:x,elementAttributeIgnoreList:k,elementsChainAsString:E,disableCaptureUrlHashes:T}){var K,en,er,ei;if(!mr(m))return{props:{}};let es=[m],el=new Set([m]),ec=m;for(;ec.parentNode&&!br(ec,"body")&&1e3>es.length;){if(wr(ec.parentNode)){let m=ec.parentNode.host;if(el.has(m))break;el.add(m),es.push(m),ec=m;continue}if(!mr(ec.parentNode)||el.has(ec.parentNode))break;el.add(ec.parentNode),es.push(ec.parentNode),ec=ec.parentNode}let eu="click"===g.type&&"http://www.w3.org/2000/svg"===m.namespaceURI?es.findIndex(m=>br(m,"button")||br(m,"a")):-1;eu>0&&(x=x||es.slice(0,eu+1).some(m=>!Ur(m)||zr(m)));let ed=[],ep={},em,ef=!1,eh=!1;if(Rn(es,m=>{let g=Ur(m);if(br(m,"a")){let v=m.getAttribute("href");ef=!!(g&&v&&Yr(v))&&(T?hi(v):v)}b(xr(m),"ph-no-capture")&&(eh=!0),ed.push(function(m,g,v,x,k=!1){let E=m.tagName.toLowerCase(),T={tag_name:E};rS.indexOf(E)>-1&&!v&&(T.$el_text="a"===E.toLowerCase()||"button"===E.toLowerCase()?vu(1024,Xr(m)):vu(1024,kr(m)));let K=xr(m);K.length>0&&(T.classes=K.filter(function(m){return""!==m})),Rn(m.attributes,function(v){var E;
7if((!zr(m)||-1!==["name","id","class","aria-label"].indexOf(v.name))&&!(null==x?void 0:x.includes(v.name))&&!g&&Yr(v.value)&&(!I(E=v.name)||"_ngcontent"!==E.substring(0,10)&&"_nghost"!==E.substring(0,7))){let m=v.value;"class"===v.name&&(m=$r(m).join(" ")),T["attr__"+v.name]=vu(1024,"href"===v.name&&k?hi(m):m)}});let et=1,en=1,er=m;for(;er=function(m){if(m.previousElementSibling)return m.previousElementSibling;let g=m;do g=g.previousSibling;while(g&&!mr(g));return g}(er);)et++,er.tagName===m.tagName&&en++;return T.nth_child=et,T.nth_of_type=en,T}(m,v,x,k,T)),Rn(function(m){if(!Ur(m))return{};let g={};return Rn(m.attributes,function(m){if(m.name&&0===m.name.indexOf("data-ph-capture-attribute")){let v=m.name.replace("data-ph-capture-attribute-",""),x=m.value;v&&x&&Yr(x)&&(g[v]=x)}}),g}(m),(m,g)=>{({}).hasOwnProperty.call(ep,g)||(ep[g]=m)})}),eh)return{props:{},explicitNoCapture:eh};if(eu>0&&(m=es[eu],ed.splice(0,eu)),x||(ed[0].$el_text=br(m,"a")||br(m,"button")?Xr(m):kr(m)),ef){ed[0].attr__href=ef;let m=null===(er=go(ef))||void 0===er?void 0:er.host,g=null==et||null===(ei=et.location)||void 0===ei?void 0:ei.host;m&&g&&m!==g&&(em=ef)}return{props:On({$event_type:g.type,$ce_version:1},E?{}:{$elements:ed},{$elements_chain:ej(ed)?ed.map(m=>{var g,v;let x={text:null===(g=m.$el_text)||void 0===g?void 0:g.slice(0,400),tag_name:m.tag_name,href:null===(v=m.attr__href)||void 0===v?void 0:v.slice(0,2048),attr_class:function(m){let g=m.attr__class;if(g)return ej(g)?g:$r(g)}(m),attr_id:m.attr__id,nth_child:m.nth_child,nth_of_type:m.nth_of_type,attributes:{}};return In(m).filter(([m])=>0===m.indexOf("attr__")).forEach(([m,g])=>x.attributes[m]=g),x}).map(m=>{var g,v;let x="";if(m.tag_name&&(x+=m.tag_name),m.attr_class)for(let g of(m.attr_class.sort(),m.attr_class))x+=`.${g.replace(/"/g,"")}`;let k=wi(wi(wi(wi({},m.text?{text:m.text}:{}),{},{"nth-child":null!==(g=m.nth_child)&&void 0!==g?g:0,"nth-of-type":null!==(v=m.nth_of_type)&&void 0!==v?v:0},m.href?{href:m.href}:{}),m.attr_id?{attr_id:m.attr_id}:{}),m.attributes),E={};return In(k).sort(([m],[g])=>g>m?-1:m>g?1:0).forEach(([m,g])=>E[Zr(m.toString())]=Zr(g.toString())),x+=":"+In(E).map(([m,g])=>`${m}="${g}"`).join("")}).join(";"):""},(null===(K=ed[0])||void 0===K?void 0:K.$el_text)?{$el_text:null===(en=ed[0])||void 0===en?void 0:en.$el_text}:{},em&&"click"===g.type?{$external_click_url:em}:{},ep),target:m}}(K,{e:m,maskAllElementAttributes:en.maskAllElementAttributes,maskAllText:en.maskAllText,elementAttributeIgnoreList:en.element_attribute_ignorelist,elementsChainAsString:this.vo,disableCaptureUrlHashes:en.disableCaptureUrlHashes});if(x)return!1;let ei=this.getElementSelectors(K,er);if(ei&&ei.length>0&&(v.$element_selectors=ei),g===ap){let g=m.type||"clipboard";if("paste"!==g){let m=null==et||null===(E=et.getSelection())||void 0===E?void 0:E.toString(),g=Er(m);if(!g)return!1;v.$selected_content=g,v.$clipboard_text_length=null!==(T=null==m?void 0:m.length)&&void 0!==T?T:0}v.$copy_type=g}return null===(k=this.lo)||void 0===k||k.capture(g,v).catch(m=>am.error("Failed to capture event",m)),!0}}isBrowserSupported(){return P(null==ei?void 0:ei.querySelectorAll)}},ah=class{constructor(m){this._instance=m}refresh(m){let g=this._instance.config,v=C(g.autocapture)?g.autocapture:void 0;m.enabled=!!g.autocapture,m.rageclick=g.rageclick,m.maskAllElementAttributes=g.mask_all_element_attributes,m.maskAllText=g.mask_all_text,m.disableCaptureUrlHashes=g.disable_capture_url_hashes,m.getCurrentUrl=g.get_current_url,m.remoteRequestsDisabled=this._instance.Ul(),m.url_allowlist=null==v?void 0:v.url_allowlist,m.url_ignorelist=null==v?void 0:v.url_ignorelist,m.dom_event_allowlist=null==v?void 0:v.dom_event_allowlist,m.element_allowlist=null==v?void 0:v.element_allowlist,m.css_selector_allowlist=null==v?void 0:v.css_selector_allowlist,m.css_selector_ignorelist=null==v?void 0:v.css_selector_ignorelist,m.element_attribute_ignorelist=null==v?void 0:v.element_attribute_ignorelist,m.capture_copied_text=null==v?void 0:v.capture_copied_text}};let ag=t4("[ExceptionAutocapture]"),bu=()=>{},yu=m=>{var g;if(P(m))return null!==(g=m.__posthog_layer__)&&void 0!==g?g:m.__rrweb_layer__};function wu(m,g,v){try{if(!(g in m))return bu;let x={next:m[g]},k=v(function(...m){return x.next.apply(this,m)});return P(k)&&(k.prototype=k.prototype||{},Object.defineProperties(k,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:x}})),m[g]=k,()=>{if(m[g]===k)return void(m[g]=x.next);let v=m[g],E=yu(v);for(;E;){if(E.next===k)return void(E.next=x.next);v=E.next,E=yu(v)}}}catch(m){return bu}}let av=t4("[TracingHeaders]"),ay=t4("[Web Vitals]"),ab=["CLS","FCP","INP","LCP"],ax=["INP","LCP"],a_=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],aw="disabled",aS="lazy_loading",aC=t4("[SessionRecording]"),ak=t4("[Heatmaps]");function Iu(m){return C(m)&&"clientX"in m&&"clientY"in m&&D(m.clientX)&&D(m.clientY)}let aE=t4("[Product Tours]"),Au=m=>{var g;return!m.config.disable_product_tours&&!!(null===(g=m.persistence)||void 0===g?void 0:g.get_property(nf))},aj=["$set_once","$set"],aN=t4("[SiteApps]"),aR="Error while initializing PostHog app with config id ",ju=(m,g)=>(null==m?void 0:m.then)?m.then(g):g(m),aI="SDK is not enabled or survey functionality is not yet loaded",aP="Disabled. Not loading surveys.";var aT=class{constructor(m,g){this.uo=m,this.oh=g,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ah=!1,this.uh=[],this.hh=null,this.dh=null,this.fo=!1,this.fh=new Set,this.onRemoteConfig=m=>{if(this.fo||this.Sr.disableSurveys)return;if(!m.ok)return iH.warn("Remote config unavailable. Not loading surveys.");let g=m.config.surveys;if(M(g))return iH.warn("Flags not loaded yet. Not loading surveys.");this.ph=j(g)?g:g.length>0,iH.info(`flags response received, isSurveysEnabled: ${this.ph}`),this.loadIfEnabled()}}setup(m){if(!this.fo)return this.gh=m,ju(m.kv.initialize(),()=>{if(this.gh!==m||this.fo)return;this.gh=void 0,this.lo=m;let g=m.onRemoteConfig(this.onRemoteConfig);this.fo?g.dispose():(this.yo=g,this.loadIfEnabled())})}dispose(){var m,g,v,x;this.fo||(this.fo=!0,this.gh=void 0,this.lo=void 0,null===(m=this.yo)||void 0===m||m.dispose(),this.yo=void 0,null===(g=this._surveyEventReceiver)||void 0===g||g.dispose(),this._surveyEventReceiver=null,null===(v=this._surveyManager)||void 0===v||null===(x=v.dispose)||void 0===x||x.call(v),this._surveyManager=null,this.uh=[],this.hh=null,this.fh.forEach(m=>clearTimeout(m)),this.fh.clear())}get Sr(){return this.uo.get()}initialize(){this.loadIfEnabled()}reset(){try{var m;null===(m=this._surveyEventReceiver)||void 0===m||m.reset(),localStorage.removeItem("lastSeenSurveyDate");let g=[];for(let m=0;m<localStorage.length;m++){let v=localStorage.key(m);((null==v?void 0:v.startsWith("seenSurvey_"))||(null==v?void 0:v.startsWith("inProgressSurvey_")))&&g.push(v)}g.forEach(m=>localStorage.removeItem(m))}catch(m){}}loadIfEnabled(){if(this.fo||!this.lo)return;let m=this.Sr;if(this._surveyManager)return;if(this.ah)return void iH.info("Already initializing surveys, skipping...");if(m.disableSurveys)return void iH.info(aP);if(m.cookielessMode&&this.uo.isOptedOut())return void iH.info("Not loading surveys in cookieless mode without consent.");let g=this.uo.getExtensions();if(!g)return void iH.error("PostHog Extensions not found.");if(O(this.ph)&&!m.advancedEnableSurveys)return;let v=this.ph||m.advancedEnableSurveys;this.ah=!0;try{let m=g.generateSurveys;if(m)return this.mh(m,v),void(this.ah=!1);let x=g.loadExternalDependency;if(!x)return this.yh(n0),void(this.ah=!1);x(m=>{try{if(this.fo)return;let g=this.uo.getExtensions();!m&&(null==g?void 0:g.generateSurveys)?this.mh(g.generateSurveys,v):this.yh("Could not load surveys script",m)}finally{this.ah=!1}})}catch(m){throw this.ah=!1,this.yh("Error initializing surveys",m),m}}mh(m,g){this.fo||(this._surveyManager=m(g),this._surveyEventReceiver=this.uo.createEventReceiver(),iH.info("Surveys loaded successfully"),this.bh({isLoaded:!0}))}yh(m,g){iH.error(m,g),this.bh({isLoaded:!1,error:m})}onSurveysLoaded(m){return this.uh.push(m),this._surveyManager&&this.bh({isLoaded:!0}),()=>{this.uh=this.uh.filter(g=>g!==m)}}getSurveys(m,g=!1){var v;let x=null!==(v=this.lo)&&void 0!==v?v:this.oh;if(!x||this.fo)return;if(this.Sr.disableSurveys)return iH.info(aP),m([]);let k=x.kv.get(nO);if(k&&!g)return m(k,{isLoaded:!0}
7),void(this._h()&&this.getSurveys(()=>{},!0));if(this.hh)return void this.hh.then(({surveys:g,context:v})=>{this.fo||m(g,v)}).catch(m=>iH.error("Error in survey callback",m));let E=this.wh("/api/surveys/",{method:"GET",query:{token:x.projectToken},sentAt:"query",timeoutMs:this.Sr.requestTimeoutMs}).then(m=>{try{return this.kh(x,m)}catch(m){return iH.error("Error processing surveys response",m),this.kh(x,{statusCode:0,error:m})}},m=>this.kh(x,{statusCode:0,error:m}));this.hh=E;let o=()=>{this.hh===E&&(this.hh=null)};E.then(g=>{o(),this.fo||m(g.surveys,g.context)},o).catch(m=>iH.error("Error in survey callback",m))}wh(m,g){let v=this.lo;return v?v.sendRequest(m,g):new Promise(m=>m({statusCode:0,error:Error(aI)}))}kh(m,g){var v;if(this.fo)return{surveys:[],context:{isLoaded:!1,error:aI}};let x=g.statusCode;if(200!==x||!g.json){let m=`Surveys API could not be loaded, status: ${x}`;return 0!==x?iH.error(m):g.error||iH.warn(m),this.dh=Date.now(),{surveys:[],context:{isLoaded:!1,error:m}}}this.dh=null;let k=g.json.surveys||[],E=k.filter(m=>{var g;return!(!m.start_date||m.end_date)&&(xa(m)||!!(null===(g=m.conditions)||void 0===g||null===(g=g.actions)||void 0===g||null===(g=g.values)||void 0===g?void 0:g.length))});return E.length>0&&(null===(v=this._surveyEventReceiver)||void 0===v||v.register(E)),m.kv.set({[nO]:k,[nA]:Date.now()}),{surveys:k,context:{isLoaded:!0}}}_h(){return this.Sh()&&!this.hh&&!this.xh()}Sh(){var m,g;let v=null===(m=null!==(g=this.lo)&&void 0!==g?g:this.oh)||void 0===m?void 0:m.kv.get(nA);return D(v)&&Date.now()-v>3e5}xh(){return D(this.dh)&&3e5>Date.now()-this.dh}markSurveyAsSeen(m,g){var v;let x={id:m,current_iteration:null!==(v=null==g?void 0:g.iteration)&&void 0!==v?v:null};Da(x);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(m){}}bh(m){for(let g of this.uh)try{if(!m.isLoaded)return g([],m);this.getSurveys(g)}catch(m){iH.error("Error in survey callback",m)}}getActiveMatchingSurveys(m,g=!1){if(!M(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(m,g);iH.warn("init was not called")}Ch(m){let g=null;return this.getSurveys(v=>{var x;g=null!==(x=v.find(g=>g.id===m))&&void 0!==x?x:null}),g}$h(m){if(M(this._surveyManager))return{eligible:!1,reason:aI};let g="string"==typeof m?this.Ch(m):m;return g?this._surveyManager.checkSurveyEligibility(g):{eligible:!1,reason:"Survey not found"}}Th(m){if(!this.uo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(M(this._surveyManager))return{eligible:!1,reason:aI};let g="string"==typeof m?this.Ch(m):m;return g?this._surveyManager.checkSurveyRenderability(g):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(m){if(M(this._surveyManager))return iH.warn("init was not called"),{visible:!1,disabledReason:aI};let g=this.Th(m);return{visible:g.eligible,disabledReason:g.reason}}canRenderSurveyAsync(m,g){return M(this._surveyManager)?(iH.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:aI})):new Promise(v=>{this.getSurveys(g=>{var x;let k=null!==(x=g.find(g=>g.id===m))&&void 0!==x?x:null;if(k){let m=this.Th(k);v({visible:m.eligible,disabledReason:m.reason})}else v({visible:!1,disabledReason:"Survey not found"})},g)})}renderSurvey(m,g,v){var x;if(!this.uo.isCapturing())return;if(M(this._surveyManager))return void iH.warn("init was not called");let k="string"==typeof m?this.Ch(m):m;if(!(null==k?void 0:k.id))return void iH.warn("Survey not found");if(!iW.includes(k.type))return void iH.warn(`Surveys of type ${k.type} cannot be rendered in the app`);let E=null==ei?void 0:ei.querySelector(g);if(E){if(null===(x=k.appearance)||void 0===x?void 0:x.surveyPopupDelaySeconds){iH.info(`Rendering survey ${k.id} with delay of ${k.appearance.surveyPopupDelaySeconds} seconds`);let m=setTimeout(()=>{var g,x;this.fh.delete(m),!this.fo&&this.uo.isCapturing()&&(iH.info(`Rendering survey ${k.id} with delay of ${null===(g=k.appearance)||void 0===g?void 0:g.surveyPopupDelaySeconds} seconds`),null===(x=this._surveyManager)||void 0===x||x.renderSurvey(k,E,v),iH.info(`Survey ${k.id} rendered`))},1e3*k.appearance.surveyPopupDelaySeconds);return void this.fh.add(m)}this._surveyManager.renderSurvey(k,E,v)}else iH.warn("Survey element not found")}displaySurvey(m,g){var v;if(!this.uo.isCapturing())return;if(M(this._surveyManager))return void iH.warn("init was not called");let x=this.Ch(m);if(!x)return void iH.warn("Survey not found");let k=x;if((null===(v=x.appearance)||void 0===v?void 0:v.surveyPopupDelaySeconds)&&g.ignoreDelay&&(k=wi(wi({},x),{},{appearance:wi(wi({},x.appearance),{},{surveyPopupDelaySeconds:0})}
7)),g.displayType!==r4.Popover&&g.initialResponses&&iH.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===g.ignoreConditions){let m=this.$h(x);if(!m.eligible)return void iH.warn("Survey is not eligible to be displayed: ",m.reason)}g.displayType!==r4.Inline?this._surveyManager.handlePopoverSurvey(k,g):this.renderSurvey(k,g.selector,g.properties)}cancelPendingSurvey(m){M(this._surveyManager)?iH.warn("init was not called"):this._surveyManager.cancelSurvey(m)}handlePageUnload(){var m,g;null===(m=this._surveyManager)||void 0===m||null===(g=m.handlePageUnload)||void 0===g||g.call(m)}};function zu(m,g,v){if(M(m))return!1;switch(v){case"exact":return m===g;case"contains":{let v=g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return RegExp(v,"i").test(m)}case"regex":try{return new RegExp(g).test(m)}catch(m){return!1}default:return!1}}var aO=class{constructor(m){this._instance=m,this.Ih=new Set,this.Mh=new Set,this.Eh=new iL,this.Ph=(m,g)=>this.Rh(m,g)&&this.Ah(m,g)&&this.Fh(m,g)&&this.Oh(m,g),this.Rh=(m,g)=>!(null==g?void 0:g.event)||(null==m?void 0:m.event)===(null==g?void 0:g.event)}init(){var m,g;O(null===(m=this._instance)||void 0===m?void 0:m._addCaptureHook)||(this.Dh=null===(g=this._instance)||void 0===g?void 0:g._addCaptureHook((m,g)=>{this.on(m,g)}))}dispose(){var m;null===(m=this.Dh)||void 0===m||m.call(this),this.Dh=void 0,this.Eh=new iL}register(m){var g,v;if(!O(null===(g=this._instance)||void 0===g?void 0:g._addCaptureHook)&&(m.forEach(m=>{var g;this.Ih.add(m),null===(g=m.steps)||void 0===g||g.forEach(m=>{this.Mh.add((null==m?void 0:m.event)||"")})}),null===(v=this._instance)||void 0===v?void 0:v.autocapture)){let m=new Set;this.Ih.forEach(g=>{var v;null===(v=g.steps)||void 0===v||v.forEach(g=>{(null==g?void 0:g.selector)&&m.add(g.selector)})}),this._instance.autocapture.setElementSelectors(m)}}replace(m){this.Ih.clear(),this.Mh.clear(),this.register(m)}on(m,g){null!=g&&0!=m.length&&(this.Mh.has(m)||this.Mh.has(g.event))&&this.Ih.forEach(m=>{this.Lh(g,m)&&this.Eh.emit("actionCaptured",m.name)})}Nh(m){this.onAction("actionCaptured",g=>m(g))}Lh(m,g){if(null==(null==g?void 0:g.steps))return!1;for(let v of g.steps)if(this.Ph(m,v))return!0;return!1}onAction(m,g){return this.Eh.on(m,g)}Ah(m,g){if(null==g?void 0:g.url){var v;let x=null==m||null===(v=m.properties)||void 0===v?void 0:v.$current_url;if(!x||"string"!=typeof x||!zu(x,g.url,g.url_matching||"contains"))return!1}return!0}Fh(m,g){return!!this.qh(m,g)&&!!this.jh(m,g)&&!!this.Bh(m,g)}qh(m,g){var v;if(!(null==g?void 0:g.href))return!0;let x=this.Hh(m);if(x.length>0)return x.some(m=>zu(m.href,g.href,g.href_matching||"exact"));let k=(null==m||null===(v=m.properties)||void 0===v?void 0:v.$elements_chain)||"";return!!k&&zu(function(m){let g=m.match(/(?::|")href="(.*?)"/);return g?g[1]:""}(k),g.href,g.href_matching||"exact")}jh(m,g){var v,x,k,E;if(!(null==g?void 0:g.text))return!0;let T=this.Hh(m);if(T.length>
70)return T.some(m=>zu(m.text,g.text,g.text_matching||"exact")||zu(m.$el_text,g.text,g.text_matching||"exact"));let K=(null==m||null===(E=m.properties)||void 0===E?void 0:E.$elements_chain)||"";return!!K&&(v=function(m){let g;let v=[],x=/(?::|")text="(.*?)"/g;for(;!M(g=x.exec(m));)v.includes(g[1])||v.push(g[1]);return v}(K),x=g.text,k=g.text_matching||"exact",v.some(m=>zu(m,x,k)))}Bh(m,g){var v,x;if(!(null==g?void 0:g.selector))return!0;let k=null==m||null===(v=m.properties)||void 0===v?void 0:v.$element_selectors;if(null==k?void 0:k.includes(g.selector))return!0;let E=(null==m||null===(x=m.properties)||void 0===x?void 0:x.$elements_chain)||"";if(g.selector_regex&&E)try{return new RegExp(g.selector_regex).test(E)}catch(m){}return!1}Hh(m){var g;return null==(null==m||null===(g=m.properties)||void 0===g?void 0:g.$elements)?[]:null==m?void 0:m.properties.$elements}Oh(m,g){return!(null==g?void 0:g.properties)||0===g.properties.length||Pa(g.properties.reduce((m,g)=>{let v=ej(g.value)?g.value.map(String):null!=g.value?[String(g.value)]:[];return m[g.key]={values:v,operator:g.operator||"exact"},m},{}),null==m?void 0:m.properties)}},aA=class{constructor(m){var g,v;this.zh=[],this._instance=m,this.Uh=new Map,this.Wh=new Map,this.Vh=new Map,this.Gh=null===(g=this._instance)||void 0===g||null===(v=g.onSessionId)||void 0===v?void 0:v.call(g,m=>this.Zh(m))}Qh(m){return!1}Jh(){return null}Kh(m){}Yh(){}Xh(m,g){return!!m&&Pa(m.propertyFilters,null==g?void 0:g.properties)}tc(m,g){let v=new Map;return m.forEach(m=>{var x;null===(x=m.conditions)||void 0===x||null===(x=x[g])||void 0===x||null===(x=x.values)||void 0===x||x.forEach(g=>{if(null==g?void 0:g.name){let x=v.get(g.name)||[];x.push(m.id),v.set(g.name,x)}})}),v}ec(m,g,v){let x=(v===r1.Activation?this.Uh:this.Wh).get(m),k=[];return this.nc(m=>{k=m.filter(m=>null==x?void 0:x.includes(m.id))}),k.filter(x=>{var k;let E=null===(k=x.conditions)||void 0===k||null===(k=k[v])||void 0===k||null===(k=k.values)||void 0===k?void 0:k.find(g=>g.name===m);return this.Xh(E,g)})}register(m){this.sc(m,!1)}replace(m){this.sc(m,!0)}sc(m,g){var v;O(null===(v=this._instance)||void 0===v?void 0:v._addCaptureHook)||(this.rc(m,g),this.oc(m,g))}oc(m,g){var v;let x=m.filter(m=>{var g;return null===(g=m.conditions)||void 0===g||null===(g=g.actions)||void 0===g||null===(g=g.values)||void 0===g?void 0:g.length});if(g&&this.Vh.clear(),0===x.length)return void(g&&(null===(v=this.lc)||void 0===v||v.replace([])));this.lc||(this.lc=new aO(this._instance),this.lc.init(),this.lc.Nh(m=>this.onAction(m)));let k=[];x.forEach(m=>{var g;null===(g=m.conditions)||void 0===g||null===(g=g.actions)||void 0===g||g.values.forEach(g=>{if(k.push(g),g.name){var v;let x=null!==(v=this.Vh.get(g.name))&&void 0!==v?v:[];x.includes(m.id)||x.push(m.id),this.Vh.set(g.name,x)}})}),g?this.lc.replace(k):this.lc.register(k)}ac(m,g){g.forEach((g,v)=>{var x;let k=null!==(x=m.get(v))&&void 0!==x?x:[];g.forEach(m=>{k.includes(m)||k.push(m)}),m.set(v,k)})}rc(m,g){var v,x;let k=m.filter(m=>{var g,v;return(null===(g=m.conditions)||void 0===g?void 0:g.events)&&(null===(v=m.conditions)||void 0===v||null===(v=v.events)||void 0===v||null===(v=v.values)||void 0===v?void 0:v.length)>0}),E=m.filter(m=>{var g,v;return(null===(g=m.conditions)||void 0===g?void 0:g.cancelEvents)&&(null===(v=m.conditions)||void 0===v||null===(v=v.cancelEvents)||void 0===v||null===(v=v.values)||void 0===v?void 0:v.length)>0}),T=this.tc(m,r1.Activation),K=this.tc(m,r1.Cancellation);g?(this.Uh=T,this.Wh=K):(this.ac(this.Uh,T),this.ac(this.Wh,K)),(0!==k.length||0!==E.length)&&(null!==(v=this.Dh)&&void 0!==v||(this.Dh=null===(x=this._instance)||void 0===x?void 0:x._addCaptureHook((m,g)=>{this.onEvent(m,g)})))}onEvent(m,g){var v,x;let k=this.uc(),E=(null==g||null===(v=g.properties)||void 0===v?void 0:v.$survey_id)||(null==g||null===(x=g.properties)||void 0===x?void 0:x.$product_tour_id);if(E&&this.getActivatedIds().includes(E)){let g=this.hc(m,E);if("consume"===g)return k.info("event consumed activated item, removing it",{event:m,itemId:E}),void this.cc([E]);if("persist"===g)return k.info("shown item promoted to persisted activation",{event:m,itemId:E}),this.dc(E),void this.vc([E])}if(this.Wh.has(m)){let v=this.ec(m,g,r1.Cancellation);v.length>0&&(k.info("cancel event matched, cancelling items",{event:m,itemsToCancel:v.map(m=>m.id)}),this.cc(v.map(m=>m.id)),v.forEach(m=>this.fc(m.id)))}if(!this.Uh.has(m))return;k.info("event name matched",{event:m,eventPayload:g,items:this.Uh.get(m)});let T=this.ec(m,g,r1.Activation);this.gc(T.map(m=>m.id))}onAction(m){this.Vh.has(m)&&this.gc(this.Vh.get(m)||[])}gc(m){var g,v;if(0===m.length)return;let x=!!(null===(g=this._instance)||void 0===g||null===(v=g.get_session_id)||void 0===v?void 0:v.call(g)),k=[];for(let g of m)x&&this.Qh(g)?this.dc(g)&&this.mc(g):k.push(g);k.length>0&&(this.zh=[...new Set([...this.zh,...k])]),this.uc().info("updating activated items",{activatedItems:this.getActivatedIds()})}dc(m){this.zh=this.zh.filter(g=>g!==m);let g=this.yc();return!g.includes(m)&&(this.bc([...g,m]),this._c(),!0)}cc(m){let g=new Set(m);this.zh=this.zh.filter(m=>!g.has(m));let v=this.wc(),x=v.filter(m=>!g.has(m));x.length!==v.length&&(this.bc(x),0===x.length&&this.kc()),this.vc(m)}Sc(){var m;let g=this.Jh();if(!g)return{};let v=null===(m=this._instance)||void 0===m||null===(m=m.persistence)||void 0===m?void 0:m.props[g];return v&&"object"==typeof v?v:{}}mc(m){if(!this.Jh())return;let g=this.Sc();this.Kh(wi(wi({},g),{},{[m]:Date.now()}))}vc(m){if(!this.Jh())return;let g=this.Sc(),v={},x=!1;for(let[k,E]of Object.entries(g))m.includes(k)?x=!0:v[k]=E;x&&(R(v)?this.Yh():this.Kh(v))}xc(){this.Jh()&&this.Yh()}getActivationTimestamp(m){if(!this.yc().includes(m))return;let g=this.Sc()[m];return D(g)?g:void 0}wc(){var m;let g=this.Cc();return(null===(m=this._instance)||void 0===m||null===(m=m.persistence)||void 0===m?void 0:m.props[g])||[]}yc(){var m,g,v;let x=this.wc();if(0===x.length)return[];let k=null===(m=this._instance)||void 0===m||null===(m=m.persistence)||void 0===m?void 0:m.props[this.$c()],E=null===(g=this._instance)||void 0===g||null===(v=g.get_session_id)||void 0===v?void 0:v.call(g);return E&&k===E?x:[]}_c(){var m,g;let v=null===(m=this._instance)||void 0===m||null===(g=m.get_session_id)||void 0===g?void 0:g.call(m);v&&this.Tc(v)}kc(){this.Ic()}Zh(m){var g;let v=null===(g=this._instance)||void 0===g||null===(g=g.persistence)||void 0===g?void 0:g.props[this.$c()];if(v&&v!==m){let m=this.wc(),g=this.Sc();m.length>0&&(this.bc([]),m.filter(m=>
7D(g[m])).forEach(m=>this.fc(m))),this.kc(),this.xc()}}getActivatedIds(){return[...new Set([...this.yc(),...this.zh])].filter(m=>!this.Mc(m))}dispose(){var m,g,v;null===(m=this.Gh)||void 0===m||m.call(this),this.Gh=void 0,null===(g=this.Dh)||void 0===g||g.call(this),this.Dh=void 0,null===(v=this.lc)||void 0===v||v.dispose(),this.lc=void 0}reset(){this.zh=[],this.wc().length>0&&this.bc([]),this.kc(),this.xc()}getEventToItemsMap(){return this.Uh}Ec(){return this.lc}},aM=class extends aA{constructor(m){super(m)}Cc(){return nM}$c(){return nD}Jh(){return nL}Kh(m){var g;null===(g=this._instance)||void 0===g||null===(g=g.persistence)||void 0===g||g.register({$surveys_activated_timestamps:m})}Yh(){var m;null===(m=this._instance)||void 0===m||null===(m=m.persistence)||void 0===m||m.unregister("$surveys_activated_timestamps")}Qh(m){var g;let v;this.nc(g=>{v=g.find(g=>g.id===m)});let x=null==v||null===(g=v.appearance)||void 0===g?void 0:g.surveyPopupDelaySeconds;return D(x)&&x>0}Pc(){return r3.SHOWN}nc(m){var g;null===(g=this._instance)||void 0===g||g.getSurveys(m)}fc(m){var g;null===(g=this._instance)||void 0===g||g.cancelPendingSurvey(m)}uc(){return iH}bc(m){var g;null===(g=this._instance)||void 0===g||null===(g=g.persistence)||void 0===g||g.register({$surveys_activated:m})}Tc(m){var g;null===(g=this._instance)||void 0===g||null===(g=g.persistence)||void 0===g||g.register({$surveys_activated_session:m})}Ic(){var m;null===(m=this._instance)||void 0===m||null===(m=m.persistence)||void 0===m||m.unregister("$surveys_activated_session")}Mc(){return!1}hc(m,g){var v,x;let k;return this.nc(m=>{k=m.find(m=>m.id===g)}),!k||xa(v=k)&&(null===(x=v.conditions)||void 0===x||null===(x=x.events)||void 0===x?void 0:x.repeatedActivation)||"always"===v.schedule?m===r3.SHOWN?"consume":"ignore":m===r3.SHOWN?"persist":m===r3.DISMISSED||m===r3.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},aD=class{constructor(m){this._instance=m}initialize(){}get(m){if("string"==typeof m)return this._instance.get_property(m);let g={};for(let v of m){let m=this._instance.get_property(v);O(m)||(g[v]=m)}return g}set(m,g){this._instance.register("string"==typeof m?{[m]:g}:m)}remove(m){"string"!=typeof m?m.forEach(m=>this._instance.unregister(m)):this._instance.unregister(m)}},aL=class{constructor(m){this._instance=m}get(){let m=this._instance.config;return{disableSurveys:m.disable_surveys,cookielessMode:!!m.cookieless_mode,advancedEnableSurveys:m.advanced_enable_surveys,requestTimeoutMs:m.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){let m=null==ef?void 0:ef.__PosthogExtensions__;if(!m)return;let{generateSurveys:g,loadExternalDependency:v}=m;return{generateSurveys:g?m=>g(this._instance,m):void 0,loadExternalDependency:v?m=>v(this._instance,"surveys",m):void 0}}createEventReceiver(){return new aM(this._instance)}};let aF=(null==et?void 0:et.location)?yo(et.location.hash,"__posthog")||yo(location.hash,"state"):null,aZ="_postHogToolbarParams",aB=t4("[Toolbar]"),a$=t4("[FeatureFlags]");var aU=class{constructor(m,g=!1){this.Rc=!1,this.update(m,g)}update(m,g){var v,x,k,E,T;this.Ac={bootstrap:{featureFlags:null===(v=m.bootstrap)||void 0===v?void 0:v.featureFlags,featureFlagPayloads:null===(x=m.bootstrap)||void 0===x?void 0:x.featureFlagPayloads},remoteRequestsDisabled:g,featureFlagsDisabled:!!m.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!m.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!m.advanced_feature_flags_dedup_per_session,cacheTtlMs:m.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(k=m.remote_config_refresh_interval_ms)&&void 0!==k?k:3e5,requestTimeoutMs:m.feature_flag_request_timeout_ms,compression:m.disable_compression?void 0:"best-available",evaluationContexts:null!==(E=null!==(T=m.evaluation_contexts)&&void 0!==T?T:m.evaluation_environments)&&void 0!==E?E:[],flagKeys:ej(m.flag_keys)?m.flag_keys:void 0},!m.evaluation_environments||m.evaluation_contexts||this.Rc||(a$.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Rc=!0),O(m.flag_keys)||ej(m.flag_keys)||a$.error("Invalid flag_keys found:",m.flag_keys,"Expected array of non-empty strings")}get(){return this.Ac}};let az=t4("[FeatureFlags]"),aV=t4("[FeatureFlags]",{debugEnabled:!0}),aq="\" failed. Feature flags didn't load in time.",aH="connection_error",sh=m=>{let g={};for(let v=0;m.length>v;v++)g[m[v]]=!0;return g},nh=m=>{let g={};for(let[v,x]of In(m||{}))x&&(g[v]=x);return g},rh=m=>H(m)&&("RangeError"===m.name&&0===m.message.indexOf("Maximum call stack size exceeded")||"InternalError"===m.name&&"too much recursion"===m.message),aW=t4("[Error tracking]"),aK="webkit-masked-url:",aG=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],aQ=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",aK],aY=["__firefox__","__gCrWeb"],aX="Refusing to render web experiment since the viewer is a likely bot",aJ={icontains:(m,g)=>g.toLowerCase().indexOf(m.toLowerCase())>-1,not_icontains:(m,g)=>-1===g.toLowerCase().indexOf(m.toLowerCase()),regex:(m,g)=>Ea(g,m),not_regex:(m,g)=>!Ea(g,m),exact:(m,g)=>g===m,is_not:(m,g)=>g!==m},a0=t4("[Conversations]"),a1="Conversations not available yet.";function ph(m,g){var v,x,k,E,T,K,et;let en=null!==(v=null==m?void 0:m.flushIntervalMs)&&void 0!==v?v:3e3,ei=null!==(x=null==m?void 0:m.maxBufferSize)&&void 0!==x?x:100,es=(null==g?void 0:g.consoleCapture)?void 0:null!==(k=null==m?void 0:m.maxLogsPerInterval)&&void 0!==k?k:1e3,el=O(es)?Math.max(ei,2048):Math.max(ei,es),ec=wi(wi({},function(){let m="",g="";try{let v=null==er?void 0:er.userAgent;v&&([m,g]=Zt(v))}catch(m){}return function(m,g){let v=function(m){if(m)return({}).hasOwnProperty.call(tX,m)?tX[m]:m}(m);return wi(wi({},v?{"os.name":v}:{}),g?{"os.version":g}:{})}(m,g)}()),null==m?void 0:m.resourceAttributes);return{serviceName:null!==(E=null!==(T=null==ec?void 0:ec["service.name"])&&void 0!==T?T:null==m?void 0:m.serviceName)&&void 0!==E?E:null==g?void 0:g.serviceNameDefault,serviceVersion:null!==(K=null==ec?void 0:ec["service.version"])&&void 0!==K?K:null==m?void 0:m.serviceVersion,environment:null!==(et=null==ec?void 0:ec["deployment.environment"])&&void 0!==et?et:null==m?void 0:m.environment,resourceAttributes:ec,beforeSend:null==m?void 0:m.beforeSend,flushIntervalMs:en,maxBufferSize:ei,maxQueueSize:el,maxBatchRecordsPerPost:100,rateCapWindowMs:en,maxLogsPerInterval:es,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}
7let a2=["debug","log","warn","error","info"],gh=m=>{for(;null==m?void 0:m.__rrweb_original__;)m=m.__rrweb_original__;return m},a3="console",a5="__posthogHandledLogsRequestError",yh=(m,g)=>{let v=m instanceof Error?m:Error(g);return v[a5]=!0,v},wh=m=>!!m&&"object"==typeof m&&!0===m[a5],a4={featureFlags:class{constructor(m){this.name="featureFlags",this.Fc=!1,this.featureFlagEventHandlers=[],this.$=az,this.Oc={},this.Dc={},this.Lc=[],this.Nc=!1,this.qc=!1,this.jc=0,this.Bc=!1,this.Hc=!1,this.zc=!1,this.Uc=!1,this.Wc=0,this.sn=()=>{let m=this.Vc();this.Wc=0,m&&this.reloadFeatureFlags()},this.Gc=()=>{var m;let g=this.Zc;O(g)||this.Sr.remoteRequestsDisabled||!ei||"hidden"===ei.visibilityState||Date.now()-(null!==(m=this.Qc)&&void 0!==m?m:0)<g||(this.reloadFeatureFlags(),this.Jc())},this.an=()=>{"visible"===(null==ei?void 0:ei.visibilityState)&&this.Gc()},"get"in m?this.uo=m:(this._instance=m,this.Kc=new aU(m.config,m.Ul()),this.uo=this.Kc)}updateConfig(m,g){var v;null===(v=this.Kc)||void 0===v||v.update(m,g),this.lo&&this.Yc()}setup(m){return this.gh=m,this.$=m.logger.createLogger("[FeatureFlags]"),ju(m.kv.initialize(),()=>{this.gh===m&&(this.gh=void 0,this.lo=m,this.Xc(m))})}Xc(m){var g;if(this.lo===m)return et&&Ln(et,"online",this.sn),this.Yc(),this.td=m.registerDynamicEventProperties(()=>this.ed()?this.Oc:this.Dc),this.nd=null===(g=this._instance)||void 0===g||null===(g=g.persistence)||void 0===g?void 0:g.onCrossTabFeatureFlagChange(()=>{this.sd(),this.rd(),this.od()}),this.rd(),this.initialize()}Yc(){let m=this.Sr.refreshIntervalMs,g=!this.Sr.remoteRequestsDisabled&&ei&&!O(m)&&m>0?m:void 0;g!==this.Zc&&(this.ld(),O(g)||(this.Zc=g,this.Jc(),(null==ei?void 0:ei.addEventListener)&&Ln(ei,n5,this.an)))}Jc(){O(this.Zc)||(O(this.ad)||clearInterval(this.ad),this.Qc=Date.now(),this.ad=setInterval(this.Gc,this.Zc))}ld(){var m;O(this.ad)||(clearInterval(this.ad),this.ad=void 0,null==ei||null===(m=ei.removeEventListener)||void 0===m||m.call(ei,"visibilitychange",this.an)),this.Zc=void 0,this.Qc=void 0}destroy(){this.ud()}dispose(){this.ud()}ud(){var m,g;this.ld(),this.jc++,this.Hc=!1,this.gh=void 0,this.lo&&(this.hd(),null===(m=this.td)||void 0===m||m.dispose(),this.td=void 0,null===(g=this.nd)||void 0===g||g.call(this),this.nd=void 0,this.Lc=[],null==et||et.removeEventListener("online",this.sn),this.lo=void 0)}get Sr(){return this.uo.get()}dd(m){var g;return this.vd&&m in this.vd?this.vd[m]:null===(g=this.lo)||void 0===g?void 0:g.kv.get(m)}sd(){return!!this.vd&&(this.vd=void 0,!0)}fd(){var m;return!O(null===(m=this.lo)||void 0===m?void 0:m.kv.get("$enabled_feature_flags"))&&this.sd()}At(m){this.pd(()=>{var g;return null===(g=this.lo)||void 0===g?void 0:g.kv.set(m)})}gd(m,g,v){var x;if(!(null===(x=this._instance)||void 0===x?void 0:x.persistence)||!m.$enabled_feature_flags)return;let k=this.dd("$enabled_feature_flags")||{},E=m.$enabled_feature_flags||{},T=g.flags||g.featureFlags,K=g.flags?Object.entries(g.flags).filter(([,m])=>!(null==m?void 0:m.failed)).map(([m])=>m):[],et=!!g.errorsWhileComputingFlags&&!!g.flags,en=et?K:v&&!ej(T)?Object.keys(T||{}):Array.from(new Set([...Object.keys(k),...Object.keys(E)])),er=this.dd("$feature_flag_payloads")||{},ei=m.$feature_flag_payloads||{},es=et||v?en:Array.from(new Set([...Object.keys(er),...Object.keys(ei)])),el=!et&&!v,ec=!!el||en,eu={[nw]:ec,[n_]:ec,[nk]:!!el||es};for(let g of(m.$feature_flag_details&&(eu[nC]=ec),[nE,nU,nj]))O(m[g])||(eu[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(eu)}Lt(m){this.pd(()=>{var g;return null===(g=this.lo)||void 0===g?void 0:g.kv.remove(m)})}pd(m){try{m()}catch(m){this.$.error("Failed to update feature flag persistence",m)}}rd(){let m={};for(let g of[nw,nk,nE,nN]){let v=this.dd(g);O(v)||(m[g]=v)}this.Oc=m;let g=wi({},m),v=this.dd(n_);if(v)for(let[m,x]of Object.entries(v))g[`$feature/${m}`]=x;this.Dc=g}ed(){let m=this.Sr.cacheTtlMs;if(!m||0>=m)return!1;let g=this.dd(nU);return"number"!=typeof g||Date.now()-g>m}md(){return!!this.ed()&&(this.Uc||this.qc||(this.Uc=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}yd(){let m=this.Sr.evaluationContexts;return(null==m?void 0:m.length)?m.filter(m=>{let g=m&&"string"==typeof m&&m.trim().length>0;return g||this.$.error("Invalid evaluation context found:",m,"Expected non-empty string"),g}):[]}bd(){let m=this.Sr.flagKeys;if(!O(m))return m.filter(m=>{let g=m&&"string"==typeof m&&m.trim().length>0;return g||this.$.error("Invalid flag key found:",m,"Expected non-empty string"),g})}initialize(){var m,g,v,x;let k=this.Sr,E=null!==(m=null===(g=k.bootstrap)||void 0===g?void 0:g.featureFlags)&&void 0!==m?m:{};if(Object.keys(E).length){let m=null!==(v=null===(x=k.bootstrap)||void 0===x?void 0:x.featureFlagPayloads)&&void 0!==v?v:{},g=Object.keys(E).filter(m=>!O(E[m])).reduce((m,g)=>(m[g]=E[g],m),{}),T=Object.keys(m).filter(m=>g[m]).reduce((g,v)=>(g[v]=m[v],g),{});return this._d({featureFlags:g,featureFlagPayloads:T},void 0,{persist:!1})}}updateFlags(m,g,v){var x,k;let E=(null==v?void 0:v.merge)&&null!==(x=this.dd("$enabled_feature_flags"))&&void 0!==x?x:{},T=(null==v?void 0:v.merge)&&null!==(k=this.dd("$feature_flag_payloads"))&&void 0!==k?k:{},K=wi(wi({},E),m),et=wi(wi({},T),g),en={};
7for(let[m,g]of Object.entries(K))en[m]={key:m,enabled:re(g),variant:oe(g),reason:void 0,metadata:O(null==et?void 0:et[m])?void 0:{id:0,version:void 0,description:void 0,payload:et[m]}};this._d({flags:en})}get hasLoadedFlags(){return this.Nc}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){let m=this.dd(nC),g=this.dd(nN),v=this.dd(nR);if(!v&&!g)return m||{};let x=On({},m||{}),k=[...new Set([...Object.keys(v||{}),...Object.keys(g||{})])];for(let m of k){var E,T;let k=x[m],K=null==g?void 0:g[m],et=O(K)?null!==(E=null==k?void 0:k.enabled)&&void 0!==E&&E:!!K,en=O(K)?null==k?void 0:k.variant:"string"==typeof K?K:void 0,er=null==v?void 0:v[m],ei=wi(wi({},k),{},{enabled:et,variant:et?null!=en?en:null==k?void 0:k.variant:void 0});et!==(null==k?void 0:k.enabled)&&(ei.original_enabled=null==k?void 0:k.enabled),en!==(null==k?void 0:k.variant)&&(ei.original_variant=null==k?void 0:k.variant),er&&(ei.metadata=wi(wi({},null==k?void 0:k.metadata),{},{payload:er,original_payload:null==k||null===(T=k.metadata)||void 0===T?void 0:T.payload})),x[m]=ei}return this.Fc||(this.$.warn(" Overriding feature flag details!",{flagDetails:m,overriddenPayloads:v,finalDetails:x}),this.Fc=!0),x}getAllFeatureFlags(){let m=this.getFlagVariants(),g=this.getFlagPayloads();return Object.keys(m).map(v=>{let x=m[v];return{key:v,enabled:re(x),variant:oe(x),payload:ne(g[v])}})}getFlagVariants(){let m=this.dd(n_),g=this.dd(nN);if(!g)return m||{};let v=On({},m||{}),x=Object.keys(g);for(let m=0;x.length>m;m++)v[x[m]]=g[x[m]];return this.Fc||(this.$.warn(" Overriding feature flags!",{enabledFlags:m,overriddenFlags:g,finalFlags:v}),this.Fc=!0),v}getFlagPayloads(){let m=this.dd(nk),g=this.dd(nR);if(!g)return m||{};let v=On({},m||{}),x=Object.keys(g);for(let m=0;x.length>m;m++)v[x[m]]=g[x[m]];return this.Fc||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:m,overriddenPayloads:g,finalPayloads:v}),this.Fc=!0),v}reloadFeatureFlags(){this.Bc||this.Sr.featureFlagsDisabled||this.Vc()||(this.qc&&(this.Hc=!0),this.wd||(this.Lc.slice().forEach(m=>{try{m()}catch(m){this.$.error("Error while running feature flags reloading callback",m)}}),this.wd=setTimeout(()=>{this.kd()},5)))}hd(){clearTimeout(this.wd),this.wd=void 0}onReloading(m){return this.Lc.push(m),()=>{this.Lc=this.Lc.filter(g=>g!==m)}}ensureFlagsLoaded(){this.Nc||this.qc||this.wd||this.reloadFeatureFlags()}setAnonymousDistinctId(m){this.$anon_distinct_id=m}setReloadingPaused(m){this.Bc=m}resetFlagCallReported(){this.Lt(nZ)}kd(m){this.hd();let g=this.lo;if(!g||this.Sr.remoteRequestsDisabled||this.Vc())return;if(this.qc)return void(this.Hc=!0);let v={token:g.projectToken,distinct_id:g.distinctId,groups:g.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:wi(wi(wi({},g.initialPersonProperties),this.dd("$stored_person_properties")||{}),{},{$lib:g.library.name,$lib_version:g.library.version}),group_properties:this.dd(nP),timezone:Do()};O(g.deviceId)||(v.$device_id=g.deviceId),((null==m?void 0:m.disableFlags)||this.Sr.featureFlagsDisabled)&&(v.disable_flags=!0);let x=this.yd();x.length&&(v.evaluation_contexts=x);let k=this.bd();O(k)||(v.flag_keys=k);let E=this.Sr.onlyEvaluateSurveyFeatureFlags,T=this.jc;this.qc=!0;let a=()=>{this.Hc&&(this.Hc=!1,this.kd())},h=m=>{this.qc=!1,T===this.jc&&(this.At({[n$]:[aH]}),this.$.error("Feature flag request failed",m),this.fd()&&this.od(!0)),a()};try{g.sendRequest("/flags/?v=2"+(E?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:v,compression:this.Sr.compression,sentAt:"body",timeoutMs:this.Sr.requestTimeoutMs}).then(m=>{var g,x;let k=null!==(g=m.json)&&void 0!==g?g:{},K=200!==m.statusCode;if(this.qc=!1,T!==this.jc)return void a();if(this.Sd(m.statusCode),K||this.Hc||(this.$anon_distinct_id=void 0),v.disable_flags&&!this.Hc)return;this.zc=!K;let et=[];m.error?et.push(m.error instanceof Error&&"AbortError"===m.error.name?"timeout":m.error instanceof Error?aH:"unknown_error"):200!==m.statusCode&&et.push(`api_error_${m.statusCode}`),k.errorsWhileComputingFlags&&et.push("errors_while_computing_flags");let en=!!(null===(x=k.quotaLimited)||void 0===x?void 0:x.includes("feature_flags"));en&&et.push("quota_limited"),this.At({[n$]:et}),en?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):v.disable_flags||this._d(k,K,{partialResponse:E}),a()}).catch(h)}catch(m){h(m)}}Vc(){return wo(this.Wc,3)}Sd(m){this.Wc=$o(m,this.Wc,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(m,g={}){var v;if(g.fresh&&!this.zc)return;if(!(this.Nc||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+m+aq);if(this.md())return;let x=this.getFeatureFlagResult(m,g);return null!==(v=null==x?void 0:x.variant)&&void 0!==v?v:null==x?void 0:x.enabled}getFeatureFlagDetails(m){return this.getFlagsWithDetails()[m]}getFeatureFlagPayload(m){let g=this.getFeatureFlagResult(m,{send_event:!1});return null==g?void 0:g.payload}getFeatureFlagResult(m,g={}){var v,x,k,E,T,K,et,en,er,ei,es,el,ec,eu;if(g.fresh&&!this.zc)return;if(!(this.Nc||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+m+aq);if(this.md())return;let ed=this.getFlagVariants(),ep=m in ed,em=ed[m],ef=this.getFlagPayloads()[m],eh=String(em),eg=this.dd("$feature_flag_request_id")||void 0,ev=this.dd("$feature_flag_evaluated_at")||void 0,ey,eb=this.dd("$flag_call_reported")||{};if(this.Sr.deduplicateCallsPerSession){let m=null===(v=this.lo)||void 0===v?void 0:v.session.sessionId,g=this.dd(nB);m&&m!==g&&(eb={},ey=m)}
7if(!g.send_event&&"send_event"in g)ey&&this.At({[nZ]:eb,[nB]:ey});else if(m in eb&&eb[m].includes(eh))ey&&this.At({[nZ]:eb,[nB]:ey});else{ej(eb[m])?eb[m].push(eh):eb[m]=[eh],this.At(wi({[nZ]:eb},ey?{[nB]:ey}:{}));let g=this.getFeatureFlagDetails(m),v=[...null!==(x=this.dd("$feature_flag_errors"))&&void 0!==x?x:[]];O(em)&&v.push("flag_missing");let ed={$feature_flag:m,$feature_flag_response:em,$feature_flag_payload:null!=ef?ef:null,$feature_flag_request_id:eg,$feature_flag_evaluated_at:ev,$feature_flag_bootstrapped_response:null!==(k=null===(E=this.Sr.bootstrap)||void 0===E||null===(E=E.featureFlags)||void 0===E?void 0:E[m])&&void 0!==k?k:null,$feature_flag_bootstrapped_payload:null!==(T=null===(K=this.Sr.bootstrap)||void 0===K||null===(K=K.featureFlagPayloads)||void 0===K?void 0:K[m])&&void 0!==T?T:null,$used_bootstrap_value:!this.zc};O(null==g||null===(et=g.metadata)||void 0===et?void 0:et.has_experiment)||(ed.$feature_flag_has_experiment=g.metadata.has_experiment),O(null==g||null===(en=g.metadata)||void 0===en?void 0:en.version)||(ed.$feature_flag_version=g.metadata.version);let ep=null!==(er=null==g||null===(ei=g.reason)||void 0===ei?void 0:ei.description)&&void 0!==er?er:null==g||null===(es=g.reason)||void 0===es?void 0:es.code;ep&&(ed.$feature_flag_reason=ep),(null==g||null===(el=g.metadata)||void 0===el?void 0:el.id)&&(ed.$feature_flag_id=g.metadata.id),O(null==g?void 0:g.original_variant)&&O(null==g?void 0:g.original_enabled)||(ed.$feature_flag_original_response=O(g.original_variant)?g.original_enabled:g.original_variant),(null==g||null===(ec=g.metadata)||void 0===ec?void 0:ec.original_payload)&&(ed.$feature_flag_original_payload=null==g||null===(eu=g.metadata)||void 0===eu?void 0:eu.original_payload),v.length&&(ed.$feature_flag_error=v.join(",")),this.xd(ed)}return ep?{key:m,enabled:!!em,variant:"string"==typeof em?em:void 0,payload:ne(ef)}:void 0}xd(m){try{var g;null===(g=this.lo)||void 0===g||g.capture("$feature_flag_called",m).catch(m=>{this.$.error("Failed to capture feature flag call",m)})}catch(m){this.$.error("Failed to capture feature flag call",m)}}getRemoteConfigPayload(m,g){this.Cd(m,g)}Cd(m,g){var v=this;return Y(function*(){let x;let k=v.lo;if(!k)return;let E={distinct_id:k.distinctId,token:k.projectToken,person_properties:{$lib:k.library.name,$lib_version:k.library.version}},T=v.yd();T.length&&(E.evaluation_contexts=T);let K=v.bd();O(K)||(E.flag_keys=K);try{var et;let g=null===(et=(yield k.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:E,compression:v.Sr.compression,sentAt:"body",timeoutMs:v.Sr.requestTimeoutMs})).json)||void 0===et?void 0:et.featureFlagPayloads;x=(null==g?void 0:g[m])||void 0}catch(m){return void v.$.error("Remote config feature flag request failed",m)}try{g(x)}catch(m){v.$.error("Remote config feature flag callback failed",m)}})()}isFeatureEnabled(m,g={}){if(g.fresh&&!this.zc)return g.defaultValue;if(!(this.Nc||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+m+aq),g.defaultValue;let v=this.getFeatureFlag(m,g);return O(v)?g.defaultValue:!!v}addFeatureFlagsHandler(m){this.featureFlagEventHandlers.push(m)}removeFeatureFlagsHandler(m){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(g=>g!==m)}receivedFeatureFlags(m,g,v){this._d(m,g,v)}_d(m,g,v){if(!this.lo)return;this.Nc=!0;let x=((m,g={},v={},x={},k,E=az)=>{let T=((m,g)=>{let v=m.flags;if(v){let g=Object.fromEntries(Object.keys(v).map(m=>{var g;return[m,null!==(g=v[m].variant)&&void 0!==g?g:v[m].enabled]})),x=Object.fromEntries(Object.keys(v).filter(m=>v[m].enabled).filter(m=>{var g;return!O(null===(g=v[m].metadata)||void 0===g?void 0:g.payload)}).map(m=>{var g;return[m,null===(g=v[m].metadata)||void 0===g?void 0:g.payload]}));return wi(wi({},m),{},{featureFlags:g,featureFlagPayloads:x})}return m.featureFlags&&g.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),m})(m,E),K=T.flags,et=T.featureFlags,en=T.featureFlagPayloads;if(!et)return;let er=m.requestId,ei=m.evaluatedAt;if(ej(et)){E.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");let m={};if(et)for(let g=0;et.length>g;g++)m[et[g]]=!0;return{[nw]:et,[n_]:m,[nj]:!1}}let es=et,el=en,ec=K;if(null==k?void 0:k.partialResponse){let m=Object.keys(es),k=el||{};es=wi(wi({},g),es),el=wi(wi({},v),k),m.forEach(m=>{m in k||null==el||delete el[m]}
7),ec=wi(wi({},x),ec)}else if(m.errorsWhileComputingFlags){if(K){let m=new Set(Object.keys(K).filter(m=>{var g;return!(null===(g=K[m])||void 0===g?void 0:g.failed)}));es=wi(wi({},g),Object.fromEntries(Object.entries(es).filter(([g])=>m.has(g))));let k=Object.fromEntries(Object.entries(el||{}).filter(([g])=>m.has(g)));el=wi(wi({},v),k),m.forEach(m=>{m in k||null==el||delete el[m]}),ec=wi(wi({},x),Object.fromEntries(Object.entries(ec||{}).filter(([g])=>m.has(g))))}else es=wi(wi({},g),es),el=wi(wi({},v),el),ec=wi(wi({},x),ec)}return wi(wi({[nw]:Object.keys(nh(es)),[n_]:es||{},[nk]:el||{},[nC]:ec||{},[nj]:!0===m.minimalFlagCalledEvents},er?{[nE]:er}:{}),ei?{[nU]:ei}:{})})(m,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),v,this.$);if(x){if(!1===(null==v?void 0:v.persist)){let m=!O(this.lo.kv.get(n_));this.vd=x,m||this.At(x)}else this.sd(),this.gd(x,m,!!(null==v?void 0:v.partialResponse)),this.At(x)}else g&&this.fd();g||(this.Uc=!1),this.od(g)}override(m,g=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:m,suppressWarning:g})}overrideFeatureFlags(m){this.$d(m)}$d(m){if(this.lo){if(!1===m)return this.Lt([nN,nR]),this.od(),void aV.info("All overrides cleared");if(ej(m))return this.At({[nN]:sh(m)}),this.od(),void aV.info("Flag overrides set",{flags:m});if(m&&"object"==typeof m&&("flags"in m||"payloads"in m)){var g;this.Fc=!!(null!==(g=m.suppressWarning)&&void 0!==g&&g);let v={},x=m.flags,k=m.payloads;return x&&(v[nN]=ej(x)?sh(x):x),k&&(v[nR]=k),Object.keys(v).length&&this.At(v),!1===x&&!1===k?this.Lt([nN,nR]):!1===x?this.Lt(nN):!1===k&&this.Lt(nR),this.od(),!1===x?aV.info("Flag overrides cleared"):x&&aV.info("Flag overrides set",{flags:x}),void(!1===k?aV.info("Payload overrides cleared"):k&&aV.info("Payload overrides set",{payloads:k}))}if(m&&"object"==typeof m)return this.At({[nN]:m}),this.od(),void aV.info("Flag overrides set",{flags:m});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:m})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(m){if(this.addFeatureFlagsHandler(m),this.Nc){let{flags:g,flagVariants:v}=this.Td();try{m(g,v)}catch(m){this.$.error("Error while running feature flags callback",m)}}return()=>this.removeFeatureFlagsHandler(m)}updateEarlyAccessFeatureEnrollment(m,g,v){var x,k;let E=(this.dd("$early_access_features")||[]).find(g=>g.flagKey===m),T={[`$feature_enrollment/${m}`]:g},K={$feature_flag:m,$feature_enrollment:g,$set:T};E&&(K.$early_access_feature_name=E.name),v&&(K.$feature_enrollment_stage=v);let et=wi(wi({},this.getFlagVariants()),{},{[m]:g});null===(x=this._instance)||void 0===x||null===(x=x.persistence)||void 0===x||x.markCrossTabFeatureFlagChanges({$active_feature_flags:[m],$enabled_feature_flags:[m],$stored_person_properties:Object.keys(T)}),this.At({[nw]:Object.keys(nh(et)),[n_]:et,[nI]:wi(wi({},this.dd("$stored_person_properties")||{}),T)}),this.od();try{null===(k=this.lo)||void 0===k||k.capture("$feature_enrollment_update",K).catch(m=>{this.$.error("Failed to capture early access feature enrollment",m)})}catch(m){this.$.error("Failed to capture early access feature enrollment",m)}}getEarlyAccessFeatures(m,g=!1,v){let x=this.dd(nS);!x||g?this.Id(m,v):m(x)}Id(m,g){var v=this;return Y(function*(){let x;let k=v.lo;if(!k)return;let E=g?`&${g.map(m=>`stage=${m}`).join("&")}`:"";try{let m=yield k.sendRequest(`/api/early_access_features/?token=${k.projectToken}${E}`,{target:"api",method:"GET",sentAt:"query"});if(!m.json)return;x=m.json.earlyAccessFeatures,v.At({[nS]:x})}catch(m){return void v.$.error("Early access feature request failed",m)}try{m(x)}catch(m){v.$.error("Early access feature callback failed",m)}})()}Td(){let m=this.getFlags(),g=this.getFlagVariants();return{flags:m.filter(m=>g[m]),flagVariants:Object.keys(g).filter(m=>g[m]).reduce((m,v)=>(m[v]=g[v],m),{})}}od(m){this.rd();let{flags:g,flagVariants:v}=this.Td();this.featureFlagEventHandlers.forEach(x=>{try{x(g,v,{errorsLoading:m})}catch(m){this.$.error("Error while running feature flags callback",m)}})}setPersonPropertiesForFlags(m,g=!0){this.Md(m,g)}Md(m,g=!0){let v=this.dd("$stored_person_properties")||{},x=(null==m?void 0:m.$set)||((null==m?void 0:m.$set_once)?{}:m),k=null==m?void 0:m.$set_once,E={};if(k)for(let m in k)({}).hasOwnProperty.call(k,m)&&(m in v||(E[m]=k[m]));this.At({[nI]:wi(wi(wi({},v),E),x)}),g&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(m,g=!0){let v=wi({},this.dd("$stored_person_properties")||{});m.forEach(m=>{delete v[m]}),this.At({[nI]:v}),g&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(m=!0){this.Lt(nI),m&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(m,g=!0){let v=this.dd("$stored_group_properties")||{},x=wi({},v);for(let g of Object.keys(m))x[g]=wi(wi({},v[g]),m[g]);this.At({[nP]:x}),g&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(m){if(m){let g=this.dd("$stored_group_properties")||{};this.At({[nP]:wi(wi({},g),{},{[m]:{}})})}else this.Lt(nP)}reset(){this.jc++,this.Hc=!1,this.Oc={},this.Dc={},this.vd=void 0,this.Nc=!1,this.Bc=!1,this.zc=!1,this.$anon_distinct_id=void 0,this.hd(),this.Fc=!1,this.Wc=0}}},a6=wi({productTours:class{get ga(){return this._instance.persistence}constructor(m){this.zv=null,this.Uv=null,this._instance=m}initialize(){this.loadIfEnabled()}onRemoteConfig(m){if(!m.ok)return;let g=m.config;if("productTours"in g){var v,x;if(this.ga&&this.ga.register({[nf]:!!g.productTours}),!Au(this._instance))return!this.zv&&M(null===(v=this.ga)||void 0===v?void 0:v.props.ph_product_tours)||aE.info("product tours disabled; stopping and clearing cached tours"),null===(x=this.zv)||void 0===x||x.stop(),this.zv=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.zv&&Au(this._instance)&&this.Eo(()=>this.Wv())}Eo(m){var g,v,x;(null===(g=ef.__PosthogExtensions__)||void 0===g?void 0:g.generateProductTours)?m():null===(v=ef.__PosthogExtensions__)||void 0===v||null===(x=v.loadExternalDependency)||void 0===x||x.call(v,this._instance,"product-tours",g=>{g?aE.error("Could not load product tours script",g):m()})}Wv(){var m;!this.zv&&(null===(m=ef.__PosthogExtensions__)||void 0===m?void 0:m.generateProductTours)&&(this.zv=ef.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(m,g=!1){if(ej(this.Uv)&&!g)return void m(this.Uv,{isLoaded:!0});let v=this.ga;if(v){let x=v.props[nF];if(ej(x)&&!g)return this.Uv=x,void m(x,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:g=>{if(!Au(this._instance))return void m([],{isLoaded:!0});let x=g.statusCode;if(200!==x||!g.json){let v=`Product Tours API could not be loaded, status: ${x}
7`;return 0===x?g.error||aE.warn(v):aE.error(v),void m([],{isLoaded:!1,error:v})}let k=ej(g.json.product_tours)?g.json.product_tours:[];this.Uv=k,v&&v.register({[nF]:k}),m(k,{isLoaded:!0})}})}getActiveProductTours(m){M(this.zv)?m([],{isLoaded:!1,error:"Product tours not loaded"}):this.zv.getActiveProductTours(m)}showProductTour(m){var g;null===(g=this.zv)||void 0===g||g.showTourById(m)}previewTour(m){this.zv?this.zv.previewTour(m):this.Eo(()=>{var g;this.Wv(),null===(g=this.zv)||void 0===g||g.previewTour(m)})}dismissProductTour(){var m;null===(m=this.zv)||void 0===m||m.dismissTour("user_clicked_skip")}nextStep(){var m;null===(m=this.zv)||void 0===m||m.nextStep()}previousStep(){var m;null===(m=this.zv)||void 0===m||m.previousStep()}clearCache(){var m;this.Uv=null,null===(m=this.ga)||void 0===m||m.unregister("ph_product_tours")}resetTour(m){var g;null===(g=this.zv)||void 0===g||g.resetTour(m)}resetAllTours(){var m;null===(m=this.zv)||void 0===m||m.resetAllTours()}cancelPendingTour(m){var g;null===(g=this.zv)||void 0===g||g.cancelPendingTour(m)}}},a4),a7=wi({surveys:class extends aT{constructor(m){super(new aL(m),{get projectToken(){return m.config.token},kv:new aD(m)}),this._instance=m}wh(m,g){let v=g.query?Zl(m,g.query):m;return new Promise(m=>{var x;this._instance._send_request({method:g.method,url:this._instance.requestRouter.endpointFor(null!==(x=g.target)&&void 0!==x?x:"api",v),data:g.body,headers:g.headers,timeout:g.timeoutMs,fireCallbackOnDrop:!0,transport:g.transport,compression:g.compression,timestampMode:g.sentAt,callback:m})})}}},a4),a8=wi({experiments:class i{get Sr(){return this._instance.config}constructor(m){this._instance=m,this.getWebExperimentsAndEvaluateDisplayLogic=(m=!1)=>{this.getWebExperiments(m=>{i.vf("retrieved web experiments from the server"),this.ff=new Map,m.forEach(m=>{if(m.feature_flag_key){var g;this.ff&&(i.vf("setting flag key ",m.feature_flag_key," to web experiment ",m),null===(g=this.ff)||void 0===g||g.set(m.feature_flag_key,m));let v=this._instance.getFeatureFlag(m.feature_flag_key);I(v)&&m.variants[v]&&this.pf(m.name,v,m.variants[v].transforms)}else if(m.variants)for(let g in m.variants){let v=m.variants[g];i.gf(v,this._instance)&&this.pf(m.name,g,v.transforms)}})},m)},this._instance.onFeatureFlags(m=>{this.onFeatureFlags(m)})}initialize(){}onFeatureFlags(m){if(this._is_bot())i.vf(aX);else if(!this.Sr.disable_web_experiments){if(M(this.ff))return this.ff=new Map,this.loadIfEnabled(),void this.previewWebExperiment();i.vf("applying feature flags",m),m.forEach(m=>{var g,v;if(this.ff&&(null===(g=this.ff)||void 0===g?void 0:g.has(m))){let g=this._instance.getFeatureFlag(m),x=null===(v=this.ff)||void 0===v?void 0:v.get(m);g&&(null==x?void 0:x.variants[g])&&this.pf(x.name,g,x.variants[g].transforms)}})}}previewWebExperiment(){let m=i.getWindowLocation();if(null==m?void 0:m.search){let g=mo(null==m?void 0:m.search,"__experiment_id"),v=mo(null==m?void 0:m.search,"__experiment_variant");g&&v&&(i.vf(`previewing web experiments ${g} && ${v}`),this.getWebExperiments(m=>{this.mf(parseInt(g),v,m)},!1,!0))}}loadIfEnabled(){this.Sr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(m,g,v){if(this.Sr.disable_web_experiments&&!v)return m([]);let x=this._instance.get_property("$web_experiments");if(x&&!g)return m(x);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Sr.token}`),method:"GET",timestampMode:"query",callback:g=>m(200===g.statusCode&&g.json&&g.json.experiments||[])})}mf(m,g,v){let x=v.filter(g=>g.id===m);x&&x.length>0&&(i.vf(`Previewing web experiment [${x[0].name}] with variant [${g}]`),this.pf(x[0].name,g,x[0].variants[g].transforms))}static gf(m,g){return!M(m.conditions)&&i.yf(m,g)&&i.bf(m)}static yf(m,g){var v,x,k,E;if(M(m.conditions)||M(null===(v=m.conditions)||void 0===v?void 0:v.url))return!0;let T=i.getWindowLocation();if(T){let v=_r(g,T.href);return!(null===(x=m.conditions)||void 0===x?void 0:x.url)||aJ[null!==(k=null===(E=m.conditions)||void 0===E?void 0:E.urlMatchType)&&void 0!==k?k:"icontains"](m.conditions.url,v)}return!1}
7static getWindowLocation(){return null==et?void 0:et.location}static bf(m){var g,v,x,k,E,T,K,et,en;if(M(m.conditions)||M(null===(g=m.conditions)||void 0===g?void 0:g.utm))return!0;let er=To();if(er.utm_source){let g=!(null===(v=m.conditions)||void 0===v||null===(v=v.utm)||void 0===v?void 0:v.utm_campaign)||(null===(x=m.conditions)||void 0===x||null===(x=x.utm)||void 0===x?void 0:x.utm_campaign)==er.utm_campaign,ei=!(null===(k=m.conditions)||void 0===k||null===(k=k.utm)||void 0===k?void 0:k.utm_source)||(null===(E=m.conditions)||void 0===E||null===(E=E.utm)||void 0===E?void 0:E.utm_source)==er.utm_source,es=!(null===(T=m.conditions)||void 0===T||null===(T=T.utm)||void 0===T?void 0:T.utm_medium)||(null===(K=m.conditions)||void 0===K||null===(K=K.utm)||void 0===K?void 0:K.utm_medium)==er.utm_medium,el=!(null===(et=m.conditions)||void 0===et||null===(et=et.utm)||void 0===et?void 0:et.utm_term)||(null===(en=m.conditions)||void 0===en||null===(en=en.utm)||void 0===en?void 0:en.utm_term)==er.utm_term;return g&&es&&el&&ei}return!1}static vf(m,...g){t5.info(`[WebExperiments] ${m}`,g)}pf(m,g,v){this._is_bot()?i.vf(aX):"control"!==g?v.forEach(v=>{if(v.selector){var x;i.vf(`applying transform of variant ${g} for experiment ${m} `,v);let k=null===(x=document)||void 0===x?void 0:x.querySelectorAll(v.selector);null==k||k.forEach(m=>{v.html&&(m.innerHTML=v.html),v.css&&m.setAttribute("style",v.css)})}}):i.vf("Control variants leave the page unmodified.")}_is_bot(){return er&&this._instance?wa(er,this.Sr.custom_blocked_useragents):void 0}}},a4);au.__defaultExtensionClasses=wi({},wi(wi(wi(wi(wi(wi(wi(wi(wi(wi(wi(wi(wi({},a4),{sessionRecording:class{get Sr(){return this._instance.config}get ga(){return this._instance.persistence}get started(){var m;return!!(null===(m=this.Ed)||void 0===m?void 0:m.isStarted)}get status(){var m,g;return"awaiting_config"===this.Pd||"missing_config"===this.Pd?this.Pd:null!==(m=null===(g=this.Ed)||void 0===g?void 0:g.status)&&void 0!==m?m:this.Pd}constructor(m){if(this._instance=m,this._forceAllowLocalhostNetworkCapture=!1,this.Pd=aw,this.Rd=void 0,this.Ad=!1,this.Ke=(()=>{var m,g;if(!(null==ei?void 0:ei.visibilityState)||"visible"===ei.visibilityState)return!0;let v=null==et||null===(m=et.performance)||void 0===m||null===(g=m.getEntriesByType)||void 0===g?void 0:g.call(m,"visibility-state");return!(null==v?void 0:v.length)||v.some(m=>"visible"===m.name)})(),this.an=()=>{var m,g;"visible"===(null==ei?void 0:ei.visibilityState)&&(this.Ke=!0,null===(m=this.Ed)||void 0===m||null===(g=m.setDocumentWasEverVisible)||void 0===g||g.call(m,!0))},!this._instance.sessionManager)throw aC.error("started without valid sessionManager"),Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Sr.cookieless_mode)throw Error('[SessionRecording] cannot be used with cookieless_mode="always"');(null==ei?void 0:ei.addEventListener)&&Ln(ei,"visibilitychange",this.an)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:m=!1}={}){var g;this.Ad=!0,null==ei||null===(g=ei.removeEventListener)||void 0===g||g.call(ei,"visibilitychange",this.an),m?this.Fd(!0):this.stopRecording()}get Od(){var m;let g=!!(null===(m=this._instance.get_property("$session_recording_remote_config"))||void 0===m?void 0:m.enabled),v=!this.Sr.disable_session_recording,x=this.Sr.disable_session_recording||this._instance.consent.isOptedOut();return et&&g&&v&&!x}startIfEnabledOrStop(m){var g;if(this.Ad||this.Od&&(null===(g=this.Ed)||void 0===g?void 0:g.isStarted))return;let v=!O(Object.assign)&&!O(Array.from);this.Od&&v?(this.Dd(m),aC.info("starting")):(this.Pd=aw,this.stopRecording())}Dd(m){var g,v,x,k;if(this.Od){if("awaiting_config"!==this.Pd&&"missing_config"!==this.Pd&&(this.Pd=aS),(null==ef||null===(g=ef.__PosthogExtensions__)||void 0===g||null===(g=g.rrweb)||void 0===g?void 0:g.record)&&(null===(v=ef.__PosthogExtensions__)||void 0===v?void 0:v.initSessionRecording))this.Ld(m);else{let g=this._instance.sessionManager;null===(x=ef.__PosthogExtensions__)||void 0===x||null===(k=x.loadExternalDependency)||void 0===k||k.call(x,this._instance,this.Nd,v=>{if(!this.Ad&&this.Od&&this._instance.sessionManager===g)return v?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),aC.error("could not load recorder",v)):void this.Ld(m);this.Pd="disabled"})}}}stopRecording(){var m,g;null===(m=this.Rd)||void 0===m||m.call(this),this.Rd=void 0,null===(g=this.Ed)||void 0===g||g.stop()}Fd(m=!1){var g,v;null===(g=this.Rd)||void 0===g||g.call(this),this.Rd=void 0,null===(v=this.Ed)||void 0===v||v.discard({discardProducerEvents:m})}qd(){var m,g;null===(m=this.ga)||void 0===m||m.unregister("$session_is_sampled"),null===(g=this.ga)||void 0===g||g.unregister("$replay_sample_rate")}jd(m,g){if(M(m))return null;let v=D(m)?m:parseFloat(m);return"number"!=typeof v||!Number.isFinite(v)||0>v||v>1?(aC.warn(`${g} must be between 0 and 1. Ignoring invalid value:`,m),null):v}Bd(m){if(this.ga){var g,v;let x=this.ga,n=()=>{var g;let v=!1===m.sessionRecording?void 0:m.sessionRecording,k=this.jd(null===(g=this.Sr.session_recording)||void 0===g?void 0:g.sampleRate,"session_recording.sampleRate"),E=this.jd(null==v?void 0:v.sampleRate,"remote config sampleRate"),T=null!=k?k:E;M(T)&&this.qd();let K=null==v?void 0:v.minimumDurationMilliseconds;x.register({[ny]:wi(wi({cache_timestamp:Date.now(),enabled:!!v},v),{},{networkPayloadCapture:wi({capturePerformance:m.capturePerformance},null==v?void 0:v.networkPayloadCapture),canvasRecording:{enabled:null==v?void 0:v.recordCanvas,fps:null==v?void 0:v.canvasFps,quality:null==v?void 0:v.canvasQuality},sampleRate:T,minimumDurationMilliseconds:O(K)?null:K,endpoint:null==v?void 0:v.endpoint,triggerMatchType:null==v?void 0:v.triggerMatchType,masking:null==v?void 0:v.masking,urlTriggers:null==v?void 0:v.urlTriggers,version:null==v?void 0:v.version,triggerGroups:null==v?void 0:v.triggerGroups})})};n(),null===(g=this.Rd)||void 0===g||g.call(this),this.Rd=null===(v=this._instance.sessionManager)||void 0===v?void 0:v.onSessionId(n)}}onRemoteConfig(m){let g=m.ok?m.config:void 0;return g&&"sessionRecording"in g?!1===g.sessionRecording?(this.Bd(g),void this.Fd()):(this.Bd(g),void this.startIfEnabledOrStop()):("awaiting_config"===this.Pd&&(this.Pd="missing_config",aC.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(m,g="log"){var v;(null===(v=this.Ed)||void 0===v?void 0:v.log)?this.Ed.log(m,g):aC.warn("log called before recorder was ready")}get Nd(){var m,g;let v=null===(m=this._instance)||void 0===m||null===(m=m.persistence)||void 0===m?void 0:m.get_property(ny);return(null==v||null===(g=v.scriptConfig)||void 0===g?void 0:g.script)||"lazy-recorder"}Hd(){let m;let g=this._instance.get_property(ny);if(!g)return!1;try{m="object"==typeof g?g:JSON.parse(g)}catch(m){return aC.warn("persisted remote config for session recording is invali
7d and will be ignored",m),!1}return!M(m.cache_timestamp)&&36e5>=Date.now()-m.cache_timestamp}Ld(m){var g,v,x,k;if(!this.Ad&&this.Od&&this._instance.sessionManager){if(!(null===(g=ef.__PosthogExtensions__)||void 0===g?void 0:g.initSessionRecording))return aC.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[nJ]:!0});if(this.Ed||(this.Ed=null===(k=ef.__PosthogExtensions__)||void 0===k?void 0:k.initSessionRecording(this._instance,this.Ke),this.Ed._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Hd()){if("missing_config"===this.Pd||"awaiting_config"===this.Pd)return;return this.Pd="awaiting_config",aC.info("persisted remote config is stale, requesting fresh config before starting"),void new ir(this._instance).load()}this.Pd=aS,null===(v=(x=this.Ed).setDocumentWasEverVisible)||void 0===v||v.call(x,this.Ke),this.Ed.start(m)}else this.Pd=aw}onRRwebEmit(m){var g,v;null===(g=this.Ed)||void 0===g||null===(v=g.onRRwebEmit)||void 0===v||v.call(g,m)}overrideLinkedFlag(){var m,g;this.Ed||null===(g=this.ga)||void 0===g||g.register({$replay_override_linked_flag:!0}),null===(m=this.Ed)||void 0===m||m.overrideLinkedFlag()}overrideSampling(){var m,g;this.Ed||null===(g=this.ga)||void 0===g||g.register({$replay_override_sampling:!0}),null===(m=this.Ed)||void 0===m||m.overrideSampling()}overrideTrigger(m){var g,v;this.Ed||null===(v=this.ga)||void 0===v||v.register({["url"===m?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null===(g=this.Ed)||void 0===g||g.overrideTrigger(m)}get sdkDebugProperties(){var m;return(null===(m=this.Ed)||void 0===m?void 0:m.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(m,g){var v;return!!(null===(v=this.Ed)||void 0===v?void 0:v.tryAddCustomEvent(m,g))}flushBeforeIdentityReset(){var m,g;null===(m=this.Ed)||void 0===m||null===(g=m.flushBeforeIdentityReset)||void 0===g||g.call(m)}}}),{autocapture:class extends af{constructor(m){super(new ah(m)),this.instance=m}},historyAutocapture:class{constructor(m){this._instance=m,this.zd=this.Ud()}initialize(){this.startIfEnabled()}get isEnabled(){let m=this.Wd();return!!(m.path||m.search||this.Vd(m))}startIfEnabled(){this.isEnabled&&(t5.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.zd=this.Ud(),this.startIfEnabled()}stop(){this.Gd&&this.Gd(),this.Gd=void 0,this.Zd&&this.Zd(),this.Zd=void 0,t5.info("History API monitoring stopped")}monitorHistoryChanges(){et&&et.history&&(this.Qd("pushState"),this.Qd("replaceState"),this.Jd(),this.Vd()&&this.Kd())}Qd(m){var g;if(!et||(null===(g=et.history[m])||void 0===g?void 0:g.__posthog_wrapped__))return;let v=this;wu(et.history,m,g=>function(x,k,E){g.call(this,x,k,E),v.Yd(m)})}Ud(){let m=null==et?void 0:et.location;if(null==m?void 0:m.pathname)return{pathname:m.pathname,search:m.search,hash:m.hash}}Wd(){let m=this._instance.config.capture_pageview;return"history_change"===m?{path:!0}:C(m)?m:{}}Vd(m=this.Wd()){return!!m.hash&&!this._instance.config.disable_capture_url_hashes}Xd(m){let g=this.Wd(),v=this.zd;return!(!v||!(g.path&&m.pathname!==v.pathname||g.search&&m.search!==v.search||this.Vd(g)&&m.hash!==v.hash))}Yd(m){try{let g=this.Ud();if(!g)return;this.Xd(g)&&this._instance.capture(n6,{navigation_type:m}),this.zd=g}catch(g){t5.error(`Error capturing ${m} pageview`,g)}}Jd(){if(this.Gd)return;let i=()=>{this.Yd("popstate")};Ln(et,"popstate",i),this.Gd=()=>{et&&et.removeEventListener("popstate",i)}}Kd(){if(this.Zd)return;let i=()=>{this.Yd("hashchange")};Ln(et,"hashchange",i),this.Zd=()=>{et&&et.removeEventListener("hashchange",i)}}},heatmaps:class{get Sr(){return this.instance.config}constructor(m){var g;this.tv=!1,this.ho=!1,this.ev=null,this.instance=m,this.tv=!!(null===(g=this.instance.persistence)||void 0===g?void 0:g.props[no]),this.rageclicks=new ad(m.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let m=5e3;return C(this.Sr.capture_heatmaps)&&this.Sr.capture_heatmaps.flush_interval_milliseconds&&(m=this.Sr.capture_heatmaps.flush_interval_milliseconds),m}get isEnabled(){return M(this.Sr.capture_heatmaps)?M(this.Sr.enable_heatmaps)?this.tv:this.Sr.enable_heatmaps:!1!==this.Sr.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.ho||(ak.info("starting..."),this.iv(),this.an());else{var m;clearInterval(null!==(m=this.ev)&&void 0!==m?m:void 0),this.nv(),this.getAndClearBuffer()}}onRemoteConfig(m){if(!m.ok)return;let g=m.config;if(!("heatmaps"in g))return;let v=!!g.heatmaps;this.instance.persistence&&this.instance.persistence.register({[no]:v}),this.tv=v,this.startIfEnabled()}getAndClearBuffer(){let m=this.Rt;return this.Rt=void 0,m}sv(m){Iu(m.originalEvent)&&this._r(m.originalEvent,"deadclick")}an(){this.ev&&clearInterval(this.ev),this.ev="visible"===(null==ei?void 0:ei.visibilityState)?setInterval(this.oa.bind(this),this.flushIntervalMilliseconds):null}iv(){et&&ei&&(this.rv=this.oa.bind(this),Ln(et,n4,this.rv),this.ov=m=>this._r(m||(null==et?void 0:et.event)),Ln(ei,"click",this.ov,{capture:!0}),this.lv=m=>this.av(m||(null==et?void 0:et.event)),Ln(ei,"mousemove",this.lv,{capture:!0}),this.uv=new rD(this.instance,eo,this.sv.bind(this)),this.uv.startIfEnabledOrStop(),this.hv=this.an.bind(this),Ln(ei,n5,this.hv),this.ho=!0)}nv(){var m;et&&ei&&(this.rv&&et.removeEventListener(n4,this.rv),this.ov&&ei.removeEventListener("click",this.ov,{capture:!0}),this.lv&&ei.removeEventListener("mousemove",this.lv,{capture:!0}),this.hv&&ei.removeEventListener(n5,this.hv),clearTimeout(this.dv),null===(m=this.uv)||void 0===m||m.stop(),this.ho=!1)}vv(m,g){let v=this.instance.scrollManager.scrollY(),x=this.instance.scrollManager.scrollX(),k=this.instance.scrollManager.scrollElement(),E=function(m,g,v){let x=m;for(;x&&mr(x)&&!br(x,"body");){let m;if(x===v)break;try{var k,E,T;m=null===(k=null!==(E=null===(T=x.ownerDocument)||void 0===T?void 0:T.defaultView)&&void 0!==E?E:et)||void 0===k?void 0:k.getComputedStyle(x).position}catch(m){break}if(b(g,m))return!0;x=Or(x)}return!1}(Tr(m),["fixed","sticky"],k);return{x:m.clientX+(E?0:x),y:m.clientY+(E?0:v),target_fixed:E,type:g}}_r(m,g="click"){var v;if(gr(m.target)||!Iu(m))return;let x=this.vv(m,g);(null===(v=this.rageclicks)||void 0===v?void 0:v.isRageClick(m.clientX,m.clientY,(new Date).getTime()))&&jr(Tr(m),this.instance.config.rageclick)&&this.Hs(wi(wi({},x),{},{type:"rageclick"})),this.Hs(x)}av(m){!gr(m.target)&&Iu(m)&&(clearTimeout(this.dv),this.dv=setTimeout(()=>{this.Hs(this.vv(m,"mousemove"))},500))}Hs(m){if(!et)return;let g=this.Sr.disable_capture_url_hashes?hi(et.location.href):et.location.href,v=this.Sr.custom_personal_data_properties,x=this.Sr.mask_personal_data_properties?[...rV,...v||[]]:[],k=bo(g,x,rH);this.Rt=this.Rt||{},this.Rt[k]||(this.Rt[k]=[]),this.Rt[k].push(m)}oa(){this.Rt&&!R(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rD,webVitalsAutocapture:class{constructor(m){var g;this._instance=m,this.tv=!1,this.ho=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.fv=()=>{clearTimeout(this.pv),this.pv=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",wi({$current_url:this.Rt.url},this.Rt.metrics.reduce((m,g)=>wi(wi({},m),{},{[`$web_vitals_${g.name}_event`]:wi({},g),[`$web_vitals_${g.name}_value`]:g.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.gv=m=>{var g;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},M(null==m?void 0:m.name)||M(null==m?void 0:m.value))return void ay.error("Invalid metric received",m);let v="string"==typeof m.navigationURL?m.navigationURL:void 0,x=this.mv(v);if(O(x))return;let k=D(m.navigationId)||"string"==typeof m.navigationId?`navigation:${m.navigationId}`:`url:${x}`;if(this.yv&&m.value>=this.yv)return void ay.error("Ignoring metric with value >= "+this.yv,m);this.Rt.navigationKey!==k&&(this.fv(),this.pv=setTimeout(this.fv,this.flushToCaptureTimeoutMs)),O(this.Rt.navigationKey)&&(this.Rt.navigationKey=k,this.Rt.url=x),this.Rt.firstMetricTimestamp=O(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;let E=null===(g=this._instance.sessionManager)||void 0===g?void 0:g.checkAndGetSessionAndWindowId(!0),T=wi(wi(wi({},m),v?{navigationURL:x}:{}),{},{$current_url:x,timestamp:Date.now()});if(delete T.entries,C(m.attribution)&&this.attributionMetrics.indexOf(m.name)>-1){let g={};for(let v of a_){let x="url"===v&&"string"==typeof m.attribution[v]?this.mv(m.attribution[v]):m.attribution[v];O(x)||(g[v]=x)}T.attribution=g}else delete T.attribution;O(E)||(T.$session_id=E.sessionId,T.$window_id=E.windowId),this.Rt.metrics.push(T),this.Rt.metrics.length===this.allowedMetrics.length&&this.fv()},this.bv=()=>{if(this.ho)return;let m,g,v,x,k=!1,E=ef.__PosthogExtensions__,T=null==E?void 0:E.postHogWebVitalsCallbacksByFlavor,K=(null==T?void 0:T[this._v])||("web-vitals"===this._v&&O(T)?null==E?void 0:E.postHogWebVitalsCallbacks:void 0);if(!O(K)){let E=K.withoutAttribution,T=this.attributionMetrics;k=!O(E),m=T.indexOf("LCP")>-1?K.onLCP:(null==E?void 0:E.onLCP)||K.onLCP,g=T.indexOf("CLS")>-1?K.onCLS:(null==E?void 0:E.onCLS)||K.onCLS,v=T.indexOf("FCP")>-1?K.onFCP:(null==E?void 0:E.onFCP)||K.onFCP,x=T.indexOf("INP")>-1?K.onINP:(null==E?void 0:E.onINP)||K.onINP}if(!(m&&g&&v&&x))return void ay.error("web vitals callbacks not loaded - not starting");let et={reportSoftNavs:this.useSoftNavs},en=k&&this.attributionMetrics.indexOf("INP")>-1?wi(wi({},et),{},{includeProcessedEventEntries:!1}):et;this.allowedMetrics.indexOf("LCP")>-1&&m(this.gv.bind(this),et),this.allowedMetrics.indexOf("CLS")>-1&&g(this.gv.bind(this),et),this.allowedMetrics.indexOf("FCP")>-1&&v(this.gv.bind(this),et),this.allowedMetrics.indexOf("INP")>-1&&x(this.gv.bind(this),en),this.ho=!0},this.tv=!!(null===(g=this._instance.persistence)||void 0===g?void 0:g.props[np]),this.startIfEnabled()}get wv(){return this._instance.config.capture_performance}get allowedMetrics(){var m,g;let v=C(this.wv)?null===(m=this.wv)||void 0===m?void 0:m.web_vitals_allowed_metrics:void 0;return M(v)?(null===(g=this._instance.persistence)||void 0===g?void 0:g.props.$web_vitals_allowed_metrics)||ab:v}get flushToCaptureTimeoutMs(){return(C(this.wv)?this.wv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){let m=C(this.wv)?this.wv.web_vitals_attribution:void 0;return j(m)?m?ab:[]:ej(m)?m:ax}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){let m=C(this.wv)?this.wv.__preview_web_vitals_soft_navs:void 0;return null!=m&&m}get yv(){let m=C(this.wv)&&D(this.wv.__web_vitals_max_value)?this.wv.__web_vitals_max_value:9e5;return m>0&&6e4>=m?9e5:m}get isEnabled(){let m=null==es?void 0:es.protocol;if("http:"!==m&&"https:"!==m)return ay.info("Web Vitals are disabled on non-http/https protocols"),!1;let g=C(this.wv)?this.wv.web_vitals:j(this.wv)?this.wv:void 0;return j(g)?g:this.tv}startIfEnabled(){this.isEnabled&&!this.ho&&(ay.info("enabled, starting..."),this.Eo(this.bv))}onRemoteConfig(m){if(!m.ok)return;let g=m.config;if(!("capturePerformance"in g))return;let v=C(g.capturePerformance)&&!!g.capturePerformance.web_vitals,x=C(g.capturePerformance)?g.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[np]:v}),this._instance.persistence.register({[nv]:x})),this.tv=v,this.startIfEnabled()}get _v(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Eo(m){var g;let v=ef.__PosthogExtensions__,x=this._v,k=null==v?void 0:v.postHogWebVitalsCallbacksByFlavor;(null==k?void 0:k[x])||"web-vitals"===x&&O(k)&&(null==v?void 0:v.postHogWebVitalsCallbacks)?m():null==v||null===(g=v.loadExternalDependency)||void 0===g||g.call(v,this._instance,x,g=>{g?ay.error("failed to load script",g):m()})}mv(m){let g=m||(null==et?void 0:et.location.href);if(!g)return void ay.error("Could not determine current URL");let v=this._instance.config.disable_capture_url_hashes?hi(g):g,x=this._instance.config.custom_personal_data_properties,k=this._instance.config.mask_personal_data_properties?[...rV,...x||[]]:[];return bo(v,k,rH)}}}),{exceptionObserver:class{constructor(m){var g;this.bv=()=>{var m;if(!et||!this.isEnabled||!(null===(m=ef.__PosthogExtensions__)||void 0===m?void 0:m.errorWrappingFunctions))return;let g=ef.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,v=ef.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,x=ef.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Sv&&this.Sr.capture_unhandled_errors&&(this.Sv=g(this.captureException.bind(this))),!this.xv&&this.Sr.capture_unhandled_rejections&&(this.xv=v(this.captureException.bind(this))),!this.Cv&&this.Sr.capture_console_errors&&(this.Cv=x(this.captureException.bind(this)))}catch(m){ag.error("failed to start",m),this.$v()}},this._instance=m,this.Tv=!!(null===(g=this._instance.persistence)||void 0===g?void 0:g.props[nl]),this.wt=new eP(wi(wi({},function(m={}){var g,v,x,k;return{refillRate:null!==(g=null!==(v=m.exceptionRateLimiterRefillRate)&&void 0!==v?v:m.__exceptionRateLimiterRefillRate)&&void 0!==g?g:1,bucketSize:null!==(x=null!==(k=m.exceptionRateLimiterBucketSize)&&void 0!==k?k:m.__exceptionRateLimiterBucketSize)&&void 0!==x?x:10}}(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:ag})),this.Sr=this.Iv(),this.startIfEnabledOrStop()}Iv(){let m=this._instance.config.capture_exceptions,g={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return C(m)?g=wi(wi({},g),m):(O(m)?this.Tv:m)&&(g=wi(wi({},g),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),g}get isEnabled(){return this.Sr.capture_console_errors||this.Sr.capture_unhandled_errors||this.Sr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ag.info("enabled"),this.$v(),this.Eo(this.bv)):this.$v()}Eo(m){var g,v,x;(null===(g=ef.__PosthogExtensions__)||void 0===g?void 0:g.errorWrappingFunctions)?m():null===(v=ef.__PosthogExtensions__)||void 0===v||null===(x=v.loadExternalDependency)||void 0===x||x.call(v,this._instance,"exception-autocapture",g=>{if(g)return ag.error("failed to load script",g);m()})}$v(){var m,g,v;null===(m=this.Sv)||void 0===m||m.call(this),this.Sv=void 0,null===(g=this.xv)||void 0===g||g.call(this),this.xv=void 0,null===(v=this.Cv)||void 0===v||v.call(this),this.Cv=void 0}onRemoteConfig(m){if(!m.ok)return;let g=m.config;"autocaptureExceptions"in g&&(this.Tv=!!g.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[nl]:this.Tv}),this.Sr=this.Iv(),this.startIfEnabledOrStop())}onConfigChange(){this.Sr=this.Iv()}captureException(m){try{var g,v,x;let k=null!==(g=null==m||null===(v=m.$exception_list)||void 0===v||null===(v=v[0])||void 0===v?void 0:v.type)&&void 0!==g?g:"Exception";if(this.wt.consumeRateLimit(k))return void ag.info("Skipping exception capture because of client rate limiting.",{exception:k});null===(x=this._instance.exceptions)||void 0===x||x.sendExceptionEvent(m)}catch(m){}}},exceptions:class{constructor(m){var g,v;this.Mv=[],this.Ev=new tE([new tO,new tU,new tM,new tA,new tB,new tZ,new tL,new t$],function(m,...g){return(v,x=0)=>{let k=[],E=v.split("\n"),T=Math.min(E.length,x+1e3),K=[];for(let v=x;T>v;v++){let x=E[v];if(x.length>1024)continue;let T=tT.test(x)?x.replace(tT,"$1"):x;if(!T.match(/\S*Error: /)){for(let v of g){let g=v(T,m);if(g){k.push(g);let m=function(m){for(let g=1;10>=g;g++){let v=m.length-2*g;if(0>v)break;let x=!0;for(let k=0;g>k;k++)if(!Fi(m[v+k],m[v+g+k])){x=!1;break}if(x){for(let x=0;g>x;x++)m[v+x]=m[v+g+x];return m.length=v+g,{start:v,length:g}}}}(k);if(m){for(let g=K.length-1;g>=0;g--){let v=K[g];if(m.start>=v.start+v.length)break;K.pop()}K.push(m)}break}}if(function(m,g){let v=g[0],x=m.length-(v?Di(m,v):0);for(let v of g)x-=Ni(m,v);return x}(k,K)>=50)break}}let et=[...K].sort((m,g)=>g.start-m.start),en=et[et.length-1];if(en){let m=Di(k,en);for(let g of(k.splice(en.start-m,m),et))g.start-=m}for(let m of et)(function(m,g){let v=g.start+g.length,x=Ni(m,g);x&&m.splice(v+x===m.length?v:g.start,x)
7})(k,m);return K.some(m=>0===m.start&&k.length===m.length)&&function(m){let g=m.map(m=>`${m.function}|${m.filename}|${m.lineno}|${m.colno}|${m.module}`),v=0;for(let m=1;g.length>m;m++)(function(m,g,v){for(let x=0;m.length>x;x++){let k=m[(g+x)%m.length],E=m[(v+x)%m.length];if(k!==E)return E>k}return!1})(g,m,v)&&(v=m);m.push(...m.splice(0,v))}(k),function(m){if(!m.length)return[];let g=Array.from(m);return g.reverse(),g.slice(0,50).map(m=>wi(wi({},m),{},{filename:m.filename||(g[g.length-1]||{}).filename,function:m.function||"?"}))}(k)}}("web:javascript",Pi,Oi)),this._instance=m,this.Mv=null!==(g=null===(v=this._instance.persistence)||void 0===v?void 0:v.get_property("$error_tracking_suppression_rules"))&&void 0!==g?g:[],this.Pv=ie(this.Rv()),this.Av=new tW(this.Pv)}onConfigChange(){this.Pv=ie(this.Rv()),this.Av.setConfig(this.Pv)}onRemoteConfig(m){var g,v,x;if(!m.ok)return;let k=m.config;if(!("errorTracking"in k))return;let E=null!==(g=null===(v=k.errorTracking)||void 0===v?void 0:v.suppressionRules)&&void 0!==g?g:[],T=null===(x=k.errorTracking)||void 0===x?void 0:x.captureExtensionExceptions;this.Mv=E,this._instance.persistence&&this._instance.persistence.register({[nc]:this.Mv,[nd]:T})}get Fv(){var m;let g=!!this._instance.get_property(nd),v=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(m=null!=v?v:g)&&void 0!==m&&m}buildProperties(m,g){return this.Ev.buildFromUnknown(m,{syntheticException:null==g?void 0:g.syntheticException,mechanism:{handled:null==g?void 0:g.handled}})}addExceptionStep(m,g){if(this.Pv.enabled)try{if(!I(m)||0===m.trim().length)return void aW.warn("Ignoring exception step because message must be a non-empty string");let{sanitizedProperties:v,droppedKeys:x}=function(m){if(!m)return{sanitizedProperties:{},droppedKeys:[]};let g=[];return{sanitizedProperties:Object.keys(m).reduce((v,x)=>(tq.has(x)?g.push(x):v[x]=m[x],v),{}),droppedKeys:g}}(this.Ov(g));x.length>0&&aW.warn("Ignoring reserved exception step fields",{droppedKeys:x}),this.Av.add(wi({[tz]:m,[tV]:(new Date).toISOString()},v))}catch(m){aW.error("Failed to add exception step. Ignoring breadcrumb.",m)}}sendExceptionEvent(m){try{let g=m.$exception_list;if(this.Dv(g)){if(this.Lv(g))return this.Nv("Exception dropped: matched a suppression rule"),void aW.info("Skipping exception capture because a suppression rule matched");if(!this.Fv&&this.qv(g))return this.Nv("Exception dropped: thrown by a browser extension"),void aW.info("Skipping exception capture because it was thrown by an extension");if(!this.Fv&&this.jv(g))return this.Nv("Exception dropped: thrown by an injected browser script"),void aW.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Bv(g))return this.Nv("Exception dropped: thrown by the PostHog SDK"),void aW.info("Skipping exception capture because it was thrown by the PostHog SDK")}let v=this.Pv.enabled&&M(m.$exception_steps)?this.Hv(m):m,x=function(){let m=globalThis._posthogReleaseId;return"string"==typeof m&&m.length>0?m:void 0}();x&&(v.$release_id=x);try{let m=this._instance.capture("$exception",v,{_noTruncate:!0,_batchKey:"exceptionEvent",Gu:!0});return m&&this.Av.clear(),m}catch(m){return rh(m)||aW.error("Failed to capture exception event. Dropping this exception.",m),void this.Av.clear()}}catch(m){return void(rh(m)||aW.error("Failed to process exception event. Ignoring this exception.",m))}}Hv(m){try{let g=this.Av.getAttachable();return 0===g.length?m:wi(wi({},m),{},{$exception_steps:g})}catch(g){return aW.error("Failed to read buffered exception steps. Capturing exception without steps.",g),m}}Nv(m){this.Pv.enabled&&this.Av.add({[tz]:m,[tV]:(new Date).toISOString()})}Ov(m){return C(m)?wi({},m):{}}Rv(){var m,g;return null!==(m=null===(g=this._instance.config.error_tracking)||void 0===g?void 0:g.exception_steps)&&void 0!==m?m:{}}Lv(m){if(0===m.length)return!1;try{let g=m.reduce((m,{type:g,value:v})=>(I(g)&&g.length>0&&m.$exception_types.push(g),I(v)&&v.length>0&&m.$exception_values.push(v),m),{$exception_types:[],$exception_values:[]});return this.Mv.some(m=>{let v=m.values.map(m=>
7{let v=iB[m.operator],x=g[m.key];if(!v||!x)return!1;let k=ej(m.value)?m.value:[m.value];return k.length>0&&v(k,x)});return"OR"===m.type?v.some(Boolean):v.every(Boolean)})}catch(m){return aW.warn("Failed to evaluate suppression rules. Capturing the exception.",m),!1}}qv(m){let g=m.flatMap(m=>{var g,v;return null!==(g=null===(v=m.stacktrace)||void 0===v?void 0:v.frames)&&void 0!==g?g:[]}),v=g.filter(({filename:m})=>!!m&&aQ.some(g=>m.startsWith(g)));return 0!==v.length&&(!v.every(({filename:m})=>!!m&&m.startsWith(aK))||m.some(({type:m,value:g})=>"NoResponse"===m||I(g)&&aG.some(({value:m,exact:v})=>v?g===m:g.includes(m)))&&!g.some(({in_app:m,filename:g})=>m&&!(null==g?void 0:g.startsWith(aK))))}jv(m){return m.some(({value:m})=>I(m)&&aY.some(g=>m.includes(g)))}Bv(m){if(m.length>0){var g,v,x,k;let E=null!==(g=null===(v=m[0].stacktrace)||void 0===v?void 0:v.frames)&&void 0!==g?g:[],T=E[E.length-1];return null!==(x=null==T||null===(k=T.filename)||void 0===k?void 0:k.includes("posthog.com/static"))&&void 0!==x&&x}return!1}Dv(m){return!M(m)&&ej(m)}}}),a6),{siteApps:class{constructor(m){this._instance=m,this.Vv=0,this.Gv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zv(m,g){if(!g)return;let v=this.globalsForEvent(g);this.Gv.push(v),this.Gv.length>1e3&&(this.Gv=this.Gv.slice(10))}get siteAppLoaders(){var m;return null===(m=ef._POSTHOG_REMOTE_CONFIG)||void 0===m||null===(m=m[this._instance.config.token])||void 0===m?void 0:m.siteApps}initialize(){if(this.isEnabled){let m=this._instance._addCaptureHook(this.Zv.bind(this));this.Qv=()=>{m(),this.Gv=[],this.Qv=void 0}}}globalsForEvent(m){var g,v,x,k,E,T,K;if(!m)throw Error("Event payload is required");let et={},en=this._instance.get_property("$groups")||[],er=this._instance.get_property("$stored_group_properties")||{};for(let[m,g]of Object.entries(er))et[m]={id:en[m],type:m,properties:g};let{$set_once:ei,$set:es}=m;return{event:wi(wi({},ge(m,aj)),{},{properties:wi(wi(wi({},m.properties),es?{$set:wi(wi({},null!==(g=null===(v=m.properties)||void 0===v?void 0:v.$set)&&void 0!==g?g:{}),es)}:{}),ei?{$set_once:wi(wi({},null!==(x=null===(k=m.properties)||void 0===k?void 0:k.$set_once)&&void 0!==x?x:{}),ei)}:{}),elements_chain:null!==(E=null===(T=m.properties)||void 0===T?void 0:T.$elements_chain)&&void 0!==E?E:"",distinct_id:null===(K=m.properties)||void 0===K?void 0:K.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:et}}Jv(m){var g;let v=null===(g=m.tagName)||void 0===g?void 0:g.toLowerCase();return"style"===v&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(m)||(aN.error("prepare_external_dependency_stylesheet returned null"),null):"script"===v&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(m)||(aN.error("prepare_external_dependency_script returned null"),null):m}Kv(){var m,g,v,x,k,E,T,K;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};let et=null==ei?void 0:ei.defaultView,en=null==et||null===(m=et.Node)||void 0===m?void 0:m.prototype;if(!et||!en)return()=>{};if(this.Vv++,this.Yv)return this.Xv();let er=[],es=this,el=new WeakSet,f=(m,g,v)=>{if(!(null==m?void 0:m[g]))return;let x=m[g];m[g]=v(x),er.push(()=>{m[g]=x})},p=m=>{if(el.has(m))return m;let g=es.Jv(m);return g&&el.add(g),g},_=m=>m.map(m=>"string"==typeof m?m:p(m)).filter(m=>!A(m));return f(en,"appendChild",m=>function(g){let v=p(g);return v?m.call(this,v):g}),f(en,"insertBefore",m=>function(g,v){let x=p(g);return x?m.call(this,x,v):g}),f(en,"replaceChild",m=>function(g,v){let x=p(g);return x?m.call(this,x,v):v}),[null===(g=et.Element)||void 0===g?void 0:g.prototype,null===(v=et.Document)||void 0===v?void 0:v.prototype,null===(x=et.DocumentFragment)||void 0===x?void 0:x.prototype].forEach(m=>{f(m,"append",m=>function(...g){return m.apply(this,_(g))}),f(m,"prepend",m=>function(...g){return m.apply(this,_(g))})}),[null===(k=et.Element)||void 0===k?void 0:k.prototype,null===(E=et.CharacterData)||void 0===E?void 0:E.prototype,null===(T=et.DocumentType)||void 0===T?void 0:T.prototype].forEach(m=>{f(m,"before",m=>function(...g){return m.apply(this,_(g))}),f(m,"after",m=>function(...g){return m.apply(this,_(g))}),f(m,"replaceWith",m=>function(...g){let v=_(g);return g.length&&!v.length?void 0:m.apply(this,v)})}),f(null===(K=et.Element)||void 0===K?void 0:K.prototype,"insertAdjacentElement",m=>function(g,v){let x=p(v);return x?m.call(this,g,x):null}),this.Yv=()=>{er.forEach(m=>m()),this.Yv=void 0},this.Xv()}Xv(){let m=!1;return()=>{var g;m||(m=!0,this.Vv--,0===this.Vv&&(null===(g=this.Yv)||void 0===g||g.call(this)))}}tf(m,g=!0){let v=this.Kv();try{let x=m(v);return g&&v(),x}
7catch(m){throw v(),m}}setupSiteApp(m){let g=this.apps[m.id],e=()=>{var v;!g.errored&&this.Gv.length&&(aN.info(`Processing ${this.Gv.length} events for site app with id ${m.id}`),this.Gv.forEach(m=>this.tf(()=>{var v;return null===(v=g.processEvent)||void 0===v?void 0:v.call(g,m)})),g.processedBuffer=!0),Object.values(this.apps).every(m=>m.processedBuffer||m.errored)&&(null===(v=this.Qv)||void 0===v||v.call(this))},v=!1,n=x=>{g.errored=!x,g.loaded=!0,aN.info(`Site app with id ${m.id} ${x?"loaded":"errored"}`),v&&e()};try{let{processEvent:x}=this.tf(g=>m.init({posthog:this._instance,callback(m){g(),n(m)}}),!1);x&&(g.processEvent=x),v=!0}catch(g){aN.error(aR+m.id,g),n(!1)}if(v&&g.loaded)try{e()}catch(v){aN.error(`Error while processing buffered events PostHog app with config id ${m.id}`,v),g.errored=!0}}ef(){let m=this.siteAppLoaders||[];for(let g of m)this.apps[g.id]={id:g.id,loaded:!1,errored:!1,processedBuffer:!1};for(let g of m)this.setupSiteApp(g)}if(m){if(0===Object.keys(this.apps).length)return;let g=this.globalsForEvent(m);for(let v of Object.values(this.apps))try{this.tf(()=>{var m;return null===(m=v.processEvent)||void 0===m?void 0:m.call(v,g)})}catch(g){aN.error(`Error while processing event ${m.event} for site app ${v.id}`,g)}}onRemoteConfig(m){var g,v,x,k,E;if(null===(g=this.siteAppLoaders)||void 0===g?void 0:g.length)return this.isEnabled?(this.ef(),void this._instance.on("eventCaptured",m=>this.if(m))):void aN.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null===(v=this.Qv)||void 0===v||v.call(this),!m.ok)return;let T=m.config;if(null===(x=T.siteApps)||void 0===x?void 0:x.length){if(this.isEnabled)for(let{id:m,url:g}of T.siteApps)ef[`__$$ph_site_app_${m}`]=this._instance,null===(k=ef.__PosthogExtensions__)||void 0===k||null===(E=k.loadSiteApp)||void 0===E||E.call(k,this._instance,g,g=>{if(g)return aN.error(aR+m,g)});else aN.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}}),a7),{tracingHeaders:class{constructor(m){this._instance=m,this.nf=void 0,this.sf=void 0,this.rf=void 0,this.bv=()=>{var m,g;let v=this.lf();v?(O(this.nf)&&(this.nf=null===(m=ef.__PosthogExtensions__)||void 0===m||null===(m=m.tracingHeadersPatchFns)||void 0===m?void 0:m._patchXHR(v,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),O(this.sf)&&(this.sf=null===(g=ef.__PosthogExtensions__)||void 0===g||null===(g=g.tracingHeadersPatchFns)||void 0===g?void 0:g._patchFetch(v,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.$v()}}initialize(){this.startIfEnabledOrStop()}Eo(m){var g,v,x;(null===(g=ef.__PosthogExtensions__)||void 0===g?void 0:g.tracingHeadersPatchFns)?m():null===(v=ef.__PosthogExtensions__)||void 0===v||null===(x=v.loadExternalDependency)||void 0===x||x.call(v,this._instance,"tracing-headers",g=>{if(g)return av.error("failed to load script",g);m()})}af(){var m,g;return null!==(m=null!==(g=this._instance.config.tracing_headers)&&void 0!==g?g:this._instance.config.addTracingHeaders)&&void 0!==m?m:this._instance.config.__add_tracing_headers}lf(){let m=this.af();return ej(m)?(ej(this.rf)?this.rf.splice(0,this.rf.length,...m):this.rf=[...m],m.length>0?this.rf:void 0):(ej(this.rf)&&this.rf.splice(0),this.rf=m||void 0,this.rf)}$v(){var m,g;null===(m=this.nf)||void 0===m||m.call(this),null===(g=this.sf)||void 0===g||g.call(this),this.nf=void 0,this.sf=void 0}startIfEnabledOrStop(){this.lf()?this.Eo(this.bv):this.$v()}}}),{toolbar:class{constructor(m){this.instance=m}uf(m){ef.ph_toolbar_state=m}hf(){var m;return null!==(m=ef.ph_toolbar_state)&&void 0!==m?m:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(m,g,v){var x,k;if(Bn(this.instance.config)||!et||!ei)return!1;m=null!==(x=m)&&void 0!==x?x:et.location,v=null!==(k=v)&&void 0!==k?k:et.history;try{let x;if(!g){try{et.localStorage.setItem("test","test"),et.localStorage.removeItem("test")}catch(m){return!1}g=null==et?void 0:et.localStorage}let k=aF||yo(m.hash,"__posthog")||yo(m.hash,"state"),E=k?Fn(()=>JSON.parse(atob(decodeURIComponent(k))))||Fn(()=>JSON.parse(decodeURIComponent(k))):null;return E&&"ph_authorize"===E.action?((x=E).source="url",x&&Object.keys(x).length>0&&(E.desiredHash?m.hash=E.desiredHash:v?v.replaceState(v.state,"",m.pathname+m.search):m.hash="")):((x=JSON.parse(g.getItem(aZ)||"{}")).source="localstorage",delete x.userIntent),!(!x.token||this.instance.config.token!==x.token||(this.loadToolbar(x),0))}catch(m){return!1}}cf(m){let g=ef.ph_load_toolbar||ef.ph_load_editor;!M(g)&&P(g)?g(m,this.instance):aB.warn("No toolbar load function found")}loadToolbar(m){let g=!!(null==ei?void 0:ei.getElementById("__POSTHOG_TOOLBAR__"));if(!et||g)return!1;let v="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,x=wi(wi({token:this.instance.config.token},m),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},v?{instrument:!1}:{});if(et.localStorage.setItem(aZ,JSON.stringify(wi(wi({},x),{},{source:void 0}))),2===this.hf())this.cf(x);else if(0===this.hf()){var k,E;this.uf(1),null===(k=ef.__PosthogExtensions__)||void 0===k||null===(E=k.loadExternalDependency)||void 0===E||E.call(k,this.instance,"toolbar",m=>{if(m)return aB.error("[Toolbar] Failed to load",m),void this.uf(0);this.uf(2),this.cf(x)}),Ln(et,"turbolinks:load",()=>{this.uf(0),this.loadToolbar(x)})}return!0}df(m){return this.loadToolbar(m)}maybeLoadEditor(m,g,v){return this.maybeLoadToolbar(m,g,v)}}}),a8),{conversations:class{constructor(m){this._instance=m,this._f=void 0,this._conversationsManager=null,this.wf=!1,this.ne=null,this.kf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(m){if(this._instance.config.disable_conversations||(this.Sf=m.ok,!m.ok))return;let g=m.config.conversations;M(g)||(j(g)?this._f=g:(this._f=g.enabled,this.ne=g),this.loadIfEnabled())}reset(){var m;null===(m=this._conversationsManager)||void 0===m||m.reset(),this._conversationsManager=null,this._f=void 0,this.ne=null,this.Sf=void 0,this.kf=!1}loadIfEnabled(){if(this._conversationsManager||this.wf||this._instance.config.disable_conversations||Bn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;let m=null==ef?void 0:ef.__PosthogExtensions__;if(m&&!O(this._f)&&this._f){if(this.ne&&this.ne.token){this.wf=!0;try{let g=m.initConversations;if(g)return this.xf(g),void(this.wf=!1);let v=m.loadExternalDependency;if(!v)return void this.Cf(n0);v(this._instance,"conversations",g=>{g||!m.initConversations?this.Cf("Could not load conversations script",g):this.xf(m.initConversations),this.wf=!1})}catch(m){this.Cf("Error initializing conversations",m),this.wf=!1}}else a0.error("Conversations enabled but missing token in remote config.")}}xf(m){if(this.ne)try{this._conversationsManager=m(this.ne,this._instance),this.kf=!1,a0.info("Conversations loaded successfully")}catch(m){this.Cf("Error completing conversations initialization",m)}else a0.error("Cannot complete initialization: remote config is null")}Cf(m,g){a0.error(m,g),this._conversationsManager=null,this.wf=!1,this.kf=!0}show(){this._conversationsManager?this._conversationsManager.show():a0.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._f&&!A(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Bn(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Sf?"remote_config_failed":O(this._f)?this.Sf?"disabled_in_project":"remote_config_pending":this._f?M(this.ne)||!this.ne.token?"missing_token":(null==ef?void 0:ef.__PosthogExtensions__)?this.wf?"initializing":this.kf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var m,g;return null!==(m=null===(g=this._conversationsManager)||void 0===g?void 0:g.isVisible())&&void 0!==m&&m}sendMessage(m,g,v){var x=this;return Y(function*(){return x._conversationsManager?x._conversationsManager.sendMessage(m,g,v):(a0.warn(a1),null)})()}getMessages(m,g){var v=this;return Y(function*(){return v._conversationsManager?v._conversationsManager.getMessages(m,g):(a0.warn(a1),null)})()}markAsRead(m){var g=this;return Y(function*(){return g._conversationsManager?g._conversationsManager.markAsRead(m):(a0.warn(a1),null)})()}getTickets(m){var g=this;return Y(function*(){return g._conversationsManager?g._conversationsManager.getTickets(m):(a0.warn(a1),null)})()}requestRestoreLink(m){var g=this;return Y(function*(){return g._conversationsManager?g._conversationsManager.requestRestoreLink(m):(a0.warn(a1),null)})()}restoreFromToken(m){var g=this;return Y(function*(){return g._conversationsManager?g._conversationsManager.restoreFromToken(m):(a0.warn(a1),null)})()}restoreFromUrlToken(){var m=this;return Y(function*(){return m._conversationsManager?m._conversationsManager.restoreFromUrlToken():(a0.warn(a1),null)})()}getCurrentTicketId(){var m,g;return null!==(m=null===(g=this._conversationsManager)||void 0===g?void 0:g.getCurrentTicketId())&&void 0!==m?m:null}getWidgetSessionId(){var m,g;return null!==(m=null===(g=this._conversationsManager)||void 0===g?void 0:g.getWidgetSessionId())&&void 0!==m?m:null}ih(){var m;null===(m=this._conversationsManager)||void 0===m||m.setIdentity()}nh(){var m;null===(m=this._conversationsManager)||void 0===m||m.clearIdentity()}}}),{logs:class{constructor(m){var g;this._instance=m,this.name="logs",this.$f=!1,this.Tf=!1,this.If=!1,this.$=t4("[logs]"),this.Mf=wi(wi({},this.$),{},{error:(...m)=>{m.some(wh)||this.$.error(...m)}}),this.Zl=[],this.Ef=[],this.Wc=0,this.fo=!1,this.Pf=[],this.Rf=[],this.Af=!1,this.Ff=!1,this.Of=()=>{var m,g;this.fo||(this.Wc=0,null===(m=this.Df)||void 0===m||m.onReconnect(),null===(g=this.Lf)||void 0===g||g.onReconnect())},this._instance&&(null===(g=this._instance.config.logs)||void 0===g?void 0:g.captureConsoleLogs)&&(this.$f=!0),et&&Ln(et,"online",this.Of)}Nf(m,g,v,x){var k;let E=ph(null===(k=this._instance)||void 0===k||null===(k=k.config)||void 0===k?void 0:k.logs,v);return[new t1(this.qf(m,g),E,this.Mf,()=>this.jf(),m=>m(),void 0,x),E]}Bf(){var m,g;let v=null===(m=this._instance)||void 0===m||null===(m=m.config)||void 0===m?void 0:m.logs;return this.Df&&this.Hf===v||(null===(g=this.Df)||void 0===g||g.reset(),this.Hf=v,[this.Df,this.zf]=this.Nf(()=>this.Zl,m=>{this.Zl=m})),this.Df}Uf(){var m,g;let v=null===(m=this._instance)||void 0===m||null===(m=m.config)||void 0===m?void 0:m.logs;return this.Lf&&this.Wf===v||(null===(g=this.Lf)||void 0===g||g.reset(),this.Wf=v,[this.Lf,this.Vf]=this.Nf(()=>this.Ef,m=>{this.Ef=m},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},a3)),this.Lf}setup(m){var g;if(this.fo)return;this.lo=m,(null===(g=this._instance)||void 0===g||null===(g=g.config)||void 0===g||null===(g=g.logs)||void 0===g?void 0:g.captureConsoleLogs)&&(this.$f=!0),(this.$f||this.Gf()&&this.Zf())&&this.Qf();let v=!1,x=m.onRemoteConfig(m=>{var g;v=m.ok&&!0===(null===(g=m.config.logs)||void 0===g?void 0:g.captureConsoleLogs),this.onRemoteConfig(m)});this.fo?x.dispose():(this.yo=x,v||this.loadIfEnabled())}dispose(){var m,g,v,x;this.fo||(this.fo=!0,this.Jf(),null===(m=this.yo)||void 0===m||m.dispose(),this.yo=void 0,this.lo=void 0,this.If=!1,null==et||et.removeEventListener("online",this.Of),null===(g=this.Kf)||void 0===g||g.call(this),this.Kf=void 0,null===(v=this.Df)||void 0===v||v.reset(),null===(x=this.Lf)||void 0===x||x.reset())}onRemoteConfig(m){var g,v;if(this.fo)return;let x=m.ok?null===(g=m.config.logs)||void 0===g?void 0:g.captureConsoleLogs:void 0;M(x)?this.Yf():(null===(v=this._instance)||void 0===v||null===(v=v.persistence)||void 0===v||v.register({$logs_capture_enabled_server_side:!!x}),x?(this.$f=!0,this.Tf||this.Qf(),this.loadIfEnabled()):this.Yf())}reset(){var m,g,v,x;this.Jf(),null===(m=this.Df)||void 0===m||m.clearQueue(),this.Zl=[],null===(g=this.Df)||void 0===g||g.reset(),null===(v=this.Lf)||void 0===v||v.clearQueue(),this.Ef=[],null===(x=this.Lf)||void 0===x||x.reset(),this.Wc=0}captureLog(m){this.fo||this.Bf().captureLog(m)}
7captureConsoleLog(m){this.fo||this.Uf().captureLog(m)}captureBufferedConsoleLog(m,g,v){this.fo||this.Uf().captureLog(m,{context:g,occurredAtMs:v})}Zf(){var m;return!!(null===(m=this._instance)||void 0===m||null===(m=m.persistence)||void 0===m||null===(m=m.props)||void 0===m?void 0:m[ng])}Gf(){var m,g,v;return!(null===(m=this._instance)||void 0===m||null===(g=m.Ul)||void 0===g?void 0:g.call(m))||!!(null===(v=ef._POSTHOG_REMOTE_CONFIG)||void 0===v||null===(v=v[this._instance.config.token])||void 0===v?void 0:v.config)}rh(){var m;this.Jf(),null===(m=this.Lf)||void 0===m||m.clearQueue(),this.Ef=[]}Yf(){this.$f||this.Jf()}Qf(){var m;if(this.Af||!(null==ef?void 0:ef.console))return;let g=ph(null===(m=this._instance)||void 0===m||null===(m=m.config)||void 0===m?void 0:m.logs).maxBufferSize;for(let m of a2){let v;try{v=gh(ef.console[m])}catch(m){continue}v&&this.Rf.push(wu(ef.console,m,x=>{let n=(...v)=>{try{this.Xf(m,v,g)}catch(m){}return x.apply(ef.console,v)};return n.__rrweb_original__=v,n}))}this.Af=!0,this.tp=setTimeout(()=>{this.Jf()},3e4)}Xf(m,g,v){var x;if(this.Af&&!this.Ff&&0!==g.length){if(null===(x=this._instance)||void 0===x?void 0:x.is_capturing()){if(v>this.Pf.length){this.Ff=!0;try{this.Pf.push({level:m,args:g,occurredAtMs:Date.now(),context:this.jf()})}finally{this.Ff=!1}}}else this.Jf()}}Jf(){if(this.Pf=[],this.Af){for(let m of(this.Af=!1,this.tp&&(clearTimeout(this.tp),this.tp=void 0),this.Rf))m();this.Rf=[]}}ep(){let m=this.Pf;return this.Jf(),m}get logger(){return this.np||(this.np={trace:(m,g)=>this.captureLog({body:m,level:"trace",attributes:g}),debug:(m,g)=>this.captureLog({body:m,level:"debug",attributes:g}),info:(m,g)=>this.captureLog({body:m,level:"info",attributes:g}),warn:(m,g)=>this.captureLog({body:m,level:"warn",attributes:g}),error:(m,g)=>this.captureLog({body:m,level:"error",attributes:g}),fatal:(m,g)=>this.captureLog({body:m,level:"fatal",attributes:g})}),this.np}flushLogs(m){m?this.sp(m):(this.Df&&this.Df.flush().catch(m=>this.rp(m)),this.Lf&&this.Lf.flush().catch(m=>this.rp(m)))}rp(m){wh(m)||this.$.error("PostHog logs flush failed:",m)}loadIfEnabled(){if(this.fo||!this.$f||this.Tf||this.If)return;let m=null==ef?void 0:ef.__PosthogExtensions__;if(!m)return this.$.error("PostHog Extensions not found."),void this.Jf();let g=m.loadExternalDependency;if(!g)return this.$.error(n0),void this.Jf();this.If=!0;try{g(this._instance,"logs",g=>{if(this.If=!1,this.fo||!this.$f)return;let v=m.logs;if(!g&&(null==v?void 0:v.initializeLogs)){var x,k,E;let m=this.ep();this.Kf=v.initializeLogs(null!==(x=this.lo)&&void 0!==x?x:this._instance),this.Tf=!0,m.length>0&&(null===(k=v.replayConsoleBuffer)||void 0===k||k.call(v,null!==(E=this.lo)&&void 0!==E?E:this._instance,m))}else this.$.error("Could not load logs script",g),this.Jf()})}catch(m){throw this.If=!1,m}}qf(m,g){let v=this._instance;return{get isDisabled(){return!1},get optedOut(){return!v.is_capturing()},getPersistedProperty:g=>g===ex.LogsQueue?m():void 0,setPersistedProperty(m,v){m===ex.LogsQueue&&g(null!=v?v:[])},Ps:m=>this.Ps(m),getLibraryId:()=>eh.LIB_NAME,getLibraryVersion:()=>eh.LIB_VERSION}}Ps(m){return new Promise(g=>{if(wo(this.Wc,3))return void g({kind:"fatal",error:yh(void 0,"logs endpoint is unreachable, dropping batch")});let v=!1,s=m=>{v||(v=!0,clearTimeout(x),g(m))},x=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:yh(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.op(),data:m,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:m=>{let g=m.statusCode;if(this.lp(g),g>=200&&300>g)s({kind:"ok"});else if(413===g)s({kind:"too-large"});else if(0!==g&&408!==g&&429!==g&&500>g)s({kind:"fatal",error:Error(`logs request failed with status ${g}`)});else{var v;0===g?(m.error||this.$.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:yh(m.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!==(v=m.error)&&void 0!==v?v:Error(`logs request failed with status ${g}`)})}}})})}lp(m){(0!==m||this._instance.__loaded)&&(this.Wc=$o(m,this.Wc,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}sp(m){this.Zl.length>0&&this.ap(m,this.Zl,this.zf,eh.LIB_NAME,m=>{this.Zl=m}),this.Ef.length>0&&this.ap(m,this.Ef,this.Vf,a3,m=>{this.Ef=m})}ap(m,g,v,x,k){if(0===g.length)return;let E=g.map(m=>m.record);k([]);let T=Re(E,Se(v,eh.LIB_NAME,eh.LIB_VERSION),x,eh.LIB_VERSION);this._instance._send_request({method:"POST",url:this.op(),data:T,compression:"best-available",batchKey:"logs",transport:m})}op(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}jf(){var m;let g={};if(g.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){let{sessionId:m,windowId:v,sessionStartTimestamp:x,lastActivityTimestamp:k}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);g.sessionId=m,g.windowId=v,M(x)||(g.sessionStartTimestamp=x),M(k)||(g.lastActivityTimestamp=k)}if((null==ef||null===(m=ef.location)||void 0===m?void 0:m.href)&&(g.currentUrl=this._instance.config.disable_capture_url_hashes?hi(ef.location.href):ef.location.href),this._instance.featureFlags){let m=this._instance.featureFlags.getFlags();m&&m.length>0&&(g.activeFeatureFlags=m)}return g}}}),{metrics:class{constructor(m){this._instance=m,this.$=t4("[metrics]")}initialize(){}Bf(){var m,g;let v=null===(m=this._instance)||void 0===m||null===(m=m.config)||void 0===m?void 0:m.metrics;return this.Df&&this.Hf===v||(null===(g=this.Df)||void 0===g||g.reset(),this.Hf=v,this.Df=new t3(this.qf(),function(m){var g,v,x,k,E;let T=null==m?void 0:m.resourceAttributes;return{serviceName:null!==(g=null==T?void 0:T["service.name"])&&void 0!==g?g:null==m?void 0:m.serviceName,serviceVersion:null!==(v=null==T?void 0:T["service.version"])&&void 0!==v?v:null==m?void 0:m.serviceVersion,environment:null!==(x=null==T?void 0:T["deployment.environment"])&&void 0!==x?x:null==m?void 0:m.environment,resourceAttributes:T,beforeSend:null==m?void 0:m.beforeSend,flushIntervalMs:null!==(k=null==m?void 0:m.flushIntervalMs)&&void 0!==k?k:1e4,maxSeriesPerFlush:null!==(E=null==m?void 0:m.maxSeriesPerFlush)&&void 0!==E?E:1e3}}(v),this.$)),this.Df}count(m,g=1,v){this.Bf().count(m,g,v)}gauge(m,g,v){this.Bf().gauge(m,g,v)}histogram(m,g,v){this.Bf().histogram(m,g,v)}flush(m){if(!this.Df)return Promise.resolve();if(m){let g=this.Df.drainWindow();return g&&this.Gs(g,m),Promise.resolve()}return this.Df.flush().catch(m=>this.$.error("PostHog metrics flush failed:",m))}reset(){var m;null===(m=this.Df)||void 0===m||m.reset()}qf(){let m=this._instance,g=this;return{get isDisabled(){return!1},get optedOut(){return!m.is_capturing()},Gs:m=>g.Gs(m),getLibraryId:()=>eh.LIB_NAME,getLibraryVersion:()=>eh.LIB_VERSION}}Gs(m,g){return new Promise(v=>{let x=!1,n=m=>{x||(x=!0,clearTimeout(k),v(m))},k=setTimeout(()=>n({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(wi(wi({method:"POST",url:this.up(),data:m,compression:"best-available",batchKey:"metrics"},g&&{transport:g}),{},{fireCallbackOnDrop:!0,callback(m){let g=m.statusCode;if(g>=200&&300>g)n({kind:"ok"});else if(413===g)n({kind:"too-large"});else if(0!==g&&408!==g&&429!==g&&500>g)n({kind:"fatal",error:Error(`metrics request failed with status ${g}`)});else{var v;n({kind:"retry-later",error:null!==(v=m.error)&&void 0!==v?v:Error(`metrics request failed with status ${g}`)})}}}))})}up(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}}));let a9=function(){eh.SDK_DIST_CHANNEL="npm";let m=i2[an]=new au;return function(){function i(){i.done||(i.done=!0,as=!1,Rn(i2,function(m){m._dom_loaded()}))}(null==ei?void 0:ei.addEventListener)?"complete"===ei.readyState?i():Ln(e
7i,"DOMContentLoaded",i,{capture:!1}):et&&t5.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),m}();var st=v(68717),sn=v(20463);let si=new Set(["class","id","role","type","rel","media","width","height","viewBox","d","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","fill-rule","clip-rule","xmlns","x","y","x1","x2","y1","y2","cx","cy","r","rx","ry","points","transform","preserveAspectRatio","colspan","rowspan","disabled","checked","selected","multiple","aria-expanded","aria-hidden","aria-disabled","aria-checked","aria-controls","aria-labelledby","aria-describedby","data-state","data-side","data-align","data-orientation","data-ph-public","data-ph-mask","_cssText"]);function maskText(m){return m.replace(/\S/g,"*")}function isPublicReplayAsset(m,g){var v;let x=null==g?void 0:null===(v=g.ownerDocument.location)||void 0===v?void 0:v.origin,k=x&&m.startsWith("".concat(x,"/"))?m.slice(x.length):m;return/^\/(?:_next\/static\/|static\/)[^?#\\]+$/.test(k)&&!/(?:^|\/)\.{1,2}(?:\/|$)|%(?:2e|2f|5c)/i.test(k)}let sa={maskAllInputs:!0,maskTextSelector:"*",maskTextFn:function(m,g){return(null==g?void 0:g.closest("[data-ph-mask], .ph-mask, input, textarea, select, [contenteditable]"))?maskText(m):(null==g?void 0:g.closest("[data-ph-public]"))?m:maskText(m)},maskAllElementAttributes:!1,maskAttributeFn:function(m,g,v){return si.has(m)||"style"===m&&function(m,g){if(/\\|\/\*/.test(m)||/image-set\s*\(/i.test(m))return!1;let v=/url\s*\(\s*(?:"([^"]*)"|'([^']*)'|([^\s'"()]+))\s*\)/gi,x=Array.from(m.matchAll(v));return!/url\s*\(/i.test(m.replace(v,""))&&x.every(m=>{var v,x;return isPublicReplayAsset(null!==(x=null!==(v=m[1])&&void 0!==v?v:m[2])&&void 0!==x?x:m[3],g)})}(g,v)||["src","href"].includes(m)&&isPublicReplayAsset(g,v)?g:maskText(g)},blockSelector:'iframe, [data-ph-block], input[type="hidden"], input[type="file"]',inlineStylesheet:!0},ss="posthog:record-session",sl=["/checkout"],sc=!1;function syncSessionRecording(m){if(sc)try{if(sl.some(g=>m.startsWith(g))||function(){try{let m=window.sessionStorage.getItem(ss);if(null!==m)return"true"===m;let g=.04>Math.random();return window.sessionStorage.setItem(ss,String(g)),g}catch(m){return(0,sn.Tb)(m,{silent:!0}),!1}}()){a9.startSessionRecording();return}a9.stopSessionRecording()}catch(m){(0,sn.Tb)(m,{silent:!0})}}function initPostHog(m){if(!sc&&st.O.NEXT_PUBLIC_POSTHOG_KEY)try{a9.init(st.O.NEXT_PUBLIC_POSTHOG_KEY,{api_host:"/ingest",ui_host:"https://us.posthog.com",autocapture:!1,capture_exceptions:{capture_unhandled_errors:!0,capture_unhandled_rejections:!0,capture_console_errors:!1},capture_pageview:"history_change",person_profiles:"identified_only",disable_session_recording:!0,session_recording:sa}),window.posthog=a9,sc=!0,syncSessionRecording(m)}catch(m){(0,sn.Tb)(m,{silent:!0})}}function identifyPostHogUser(m,g){if(sc)try{a9.identify(m,g)}catch(m){(0,sn.Tb)(m,{silent:!0})}}function resetPostHogUser(){if(sc&&"identified"===a9.get_property("$user_state"))try{a9.reset(),window.sessionStorage.removeItem(ss)}catch(m){(0,sn.Tb)(m,{silent:!0})}}function posthogAnonymousDistinctId(){if(!sc||"identified"===a9.get_property("$user_state"))return null;try{return a9.get_distinct_id()}catch(m){return(0,sn.Tb)(m,{silent:!0}),null}}function registerQuoteFlowExperiment(m,g){if(sc)try{let v={["experiment_".concat(m)]:g};a9.register(v),"identified"===a9.get_property("$user_state")&&a9.setPersonProperties(v)}catch(m){(0,sn.Tb)(m,{silent:!0})}}},68344:function(m,g,v){"use strict";v.d(g,{o:function(){return QueryError}});let QueryError=class QueryError extends Error{constructor(m,g){var v;if(super(m),this.name="QueryError",!(!g||"object"!=typeof g||Array.isArray(g))&&("statusCode"in g||"code"in g||"isExpected"in g||"details"in g)){this.statusCode=g.statusCode,this.code=g.code,this.details=g.details,this.isExpected=null!==(v=g.isExpected)&&void 0!==v&&v;return}this.details=g,this.isExpected=!1}}},20463:function(m,g,v){"use strict";v.d(g,{Tb:function(){return captureException},av:function(){return setUser},nZ:function(){return getCurrentScope},uu:function(){return getTraceData},yl:function(){return flush}});var x=v(86239),k=v(51159),E=v(41690),T=v(89644),K=v(14016);function captureException(m,g){if(m instanceof T.AxiosError&&!m.response&&void 0!==m.code&&K.TZ.includes(m.code))return;let{silent:v,...k}=null!=g?g:{};x.Tb(m,k)}function getTraceData(){return k.u()}function getCurrentScope(){return E.nZ()}function setUser(){for(var m=arguments.length,g=Array(m),v=0;v<m;v++)g[v]=arguments[v];x.av(...g)}function flush(){for(var m=arguments.length,g=Array(m),v=0;v<m;v++)g[v]=arguments[v];return x.yl(...g)}},37146:function(m,g,v){"use strict";v.d(g,{Jp:function(){return storedAnonymousId},Q0:function(){return clearAnonymousId},ai:function(){return anonymousId}});var x=v(75969),k=v(32765);let E="cacttus_anonymous_id";function storedAnonymousId(){let m=new x.Z().get(E,{doNotParse:!0});return"string"==typeof m&&m?m:null}function anonymousId(){var m;let g=storedAnonymousId();if(g)return g;let v=null!==(m=(0,k.Qo)())&&void 0!==m?m:crypto.randomUUID();return new x.Z().set(E,v,{path:"/",maxAge:31536e3,sameSite:"lax"}),v}function clearAnonymousId(){new x.Z().remove(E,{path:"/"})}},90206:function(m,g,v){"use strict";function hasPayableAmount(m){return(null!=m?m:0)>0}function claimStatusTag(m,g){if(!m)return{label:"Borrador",tone:"neutral"};switch(m){case"appealed":return{label:"Revisar estado del reembolso",tone:"warning"};case"adjusted":return{label:"Revisar liquidaci\xf3n",tone:"review"};case"info_needed":return{label:"Revisar documento",tone:"attention"};case"settled":return{label:"Esperando pago",tone:"waiting"};case"paid":return{label:hasPayableAmount(g)?"Pagado":"Cerrado",tone:"success"};case"payment_error":return{label:"Error en el pago",tone:"danger"};case"denied":return{label:"Rechazado",tone:"rejected"};case"appeal_response":return{label:"Respuesta de impugnaci\xf3n",tone:"response"};default:return{label:"Revisar estado del reembolso",tone:"info"}}}function claimListStatus(m,g){if(!m)return{label:"Finaliza tu reembolso pendiente - Borrador",tone:"neutral",requiresAction:!1,isActive:!0};switch(m){case"processing":case"further_investigation":case"processing_delayed":return{label:"Estamos procesando tu reembolso",tone:"info",requiresAction:!1,isActive:!0};case"appealed":return{label:"Impugnado",tone:"warning",requiresAction:!1,isActive:!0};case"adjusted":return{label:"Revisar liquidaci\xf3n",tone:"review",requiresAction:!0,isActive:!0};
7case"info_needed":return{label:"Falta subir informaci\xf3n",tone:"attention",requiresAction:!0,isActive:!0};case"settled":return{label:"Gestionando tu reembolso",tone:"waiting",requiresAction:!1,isActive:!0};case"paid":return{label:hasPayableAmount(g)?"Pagado":"Cerrado",tone:"success",requiresAction:!1,isActive:!1};case"payment_error":return{label:"Error en pago",tone:"danger",requiresAction:!0,isActive:!0};case"denied":return{label:"Rechazado",tone:"rejected",requiresAction:!1,isActive:!1};case"appeal_response":return{label:"Respuesta de impugnaci\xf3n",tone:"response",requiresAction:!0,isActive:!0};default:return{label:"En proceso",tone:"info",requiresAction:!1,isActive:!0}}}v.d(g,{e6:function(){return claimStatusTag},sk:function(){return claimListStatus}})},66226:function(m,g,v){"use strict";v.d(g,{Kf:function(){return getMetaCookies},WL:function(){return getGaCookies}});var x=v(68717),k=v(14016),E=v(10638);let T="cactus_fbclid",K="cactus_fbclid_ts";function getCookie(m){var g;if("undefined"==typeof document)return null;let v=document.cookie.match(RegExp("(^| )"+m+"=([^;]+)"));return null!==(g=null==v?void 0:v[2])&&void 0!==g?g:null}function getGaCookies(){var m,g,v;return"undefined"==typeof document?{gaClientId:null,gaSessionId:null}:{gaClientId:(m=getCookie("_ga"))&&null!==(v=null===(g=m.match(/^GA\d+\.\d+\.(\d+\.\d+)$/))||void 0===g?void 0:g[1])&&void 0!==v?v:null,gaSessionId:function(m){var g,v,x,k;if(!m)return null;let E=null===(g=m.match(/^GS1\.\d+\.(\d+)(?:\.|$)/))||void 0===g?void 0:g[1];if(E)return E;let T=null===(v=m.match(/^GS2\.\d+\.([^.]*)$/))||void 0===v?void 0:v[1];if(!T)return null;let K=T.split("$").find(m=>m.startsWith("s"));return null!==(k=null==K?void 0:null===(x=K.match(/^s(\d+)$/))||void 0===x?void 0:x[1])&&void 0!==k?k:null}(getCookie("_ga_".concat(x.O.NEXT_PUBLIC_GA4_MEASUREMENT_ID.slice(2))))}}function getMetaCookies(){var m;let g=getCookie("_fbc"),v=g&&!function(m){let g=m.split(".");if(g.length<4)return!1;let v=parseInt(g[2],10);return!isNaN(v)&&Date.now()-v>E.ac}(g)?g:null,x=null!==(m=(0,E.mD)())&&void 0!==m?m:function(){let m,g;try{m=window.sessionStorage.getItem(T),g=Number(window.sessionStorage.getItem(K)),window.sessionStorage.removeItem(T),window.sessionStorage.removeItem(K)}catch(m){(0,k.rj)(m);return}if(!m||!Number.isSafeInteger(g))return;let v=Date.now()-g;if(v<0||v>=E.ac)return;let x=new Date(g).toISOString();return(0,E.wG)(m,x)}();return!v&&x&&(v="fb.1.".concat(Date.parse(x.captured_at),".").concat(x.fbclid)),{fbc:v,fbp:getCookie("_fbp")}}},64652:function(m,g,v){"use strict";v.d(g,{mo:function(){return getAccidentsIllnessesLabel},m3:function(){return getComplementaryTreatmentDescription},_F:function(){return getComplementaryTreatmentLimit},u9:function(){return getComplementaryTreatmentLimitText},Hq:function(){return getCoverageStatus},iu:function(){return getLiabilityLimit},r5:function(){return getPreventiveItemsFromCoverageBundle}});var x,k,E,T,K,et,en,er,ei,es,el,ec,eu,ed,ep,em,ef,eh=v(27484),eg=v.n(eh);let ev={4:{complementary_treatments:null},5:{complementary_treatments:{therapies:["Acupuntura","Ozonoterapia","Kinesiolog\xeda","Tratamientos homeop\xe1ticos y fitoterap\xe9uticos de uso veterinario"],supplements:["Ursovet","Silimarina","Papainpet","Traumeel","Arnica","Canigest","Florafix","Artritabs","Felifat"]}},7:{complementary_treatments:{therapies:["Acupuntura","Ozonoterapia","Kinesiolog\xeda, fisioterapia e hidroterapia","Tratamientos homeop\xe1ticos y naturop\xe1ticos y terapias florales de uso veterinario","Terapias regenerativas y tratamientos de aplicaci\xf3n avanzada (c\xe9lulas madre, toxina botul\xednica, anticuerpos monoclonales)"],supplements:["Suplementos nutricionales y nutrac\xe9uticos de uso veterinario, de origen natural o sint\xe9tico, incluyendo hepatoprotectores, condroprotectores, antiinflamatorios naturales, antioxidantes, probi\xf3ticos, prebi\xf3ticos, \xe1cidos grasos esenciales, vitaminas y cannabidiol"]}}};var ey=v(2784);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var laptop=function(m){return ey.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 28 28"},m),x||(x=ey.createElement("g",{clipPath:"url(#laptop_svg__a)"},ey.createElement("path",{fill:"#fff",d:"M4.375 16.43V5.064a2 2 0 0 1 2-2h15.25a2 2 0 0 1 2 2V16.43l1.687 5.962a2 2 0 0 1-1.925 2.544H4.613a2 2 0 0 1-1.925-2.544z"}),ey.createElement("path",{stroke:"#737373",strokeWidth:1.5,d:"M4.375 16.43V5.064a2 2 0 0 1 2-2h15.25a2 2 0 0 1 2 2V16.43m-19.25 0h19.25m-19.25 0-1.687 5.962a2 2 0 0 0 1.925 2.544h18.774a2 2 0 0 0 1.925-2.544l-1.687-5.962"}),ey.createElement("rect",{width:14.25,height:8.387,x:6.875,y:5.563,fill:"#E5E5E5",stroke:"#737373",strokeWidth:1.5,rx:1.25}),ey.createElement("path",{stroke:"#737373",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12.906 21.656h2.188"}))),k||(k=ey.createElement("defs",null,ey.createElement("clipPath",{id:"laptop_svg__a"},ey.createElement("path",{fill:"#fff",d:"M0 0h28v28H0z"})))))};function dog_frame_extends(){return(dog_frame_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var dog_frame=function(m){return ey.createElement("svg",dog_frame_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32"},m),E||(E=ey.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M24 4h4v4M8 28H4v-4M24 28h4v-4M8 4H4v4"})),T||(T=ey.createElement("rect",{width:18,height:18,x:7,y:7,fill:"#E5E5E5",stroke:"#000",strokeWidth:1.5,rx:1})),K||(K=ey.createElement("path",{fill:"#FAFAFA",d:"M18 18v3a2 2 0 0 1-4 0v-3"})),et||(et=ey.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M18 18v3a2 2 0 0 1-4 0v-3"})),en||(en=ey.createElement("path",{fill:"#FAFAFA",d:"m16 16.5 1.299 2.25h-2.598z"})),er||(er=ey.createElement("path",{fill:"#000",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M11.5 11a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1M20.5 11a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1M16.41 15.41l1.08-1.87a.48.48 0 0 0-.41-.71h-2.16a.48.48 0 0 0-.41.71l1.08 1.87a.471.471 0 0 0 .82 0"})),ei||(ei=ey.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M16 15.5a2.5 2.5 0 0 1-5 0M21 15.5a2.5 2.5 0 0 1-5 0"})))};function chip_extends(){return(chip_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var chip=function(m){return ey.createElement("svg",chip_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 28 28"},m),es||(es=ey.createElement("path",{fill:"#E5E5E5",stroke:"#737373",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.167 22.633V5.367a.7.7 0 0 1 .7-.7h10.266a.7.7 0 0 1 .7.7v17.266a.7.7 0 0 1-.7.7H8.867a.7.7 0 0 1-.7-.7"})),el||(el=ey.createElement("path",{stroke:"#737373",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M16.333 23.333v2.917M11.667 23.333v2.917M16.333 4.667V1.75M11.667 4.667V1.75M8.167 14H5.25M22.75 14h-2.917M8.167 7.583H5.25M22.75 7.583h-2.917M8.167 20.417H5.25M22.75 20.417h-2.917"})))};function syringe_extends(){return(syringe_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var syringe=function(m){return ey.createElement("svg",syringe_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32"},m),ec||(ec=ey.createElement("path",{fill:"#fff",d:"m22.833 9.867 2.6 2.6-13.55 13.534A4.2 4.2 0 0 1 6 26a4.2 4.2 0 0 1 0-5.9L19.55 6.55l3.333 3.333"})),eu||(eu=ey.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"m22.833 9.867 2.6 2.6-13.55 13.534A4.2 4.2 0 0 1 6 26a4.2 4.2 0 0 1 0-5.9L19.55 6.55l3.333 3.333M2.45 29.55l3.533-3.532M10.1 21.902l-2.35-2.367M14.233 17.768l-2.35-2.35M18.35 13.65 16 11.283M22.483 9.516l3.534-3.534M22.483 2.45l7.067 7.066"})))};function sample_tube_extends(){return(sample_tube_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)({}).hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(null,arguments)}var sample_tube=function(m){return ey.createElement("svg",sample_tube_extends({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32"},m),ed||(ed=ey.createElement("path",{fill:"#fff",d:"M15.637 8.52h5.792v15.9c-.004 1.28-.578 2.505-1.597 3.41s-2.4 1.416-3.84 1.42c-1.441-.005-2.822-.515-3.84-1.42-1.02-.904-1.594-2.13-1.598-3.41V8.52h5.066"})),ep||(ep=ey.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M15.637 8.52h5.792v15.9c-.004 1.28-.578 2.505-1.597 3.41s-2.4 1.416-3.84 1.42v0c-1.441-.005-2.822-.515-3.84-1.42-1.02-.904-1.594-2.13-1.598-3.41V8.52h5.066"})),em||(em=ey.createElement("path",{fill:"#F5F5F5",d:"M11.525 16h8.836v6h-8.836z"})),ef||(ef=ey.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.56,d:"M21.43 3H10.57C9.703 3 9 3.625 9 4.395v2.73c0 .77.703 1.395 1.57 1.395h10.86c.867 0 1.57-.625 1.57-1.395v-2.73C23 3.625 22.297 3 21.43 3M13.661 3.69v4.14M18.318 3.334v5M10.554 16.125h10.875M10.554 21.645h10.875"})))};let getCoverageItemByName=(m,g)=>m.items.find(m=>m.coverage.name===g),formatToCLP=m=>
7"$".concat(Math.round(m).toLocaleString("es-CL")),getPreventiveItemsFromCoverageBundle=(m,g)=>{let v=[];if(m.has_preventive_package){let x=getCoverageItemByName(m,"teleconsultations");x&&v.push({icon:laptop,title:"Teleconsultas",subtitle:"Ilimitadas en cantidad",value:x.amount_limit_per_event?"".concat(x.amount_limit_per_event," UF"):"Incluido",amount:x.amount_limit_per_event?"~".concat(formatToCLP(x.amount_limit_per_event*g)):"",limitType:"Tope por evento",description:"Se cubren teleconsultas ilimitadas a trav\xe9s de la aplicaci\xf3n, para atenciones que no sean urgentes o asesor\xedas m\xe9dicas. Incluye informe cl\xednico, receta de medicamentos, orden para ex\xe1menes.",events:"Sin l\xedmite de eventos",coverage:x})}let x=getCoverageItemByName(m,"vaccines");x&&x.amount_limit&&v.push({icon:syringe,title:"Vacunaci\xf3n",subtitle:"Vacunas anuales",value:"".concat(x.amount_limit," UF"),amount:"~".concat(formatToCLP(x.amount_limit*g)),limitType:"Tope anual",description:"Cobertura para las vacunas anuales de tu mascota. Se excluye de esta cobertura todos los ex\xe1menes necesarios para realizar la vacunaci\xf3n.",events:"Sin l\xedmite de eventos",coverage:x});let k=getCoverageItemByName(m,"preventive_exams");k&&k.amount_limit&&v.push({icon:sample_tube,title:"Examen Preventivo",subtitle:"Examen de sangre anual",value:"".concat(k.amount_limit," UF"),amount:"~".concat(formatToCLP(k.amount_limit*g)),limitType:"Tope anual",description:"Se cubre un examen de sangre anual que incluye un hemograma completo, un perfil bioqu\xedmico de la mascota y toma de muestra, hasta el tope anual",events:"Sin l\xedmite de eventos",coverage:k});let E=getCoverageItemByName(m,"preventive_consultations");E&&E.amount_limit&&v.push({icon:dog_frame,title:"Consulta Preventiva",subtitle:"Una consulta al a\xf1o",value:"".concat(E.amount_limit," UF"),amount:"~".concat(formatToCLP(E.amount_limit*g)),limitType:"Tope anual",description:"Consulta veterinaria preventiva para mantener la salud de tu mascota.",events:"1 consulta por a\xf1o",coverage:E});let T=getCoverageItemByName(m,"chip_posture");return T&&T.amount_limit_per_event&&v.push({icon:chip,title:"Microchip",subtitle:"Postura de chip",value:"".concat(T.amount_limit_per_event," UF"),amount:"~".concat(formatToCLP(T.amount_limit_per_event*g)),limitType:"Tope",description:"Cobertura para la colocaci\xf3n del microchip de identificaci\xf3n de tu mascota.",events:"1 evento por vida de la p\xf3liza",coverage:T}),v},getComplementaryTreatmentLimit=m=>{var g;let v=getCoverageItemByName(m,"complementary_treatments");return null!==(g=null==v?void 0:v.amount_limit)&&void 0!==g?g:0},getLiabilityLimit=m=>{var g;let v=getCoverageItemByName(m,"liability");return null!==(g=null==v?void 0:v.amount_limit)&&void 0!==g?g:0},getAccidentsIllnessesLabel=m=>{let{has_accidents:g,has_illnesses:v}=m;return g&&v?"Accidentes y Enfermedades":g?"Accidentes":v?"Enfermedades":null},formatUf=m=>m.toLocaleString("es-CL",{minimumFractionDigits:2,maximumFractionDigits:2}),getComplementaryTreatmentLimitText=m=>{if(!m.has_complementary_treatments)return"No incluido en tu plan";let g=getComplementaryTreatmentLimit(m);return g?"Te reembolsamos los gastos de estas terapias con un tope de UF ".concat(formatUf(g)," por vigencia anual del seguro."):"No incluido en tu plan"},getComplementaryTreatmentDescription=m=>{var g,v;if(!m.has_complementary_treatments)return null;let x=m.product_id;return null!==(v=null===(g=ev[x])||void 0===g?void 0:g.complementary_treatments)&&void 0!==v?v:null},getCoverageStatus=m=>{var g,v,x,k,E,T,K;let et=eg()(null!==(K=m.coverage_start_date)&&void 0!==K?K:m.start_date),en=eg()();if(m.is_cancelled)return{allActive:!1,activeCoverages:[],pendingCoverages:[],nextCoverage:null,isCancelled:!0};let er=[{name:"Cobertura preventiva",isIncluded:null===(g=m.coverage_bundle)||void 0===g?void 0:g.has_preventive_package,waitingDays:0,availableDate:et},{name:"Responsabilidad Civil",isIncluded:null===(v=m.coverage_bundle)||void 0===v?void 0:v.has_liability,waitingDays:0,availableDate:et},{name:"Accidentes",isIncluded:null===(x=m.coverage_bundle)||void 0===x?void 0:x.has_accidents,waitingDays:7,availableDate:et.add(8,"day")},{name:"Enfermedades",isIncluded:null===(k=m.coverage_bundle)||void 0===k?void 0:k.has_illnesses,waitingDays:28,availableDate:et.add(29,"day")},{name:"Accidentes relacionados con ligamentos cruzados, luxaciones, displasias y hernias",isIncluded:null===(E=m.coverage_bundle)||void 0===E?void 0:E.has_accidents,waitingDays:90,availableDate:et.add(91,"day")},{name:"Enfermedades relacionadas con neoplasias benignas o malignas, ligamentos cruzados, luxaciones, displasias y hernias",isIncluded:null===(T=m.coverage_bundle)||void 0===T?void 0:T.has_illnesses,waitingDays:90,availableDate:et.add(91,"day")}],ei=er.filter(m=>m.isIncluded),es=ei.filter(m=>en.isAfter(m.availableDate)||en.isSame(m.availableDate,"day")),el=ei.filter(m=>en.isBefore(m.availableDate)),ec=el.sort((m,g)=>m.availableDate.diff(en)-g.availableDate.diff(en))[0],eu=0===el.length&&ei.length>0,ed=ec?ec.availableDate.diff(en,"day"):0;return{allActive:eu,activeCoverages:es,pendingCoverages:el,nextCoverage:ec,daysUntilNext:ed,totalCoverages:ei.length,activeCoveragesCount:es.length,coverageStates:ei,isCancelled:!1}}},42661:function(m,g,v){"use strict";v.d(g,{J_:function(){return x.p6},p6:function(){return x.p6}});var x=v(37903)},10638:function(m,g,v){"use strict";v.d(g,{ac:function(){return T},cj:function(){return saveFacebookClickFromUrl},mD:function(){return getFacebookClick},wG:function(){return saveFacebookClick}});var x=v(53538),k=v(14016);let E="cacttus_facebook_click",T=7776e6,K=x.Z_().min(1).max(512).regex(/^[A-Za-z0-9._~-]+$/),et=x.Ry({fbclid:K,captured_at:x.Z_().datetime()});function saveFacebookClick(m,g){let v=et.safeParse({fbclid:m,captured_at:g});if(!v.success){(0,k.rj)(v.error);return}try{window.localStorage.setItem(E,JSON.stringify(v.data))}catch(m){(0,k.rj)(m)}return v.data}function getFacebookClick(){try{let m;let g=window.localStorage.getItem(E);if(!g)return;try{m=JSON.parse(g)}catch(m){(0,k.rj)(m),window.localStorage.removeItem(E);return}let v=et.safeParse(m);
7if(!v.success){(0,k.rj)(v.error),window.localStorage.removeItem(E);return}let x=Date.now()-Date.parse(v.data.captured_at);if(x<0||x>=T){window.localStorage.removeItem(E);return}return v.data}catch(m){(0,k.rj)(m);return}}function saveFacebookClickFromUrl(){let m=new URLSearchParams(window.location.search).get("fbclid");m&&saveFacebookClick(m,new Date().toISOString())}},59705:function(m,g,v){"use strict";v.d(g,{C:function(){return saveGoogleAdsClickFromUrl},Y:function(){return getGoogleAdsClick}});var x=v(53538),k=v(14016);let E="cacttus_google_ads_click",T=["gclid","gbraid","wbraid"],K=x.Z_().min(1).max(512).regex(/^[A-Za-z0-9._~-]+$/),et=x.Ry({gclid:K.optional(),gbraid:K.optional(),wbraid:K.optional(),captured_at:x.Z_().datetime()}).refine(m=>T.some(g=>m[g]));function getGoogleAdsClick(){try{let m;let g=window.localStorage.getItem(E);if(!g)return;try{m=JSON.parse(g)}catch(m){window.localStorage.removeItem(E),(0,k.rj)(Error("Invalid Google Ads click storage"));return}let v=et.safeParse(m);if(!v.success){window.localStorage.removeItem(E),(0,k.rj)(Error("Invalid Google Ads click storage"));return}let x=Date.now()-Date.parse(v.data.captured_at);if(x<0||x>=7776e6){window.localStorage.removeItem(E);return}return v.data}catch(m){(0,k.rj)(Error("Unable to read Google Ads click storage"));return}}function saveGoogleAdsClickFromUrl(){let m=new URLSearchParams(window.location.search),g={};for(let v of T){let x=K.safeParse(m.get(v));x.success&&(g[v]=x.data)}if(!T.some(m=>g[m]))return;let v=getGoogleAdsClick();if(!(v&&T.every(m=>v[m]===g[m])))try{window.localStorage.setItem(E,JSON.stringify({...g,captured_at:new Date().toISOString()}))}catch(m){(0,k.rj)(Error("Unable to save Google Ads click storage"))}}},9374:function(m,g,v){"use strict";v.d(g,{k:function(){return getUtmVisit},r:function(){return saveUtmVisitFromUrl}}
7);var x=v(53538),k=v(14016);let E="cacttus_utm_visit",T=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],K=x.Z_().min(1).max(512).refine(m=>!function(m){for(let g=0;g<m.length;g+=1){let v=m.charCodeAt(g);if(v<=31||v>=127&&v<=159)return!0}return!1}(m)),et=x.Ry({utm_source:K.optional(),utm_medium:K.optional(),utm_campaign:K.optional(),utm_term:K.optional(),utm_content:K.optional(),utm_id:K.optional(),captured_at:x.Z_().datetime()}).refine(m=>T.some(g=>m[g]));function decodeParam(m){try{return decodeURIComponent(m)}catch(m){if(m instanceof URIError)return;throw m}}function getUtmVisit(){try{let m;let g=window.localStorage.getItem(E);if(!g)return;try{m=JSON.parse(g)}catch(m){window.localStorage.removeItem(E),(0,k.rj)(Error("Invalid UTM visit storage"));return}let v=et.safeParse(m);if(!v.success){window.localStorage.removeItem(E),(0,k.rj)(Error("Invalid UTM visit storage"));return}let x=Date.now()-Date.parse(v.data.captured_at);if(x<0||x>=7776e6){window.localStorage.removeItem(E);return}return v.data}catch(m){(0,k.rj)(Error("Unable to read UTM visit storage"));return}}function saveUtmVisitFromUrl(){let m=function(m){let g={},v=new Set,x=m.startsWith("?")?m.slice(1):m;for(let m of x.split("&")){let x=m.indexOf("=");if(x<0)continue;let k=decodeParam(m.slice(0,x));if(!k||!function(m){return T.some(g=>g===m)}(k)||v.has(k))continue;v.add(k);let E=K.safeParse(decodeParam(m.slice(x+1)));E.success&&(g[k]=E.data)}return g}(window.location.search);if(T.some(g=>m[g]))try{window.localStorage.setItem(E,JSON.stringify({...m,captured_at:new Date().toISOString()}))}catch(m){(0,k.rj)(Error("Unable to save UTM visit storage"))}}},43889:function(m,g,v){"use strict";v.d(g,{t:function(){return K}});var x=v(31993),k=v(782),E=v(75969),T=v(32765);let K=(0,x.U)()((0,k.tJ)(m=>({token:new E.Z().get("token")||null,setToken:g=>{let v=new E.Z;v.set("token",g,{path:"/"}),m({token:g})},logout:()=>{let g=new E.Z;g.remove("token",{path:"/"}),(0,T.mo)(),m({token:null})}}),{name:"auth-storage",storage:(0,k.FL)(()=>localStorage),partialize:m=>({token:m.token})}))},53328:function(m,g,v){"use strict";v.d(g,{w:function(){return T}});var x=v(31993),k=v(782);let E={},T=(0,x.U)()((0,k.tJ)(m=>({state:E,updateOnboarding:g=>{m(m=>({state:{...m.state,...g}}))},resetOnboarding:()=>{m({state:E})}}),{name:"onboarding-storage",storage:(0,k.FL)(()=>localStorage),partialize:m=>({state:m.state})}))},13329:function(m,g,v){"use strict";let x,k,E,T,K,et,en,er,ei,es,el,ec,eu,ed,ep,em,ef,eh;var eg,ev,ey,eb,ex,e_,ew,eS,eC,ek=v(81880),eE=v(86651),ej=v(70385);function applySdkMetadata(m,g,v=[g],x="npm"){let k=(m._metadata=m._metadata||{}).sdk=m._metadata.sdk||{};k.name||(k.name=`sentry.javascript.${g}`,k.packages=v.map(m=>({name:`${x}:@sentry/${m}`,version:ej.J})),k.version=ej.J)}var eN=v(86239),eR=v(61662);let eI=[];function afterSetupIntegrations(m,g){for(let v of g)v?.afterAllSetup&&v.afterAllSetup(m)}function setupIntegration(m,g,v){if(v[g.name]){eR.X&&eE.fF.log(`Integration skipped because it was already installed: ${g.name}`);return}if(v[g.name]=g,eI.includes(g.name)||"function"!=typeof g.setupOnce||(g.setupOnce(),eI.push(g.name)),g.setup&&"function"==typeof g.setup&&g.setup(m),"function"==typeof g.preprocessEvent){let v=g.preprocessEvent.bind(g);m.on("preprocessEvent",(g,x)=>v(g,x,m))}if("function"==typeof g.processEvent){let v=g.processEvent.bind(g),x=Object.assign((g,x)=>v(g,x,m),{id:g.name});m.addEventProcessor(x)}["processSpan","processSegmentSpan"].forEach(v=>{let x=g[v];"function"==typeof x&&m.on(v,v=>x.call(g,v,m))}),eR.X&&eE.fF.log(`Integration installed: ${g.name}`)}function getPossibleEventMessages(m){let g=[];m.message&&g.push(m.message);try{let v=m.exception.values[m.exception.values.length-1];v?.value&&(g.push(v.value),v.type&&g.push(`${v.type}: ${v.value}`))}catch{}return g}var eP=v(87279),eT=v(36953);let eO=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],eventFiltersIntegration=(m={})=>{let g;return{name:"EventFilters",setup(v){let x=v.getOptions();g=_mergeOptions(m,x)},processEvent(v,x,k){if(!g){let v=k.getOptions();g=_mergeOptions(m,v)}return!function(m,g){if(m.type){if("transaction"===m.type&&function(m,g){if(!g?.length)return!1;let v=m.transaction;return!!v&&(0,eT.U0)(v,g)}(m,g.ignoreTransactions))return eR.X&&eE.fF.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
8Event: ${(0,eP.jH)(m)}`),!0}else{var v;if(v=g.ignoreErrors,v?.length&&getPossibleEventMessages(m).some(m=>(0,eT.U0)(m,v)))return eR.X&&eE.fF.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
9Event: ${(0,eP.jH)(m)}`),!0;if(m.exception?.values?.length&&!m.message&&!m.exception.values.some(m=>m.stacktrace||m.type&&"Error"!==m.type||m.value))return eR.X&&eE.fF.warn(`Event dropped due to not having an error message, error type or stacktrace.
10Event: ${(0,eP.jH)(m)}`),!0;if(function(m,g){if(!g?.length)return!1;let v=_getEventFilterUrl(m);return!!v&&(0,eT.U0)(v,g)}(m,g.denyUrls))return eR.X&&eE.fF.warn(`Event dropped due to being matched by \`denyUrls\` option.
11Event: ${(0,eP.jH)(m)}.
12Url: ${_getEventFilterUrl(m)}`),!0;if(!function(m,g){if(!g?.length)return!0;let v=_getEventFilterUrl(m);return!v||(0,eT.U0)(v,g)}(m,g.allowUrls))return eR.X&&eE.fF.warn(`Event dropped due to not being matched by \`allowUrls\` option.
13Event: ${(0,eP.jH)(m)}.
14Url: ${_getEventFilterUrl(m)}`),!0}return!1}(v,g)?v:null}}},inboundFiltersIntegration=(m={})=>({...eventFiltersIntegration(m),name:"InboundFilters"});function _mergeOptions(m={},g={}){return{allowUrls:[...m.allowUrls||[],...g.allowUrls||[]],denyUrls:[...m.denyUrls||[],...g.denyUrls||[]],ignoreErrors:[...m.ignoreErrors||[],...g.ignoreErrors||[],...m.disableErrorDefaults?[]:eO],ignoreTransactions:[...m.ignoreTransactions||[],...g.ignoreTransactions||[]]}}function _getEventFilterUrl(m){try{let g=[...m.exception?.values??[]].reverse().find(m=>m.mechanism?.parent_id===void 0&&m.stacktrace?.frames?.length),v=g?.stacktrace?.frames;return v?function(m=[]){for(let g=m.length-1;g>=0;g--){let v=m[g];if(v&&"<anonymous>"!==v.filename&&"[native code]"!==v.filename)return v.filename||null}return null}(v):null}catch{return eR.X&&eE.fF.error(`Cannot extract url for event ${(0,eP.jH)(m)}`),null}}var eA=v(41690),eM=v(70524);let eD=new WeakMap,functionToStringIntegration=()=>({name:"FunctionToString",setupOnce(){let m=Function.prototype.toString;try{Function.prototype.toString=function(...g){let v;let x=(0,eM.HK)(this);try{eD.has((0,eA.s3)())&&void 0!==x&&(v=x)}catch{}return m.apply(v??this,g)}}catch{}},setup(m){eD.set(m,!0)}});var eL=v(45535),eF=v(66603);let conversationIdIntegration=()=>({name:"ConversationId",setup(m){m.on("spanStart",m=>{let g=(0,eA.nZ)().getScopeData(),v=(0,eA.aF)().getScopeData(),x=g.conversationId||v.conversationId;if(x){let{op:g,data:v,description:k}=(0,eF.XU)(m);if(!g?.startsWith("gen_ai.")&&!v["ai.operationId"]&&!k?.startsWith("ai."))return;m.setAttribute(eL.Ap,x)}})}});var eZ=v(48643);let dedupeIntegration=()=>{let m;return{name:"Dedupe",processEvent(g){if(g.type)return g;try{var v;if((v=m)&&(function(m,g){let v=m.message,x=g.message;return!!((v||x)&&(!v||x)&&(v||!x)&&v===x&&_isSameFingerprint(m,g)&&_isSameStacktrace(m,g))}(g,v)||function(m,g){let v=_getExceptionFromEvent(g),x=_getExceptionFromEvent(m);return!!(v&&x&&v.type===x.type&&v.value===x.value&&_isSameFingerprint(m,g)&&_isSameStacktrace(m,g))}(g,v)))return eR.X&&eE.fF.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return m=g}}};function _isSameStacktrace(m,g){let v=(0,eZ.Fr)(m),x=(0,eZ.Fr)(g);if(!v&&!x)return!0;
14if(v&&!x||!v&&x||x.length!==v.length)return!1;for(let m=0;m<x.length;m++){let g=x[m],k=v[m];if(g.filename!==k.filename||g.lineno!==k.lineno||g.colno!==k.colno||g.function!==k.function)return!1}return!0}function _isSameFingerprint(m,g){let v=m.fingerprint,x=g.fingerprint;if(!v&&!x)return!0;if(v&&!x||!v&&x)return!1;try{return!(v.join("")!==x.join(""))}catch{return!1}}function _getExceptionFromEvent(m){return m.exception?.values?.[0]}var eB=v(75437),e$=v(42219),eU=v(6262);function beforeSendSpan_isStreamedBeforeSendSpanCallback(m){return!!m&&"function"==typeof m&&"_streamed"in m&&!!m._streamed}var ez=v(63197),eV=v(79751),eq=v(36882);function createEnvelope(m,g=[]){return[m,g]}function addItemToEnvelope(m,g){let[v,x]=m;return[v,[...x,g]]}function forEachEnvelopeItem(m,g){let v=m[1];for(let m of v){let v=m[0].type,x=g(m,v);if(x)return!0}return!1}function encodeUTF8(m){let g=(0,eV.qA)(ek.GLOBAL_OBJ);return g.encodePolyfill?g.encodePolyfill(m):new TextEncoder().encode(m)}let eH={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function envelopeItemTypeToDataCategory(m){return m in eH?eH[m]:m}function getSdkMetadataForEnvelopeHeader(m){if(!m?.sdk)return;let{name:g,version:v}=m.sdk;return{name:g,version:v}}function createEventEnvelopeHeaders(m,g,v,x){let k=m.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:m.event_id,sent_at:new Date((0,eq.lk)()).toISOString(),...g&&{sdk:g},...!!v&&x&&{dsn:(0,ez.RA)(x)},...k&&{trace:k}}}function logIgnoredSpan(m){eE.fF.log(`Ignoring span ${m.op} - ${m.description} because it matches \`ignoreSpans\`.`)}function shouldIgnoreSpan(m,g){if(!g?.length)return!1;for(let v of g){if("string"==typeof v||v instanceof RegExp){if(m.description&&(0,eT.zC)(m.description,v))return eR.X&&logIgnoredSpan(m),!0;continue}let g=!!v.attributes&&Object.keys(v.attributes).length>0;if(!v.name&&!v.op&&!g)continue;let x=!v.name||m.description&&(0,eT.zC)(m.description,v.name),k=!v.op||m.op&&(0,eT.zC)(m.op,v.op),E=!v.attributes||Object.entries(v.attributes).every(([g,v])=>(function(m,g){return"string"==typeof m&&("string"==typeof g||g instanceof RegExp)?(0,eT.zC)(m,g):Array.isArray(m)&&Array.isArray(g)?m.length===g.length&&m.every((m,v)=>m===g[v]):m===g})(m.attributes?.[g],v));if(x&&k&&E)return eR.X&&logIgnoredSpan(m),!0}return!1}var eW=v(93542);function isBrowser(){return"undefined"!=typeof window&&(!(!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call(void 0!==eW?eW:0))||function(){let m=ek.GLOBAL_OBJ.process;return m?.type==="renderer"}())}function _INTERNAL_flushLogsBuffer(m,g){let v=g??_getBufferMap().get(m)??[];if(0===v.length)return;let x=m.getOptions(),k=function(m,g,v,x,k){let E={};return g?.sdk&&(E.sdk={name:g.sdk.name,version:g.sdk.version}),v&&x&&(E.dsn=(0,ez.RA)(x)),createEnvelope(E,[function(m,g){let v=g?"auto":"never";return[{type:"log",item_count:m.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...isBrowser()&&{ingest_settings:{infer_ip:v,infer_user_agent:v}},items:m}]}(m,k)])}(v,x._metadata,x.tunnel,m.getDsn(),m.getDataCollectionOptions().userInfo);_getBufferMap().set(m,[]),m.emit("flushLogs"),m.sendEnvelope(k)}function _getBufferMap(){return(0,eV.YO)("clientToLogBufferMap",()=>new WeakMap)}function _INTERNAL_flushMetricsBuffer(m,g){let v=g??internal_getBufferMap().get(m)??[];if(0===v.length)return;let x=m.getOptions(),k=function(m,g,v,x,k){let E={};return g?.sdk&&(E.sdk={name:g.sdk.name,version:g.sdk.version}),v&&x&&(E.dsn=(0,ez.RA)(x)),createEnvelope(E,[function(m,g){let v=g?"auto":"never";return[{type:"trace_metric",item_count:m.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...isBrowser()&&{ingest_settings:{infer_ip:v,infer_user_agent:v}},items:m}]}(m,k)])}(v,x._metadata,x.tunnel,m.getDsn(),m.getDataCollectionOptions().userInfo);internal_getBufferMap().set(m,[]),m.emit("flushMetrics"),m.sendEnvelope(k)}function internal_getBufferMap(){return(0,eV.YO)("clientToMetricBufferMap",()=>new WeakMap)}var eK=v(79681);function hasSpanStreamingEnabled(m){return"stream"===m.getOptions().traceLifecycle}var eG=v(62435);function safeUnref(m){return"object"==typeof m&&"function"==typeof m.unref&&m.unref(),m}let eQ=Symbol.for("SentryBufferFullError");function makePromiseBuffer(m=100){let g=new Set;return{get $(){return Array.from(g)},add:function(v){if(!(g.size<m))return(0,eG.$2)(eQ);let x=v();return g.add(x),x.then(()=>{g.delete(x)},()=>{g.delete(x)}),x},drain:function(m){if(!g.size)return(0,eG.WD)(!0);let v=Promise.allSettled(Array.from(g)).then(()=>!0);if(!m)return v;let x=[v,new Promise(g=>safeUnref(setTimeout(()=>g(!1),m)))];return Promise.race(x)}}}function isRateLimited(m,g,v=(0,eq.lk)()){return(m[g]||m.all||0)>v}function updateRateLimits(m,{statusCode:g,headers:v},x=(0,eq.lk)()){let k={...m},E=v?.["x-sentry-rate-limits"],T=v?.["retry-after"];if(E)for(let m of E.trim().split(",")){let[g,v,,,E]=m.split(":",5),T=parseInt(g,10),K=(isNaN(T)?60:T)*1e3;if(v)for(let m of v.split(";"))"metric_bucket"===m?(!E||E.split(";").includes("custom"))&&(k[m]=x+K):k[m]=x+K;else k.all=x+K}else T?k.all=x+function(m,g=(0,eq.lk)()){let v=parseInt(`${m}`,10);if(!isNaN(v))return 1e3*v;let x=Date.parse(`${m}`);return isNaN(x)?6e4:x-g}(T,x):429===g&&(k.all=x+6e4);return k}var eY=v(64150),eX=v(11750),eJ=v(34276),e0=v(97680),e1=v(21068);let e2=["forwarded","-ip","remote-","via","-user"],e3={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0}
14,databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5},e5="Not capturing exception because it's already been captured.",e4="Discarded session because of missing or non-string release",e6=Symbol.for("SentryInternalError"),e7=Symbol.for("SentryDoNotSendEventError");function _makeInternalError(m){return{message:m,[e6]:!0}}function _makeDoNotSendEventError(m){return{message:m,[e7]:!0}}function _isInternalError(m){return(0,eX.yD)(m)&&e6 in m}function _isDoNotSendEventError(m){return(0,eX.yD)(m)&&e7 in m}function setupWeightBasedFlushing(m,g,v,x,k){let E,T=0,K=!1;m.on(v,()=>{T=0,clearTimeout(E),K=!1}),m.on(g,g=>{if((T+=x(g))>=8e5)k(m);else if(!K){let g=m.getOptions()._flushInterval??5e3;g>0&&(K=!0,E=safeUnref(setTimeout(()=>{k(m)},g)))}}),m.on("flush",()=>{k(m)})}let Client=class Client{constructor(m){if(this._options=m,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=makePromiseBuffer(m.transportOptions?.bufferSize??64),this._dataCollection=function(m){let g=null!=m.dataCollection?e3:!0===m.sendDefaultPii?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:e2},httpHeaders:{request:{deny:e2},response:{deny:e2}},httpBodies:[],urlQueryParams:{deny:e2},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7},v=m.dataCollection??{};return{userInfo:v.userInfo??g.userInfo,cookies:v.cookies??g.cookies,httpHeaders:{request:v.httpHeaders?.request??g.httpHeaders.request,response:v.httpHeaders?.response??g.httpHeaders.response},httpBodies:v.httpBodies??g.httpBodies,urlQueryParams:v.urlQueryParams??v.queryParams??g.urlQueryParams,graphQL:{document:v.graphQL?.document??g.graphQL.document,variables:v.graphQL?.variables??g.graphQL.variables},genAI:{inputs:v.genAI?.inputs??g.genAI.inputs,outputs:v.genAI?.outputs??g.genAI.outputs},databaseQueryData:v.databaseQueryData??g.databaseQueryData,stackFrameVariables:v.stackFrameVariables??g.stackFrameVariables,frameContextLines:v.frameContextLines??g.frameContextLines}}(m),m.dsn?this._dsn=(0,ez.vK)(m.dsn):eR.X&&eE.fF.warn("No DSN provided, client will not send events."),this._dsn){var g,v,x;let k=(g=this._dsn,v=m.tunnel,x=m._metadata?m._metadata.sdk:void 0,v||`${function(m){let g=m.protocol?`${m.protocol}:`:"",v=m.port?`:${m.port}`:"";return`${g}//${m.host}${v}${m.path?`/${m.path}`:""}/api/`}(g)}${g.projectId}/envelope/?${function(m,g){let v={sentry_version:"7"};return m.publicKey&&(v.sentry_key=m.publicKey),g&&(v.sentry_client=`${g.name}/${g.version}`),new URLSearchParams(v).toString()}(g,x)}`);this._transport=m.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...m.transportOptions,url:k})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&setupWeightBasedFlushing(this,"afterCaptureLog","flushLogs",estimateLogSizeInBytes,_INTERNAL_flushLogsBuffer);let k=this._options.enableMetrics??this._options._experiments?.enableMetrics??!0;k&&setupWeightBasedFlushing(this,"afterCaptureMetric","flushMetrics",estimateMetricSizeInBytes,_INTERNAL_flushMetricsBuffer)}captureException(m,g,v){let x=(0,eP.DM)();if((0,eP.YO)(m))return eR.X&&eE.fF.log(e5),x;let k={event_id:x,...g};return this._process(()=>this.eventFromException(m,k).then(m=>this._captureEvent(m,k,v)).then(m=>m),"error"),k.event_id}captureMessage(m,g,v,x){let k={event_id:(0,eP.DM)(),...v},E=(0,eX.Le)(m)?m:String(m),T=(0,eX.pt)(m),K=T?this.eventFromMessage(E,g,k):this.eventFromException(m,k);return this._process(()=>K.then(m=>this._captureEvent(m,k,x)),T?"unknown":"error"),k.event_id}captureEvent(m,g,v){let x=(0,eP.DM)();if(g?.originalException&&(0,eP.YO)(g.originalException))return eR.X&&eE.fF.log(e5),x;let k={event_id:x,...g},E=m.sdkProcessingMetadata||{},T=E.capturedSpanScope,K=E.capturedSpanIsolationScope,et=getDataCategoryByType(m.type);return this._process(()=>this._captureEvent(m,k,T||v,K),et),k.event_id}captureSession(m){this.sendSession(m),(0,eK.CT)(m,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(m){let g=this._transport;
14if(this.emit("flush"),!g)return!0;let v=await this._isClientDoneProcessing(m),x=await g.flush(m);return v&&x}async close(m){let g=await this.flush(m);return this.getOptions().enabled=!1,this.emit("close"),g}getEventProcessors(){return this._eventProcessors}addEventProcessor(m){this._eventProcessors.push(m)}init(){(this._isEnabled()||this._options.integrations.some(({name:m})=>m.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(m){return this._integrations[m]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(m){let g=this._integrations[m.name];!g&&m.beforeSetup&&m.beforeSetup(this),setupIntegration(this,m,this._integrations),g||afterSetupIntegrations(this,[m])}sendEvent(m,g={}){this.emit("beforeSendEvent",m,g);let v=function(m,g){if("transaction"!==m.type||!m.spans?.length||!m.sdkProcessingMetadata?.hasGenAiSpans||!1===g.getOptions().streamGenAiSpans||hasSpanStreamingEnabled(g))return;let v=[],x=[];for(let g of m.spans)g.op?.startsWith("gen_ai.")?v.push(function(m){let g={trace_id:m.trace_id,span_id:m.span_id,parent_span_id:m.parent_span_id,name:m.description||"",start_timestamp:m.start_timestamp,end_timestamp:m.timestamp||m.start_timestamp,status:m.status&&"ok"!==m.status&&"cancelled"!==m.status?"error":"ok",is_segment:!1,attributes:{...m.data},links:m.links};return(0,eF.i7)(g)}(g)):x.push(g);if(0===v.length)return;m.spans=x;let k=g.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:v.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...isBrowser()&&{ingest_settings:{infer_ip:k,infer_user_agent:k}},items:v}]}(m,this),x=function(m,g,v,x){let k=getSdkMetadataForEnvelopeHeader(v),E=m.type&&"replay_event"!==m.type?m.type:"event";!function(m,g){if(!g)return;let v=m.sdk||{};m.sdk={...v,name:v.name||g.name,version:v.version||g.version,integrations:[...m.sdk?.integrations||[],...g.integrations||[]],packages:[...m.sdk?.packages||[],...g.packages||[]],settings:m.sdk?.settings||g.settings?{...m.sdk?.settings,...g.settings}:void 0}}(m,v?.sdk);let T=createEventEnvelopeHeaders(m,k,x,g);delete m.sdkProcessingMetadata;let K=[{type:E},m];return createEnvelope(T,[K])}(m,this._dsn,this._options._metadata,this._options.tunnel);for(let m of g.attachments||[])x=addItemToEnvelope(x,function(m){let g="string"==typeof m.data?encodeUTF8(m.data):m.data;return[{type:"attachment",length:g.length,filename:m.filename,content_type:m.contentType,attachment_type:m.attachmentType},g]}(m));v&&(x=addItemToEnvelope(x,v)),this.sendEnvelope(x).then(g=>this.emit("afterSendEvent",m,g))}sendSession(m){let{release:g,environment:v=e$.J}=this._options;if("aggregates"in m){let x=m.attrs||{};if(!x.release&&!g){eR.X&&eE.fF.warn(e4);return}x.release=x.release||g,x.environment=x.environment||v,m.attrs=x}else{if(!m.release&&!g){eR.X&&eE.fF.warn(e4);return}m.release=m.release||g,m.environment=m.environment||v}this.emit("beforeSendSession",m);let x=function(m,g,v,x){let k=getSdkMetadataForEnvelopeHeader(v),E={sent_at:new Date((0,eq.lk)()).toISOString(),...k&&{sdk:k},...!!x&&g&&{dsn:(0,ez.RA)(g)}},T="aggregates"in m?[{type:"sessions"},m]:[{type:"session"},m.toJSON()];return createEnvelope(E,[T])}(m,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(x)}recordDroppedEvent(m,g,v=1){if(this._options.sendClientReports){let x=`${m}:${g}`;eR.X&&eE.fF.log(`Recording outcome: "${x}"${v>1?` (${v} times)`:""}`),this._outcomes[x]=(this._outcomes[x]||0)+v}}on(m,g){let v=this._hooks[m]=this._hooks[m]||new Set,uniqueCallback=(...m)=>g(...m);return v.add(uniqueCallback),()=>{v.delete(uniqueCallback)}}emit(m,...g){let v=this._hooks[m];v&&v.forEach(m=>m(...g))}async sendEnvelope(m){if(this.emit("beforeEnvelope",m),this._isEnabled()&&this._transport)try{return await this._transport.send(m)}catch(m){return eR.X&&eE.fF.error("Error while sending envelope:",m),{}}return eR.X&&eE.fF.error("Transport disabled"),{}}registerCleanup(m){}dispose(){}_setupIntegrations(){let{integrations:m}=this._options;this._integrations=function(m,g){let v={};return g.forEach(g=>{g?.beforeSetup&&g.beforeSetup(m)}),g.forEach(g=>{g&&setupIntegration(m,g,v)}),v}(this,m),afterSetupIntegrations(this,m)}_updateSessionFromEvent(m,g){let v="fatal"===g.level,x=!1,k=g.exception?.values;if(k){for(let m of(x=!0,v=!1,k))if(m.mechanism?.handled===!1){v=!0;break}}let E="ok"===m.status,T=E&&0===m.errors||E&&v;T&&((0,eK.CT)(m,{...v&&{status:"crashed"},errors:m.errors||Number(x||v)}),this.captureSession(m))}async _isClientDoneProcessing(m){let g=0;for(;!m||g<m;){if(await new Promise(m=>setTimeout(m,1)),!this._numProcessing)return!0;g++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(m,g,v,x){let k=this.getOptions(),E=this.getIntegrationNames();
14return!g.integrations&&E.length&&(g.integrations=E),this.emit("preprocessEvent",m,g),m.type||x.setLastEventId(m.event_id||g.event_id),(0,e1.R)(k,m,g,v,this,x).then(m=>{if(null===m)return m;this.emit("postprocessEvent",m,g),m.contexts={trace:{...m.contexts?.trace,...(0,eA.XX)(v)},...m.contexts};let x=(0,eU.CG)(this,v);return m.sdkProcessingMetadata={dynamicSamplingContext:x,...m.sdkProcessingMetadata},m})}_captureEvent(m,g={},v=(0,eA.nZ)(),x=(0,eA.aF)()){return eR.X&&client_isErrorEvent(m)&&eE.fF.log(`Captured error event \`${getPossibleEventMessages(m)[0]||"<unknown>"}\``),this._processEvent(m,g,v,x).then(m=>m.event_id,m=>{eR.X&&(_isDoNotSendEventError(m)?eE.fF.log(m.message):_isInternalError(m)?eE.fF.warn(m.message):eE.fF.warn(m))})}_processEvent(m,g,v,x){let k=this.getOptions(),{sampleRate:E}=k,T=isTransactionEvent(m),K=client_isErrorEvent(m),et=m.type||"error",en=`before send for type \`${et}\``,er=void 0===E?void 0:(0,e0.o)(E),ei=getDataCategoryByType(m.type);return this._prepareEvent(m,g,v,x).then(m=>{if(null===m)throw this.recordDroppedEvent("event_processor",ei),_makeDoNotSendEventError("An event processor returned `null`, will not send event.");let v=g.data?.__sentry__===!0;if(v)return m;let x=function(m,g,v,x){let{beforeSend:k,beforeSendTransaction:E,ignoreSpans:T}=g,K=!beforeSendSpan_isStreamedBeforeSendSpanCallback(g.beforeSendSpan)&&g.beforeSendSpan,et=v;if(client_isErrorEvent(et)&&k)return k(et,x);if(isTransactionEvent(et)){if(K||T){let g=function(m){let{trace_id:g,parent_span_id:v,span_id:x,status:k,origin:E,data:T,op:K}=m.contexts?.trace??{};return{data:T??{},description:m.transaction,op:K,parent_span_id:v,span_id:x??"",start_timestamp:m.start_timestamp??0,status:k,timestamp:m.timestamp,trace_id:g??"",origin:E,profile_id:T?.[eL.p6],exclusive_time:T?.[eL.JQ],measurements:m.measurements,is_segment:!0}}(et);if(T?.length&&shouldIgnoreSpan({description:g.description,op:g.op,attributes:g.data},T))return null;if(K){let m=K(g);m?et=(0,eJ.T)(v,{type:"transaction",timestamp:m.timestamp,start_timestamp:m.start_timestamp,transaction:m.description,contexts:{trace:{trace_id:m.trace_id,span_id:m.span_id,parent_span_id:m.parent_span_id,op:m.op,status:m.status,origin:m.origin,data:{...m.data,...m.profile_id&&{[eL.p6]:m.profile_id},...m.exclusive_time&&{[eL.JQ]:m.exclusive_time}}}},measurements:m.measurements}):(0,eF.R6)()}if(et.spans){let g=[],v=et.spans;for(let m of v){if(T?.length&&shouldIgnoreSpan({description:m.description,op:m.op,attributes:m.data},T)){!function(m,g){let v=g.parent_span_id,x=g.span_id;if(v)for(let g of m)g.parent_span_id===x&&(g.parent_span_id=v)}(v,m);continue}if(K){let v=K(m);v?g.push(v):((0,eF.R6)(),g.push(m))}else g.push(m)}let x=et.spans.length-g.length;x&&m.recordDroppedEvent("before_send","span",x),et.spans=g}}if(E){if(et.spans){let m=et.spans.length;et.sdkProcessingMetadata={...v.sdkProcessingMetadata,spanCountBeforeProcessing:m}}return E(et,x)}}return et}(this,k,m,g);return function(m,g){let v=`${g} must return \`null\` or a valid event.`;if((0,eX.J8)(m))return m.then(m=>{if(!(0,eX.PO)(m)&&null!==m)throw _makeInternalError(v);return m},m=>{throw _makeInternalError(`${g} rejected with ${m}`)});if(!(0,eX.PO)(m)&&null!==m)throw _makeInternalError(v);return m}(x,en)}).then(k=>{if(null===k){if(this.recordDroppedEvent("before_send",ei),T){let g=m.spans||[],v=1+g.length;this.recordDroppedEvent("before_send","span",v)}throw _makeDoNotSendEventError(`${en} returned \`null\`, will not send event.`)}let et=v.getSession()||x.getSession();if(K&&et&&this._updateSessionFromEvent(et,k),K&&"number"==typeof er&&(0,eq.n0)()>er)throw this.recordDroppedEvent("sample_rate","error"),_makeDoNotSendEventError(`Discarding event because it's not included in the random sample (sampling rate = ${E})`);if(T){let m=k.sdkProcessingMetadata?.spanCountBeforeProcessing||0,g=k.spans?k.spans.length:0,v=m-g;v>0&&this.recordDroppedEvent("before_send","span",v)}let es=k.transaction_info;return T&&es&&k.transaction!==m.transaction&&(k.transaction_info={...es,source:"custom"}),this.sendEvent(k,g),k}).then(null,m=>{if(_isDoNotSendEventError(m)||_isInternalError(m))throw m;throw this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),_makeInternalError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
15Reason: ${m}`)})}_process(m,g){this._numProcessing++,this._promiseBuffer.add(m).then(m=>(this._numProcessing--,m),m=>(this._numProcessing--,m===eQ&&this.recordDroppedEvent("queue_overflow",g),m))}_clearOutcomes(){let m=this._outcomes;return this._outcomes={},Object.entries(m).map(([m,g])=>{let[v,x]=m.split(":");return{reason:v,category:x,quantity:g}})}_flushOutcomes(){eR.X&&eE.fF.log("Flushing outcomes...");let m=this._clearOutcomes();if(0===m.length){eR.X&&eE.fF.log("No outcomes to send");return}if(!this._dsn){eR.X&&eE.fF.log("No dsn provided, will not send outcomes");return}eR.X&&eE.fF.log("Sending outcomes:",m);let g=function(m,g,v){let x=[{type:"client_report"},{timestamp:(0,eY.yW)(),discarded_events:m}];return createEnvelope(g?{dsn:g}:{},[x])}(m,this._options.tunnel&&(0,ez.RA)(this._dsn));this.sendEnvelope(g)}};function getDataCategoryByType(m){return"replay_event"===m?"replay":m||"error"}function client_isErrorEvent(m){return void 0===m.type}function isTransactionEvent(m){return"transaction"===m.type}function estimateMetricSizeInBytes(m){let g=0;return m.name&&(g+=2*m.name.length),(g+=8)+estimateAttributesSizeInBytes(m.attributes)}function estimateLogSizeInBytes(m){let g=0;return m.message&&(g+=2*m.message.length),g+estimateAttributesSizeInBytes(m.attributes)}function estimateAttributesSizeInBytes(m){if(!m)return 0;let g=0;return Object.values(m).forEach(m=>{Array.isArray(m)?g+=m.length*estimatePrimitiveSizeInBytes(m[0]):(0,eX.pt)(m)?g+=estimatePrimitiveSizeInBytes(m):g+=100}),g}function estimatePrimitiveSizeInBytes(m){return"string"==typeof m?2*m.length:"number"==typeof m?8:"boolean"==typeof m?4:0}function addAutoIpAddressToSession(m){"aggregates"in m?m.attrs?.ip_address===void 0&&(m.attrs={...m.attrs,ip_address:"{{auto}}"}):void 0===m.ipAddress&&(m.ipAddress="{{auto}}")}function _enhanceErrorWithSentryInfo(m){return(0,eX.VZ)(m)&&"__sentry_fetch_url_host__"in m&&"string"==typeof m.__sentry_fetch_url_host__?`${m.message} (${m.__sentry_fetch_url_host__})`:m.message}function eventbuilder_exceptionFromError(m,g){let v=eventbuilder_parseStackFrames(m,g),x={type:function(m){let g=m?.name;if(!g&&isWebAssemblyException(m)){let g=m.message&&Array.isArray(m.message)&&2==m.message.length;return g?m.message[0]:"WebAssembly.Exception"}return g}(g),value:function(m){let g=m?.message;return isWebAssemblyException(m)?Array.isArray(m.message)&&2==m.message.length?m.message[1]:"wasm exception":g?g.error&&"string"==typeof g.error.message?_enhanceErrorWithSentryInfo(g.error):_enhanceErrorWithSentryInfo(m):"No error message"}(g)};return v.length&&(x.stacktrace={frames:v}),void 0===x.type&&""===x.value&&(x.value="Unrecoverable error caught"),x}function eventFromError(m,g){return{exception:{values:[eventbuilder_exceptionFromError(m,g)]}}}function eventbuilder_parseStackFrames(m,g){let v=g.stacktrace||g.stack||"",x=g&&e8.test(g.message)?1:0,k="number"==typeof g.framesToPop?g.framesToPop:0;try{return m(v,x,k)}catch{}return[]}let e8=/Minified React error #\d+;/i;function isWebAssemblyException(m){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&m instanceof WebAssembly.Exception}function eventbuilder_eventFromUnknownInput(m,g,v,x,k){let E;if((0,eX.VW)(g)&&g.error)return eventFromError(m,g.error);if((0,eX.TX)(g)||(0,eX.fm)(g)){if("stack"in g){E=eventFromError(m,g);let k=E.exception?.values?.[0];if(x&&v&&k&&!k.stacktrace){let g=eventbuilder_parseStackFrames(m,v);g.length&&(k.stacktrace={frames:g},(0,eP.EG)(E,{synthetic:!0}))}}else{let k=g.name||((0,eX.TX)(g)?"DOMError":"DOMException"),T=g.message?`${k}: ${g.message}`:k;E=eventFromString(m,T,v,x),(0,eP.Db)(E,T)}return"code"in g&&(E.tags={...E.tags,"DOMException.code":`${g.code}`}),E}return(0,eX.VZ)(g)?eventFromError(m,g):((0,eX.PO)(g)||(0,eX.cO)(g)?E=function(m,g,v,x){let k=(0,eA.s3)(),E=k?.getOptions().normalizeDepth,T=Object.values(g).find(eX.VZ),K={__serialized__:(0,eB.Qy)(g,E)};if(T)return{exception:{values:[eventbuilder_exceptionFromError(m,T)]},extra:K};let et={exception:{values:[{type:(0,eX.cO)(g)?g.constructor.name:x?"UnhandledRejection":"Error",value:function(m,{isUnhandledRejection:g}){let v=(0,eM.zf)(m),x=g?"promise rejection":"exception";if((0,eX.VW)(m))return`Event \`ErrorEvent\` captured as ${x} with message \`${m.message}\``;if((0,eX.cO)(m)){let g=function(m){try{let g=Object.getPrototypeOf(m);return g?g.constructor.name:void 0}catch{}}(m);return`Event \`${g}\` (type=${m.type}) captured as ${x}`}return`Object captured as ${x} with keys: ${v}`}(g,{isUnhandledRejection:x})}]},extra:K};if(v){let g=eventbuilder_parseStackFrames(m,v);g.length&&(et.exception.values[0].stacktrace={frames:g})}return et}(m,g,v,k):(E=eventFromString(m,g,v,x),(0,eP.Db)(E,`${g}`,void 0)),(0,eP.EG)(E,{synthetic:!0}),E)}function eventFromString(m,g,v,x){let k={};if(x&&v){let x=eventbuilder_parseStackFrames(m,v);x.length&&(k.exception={values:[{value:g,stacktrace:{frames:x}}]}),(0,eP.EG)(k,{synthetic:!0})}
15if((0,eX.Le)(g)){let{__sentry_template_string__:m,__sentry_template_values__:v}=g;return k.logentry={message:m,params:v},k}return k.message=g,k}let e9=ek.GLOBAL_OBJ;function getLocationHref(){try{return e9.document.location.href}catch{return""}}function getComponentName(m,g=5){if(!e9.HTMLElement)return null;let v=m;for(let m=0;m<g&&v;m++){if(v instanceof HTMLElement){if(v.dataset.sentryComponent)return v.dataset.sentryComponent;if(v.dataset.sentryElement)return v.dataset.sentryElement}v=v.parentNode}return null}let tt=ek.GLOBAL_OBJ,tn=0;function wrap(m,g={}){if("function"!=typeof m)return m;try{let g=Object.prototype.hasOwnProperty.call(m,"__sentry_wrapped__");if(g){let g=m.__sentry_wrapped__;if("function"==typeof g)return g;return m}if((0,eM.HK)(m))return m}catch{return m}let sentryWrapped=function(...v){ek.GLOBAL_OBJ._sentryWrappedDepth=(ek.GLOBAL_OBJ._sentryWrappedDepth||0)+1;try{let x=v.map(m=>wrap(m,g));return m.apply(this,x)}catch(m){throw tn++,setTimeout(()=>{tn--}),(0,eA.$e)(x=>{x.addEventProcessor(m=>(g.mechanism&&((0,eP.Db)(m,void 0,void 0),(0,eP.EG)(m,g.mechanism)),m.extra={...m.extra,arguments:v},m)),(0,eN.Tb)(m)}),m}finally{ek.GLOBAL_OBJ._sentryWrappedDepth=(ek.GLOBAL_OBJ._sentryWrappedDepth||0)-1}};try{for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(sentryWrapped[g]=m[g])}catch{}(0,eM.$Q)(sentryWrapped,m),(0,eM.xp)(m,"__sentry_wrapped__",sentryWrapped);try{let g=Object.getOwnPropertyDescriptor(sentryWrapped,"name");g.configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>m.name})}catch{}return sentryWrapped}function getHttpRequestData(){let m=getLocationHref(),{referrer:g}=tt.document||{},{userAgent:v}=tt.navigator||{},x={...g&&{Referer:g},...v&&{"User-Agent":v}};return{url:m,headers:x}}let BrowserClient=class BrowserClient extends Client{constructor(m){let g={release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:tt.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...m},v=tt.SENTRY_SDK_SOURCE||"npm";applySdkMetadata(g,"browser",["browser"],v),super(g);let{userInfo:x}=this.getDataCollectionOptions();g._metadata?.sdk&&(g._metadata.sdk.settings={infer_ip:x?"auto":"never",...g._metadata.sdk.settings});let{sendClientReports:k}=this._options;tt.document&&tt.document.addEventListener("visibilitychange",()=>{"hidden"===tt.document.visibilityState&&(k&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),x&&this.on("beforeSendSession",addAutoIpAddressToSession)}eventFromException(m,g){return function(m,g,v,x){let k=v?.syntheticException||void 0,E=eventbuilder_eventFromUnknownInput(m,g,k,x);return(0,eP.EG)(E),E.level="error",v?.event_id&&(E.event_id=v.event_id),(0,eG.WD)(E)}(this._options.stackParser,m,g,this._options.attachStacktrace)}eventFromMessage(m,g="info",v){return function(m,g,v="info",x,k){let E=x?.syntheticException||void 0,T=eventFromString(m,g,E,k);return T.level=v,x?.event_id&&(T.event_id=x.event_id),(0,eG.WD)(T)}(this._options.stackParser,m,g,v,this._options.attachStacktrace)}_prepareEvent(m,g,v,x){return m.platform=m.platform||"javascript",super._prepareEvent(m,g,v,x)}};let tr={},ts={};function addHandler(m,g){return tr[m]=tr[m]||[],tr[m].push(g),()=>{let v=tr[m];if(v){let m=v.indexOf(g);-1!==m&&v.splice(m,1)}}}function maybeInstrument(m,g){if(!ts[m]){ts[m]=!0;try{g()}catch(g){eR.X&&eE.fF.error(`Error while instrumenting ${m}`,g)}}}function triggerHandlers(m,g){let v=m&&tr[m];if(v)for(let x of v)try{x(g)}catch(g){eR.X&&eE.fF.error(`Error while triggering instrumentation handler.
16Type: ${m}
17Name: ${(0,eZ.$P)(x)}
18Error:`,g)}}let to=new Set([]),tl=new Set;function instrumentConsole(){"console"in ek.GLOBAL_OBJ&&eE.RU.forEach(function(m){!tl.has(m)&&m in ek.GLOBAL_OBJ.console&&(tl.add(m),(0,eM.hl)(ek.GLOBAL_OBJ.console,m,function(g){return eE.LD[m]=g,function(...g){let v=g[0],x=eE.LD[m],k=to.size&&"string"==typeof v&&(0,eT.U0)(v,to);k||triggerHandlers("console",{args:g,level:m}),(!k||eR.X&&eE.fF.isEnabled())&&x?.apply(ek.GLOBAL_OBJ.console,g)}}))})}let tc=ek.GLOBAL_OBJ;function isNativeFunction(m){return m&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(m.toString())}function addFetchInstrumentationHandler(m,g){let v="fetch",x=addHandler(v,m);return maybeInstrument(v,()=>instrumentFetch(void 0,g)),x}function instrumentFetch(m,g=!1){(!g||function(){if("string"==typeof EdgeRuntime)return!0;
18if(!function(){if(!("fetch"in tc))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(isNativeFunction(tc.fetch))return!0;let m=!1,g=tc.document;if(g&&"function"==typeof g.createElement)try{let v=g.createElement("iframe");v.hidden=!0,g.head.appendChild(v),v.contentWindow?.fetch&&(m=isNativeFunction(v.contentWindow.fetch)),g.head.removeChild(v)}catch(m){eR.X&&eE.fF.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",m)}return m}())&&(0,eM.hl)(ek.GLOBAL_OBJ,"fetch",function(g){return function(...v){let x=Error(),{method:k,url:E}=function(m){if(0===m.length)return{method:"GET",url:""};if(2===m.length){let[g,v]=m;return{url:getUrlFromResource(g),method:hasProp(v,"method")?String(v.method).toUpperCase():(0,eX.gJ)(g)&&hasProp(g,"method")?String(g.method).toUpperCase():"GET"}}let g=m[0];return{url:getUrlFromResource(g),method:hasProp(g,"method")?String(g.method).toUpperCase():"GET"}}(v),T={args:v,fetchData:{method:k,url:E},startTimestamp:1e3*(0,eY.ph)(),virtualError:x,headers:function(m){let[g,v]=m;try{if("object"==typeof v&&null!==v&&"headers"in v&&v.headers)return new Headers(v.headers);if((0,eX.gJ)(g))return new Headers(g.headers)}catch{}}(v)};return m||triggerHandlers("fetch",{...T}),g.apply(ek.GLOBAL_OBJ,v).then(async g=>(m?m(g):triggerHandlers("fetch",{...T,endTimestamp:1e3*(0,eY.ph)(),response:g}),g),m=>{triggerHandlers("fetch",{...T,endTimestamp:1e3*(0,eY.ph)(),error:m}),(0,eX.VZ)(m)&&void 0===m.stack&&(m.stack=x.stack,(0,eM.xp)(m,"framesToPop",1));let g=(0,eA.s3)(),v=g?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==v&&(0,eX.VZ)(m)&&"TypeError"===m.name&&("Failed to fetch"===m.message||"Load failed"===m.message||"NetworkError when attempting to fetch resource."===m.message))try{let g=new URL(T.fetchData.url),x=g.host;"always"===v?m.message=`${m.message} (${x})`:(0,eM.xp)(m,"__sentry_fetch_url_host__",x)}catch{}throw m})}})}async function resolveResponse(m,g){if(m?.body){let v=m.body,x=v.getReader(),k=setTimeout(()=>{v.cancel().then(null,()=>{})},9e4),E=!0;for(;E;){let m;try{m=setTimeout(()=>{v.cancel().then(null,()=>{})},5e3);let{done:k}=await x.read();clearTimeout(m),k&&(g(),E=!1)}catch{E=!1}finally{clearTimeout(m)}}clearTimeout(k),x.releaseLock(),v.cancel().then(null,()=>{})}}function streamHandler(m){let g;try{g=m.clone()}catch{return}resolveResponse(g,()=>{triggerHandlers("fetch-body-resolved",{endTimestamp:1e3*(0,eY.ph)(),response:m})})}function hasProp(m,g){return(0,eX.yD)(m)&&!!m[g]}function getUrlFromResource(m){return"string"==typeof m?m:m?hasProp(m,"url")?m.url:m.toString?m.toString():"":""}function addBreadcrumb(m,g){let v=(0,eA.s3)(),x=(0,eA.aF)();if(!v)return;let{beforeBreadcrumb:k=null,maxBreadcrumbs:E=100}=v.getOptions();if(E<=0)return;let T=(0,eY.yW)(),K={timestamp:T,...m},et=k?(0,eE.Cf)(()=>k(K,g)):K;null!==et&&(v.emit&&v.emit("beforeAddBreadcrumb",et,g),x.addBreadcrumb(et,E))}function getBreadcrumbLogLevelFromHttpStatusCode(m){if(void 0!==m)return m>=400&&m<500?"warning":m>=500?"error":void 0}function isURLObjectRelative(m){return"isRelative"in m}function parseStringToURLObject(m,g){let v=0>=m.indexOf("://")&&0!==m.indexOf("//"),x=g??(v?"thismessage:/":void 0);try{if("canParse"in URL&&!URL.canParse(m,x))return;let g=new URL(m,x);if(v)return{isRelative:v,pathname:g.pathname,search:g.search,hash:g.hash};return g}catch{}}function getSanitizedUrlStringFromUrlObject(m){if(isURLObjectRelative(m))return m.pathname;let g=new URL(m);return g.search="",g.hash="",["80","443"].includes(g.port)&&(g.port=""),g.password&&(g.password="%filtered%"),g.username&&(g.username="%filtered%"),g.toString()}function parseUrl(m){if(!m)return{};let g=m.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!g)return{};let v=g[6]||"",x=g[8]||"";return{host:g[4],path:g[5],protocol:g[2],search:v,hash:x,relative:g[5]+v+x}}function stripUrlQueryAndFragment(m){return m.split(/[?#]/,1)[0]}function stripDataUrlContent(m,g=!0){if(m.startsWith("data:")){let v=m.match(/^data:([^;,]+)/),x=v?v[1]:"text/plain",k=m.includes(";base64,"),E=m.indexOf(","),T="";if(g&&-1!==E){let g=m.slice(E+1);T=g.length>10?`${g.slice(0,10)}... [truncated]`:g}return`data:${x}${k?",base64":""}${T?`,${T}`:""}`}return m}let tu=ek.GLOBAL_OBJ;function addClickKeypressInstrumentationHandler(m){addHandler("dom",m),maybeInstrument("dom",instrumentDOM)}function instrumentDOM(){if(!tu.document)return;let m=triggerHandlers.bind(null,"dom"),g=makeDOMEventHandler(m,!0);tu.document.addEventListener("click",g,!1),tu.document.addEventListener("keypress",g,!1),["EventTarget","Node"].forEach(g=>{let v=tu[g]?.prototype;v?.hasOwnProperty?.("addEventListener")&&((0,eM.hl)(v,"addEventListener",function(g){return function(v,x,k){if("click"===v||"keypress"==v)try{let x=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},E=x[v]=x[v]||{refCount:0};if(!E.handler){let x=makeDOMEventHandler(m);E.handler=x,g.call(this,v,x,k)}E.refCount++}catch{}return g.call(this,v,x,k)}}),(0,eM.hl)(v,"removeEventListener",function(m){return function(g,v,x){if("click"===g||"keypress"==g)try{let v=this.__sentry_instrumentation_handlers__||{},k=v[g];k&&(k.refCount--,k.refCount<=0&&(m.call(this,g,k.handler,x),k.handler=void 0,delete v[g]),0===Object.keys(v).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return m.call(this,g,v,x)}}))})}function makeDOMEventHandler(m,g=!1){return v=>{if(!v||v._sentryCaptured)return;let T=function(m){try{return m.target}catch{return null}}(v);if("keypress"===v.type&&(!T?.tagName||"INPUT"!==T.tagName&&"TEXTAREA"!==T.tagName&&!T.isContentEditable))return;(0,eM.xp)(v,"_sentryCaptured",!0),T&&!T._sentryId&&(0,eM.xp)(T,"_sentryId",(0,eP.DM)());let K="keypress"===v.type?"input":v.type;!function(m){if(m.type!==k)return!1;try{if(!m.target||m.target._sentryId!==E)return!1}catch{}return!0}(v)&&(m({event:v,name:K,global:g}),k=v.type,E=T?T._sentryId:void 0),clearTimeout(x),x=tu.setTimeout(()=>{E=void 0,k=void 0},1e3)}}let td="__sentry_xhr_v3__";function addXhrInstrumentationHandler(m){addHandler("xhr",m),maybeInstrument("xhr",instrumentXHR)}function instrumentXHR(){if(!tu.XMLHttpRequest)return;let m=XMLHttpRequest.prototype;m.open=new Proxy(m.open,{apply(m,g,v){let x=Error(),k=1e3*(0,eY.ph)(),E=(0,eX.HD)(v[0])?v[0].toUpperCase():void 0,T=function(m){if((0,eX.HD)(m))return m;try{return m.toString()}catch{}}(v[1]);if(!E||!T)return m.apply(g,v);g[td]={method:E,url:T,request_headers:{}}
18,"POST"===E&&T.match(/sentry_key/)&&(g.__sentry_own_request__=!0);let onreadystatechangeHandler=()=>{let m=g[td];if(m&&4===g.readyState){try{m.status_code=g.status}catch{}let v={endTimestamp:1e3*(0,eY.ph)(),startTimestamp:k,xhr:g,virtualError:x};triggerHandlers("xhr",v),g.removeEventListener("readystatechange",onreadystatechangeHandler)}};return"onreadystatechange"in g&&"function"==typeof g.onreadystatechange?g.onreadystatechange=new Proxy(g.onreadystatechange,{apply:(m,g,v)=>(onreadystatechangeHandler(),m.apply(g,v))}):g.addEventListener("readystatechange",onreadystatechangeHandler),g.setRequestHeader=new Proxy(g.setRequestHeader,{apply(m,g,v){let[x,k]=v,E=g[td];return E&&(0,eX.HD)(x)&&(0,eX.HD)(k)&&(E.request_headers[x.toLowerCase()]=k),m.apply(g,v)}}),m.apply(g,v)}}),m.send=new Proxy(m.send,{apply(m,g,v){let x=g[td];if(!x)return m.apply(g,v);void 0!==v[0]&&(x.body=v[0]);let k={startTimestamp:1e3*(0,eY.ph)(),xhr:g};return triggerHandlers("xhr",k),m.apply(g,v)}})}function addHistoryInstrumentationHandler(m){let g="history";addHandler(g,m),maybeInstrument(g,instrumentHistory)}function instrumentHistory(){tu.addEventListener("popstate",()=>{let m=tu.location.href,g=T;T=m,g!==m&&triggerHandlers("history",{from:g,to:m})}),"history"in tc&&tc.history&&((0,eM.hl)(tu.history,"pushState",historyReplacementFunction),(0,eM.hl)(tu.history,"replaceState",historyReplacementFunction));function historyReplacementFunction(m){return function(...g){let v=g.length>2?g[2]:void 0;if(v){let x=T,k=function(m){try{let g=new URL(m,tu.location.origin);return g.toString()}catch{return m}}(String(v));if(T=k,x===k)return m.apply(this,g);triggerHandlers("history",{from:x,to:k})}return m.apply(this,g)}}}let tp={};try{"undefined"!=typeof Node&&(tp.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),"undefined"!=typeof Element&&(tp.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,tp.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,tp.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,tp.getAttribute=Element.prototype.getAttribute),"undefined"!=typeof HTMLElement&&(tp.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function _safeRead(m,g,v){let x=tp[g];if(x)try{return x.call(m,v)}catch{}let k=m[g];return"function"==typeof k?k.call(m,v):k}function htmlTreeAsString_htmlTreeAsString(m,g={}){if(!m)return"<unknown>";try{let v,x=m,k=[],E=0,T=0,K=Array.isArray(g)?g:g.keyAttrs,et=!Array.isArray(g)&&g.maxStringLength||80;for(;x&&E++<5&&(v=function(m,g){let v=[],x=_safeRead(m,"tagName");if(!x)return"";if("undefined"!=typeof HTMLElement&&m instanceof HTMLElement){let g=_safeRead(m,"dataset");if(g){if(g.sentryComponent)return g.sentryComponent;if(g.sentryElement)return g.sentryElement}}v.push(x.toLowerCase());let k=g?.length?g.filter(g=>_safeRead(m,"getAttribute",g)).map(g=>[g,_safeRead(m,"getAttribute",g)]):null;if(k?.length)k.forEach(m=>{v.push(`[${m[0]}="${m[1]}"]`)});else{let g=_safeRead(m,"id");g&&v.push(`#${g}`);let x=_safeRead(m,"className");if(x&&(0,eX.HD)(x)){let m=x.split(/\s+/);for(let g of m)v.push(`.${g}`)}}for(let g of["aria-label","type","name","title","alt"]){let x=_safeRead(m,"getAttribute",g);x&&v.push(`[${g}="${x}"]`)}return v.join("")}(x,K),"html"!==v&&(!(E>1)||!(T+3*k.length+v.length>=et)));)k.push(v),T+=v.length,x=_safeRead(x,"parentNode");return k.reverse().join(" > ")}catch{return"<unknown>"}}let breadcrumbsIntegration=(m={})=>{let g={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...m};return{name:"Breadcrumbs",setup(m){var v;g.console&&function(m){let g="console";addHandler(g,m),maybeInstrument(g,instrumentConsole)}(function(g){var v;if((0,eA.s3)()!==m)return;let x={category:"console",data:{arguments:g.args,logger:"console"},level:"warn"===(v=g.level)?"warning":["fatal","error","warning","log","info","debug"].includes(v)?v:"log",message:(0,eT.nK)(g.args," ")};if("assert"===g.level){if(!1!==g.args[0])return;x.message=`Assertion failed: ${(0,eT.nK)(g.args.slice(1)," ")||"console.assert"}`,x.data.arguments=g.args.slice(1)}addBreadcrumb(x,{input:g.args,level:g.level})}),g.dom&&addClickKeypressInstrumentationHandler((v=g.dom,function(g){let x,k;if((0,eA.s3)()!==m)return;let E="object"==typeof v?v.serializeAttribute:void 0,T="object"==typeof v&&"number"==typeof v.maxStringLength?v.maxStringLength:void 0;T&&T>1024&&(T=1024),"string"==typeof E&&(E=[E]);try{let m=g.event,v=m&&m.target?m.target:m;x=htmlTreeAsString_htmlTreeAsString(v,{keyAttrs:E,maxStringLength:T}),k=getComponentName(v)}catch{x="<unknown>"}if(0===x.length)return;let K={category:`ui.${g.name}`,message:x};k&&(K.data={"ui.component_name":k}),addBreadcrumb(K,{event:g.event,name:g.name,global:g.global})})),g.xhr&&addXhrInstrumentationHandler(function(g){if((0,eA.s3)()!==m)return;let{startTimestamp:v,endTimestamp:x}=g,k=g.xhr[td];if(!v||!x||!k)return;let{method:E,url:T,status_code:K,body:et}=k,en={xhr:g.xhr,input:et,startTimestamp:v,endTimestamp:x},er={category:"xhr",data:{method:E,url:T,status_code:K},type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(K)};m.emit("beforeOutgoingRequestBreadcrumb",er,en),addBreadcrumb(er,en)}),g.fetch&&addFetchInstrumentationHandler(function(g){if((0,eA.s3)()!==m)return;let{startTimestamp:v,endTimestamp:x}=g;
18if(!(!x||g.fetchData.url.match(/sentry_key/)&&"POST"===g.fetchData.method)){if(g.error){let k={data:g.error,input:g.args,startTimestamp:v,endTimestamp:x},E={category:"fetch",data:g.fetchData,level:"error",type:"http"};m.emit("beforeOutgoingRequestBreadcrumb",E,k),addBreadcrumb(E,k)}else{let k=g.response,E={...g.fetchData,status_code:k?.status},T={input:g.args,response:k,startTimestamp:v,endTimestamp:x},K={category:"fetch",data:E,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(E.status_code)};m.emit("beforeOutgoingRequestBreadcrumb",K,T),addBreadcrumb(K,T)}}}),g.history&&addHistoryInstrumentationHandler(function(g){if((0,eA.s3)()!==m)return;let v=g.from,x=g.to,k=parseUrl(tt.location.href),E=v?parseUrl(v):void 0,T=parseUrl(x);E?.path||(E=k),k.protocol===T.protocol&&k.host===T.host&&(x=T.relative),k.protocol===E.protocol&&k.host===E.host&&(v=E.relative),addBreadcrumb({category:"navigation",data:{from:v,to:x}})}),g.sentry&&m.on("beforeSendEvent",function(g){(0,eA.s3)()===m&&addBreadcrumb({category:`sentry.${"transaction"===g.type?"transaction":"event"}`,event_id:g.event_id,level:g.level,message:(0,eP.jH)(g)},{event:g})})}}},tm="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),browserApiErrorsIntegration=(m={})=>{let g={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...m};return{name:"BrowserApiErrors",setupOnce(){g.setTimeout&&(0,eM.hl)(tt,"setTimeout",_wrapTimeFunction),g.setInterval&&(0,eM.hl)(tt,"setInterval",_wrapTimeFunction),g.requestAnimationFrame&&(0,eM.hl)(tt,"requestAnimationFrame",_wrapRAF),g.XMLHttpRequest&&"XMLHttpRequest"in tt&&(0,eM.hl)(XMLHttpRequest.prototype,"send",_wrapXHR);let m=g.eventTarget;if(m){let v=Array.isArray(m)?m:tm;v.forEach(m=>(function(m,g){let v=tt[m]?.prototype;v?.hasOwnProperty?.("addEventListener")&&((0,eM.hl)(v,"addEventListener",function(v){return function(x,k,E){try{"function"==typeof k.handleEvent&&(k.handleEvent=wrap(k.handleEvent,{mechanism:{data:{handler:(0,eZ.$P)(k),target:m},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return g.unregisterOriginalCallbacks&&this&&"object"==typeof this&&"removeEventListener"in this&&"function"==typeof this.removeEventListener&&this.removeEventListener(x,k),v.apply(this,[x,wrap(k,{mechanism:{data:{handler:(0,eZ.$P)(k),target:m},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),E])}}),(0,eM.hl)(v,"removeEventListener",function(m){return function(g,v,x){try{if(Object.prototype.hasOwnProperty.call(v,"__sentry_wrapped__")){let k=v.__sentry_wrapped__;k&&m.call(this,g,k,x)}}catch{}return m.call(this,g,v,x)}}))})(m,g))}}}};function _wrapTimeFunction(m){return function(...g){let v=g[0];return g[0]=wrap(v,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${(0,eZ.$P)(m)}`}}),m.apply(this,g)}}function _wrapRAF(m){return function(g){return m.apply(this,[wrap(g,{mechanism:{data:{handler:(0,eZ.$P)(m)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function _wrapXHR(m){return function(...g){let v=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(m=>{m in v&&"function"==typeof v[m]&&(0,eM.hl)(v,m,function(g){let v={mechanism:{data:{handler:(0,eZ.$P)(g)},handled:!1,type:`auto.browser.browserapierrors.xhr.${m}`}},x=(0,eM.HK)(g);return x&&(v.mechanism.data.handler=(0,eZ.$P)(x)),wrap(g,v)})}),m.apply(this,g)}}function addPageListener(m,g,v){tu.document&&tu.addEventListener(m,g,v)}function removePageListener(m,g,v){tu.document&&tu.removeEventListener(m,g,v)}let runOnce=m=>{let g=!1;return()=>{g||(m(),g=!0)}},whenIdleOrHidden=m=>{let g=tu.requestIdleCallback||tu.setTimeout;tu.document?.visibilityState==="hidden"?m():(addPageListener("visibilitychange",m=runOnce(m),{once:!0,capture:!0}),addPageListener("pagehide",m,{once:!0,capture:!0}),g(()=>{m(),removePageListener("visibilitychange",m,{capture:!0}),removePageListener("pagehide",m,{capture:!0})}
18))},browserSessionIntegration=(m={})=>{let g=m.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===tt.document)return;(0,eN.yj)({ignoreDuration:!0});let m=!1;whenIdleOrHidden(()=>{m||((0,eN.cg)(),m=!0)});let v=(0,eA.aF)(),x=v.getUser();v.addScopeListener(g=>{let v=g.getUser();(x?.id!==v?.id||x?.ip_address!==v?.ip_address)&&(x=v,m&&(0,eN.cg)())}),"route"===g&&addHistoryInstrumentationHandler(({from:g,to:v})=>{g!==v&&((0,eN.yj)({ignoreDuration:!0}),(0,eN.cg)(),m=!0)})}}};function safeSetSpanJSONAttributes(m,g){let v=m.attributes??(m.attributes={});Object.entries(g).forEach(([m,g])=>{null==g||m in v||(v[m]=g)})}let cultureContextIntegration=()=>({name:"CultureContext",preprocessEvent(m){let g=getCultureContext();g&&(m.contexts={...m.contexts,culture:{...g,...m.contexts?.culture}})},processSegmentSpan(m){let g=getCultureContext();g&&safeSetSpanJSONAttributes(m,{"culture.locale":g.locale,"culture.timezone":g.timezone,"culture.calendar":g.calendar})}});function getCultureContext(){try{let m=tt.Intl;if(!m)return;let g=m.DateTimeFormat().resolvedOptions();return{locale:g.locale,timezone:g.timeZone,calendar:g.calendar}}catch{return}}let tf=null;function addGlobalErrorInstrumentationHandler(m){let g="error";addHandler(g,m),maybeInstrument(g,instrumentError)}function instrumentError(){tf=ek.GLOBAL_OBJ.onerror,ek.GLOBAL_OBJ.onerror=function(m,g,v,x,k){return triggerHandlers("error",{column:x,error:k,line:v,msg:m,url:g}),!!tf&&tf.apply(this,arguments)},ek.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}let th=null;function addGlobalUnhandledRejectionInstrumentationHandler(m){let g="unhandledrejection";addHandler(g,m),maybeInstrument(g,instrumentUnhandledRejection)}function instrumentUnhandledRejection(){th=ek.GLOBAL_OBJ.onunhandledrejection,ek.GLOBAL_OBJ.onunhandledrejection=function(m){return triggerHandlers("unhandledrejection",m),!th||th.apply(this,arguments)},ek.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let globalHandlersIntegration=(m={})=>{let g={onerror:!0,onunhandledrejection:!0,...m};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(m){g.onerror&&addGlobalErrorInstrumentationHandler(g=>{let{stackParser:v,attachStacktrace:x}=getOptions();if((0,eA.s3)()!==m||tn>0)return;let{msg:k,url:E,line:T,column:K,error:et}=g,en=function(m,g,v,x){let k=m.exception=m.exception||{},E=k.values=k.values||[],T=E[0]=E[0]||{},K=T.stacktrace=T.stacktrace||{},et=K.frames=K.frames||[];return 0===et.length&&et.push({colno:x,lineno:v,filename:((0,eX.HD)(g)&&0!==g.length?g.startsWith("data:")?`<${stripDataUrlContent(g,!1)}>`:g:void 0)??getLocationHref(),function:eZ.Fi,in_app:!0}),m}(eventbuilder_eventFromUnknownInput(v,et||k,void 0,x,!1),E,T,K);en.level="error",(0,eN.eN)(en,{originalException:et,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}),g.onunhandledrejection&&addGlobalUnhandledRejectionInstrumentationHandler(g=>{let{stackParser:v,attachStacktrace:x}=getOptions();if((0,eA.s3)()!==m||tn>0)return;let k=function(m){if((0,eX.pt)(m))return m;try{if("reason"in m)return m.reason;if("detail"in m&&"reason"in m.detail)return m.detail.reason}catch{}return m}(g),E=(0,eX.pt)(k)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(k)}`}]}}:eventbuilder_eventFromUnknownInput(v,k,void 0,x,!0);E.level="error",(0,eN.eN)(E,{originalException:k,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}}};function getOptions(){let m=(0,eA.s3)(),g=m?.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return g}let tg="http.url",tv="sentry.segment.name",ty="sentry.transaction",tb="url.full",tx="url.path",t_="url.template",httpContextIntegration=()=>({name:"HttpContext",preprocessEvent(m){if(!tt.navigator&&!tt.location&&!tt.document)return;let g=getHttpRequestData(),v={...g.headers,...m.request?.headers};m.request={...g,...m.request,headers:v}},processSegmentSpan(m){let g=m.attributes?.[eL.$J];if(!tt.navigator&&!tt.location&&!tt.document)return;let v=getHttpRequestData();safeSetSpanJSONAttributes(m,{[tb]:"http.client"!==g?v.url:void 0,"http.request.header.user_agent":v.headers["User-Agent"],"http.request.header.referer":v.headers.Referer})}});function isExceptionGroup(m){return Array.isArray(m.errors)}function applyExceptionGroupFieldsForParentException(m,g,v){m.mechanism={handled:!0,type:"auto.core.linked_errors",...isExceptionGroup(v)&&{is_exception_group:!0}
18,...m.mechanism,exception_id:g}}function applyExceptionGroupFieldsForChildException(m,g,v,x){m.mechanism={handled:!0,...m.mechanism,type:"chained",source:g,exception_id:v,parent_id:x}}let linkedErrorsIntegration=(m={})=>{let g=m.limit||5,v=m.key||"cause";return{name:"LinkedErrors",preprocessEvent(m,x,k){let E=k.getOptions();!function(m,g,v,x,k,E){if(!k.exception?.values||!E||!(0,eX.VZ)(E.originalException))return;let T=k.exception.values.length>0?k.exception.values[k.exception.values.length-1]:void 0;T&&(k.exception.values=function aggregateExceptionsFromError(m,g,v,x,k,E,T,K){if(E.length>=v+1)return E;let et=[...E];if((0,eX.VZ)(x[k])){applyExceptionGroupFieldsForParentException(T,K,x);let E=m(g,x[k]),en=et.length;applyExceptionGroupFieldsForChildException(E,k,en,K),et=aggregateExceptionsFromError(m,g,v,x[k],k,[E,...et],E,en)}return isExceptionGroup(x)&&x.errors.forEach((E,en)=>{if((0,eX.VZ)(E)){applyExceptionGroupFieldsForParentException(T,K,x);let er=m(g,E),ei=et.length;applyExceptionGroupFieldsForChildException(er,`errors[${en}]`,ei,K),et=aggregateExceptionsFromError(m,g,v,E,k,[er,...et],er,ei)}}),et}(m,g,x,E.originalException,v,k.exception.values,T,0))}(eventbuilder_exceptionFromError,E.stackParser,v,g,m,x)}}};function createFrame(m,g,v,x){let k={filename:m,function:"<anonymous>"===g?eZ.Fi:g,in_app:!0};return void 0!==v&&(k.lineno=v),void 0!==x&&(k.colno=x),k}let tw=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tS=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tC=/\((\S*)(?::(\d+))(?::(\d+))\)/,tk=/at (.+?) ?\(data:(.+?),/,tE=[30,m=>{let g=m.match(tk);if(g)return{filename:`<data:${g[2]}>`,function:g[1]};let v=tw.exec(m);if(v){let[,m,g,x]=v;return createFrame(m,eZ.Fi,+g,+x)}let x=tS.exec(m);if(x){let m=x[2]?.indexOf("eval")===0;if(m){let m=tC.exec(x[2]);m&&(x[2]=m[1],x[3]=m[2],x[4]=m[3])}let[g,v]=extractSafariExtensionDetails(x[1]||eZ.Fi,x[2]);return createFrame(v,g,x[3]?+x[3]:void 0,x[4]?+x[4]:void 0)}}],tj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tR=[50,m=>{let g=tj.exec(m);if(g){let m=g[3]&&g[3].indexOf(" > eval")>-1;if(m){let m=tN.exec(g[3]);m&&(g[1]=g[1]||"eval",g[3]=m[1],g[4]=m[2],g[5]="")}let v=g[3],x=g[1]||eZ.Fi;return[x,v]=extractSafariExtensionDetails(x,v),createFrame(v,x,g[4]?+g[4]:void 0,g[5]?+g[5]:void 0)}}],tI=(0,eZ.pE)(...[tE,tR]),extractSafariExtensionDetails=(m,g)=>{let v=-1!==m.indexOf("safari-extension"),x=-1!==m.indexOf("safari-web-extension");return v||x?[-1!==m.indexOf("@")?m.split("@")[0]:eZ.Fi,v?`safari-extension:${g}`:`safari-web-extension:${g}`]:[m,g]},tP={};function getNativeImplementation(m){let g=tP[m];if(g)return g;let v=tu[m];if(isNativeFunction(v))return tP[m]=v.bind(tu);let x=tu.document;if(x&&"function"==typeof x.createElement)try{let g=x.createElement("iframe");g.hidden=!0,x.head.appendChild(g);let k=g.contentWindow;k?.[m]&&(v=k[m]),x.head.removeChild(g)}catch(m){}return v?tP[m]=v.bind(tu):v}function getNativeImplementation_setTimeout(...m){return getNativeImplementation("setTimeout")(...m)}function makeFetchTransport(m,g=getNativeImplementation("fetch")){let v=0,x=0;async function makeRequest(k){let E=k.body.length;v+=E,x++;let T={body:k.body,method:"POST",referrerPolicy:"strict-origin",headers:m.headers,keepalive:v<=6e4&&x<15,...m.fetchOptions};try{let v=await g(m.url,T);return{statusCode:v.status,headers:{"x-sentry-rate-limits":v.headers.get("X-Sentry-Rate-Limits"),"retry-after":v.headers.get("Retry-After")}}}catch(m){throw tP.fetch=void 0,m}finally{v-=E,x--}}return function(m,g,v=makePromiseBuffer(m.bufferSize||64)){let x={};return{send:function(k){let E=[];if(forEachEnvelopeItem(k,(g,v)=>{let k=envelopeItemTypeToDataCategory(v);isRateLimited(x,k)?m.recordDroppedEvent("ratelimit_backoff",k):E.push(g)}),0===E.length)return Promise.resolve({});let T=createEnvelope(k[0],E),recordEnvelopeLoss=g=>{var v;if(v=["client_report"],forEachEnvelopeItem(T,(m,g)=>v.includes(g))){eR.X&&eE.fF.warn(`Dropping client report. Will not send outcomes (reason: ${g}).`);return}forEachEnvelopeItem(T,(v,x)=>{m.recordDroppedEvent(g,envelopeItemTypeToDataCategory(x))})};return v.add(()=>g({body:function(m){let[g,v]=m,x=JSON.stringify(g);
18function append(m){"string"==typeof x?x="string"==typeof m?x+m:[encodeUTF8(x),m]:x.push("string"==typeof m?encodeUTF8(m):m)}for(let m of v){let[g,v]=m;if(append(`
19${JSON.stringify(g)}
20`),"string"==typeof v||v instanceof Uint8Array)append(v);else{let m;try{m=JSON.stringify(v)}catch{m=JSON.stringify((0,eB.Fv)(v))}append(m)}}return"string"==typeof x?x:function(m){let g=m.reduce((m,g)=>m+g.length,0),v=new Uint8Array(g),x=0;for(let g of m)v.set(g,x),x+=g.length;return v}(x)}(T)}).then(m=>(413===m.statusCode?(eR.X&&eE.fF.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),recordEnvelopeLoss("send_error")):(eR.X&&void 0!==m.statusCode&&(m.statusCode<200||m.statusCode>=300)&&eE.fF.warn(`Sentry responded with status code ${m.statusCode} to sent event.`),x=updateRateLimits(x,m)),m),m=>{throw recordEnvelopeLoss("network_error"),eR.X&&eE.fF.error("Encountered error running transport request:",m),m})).then(m=>m,m=>{if(m===eQ)return eR.X&&eE.fF.error("Skipped sending event because buffer is full."),recordEnvelopeLoss("queue_overflow"),Promise.resolve({});throw m})},flush:m=>v.drain(m)}}(m,makeRequest,makePromiseBuffer(m.bufferSize||40))}let tT=/^HTML(\w*)Element$/;function normalizeStringifyValue(m){if("undefined"!=typeof window&&m===window)return"[Window]";if("undefined"!=typeof document&&m===document)return"[Document]";if(function(m){if("undefined"==typeof Element)return!1;try{return m instanceof Element}catch{return!1}}(m)){let g=function(m){let g=Object.getPrototypeOf(m);return g?.constructor?g.constructor.name:"null prototype"}(m);if(tT.test(g))return`[HTMLElement: ${htmlTreeAsString_htmlTreeAsString(m)}]`}}function getDefaultIntegrations(m){return[inboundFiltersIntegration(),functionToStringIntegration(),conversationIdIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration(),cultureContextIntegration(),browserSessionIntegration()]}var tO=v(2784);function sdk_normalizeStringifyValue(m){return(0,eX.PO)(m)&&"nativeEvent"in m&&"preventDefault"in m&&"stopPropagation"in m?"[SyntheticEvent]":normalizeStringifyValue(m)}var tA=v(93542),tM=v(21990),tD=v(13201),tL=v(64751),tF=v(95024);function setMeasurement(m,g,v,x=(0,eF.HN)()){let k=x&&(0,eF.Gx)(x);k&&(eR.X&&eE.fF.log(`[Measurement] Setting measurement on root span: ${m} = ${g} ${v}`),k.addEvent(m,{[eL.Wb]:g,[eL.E1]:v}))}function timedEventsToMeasurements(m){if(!m||0===m.length)return;let g={};return m.forEach(m=>{let v=m.attributes||{},x=v[eL.E1],k=v[eL.Wb];"string"==typeof x&&"number"==typeof k&&(g[m.name]={value:k,unit:x})}),g}function getSegmentSpanCaptureStrategy(){return(0,eV.qA)((0,eV.cu)()).segmentSpanCaptureStrategy}var tZ=v(21458);let SentrySpan=class SentrySpan{constructor(m={}){this._traceId=m.traceId||(0,tF.H)(),this._spanId=m.spanId||(0,tF.M)(),this._startTime=m.startTimestamp||(0,eY.ph)(),this._links=m.links,this._attributes={},this.setAttributes({[eL.S3]:"manual",[eL.$J]:m.op,...m.attributes}),this._name=m.name,m.parentSpanId&&(this._parentSpanId=m.parentSpanId),"sampled"in m&&(this._sampled=m.sampled),m.endTimestamp&&(this._endTime=m.endTimestamp),this._events=[],this._isStandaloneSpan=m.isStandalone,this._endTime&&this._onSpanEnded()}addLink(m){return this._frozen||(this._links?this._links.push(m):this._links=[m]),this}addLinks(m){return this._frozen||(this._links?this._links.push(...m):this._links=m),this}recordException(m,g){}spanContext(){let{_spanId:m,_traceId:g,_sampled:v}=this;return{spanId:m,traceId:g,traceFlags:v?eF.i0:eF.ve}}setAttribute(m,g){return this._frozen||(void 0===g?delete this._attributes[m]:this._attributes[m]=g,m===eL.Zj&&void 0!==g&&(0,tZ.Yi)(this)&&(0,tZ.qN)(this)),this}setAttributes(m){return Object.keys(m).forEach(g=>this.setAttribute(g,m[g])),this}updateStartTime(m){this._frozen||(this._startTime=(0,eF.$k)(m))}setStatus(m){return this._frozen||(this._status=m),this}updateName(m){return this._frozen||(this._name=m,(0,tZ.Yi)(this)||this.setAttribute(eL.Zj,"custom")),this}end(m){if(this._endTime){this._frozen=(0,tZ.Tx)(this);return}this._endTime=(0,eF.$k)(m),function(m){if(!eR.X)return;let{description:g="< unknown name >",op:v="< unknown op >"}=(0,eF.XU)(m),{spanId:x}=m.spanContext(),k=(0,eF.Gx)(m),E=k===m,T=`[Tracing] Finishing "${v}" ${E?"root ":""}span "${g}" with ID ${x}`;eE.fF.log(T)}(this),this._onSpanEnded(),this._frozen=(0,tZ.Tx)(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[eL.$J],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:(0,eF._4)(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[eL.S3],profile_id:this._attributes[eL.p6],exclusive_time:this._attributes[eL.JQ],measurements:timedEventsToMeasurements(this._events),is_segment:this._isStandaloneSpan&&(0,eF.Gx)(this)===this||void 0,segment_id:this._isStandaloneSpan?(0,eF.Gx)(this).spanContext().spanId:void 0,links:(0,eF.FF)(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===(0,eF.Gx)(this),status:(0,eF.bD)(this._status),attributes:(0,eF.kq)(this._attributes,this._status),links:(0,eF.vq)(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(m,g,v){if(this._frozen)return this;eR.X&&eE.fF.log("[Tracing] Adding an event to span:",m);let x=isSpanTimeInput(g)?g:v||(0,eY.ph)(),k=isSpanTimeInput(g)?{}:g||{},E={name:m,time:(0,eF.$k)(x),attributes:k};return this._events.push(E),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let m=(0,eA.s3)();m&&(m.emit("spanEnd",this),this._isStandaloneSpan||m.emit("afterSpanEnd",this));let g=(0,eF.Gx)(this),v=this._isStandaloneSpan||this===g;if(this._isStandaloneSpan){this._sampled?function(m){let g=(0,eA.s3)();if(!g)return;let v=m[1];if(!v||0===v.length){g.recordDroppedEvent("before_send","span");return}g.sendEnvelope(m)}(function(m,g){let v=(0,eU.jC)(m[0]),x=g?.getDsn(),k=g?.getOptions().tunnel,E={sent_at:new Date((0,eq.lk)()).toISOString(),...!!v.trace_id&&!!v.public_key&&{trace:v},...!!k&&x&&{dsn:(0,ez.RA)(x)}},{beforeSendSpan:T,ignoreSpans:K}=g?.getOptions()||{},et=K?.length?m.filter(m=>{let g=(0,eF.XU)(m);return!shouldIgnoreSpan({description:g.description,op:g.op,attributes:g.data},K)}):m,en=m.length-et.length;en&&g?.recordDroppedEvent("before_send","span",en);let er=T?m=>{let g=(0,eF.XU)(m),v=beforeSendSpan_isStreamedBeforeSendSpanCallback(T)?g:T(g);return v||((0,eF.R6)(),g)}:eF.XU,ei=[];for(let m of et){let g=er(m);g&&ei.push([{type:"span"},g])}return createEnvelope(E,ei)}([this],m)):(eR.X&&eE.fF.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),m&&m.recordDroppedEvent("sample_rate","span"));return}if(!v){let m=getSegmentSpanCaptureStrategy();if(m){let v=(0,tZ.I1)(this).scope||(0,eA.nZ)();m.onChildSpanEnded(this,g,m=>this._convertSpanToTransaction(m),v)}return}if(m&&hasSpanStreamingEnabled(m)){m.emit("afterSegmentSpanEnd",this);return}let x=(0,tZ.I1)(this).scope||(0,eA.nZ)(),k=getSegmentSpanCaptureStrategy();if(k)k.onSegmentSpanEnded(m=>this._convertSpanToTransaction(m),x);else{let m=this._convertSpanToTransaction();m&&x.captureEvent(m)}}_convertSpanToTransaction(m={}){if(!isFullFinishedSpan((0,eF.XU)(this)))return;this._name||(eR.X&&eE.fF.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:g,isolationScope:v}=(0,tZ.I1)(this),x=g?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(!0!==this._sampled)return;m.onSpanCaptured?.(this);let k=[];for(let g of(0,eF.Dp)(this)){if(g===this||g instanceof SentrySpan&&g.isStandaloneSpan()||m.isSpanAlreadyCaptured?.(g))continue;let v=(0,eF.XU)(g);
20isFullFinishedSpan(v)&&(m.onSpanCaptured?.(g),k.push(v))}let E=this._attributes[eL.Zj];delete this._attributes[eL.xF];let T=!1;k.forEach(m=>{delete m.data[eL.xF],m.op?.startsWith("gen_ai.")&&(T=!0)});let K={contexts:{trace:(0,eF.HR)(this)},spans:k.length>1e3?k.sort((m,g)=>m.start_timestamp-g.start_timestamp).slice(0,1e3):k,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:g,capturedSpanIsolationScope:v,dynamicSamplingContext:(0,eU.jC)(this),hasGenAiSpans:T},request:x,...E&&{transaction_info:{source:E}}},et=timedEventsToMeasurements(this._events),en=et&&Object.keys(et).length;return en&&(eR.X&&eE.fF.log("[Measurements] Adding measurements to transaction event",JSON.stringify(et,void 0,2)),K.measurements=et),K}};function isSpanTimeInput(m){return m&&"number"==typeof m||m instanceof Date||Array.isArray(m)}function isFullFinishedSpan(m){return!!m.start_timestamp&&!!m.timestamp&&!!m.span_id&&!!m.trace_id}var tB=v(48485),t$=v(62964);function startInactiveSpan(m){let g=getAcs();return g.startInactiveSpan?g.startInactiveSpan(m):function(m){let g=function(m){let g=m.experimental||{},v={isStandalone:g.standalone,...m};if(m.startTime){let g={...v};return g.startTimestamp=(0,eF.$k)(m.startTime),delete g.startTime,g}return v}(m),{forceTransaction:v,parentSpan:x}=m,k=m.scope?g=>(0,eA.$e)(m.scope,g):void 0!==x?m=>withActiveSpan(x,m):m=>m();return k(()=>{let k=(0,eA.nZ)(),E=function(m,g){if(g)return g;if(null===g)return;let v=(0,tD.Y)(m);if(!v)return;let x=(0,eA.s3)(),k=x?x.getOptions():{};return k.parentSpanIsAlwaysRootSpan?(0,eF.Gx)(v):v}(k,x),T=(0,eA.s3)(),K=m.onlyIfParent&&!E;return K?function(m,g){g?.recordDroppedEvent("no_parent_span","span");let v=new tL.b({traceId:m.getPropagationContext().traceId});return(0,tZ.YJ)(v,m,(0,eA.aF)()),v}(k,T):function({parentSpan:m,spanArguments:g,forceTransaction:v,scope:x}){let k;let E=(0,eA.aF)();if(!(0,tM.f)()){let g={...E.getPropagationContext(),...x.getPropagationContext()},k=m?m.spanContext().traceId:g.traceId,T=new tL.b({traceId:k});return m&&!v&&(0,eF.j5)(m,T),(0,tZ.YJ)(T,x,E),T}let T=(0,eA.s3)();if(function(m,g){let v=m?.getOptions().ignoreSpans;return!!(m&&hasSpanStreamingEnabled(m)&&v?.length)&&shouldIgnoreSpan({description:g.name||"",op:g.attributes?.[eL.$J]||g.op,attributes:g.attributes},v)}(T,g)){isTracingSuppressed(x)||T?.recordDroppedEvent("ignored","span");let g=new tL.b({dropReason:"ignored",traceId:m?.spanContext().traceId??x.getPropagationContext().traceId});return m&&!v&&(0,eF.j5)(m,g),(0,tZ.YJ)(g,x,E),g}if(m&&!v)k=function(m,g,v,x){let{spanId:k,traceId:E}=m.spanContext(),T=isTracingSuppressed(g),K=!T&&(0,eF.Tt)(m),et=K?new SentrySpan({...v,parentSpanId:k,traceId:E,sampled:K}):new tL.b({traceId:E});(0,eF.j5)(m,et),(0,tZ.YJ)(et,g,x);let en=(0,eA.s3)();return en&&(hasSpanStreamingEnabled(en)&&(0,tL.Z)(et)&&((0,tL.Z)(m)&&m.dropReason?(et.dropReason=m.dropReason,en.recordDroppedEvent(m.dropReason,"span")):T||(et.dropReason="sample_rate",en.recordDroppedEvent("sample_rate","span"))),en.emit("spanStart",et),v.endTimestamp&&(en.emit("spanEnd",et),en.emit("afterSpanEnd",et))),et}(m,x,g,E),(0,eF.j5)(m,k);else if(m){let v=(0,eU.jC)(m),{traceId:T,spanId:K}=m.spanContext(),et=(0,eF.Tt)(m);k=_startRootSpan({traceId:T,parentSpanId:K,...g},x,E,et),(0,eU.Lh)(k,v)}else{let{traceId:m,dsc:v,parentSpanId:T,sampled:K}={...E.getPropagationContext(),...x.getPropagationContext()};k=_startRootSpan({traceId:m,parentSpanId:T,...g},x,E,K),v&&(0,eU.Lh)(k,v)}return function(m){if(!eR.X)return;let{description:g="< unknown name >",op:v="< unknown op >",parent_span_id:x}=(0,eF.XU)(m),{spanId:k}=m.spanContext(),E=(0,eF.Tt)(m),T=(0,eF.Gx)(m),K=T===m,et=`[Tracing] Starting ${E?"sampled":"unsampled"} ${K?"root ":""}span`,en=[`op: ${v}`,`name: ${g}`,`ID: ${k}`];if(x&&en.push(`parent ID: ${x}`),!K){let{op:m,description:g}=(0,eF.XU)(T);en.push(`root ID: ${T.spanContext().spanId}`),m&&en.push(`root op: ${m}`),g&&en.push(`root description: ${g}`)}eE.fF.log(`${et}
21  ${en.join("\n  ")}`)}(k),k}({parentSpan:E,spanArguments:g,forceTransaction:v,scope:k})})}(m)}function withActiveSpan(m,g){let v=getAcs();return v.withActiveSpan?v.withActiveSpan(m,g):(0,eA.$e)(v=>((0,tD.D)(v,m||void 0),g(v)))}function isTracingSuppressed(m=(0,eA.nZ)()){let g=getAcs();return g.isTracingSuppressed?g.isTracingSuppressed(m):!0===m.getScopeData().sdkProcessingMetadata.__SENTRY_SUPPRESS_TRACING__}function getAcs(){let m=(0,eV.cu)();return(0,t$.G)(m)}function _startRootSpan(m,g,v,x){let k=(0,eA.s3)(),E=k?.getOptions()||{},{name:T=""}=m,K={spanAttributes:{...m.attributes},spanName:T,parentSampled:x};k?.emit("beforeSampling",K,{decision:!1});let et=K.parentSampled??x,en=K.spanAttributes,er=g.getPropagationContext(),ei=isTracingSuppressed(g),[es,el,ec]=ei?[!1]:function(m,g,v){let x,k;if(!(0,tM.f)(m))return[!1];"function"==typeof m.tracesSampler?(x=m.tracesSampler({...g,inheritOrSampleWith:m=>"number"==typeof g.parentSampleRate?g.parentSampleRate:"boolean"==typeof g.parentSampled?Number(g.parentSampled):m}),k=!0):void 0!==g.parentSampled?x=g.parentSampled:void 0!==m.tracesSampleRate&&(x=m.tracesSampleRate,k=!0);let E=(0,e0.o)(x);if(void 0===E)return eR.X&&eE.fF.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(x)} of type ${JSON.stringify(typeof x)}.`),[!1];if(!E)return eR.X&&eE.fF.log(`[Tracing] Discarding transaction because ${"function"==typeof m.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,E,k];let T=v<E;return!T&&eR.X&&eE.fF.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(x)})`),[T,E,k]}(E,{name:T,parentSampled:et,attributes:en,normalizedRequest:v.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:(0,e0.o)(er.dsc?.sample_rate)},er.sampleRand),eu=new SentrySpan({...m,attributes:{[eL.Zj]:"custom",[eL.TE]:void 0!==el&&ec?el:void 0,...en},sampled:es});return es||!k||ei||(eR.X&&eE.fF.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),k.recordDroppedEvent("sample_rate",hasSpanStreamingEnabled(k)?"span":"transaction")),(0,tZ.YJ)(eu,g,v),k&&k.emit("spanStart",eu),eu}function spanIsIgnored(m){return(0,tL.Z)(m)&&"ignored"===m.dropReason}let tU={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};function startIdleSpan(m,g={}){let v;let x=new Map,k=!1,E="externalFinish",T=!g.disableAutoFinish,K=[],{idleTimeout:et=tU.idleTimeout,finalTimeout:en=tU.finalTimeout,childSpanTimeout:er=tU.childSpanTimeout,beforeSpanEnd:ei,trimIdleSpanEndTimestamp:es=!0}=g,el=(0,eA.s3)(),ec=(0,eA.nZ)();if(!el||!(0,tM.f)()){let m=new tL.b({traceId:ec.getPropagationContext().traceId});return(0,tZ.YJ)(m,ec,(0,eA.aF)()),m}let eu=(0,eF.HN)(),ed=function(m){let g=startInactiveSpan(m);return(0,tD.D)((0,eA.nZ)(),g),eR.X&&eE.fF.log("[Tracing] Started span is an i
21dle span"),g}(m);function _cancelIdleTimeout(){v&&(clearTimeout(v),v=void 0)}function _restartIdleTimeout(m){_cancelIdleTimeout(),v=setTimeout(()=>{!k&&0===x.size&&T&&(E="idleTimeout",ed.end(m))},et)}function _restartChildSpanTimeout(m){v=setTimeout(()=>{!k&&T&&(E="heartbeatFailed",ed.end(m))},er)}function onIdleSpanEnded(m){k=!0,x.clear(),K.forEach(m=>m()),(0,tD.D)(ec,eu);let g=(0,eF.XU)(ed),{start_timestamp:v}=g;if(!v)return;let T=g.data;T[eL.ju]||ed.setAttribute(eL.ju,E);let er=g.status;er&&"unknown"!==er||ed.setStatus({code:tB.OP}),eE.fF.log(`[Tracing] Idle span "${g.op}" finished`);let ei=(0,eF.Dp)(ed).filter(m=>m!==ed),es=0;ei.forEach(g=>{g.isRecording()&&(g.setStatus({code:tB.jt,message:"cancelled"}),g.end(m),eR.X&&eE.fF.log("[Tracing] Cancelling span since span ended early",JSON.stringify(g,void 0,2)));let v=(0,eF.XU)(g),{timestamp:x=0,start_timestamp:k=0}=v,E=k<=m,T=(en+et)/1e3,K=x-k<=T;if(eR.X){let m=JSON.stringify(g,void 0,2);E?K||eE.fF.log("[Tracing] Discarding span since it finished after idle span final timeout",m):eE.fF.log("[Tracing] Discarding span since it happened after idle span was finished",m)}(!K||!E)&&((0,eF.ed)(ed,g),es++)}),es>0&&ed.setAttribute("sentry.idle_span_discarded_spans",es)}return ed.end=new Proxy(ed.end,{apply(m,g,v){if(ei&&ei(ed),(0,tL.Z)(g))return;let[x,...k]=v,E=x||(0,eY.ph)(),T=(0,eF.$k)(E),K=(0,eF.Dp)(ed).filter(m=>m!==ed),et=(0,eF.XU)(ed);if(!K.length||!es)return onIdleSpanEnded(T),Reflect.apply(m,g,[T,...k]);let er=el.getOptions().ignoreSpans,ec=K?.reduce((m,g)=>{let v=eF.XU(g);return!v.timestamp||er&&shouldIgnoreSpan({description:v.description,op:v.op,attributes:v.data},er)?m:m?Math.max(m,v.timestamp):v.timestamp},void 0),eu=et.start_timestamp,ep=Math.min(eu?eu+en/1e3:1/0,Math.max(eu||-1/0,Math.min(T,ec||1/0)));return onIdleSpanEnded(ep),Reflect.apply(m,g,[ep,...k])}}),K.push(el.on("spanStart",m=>{if(k||m===ed||(0,eF.XU)(m).timestamp||m instanceof SentrySpan&&m.isStandaloneSpan())return;let g=(0,eF.Dp)(ed);g.includes(m)&&function(m){_cancelIdleTimeout(),x.set(m,!0);let g=(0,eY.ph)();_restartChildSpanTimeout(g+er/1e3)}(m.spanContext().spanId)})),K.push(el.on("spanEnd",m=>{k||function(m){if(x.has(m)&&x.delete(m),0===x.size){let m=(0,eY.ph)();_restartIdleTimeout(m+et/1e3)}}(m.spanContext().spanId)})),K.push(el.on("idleSpanEnableAutoFinish",m=>{m===ed&&(T=!0,_restartIdleTimeout(),x.size&&_restartChildSpanTimeout())})),g.disableAutoFinish||_restartIdleTimeout(),setTimeout(()=>{k||(ed.setStatus({code:tB.jt,message:"deadline_exceeded"}),E="finalTimeout",ed.end())},en),ed}let tz=!1;var tV=v(15436);let getRating=(m,g)=>m>g[1]?"poor":m>g[0]?"needs-improvement":"good",bindReporter=(m,g,v,x)=>{let k,E;return T=>{g.value>=0&&(T||x)&&((E=g.value-(k??0))||void 0===k)&&(k=g.value,g.delta=E,g.rating=getRating(g.value,v),m(g))}},getNavigationEntry=(m=!0)=>{let g=tu.performance?.getEntriesByType?.("navigation")[0];if(!m||g&&g.responseStart>0&&g.responseStart<performance.now())return g},getActivationStart=()=>{let m=getNavigationEntry();return m?.activationStart??0},tq=-1,tH=new Set,initHiddenTime=()=>tu.document?.visibilityState!=="hidden"||tu.document?.prerendering?1/0:0,onVisibilityUpdate=m=>{if(("pagehide"===m.type||tu.document?.visibilityState==="hidden")&&tq>-1){if("visibilitychange"===m.type||"pagehide"===m.type)for(let m of tH)m();isFinite(tq)||(tq="visibilitychange"===m.type?m.timeStamp:0,removePageListener("prerenderingchange",onVisibilityUpdate,!0))}},getVisibilityWatcher=()=>{if(tu.document&&tq<0){let m=getActivationStart(),g=tu.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(g=>"hidden"===g.name&&g.startTime>m)[0]?.startTime;tq=g??initHiddenTime(),addPageListener("visibilitychange",onVisibilityUpdate,!0),addPageListener("pagehide",onVisibilityUpdate,!0),addPageListener("prerenderingchange",onVisibilityUpdate,!0)}return{get firstHiddenTime(){return tq},onHidden(m){tH.add(m)}}},generateUniqueID=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,initMetric=(m,g=-1)=>{let v=getNavigationEntry(),x="navigate";return v&&(tu.document?.prerendering||getActivationStart()>0?x="prerender":tu.document?.wasDiscarded?x="restore":v.type&&(x=v.type.replace(/_/g,"-"))),{name:m,value:g,rating:"good",delta:0,entries:[],id:generateUniqueID(),navigationType:x}},tW=new WeakMap;function initUnique(m,g){try{return tW.get(m)||tW.set(m,new g),tW.get(m)}catch(m){return new g}}let LayoutShiftManager=class LayoutShiftManager{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(m){if(m.hadRecentInput)return;let g=this._sessionEntries[0],v=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&g&&v&&m.startTime-v.startTime<1e3&&m.startTime-g.startTime<5e3?(this._sessionValue+=m.value,this._sessionEntries.push(m)):(this._sessionValue=m.value,this._sessionEntries=[m]),this._onAfterProcessingUnexpectedShift?.(m)}};let observe=(m,g,v={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(m)){let x=new PerformanceObserver(m=>{Promise.resolve().then(()=>{g(m.getEntries())})});return x.observe({type:m,buffered:!0,...v}),x}}catch{}},whenActivated=m=>{tu.document?.prerendering?addEventListener("prerenderingchange",()=>m(),!0):m()},tK=[1800,3e3],onFCP=(m,g={})=>{whenActivated(()=>{let v;let x=getVisibilityWatcher(),k=initMetric("FCP"),E=observe("paint",m=>{for(let g of m)"first-contentful-paint"===g.name&&(E.disconnect(),g.startTime<x.firstHiddenTime&&(k.value=Math.max(g.startTime-getActivationStart(),0),k.entr
21ies.push(g),v(!0)))});E&&(v=bindReporter(m,k,tK,g.reportAllChanges))})},tG=[.1,.25],onCLS=(m,g={})=>{onFCP(runOnce(()=>{let v;let x=initMetric("CLS",0),k=getVisibilityWatcher(),E=initUnique(g,LayoutShiftManager),handleEntries=m=>{for(let g of m)E._processEntry(g);E._sessionValue>x.value&&(x.value=E._sessionValue,x.entries=E._sessionEntries,v())},T=observe("layout-shift",handleEntries);T&&(v=bindReporter(m,x,tG,g.reportAllChanges),k.onHidden(()=>{handleEntries(T.takeRecords()),v(!0)}),tu?.setTimeout?.(v))}))},tQ=0,tY=1/0,tX=0,updateEstimate=m=>{m.forEach(m=>{m.interactionId&&(tY=Math.min(tY,m.interactionId),tQ=(tX=Math.max(tX,m.interactionId))?(tX-tY)/7+1:0)})},getInteractionCount=()=>K?tQ:performance.interactionCount||0,initInteractionCountPolyfill=()=>{"interactionCount"in performance||K||(K=observe("event",updateEstimate,{type:"event",buffered:!0,durationThreshold:0}))},tJ=0,getInteractionCountForNavigation=()=>getInteractionCount()-tJ;let InteractionManager=class InteractionManager{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){tJ=getInteractionCount(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let m=Math.min(this._longestInteractionList.length-1,Math.floor(getInteractionCountForNavigation()/50));return this._longestInteractionList[m]}_processEntry(m){if(this._onBeforeProcessingEntry?.(m),!(m.interactionId||"first-input"===m.entryType))return;let g=this._longestInteractionList.at(-1),v=this._longestInteractionMap.get(m.interactionId);if(v||this._longestInteractionList.length<10||m.duration>g._latency){if(v?m.duration>v._latency?(v.entries=[m],v._latency=m.duration):m.duration===v._latency&&m.startTime===v.entries[0].startTime&&v.entries.push(m):(v={id:m.interactionId,entries:[m],_latency:m.duration},this._longestInteractionMap.set(v.id,v),this._longestInteractionList.push(v)),this._longestInteractionList.sort((m,g)=>g._latency-m._latency),this._longestInteractionList.length>10){let m=this._longestInteractionList.splice(10);for(let g of m)this._longestInteractionMap.delete(g.id)}this._onAfterProcessingINPCandidate?.(v)}}};let t0=[200,500],onINP=(m,g={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let v=getVisibilityWatcher();whenActivated(()=>{let x;initInteractionCountPolyfill();let k=initMetric("INP"),E=initUnique(g,InteractionManager),handleEntries=m=>{whenIdleOrHidden(()=>{for(let g of m)E._processEntry(g);let g=E._estimateP98LongestInteraction();g&&g._latency!==k.value&&(k.value=g._latency,k.entries=g.entries,x())})},T=observe("event",handleEntries,{durationThreshold:g.durationThreshold??40});x=bindReporter(m,k,t0,g.reportAllChanges),T&&(T.observe({type:"first-input",buffered:!0}),v.onHidden(()=>{handleEntries(T.takeRecords()),x(!0)}))})};let LCPEntryManager=class LCPEntryManager{_processEntry(m){this._onBeforeProcessingEntry?.(m)}};let t1=[2500,4e3],onLCP=(m,g={})=>{whenActivated(()=>{let v;let x=getVisibilityWatcher(),k=initMetric("LCP"),E=initUnique(g,LCPEntryManager),handleEntries=m=>{for(let T of(g.reportAllChanges||(m=m.slice(-1)),m))E._processEntry(T),T.startTime<x.firstHiddenTime&&(k.value=Math.max(T.startTime-getActivationStart(),0),k.entries=[T],v())},T=observe("largest-contentful-paint",handleEntries);if(T){v=bindReporter(m,k,t1,g.reportAllChanges);let x=runOnce(()=>{handleEntries(T.takeRecords()),T.disconnect(),v(!0)}),stopListeningWrapper=m=>{m.isTrusted&&(whenIdleOrHidden(x),removePageListener(m.type,stopListeningWrapper,{capture:!0}))};for(let m of["keydown","click","visibilitychange"])addPageListener(m,stopListeningWrapper,{capture:!0})}})},t2=[800,1800],whenReady=m=>{tu.document?.prerendering?whenActivated(()=>whenReady(m)):tu.document?.readyState!=="complete"?addEventListener("load",()=>whenReady(m),!0):setTimeout(m)},onTTFB=(m,g={})=>{let v=initMetric("TTFB"),x=bindReporter(m,v,t2,g.reportAllChanges);whenReady(()=>{let m=getNavigationEntry();m&&(v.value=Math.max(m.responseStart-getActivationStart(),0),v.entries=[m],x(!0))})},t3={},t5={};function addClsInstrumentationHandler(m,g=!1){return addMetricObserver("cls",m,instrumentCls,et,g)}function addLcpInstrumentationHandler(m,g=!1){return addMetricObserver("lcp",m,instrumentLcp,en,g)}function addInpInstrumentationHandler(m){return addMetricObserver("inp",m,instrumentInp,ei)}function addPerformanceInstrumentationHandler(m,g){return instrument_addHandler(m,g),t5[m]||(function(m){let g={};"event"===m&&(g.durationThreshold=0),observe(m,g=>{instrument_triggerHandlers(m,{entries:g})},g)}(m),t5[m]=!0),getCleanupCallback(m,g)}function instrument_triggerHandlers(m,g){let v=t3[m];if(v?.length)for(let m of v)try{m(g)}catch(m){}}function instrumentCls(){return onCLS(m=>{instrument_triggerHandlers("cls",{metric:m}),et=m},{reportAllChanges:!0})}function instrumentLcp(){return onLCP(m=>{instrument_triggerHandlers("lcp",{metric:m}),en=m},{reportAllChanges:!0})}function instrumentTtfb(){return onTTFB(m=>{instrument_triggerHandlers("ttfb",{metric:m}),er=m})}function instrumentInp(){return onINP(m=>{instrument_triggerHandlers("inp",{metric:m}),ei=m})}function addMetricObserver(m,g,v,x,k=!1){let E;return instrument_addHandler(m,g),t5[m]||(E=v(),t5[m]=!0),x&&g({metric:x}),getCleanupCallback(m,g,k?E:void 0)}function instrument_addHandler(m,g){t3[m]=t3[m]||[],t3[m].push(g)}function getCleanupCallback(m,g,v){return()=>{v&&v();let x=t3[m];if(!x)return;let k=x.indexOf(g);-1!==k&&x.splice(k,1)}}let onHidden=m=>{let onHiddenOrPageHide=g=>{("pagehide"===g.type||tu.document?.visibilityState==="hidden")&&m(g)};addPageListener("visibilitychange",onHiddenOrPageHide,{capture:!0,once:!0}),addPageListener("pagehide",onHiddenOrPageHide,{capture:!0,once:!0})};function isMeasurementValue(m){return"number"==typeof m&&isFinite(m)}function startAndEndSpan(m,g,v,{...x}){let k=(0,eF.XU)(m).start_timestamp;return k&&k>g&&"function"==typeof m.updateStartTime&&m.updateStartTime(g),withActiveSpan(m,()=>{let m=startInactiveSpan({startTime:g,...x});return m&&m.end(v),m})}function startStandaloneWebVitalSpan(m){let g;let v=(0,eA.s3)();if(!v)return;let{name:x,transaction:k,attributes:E,startTime:T}=m,{release:K,environment:et}=v.getOptions(),{userInfo:en}=v.getDataCollectionOptions(),er=v.getIntegrationByName("Replay"),ei=er?.getReplayId(),es=(0,eA.nZ)(),el=es.getUser(),ec=void 0!==el?el.email||el.id||el.ip_address:void 0;try{g=es.getScopeData().contexts.profile.profile_id}catch{}let eu={release:K,environment:et,user:ec||void 0,profile_id:g||void 0,replay_id:ei||void 0,transaction:k,"user_agent.original":tu.navigator?.userAgent,"client.address":en?"{{auto}}":void 0,...E};return startInactiveSpan({name:x,attributes:eu,startTime:T,experimental:{standalone:!0}})}function getBrowserPerformanceAPI(){return tu.addEventListener&&tu.performance}function msToSec(m){return m/1e3}function supportsWebVital(m){try{return PerformanceObserver.supportedEntryTypes.includes(m)}catch{return!1}}function listenForWebVitalReportEvents(m,g){let v;let x=!1;function _runCollectorCallbackOnce(m){!x&&v&&g(m,v.spanContext().spanId,v),x=!0}onHidden(()=>{_runCollectorCallbackOnce("pagehide")});let k=m.on("beforeStartNavigationSpan",(m,g)=>{g?.isRedirect||(_runCollectorCallbackOnce("navigation"),k(),E())}),E=m.on("afterStartPageLoadSpan",m=>{v=m,E()})}function isValidLcpMetric(m){return null!=m&&m>0&&m<=6e4}function getAbsoluteTime(m){return m?(((0,eY.Z1)()||performance.timeOrigin)+m)/1e3:m}function resourceTimingToSpanAttributes(m){let g={};if(void 0!=m.nextHopProtocol){let{name:v,version:x}=function(m){let g="unknown",v="unknown",x="";for(let k of m){if("/"===k){[g,v]=m.split("/");break}if(!isNaN(Number(k))){g="h"===x?"http":x,v=m.split(x)[1];break}x+=k}return x===m&&(g=x),{name:g,version:v}}(m.nextHopProtocol);g["network.protocol.version"]=x,g["network.protocol.name"]=v}return(0,eY.Z1)()||getBrowserPerformanceAPI()?.timeOrigin?Object.fromEntries(Object.entries({...g,"http.request.redirect_start":getAbsoluteTime(m.redirectStart),"http.request.redirect_end":getAbsoluteTime(m.redirectEnd),"http.request.worker_start":getAbsoluteTime(m.workerStart),"http.request.fetch_start":getAbsoluteTime(m.fetchStart),"http.request.domain_lookup_start":getAbsoluteTime(m.domainLookupStart),"http.request.domain_lookup_end":getAbsoluteTime(m.domainLookupEnd),"http.request.connect_start":getAbsoluteTime(m.connectStart),"http.request.secure_connection_start":getAbsoluteTime(m.secureConnectionStart),"http.request.connection_end":getAbsoluteTime(m.connectEnd),"http.request.request_start":getAbsoluteTime(m.requestStart),"http.request.response_start":getAbsoluteTime(m.responseStart),"http.request.response_end":getAbsoluteTime(m.responseEnd),"http.request.time_to_first_byte":null!=m.responseStart?m.responseStart/1e3:void 0}).filter(([,m])=>null!=m)):g}let t4=0,t6={};function resetWebVitalState(){es=void 0,el=void 0,t6={}}
21function _addPerformanceNavigationTiming(m,g,v,x,k=v){let E="secureConnection"===v?"connectEnd":"fetch"===v?"domainLookupStart":`${v}End`,T=g[E],K=g[`${v}Start`];K&&T&&startAndEndSpan(m,x+msToSec(K),x+msToSec(T),{op:`browser.${k}`,name:g.name,attributes:{[eL.S3]:"auto.ui.browser.metrics",..."redirect"===v&&null!=g.redirectCount?{"http.redirect_count":g.redirectCount}:{}}})}let t7=new WeakMap,t8=new WeakMap,t9=["text/event-stream","application/x-ndjson","application/stream+json"],fetchStreamPerformanceIntegration=()=>({name:"FetchStreamPerformance",setup(){(function(m){let g="fetch-body-resolved";addHandler(g,m),maybeInstrument(g,()=>instrumentFetch(streamHandler))})(m=>{if(m.response){let g=t7.get(m.response);if(g&&m.endTimestamp){g.end(m.endTimestamp);let v=t8.get(m.response);v&&clearTimeout(v)}}}),addFetchInstrumentationHandler(m=>{if(m.endTimestamp&&m.response){let g=m.response.headers?.get("content-type")||"";if(m.response.headers?.get("content-length")||!t9.some(m=>g.startsWith(m)))return;let v=m.fetchData?.url||"",x=m.fetchData?.method||"GET",k=parseStringToURLObject(v),E=v.startsWith("data:")?stripDataUrlContent(v):k?getSanitizedUrlStringFromUrlObject(k):v,T=startInactiveSpan({name:`${x} ${E}`,startTime:m.endTimestamp,attributes:{url:stripDataUrlContent(v),"http.method":x,type:"fetch",[eL.$J]:"http.client.stream",[eL.S3]:"auto.http.browser.stream"}});t7.set(m.response,T);let K=setTimeout(()=>{T.isRecording()&&T.end()},9e4);t8.set(m.response,K)}})}}),nt=[],nn=new Map,nr=new Map,ni={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"},_onInp=({metric:m})=>{if(void 0==m.value)return;let g=msToSec(m.value);if(g>60)return;let v=m.entries.find(g=>g.duration===m.value&&ni[g.name]);if(!v)return;let{interactionId:x}=v,k=ni[v.name],E=msToSec((0,eY.Z1)()+v.startTime),T=(0,eF.HN)(),K=T?(0,eF.Gx)(T):void 0,et=null!=x?nn.get(x):void 0,en=et?.span||K,er=en?(0,eF.XU)(en).description:(0,eA.nZ)().getScopeData().transactionName,ei=et?.elementName||htmlTreeAsString_htmlTreeAsString(v.target),es={[eL.S3]:"auto.http.browser.inp",[eL.$J]:`ui.interaction.${k}`,[eL.JQ]:v.duration},el=startStandaloneWebVitalSpan({name:ei,transaction:er,attributes:es,startTime:E});el&&(el.addEvent("inp",{[eL.E1]:"millisecond",[eL.Wb]:m.value}),el.end(E+g))};function _emitWebVitalSpan(m){let{name:g,op:v,origin:x,metricName:k,value:E,attributes:T,parentSpan:K,reportEvent:et,startTime:en,endTime:er}=m,ei=(0,eA.nZ)().getScopeData().transactionName,es={[eL.S3]:x,[eL.$J]:v,[eL.JQ]:0,[`browser.web_vital.${k}.value`]:E,[ty]:ei,[tv]:ei,"user_agent.original":tu.navigator?.userAgent,...T};K&&eF.FS(K).attributes?.[eL.$J]==="pageload"&&(es["sentry.pageload.span_id"]=K.spanContext().spanId),et&&(es[`browser.web_vital.${k}.report_event`]=et);let el=startInactiveSpan({name:g,attributes:es,startTime:en,parentSpan:K});el&&el.end(er??en)}let na="WebVitals",webVitalsIntegration=(m={})=>{let g=new Set(m.ignore??[]);return{name:na,setup(v){let x=hasSpanStreamingEnabled(v),{enableStandaloneClsSpans:k,enableStandaloneLcpSpans:E}=m._experiments??{},T=x||g.has("cls")?void 0:k||!1,K=x||g.has("lcp")?void 0:E||!1,et=function({recordClsStandaloneSpans:m,recordLcpStandaloneSpans:g,client:v}){let x=getBrowserPerformanceAPI();if(x&&(0,eY.Z1)()){x.mark&&tu.performance.mark("sentry-tracing-init");let k=g?function(m){let g,v=0;if(!supportsWebVital("largest-contentful-paint"))return;let x=addLcpInstrumentationHandler(({metric:m})=>{let x=m.entries[m.entries.length-1];x&&isValidLcpMetric(m.value)&&(v=m.value,g=x)},!0);listenForWebVitalReportEvents(m,(m,k)=>{(function(m,g,v,x){if(!isValidLcpMetric(m))return;let k=msToSec(((0,eY.Z1)()||0)+(g?.startTime||0)),E=(0,eA.nZ)().getScopeData().transactionName,T=g?htmlTreeAsString_htmlTreeAsString(g.element):"Largest contentful paint",K={[eL.S3]:"auto.http.browser.lcp",[eL.$J]:"ui.webvital.lcp",[eL.JQ]:0,"sentry.pageload.span_id":v,"sentry.report_event":x};g&&(g.element&&(K["lcp.element"]=htmlTreeAsString_htmlTreeAsString(g.element)),g.id&&(K["lcp.id"]=g.id),g.url&&(K["lcp.url"]=g.url),null!=g.loadTime&&(K["lcp.loadTime"]=g.loadTime),null!=g.renderTime&&(K["lcp.renderTime"]=g.renderTime),null!=g.size&&(K["lcp.size"]=g.size));let et=startStandaloneWebVitalSpan({name:T,transaction:E,attributes:K,startTime:k});et&&(et.addEvent("lcp",{[eL.E1]:"millisecond",[eL.Wb]:m}),et.end(k))})(v,g,k,m),x()})}(v):!1===g?addLcpInstrumentationHandler(({metric:m})=>{let g=m.entries[m.entries.length-1];g&&isValidLcpMetric(m.value)&&(t6.lcp={value:m.value,unit:"millisecond"},es=g)},!0):void 0,E=m?function(m){let g,v=0;
21if(!supportsWebVital("layout-shift"))return;let x=addClsInstrumentationHandler(({metric:m})=>{let x=m.entries[m.entries.length-1];x&&(v=m.value,g=x)},!0);listenForWebVitalReportEvents(m,(m,k)=>{(function(m,g,v,x){let k=g?msToSec(((0,eY.Z1)()||0)+g.startTime):(0,eY.ph)(),E=(0,eA.nZ)().getScopeData().transactionName,T=g?htmlTreeAsString_htmlTreeAsString(g.sources[0]?.node):"Layout shift",K={[eL.S3]:"auto.http.browser.cls",[eL.$J]:"ui.webvital.cls",[eL.JQ]:0,"sentry.pageload.span_id":v,"sentry.report_event":x};g?.sources&&g.sources.forEach((m,g)=>{K[`cls.source.${g+1}`]=htmlTreeAsString_htmlTreeAsString(m.node)});let et=startStandaloneWebVitalSpan({name:T,transaction:E,attributes:K,startTime:k});et&&(et.addEvent("cls",{[eL.E1]:"",[eL.Wb]:m}),et.end(k))})(v,g,k,m),x()})}(v):!1===m?addClsInstrumentationHandler(({metric:m})=>{let g=m.entries[m.entries.length-1];g&&(t6.cls={value:m.value,unit:""},el=g)},!0):void 0,T=addMetricObserver("ttfb",({metric:m})=>{let g=m.entries[m.entries.length-1];g&&(t6.ttfb={value:m.value,unit:"millisecond"})},instrumentTtfb,er),K=addPerformanceInstrumentationHandler("paint",({entries:m})=>{let g=getVisibilityWatcher();for(let v of m){let m=v.startTime<g.firstHiddenTime;"first-paint"===v.name&&m&&(t6.fp={value:v.startTime,unit:"millisecond"}),"first-contentful-paint"===v.name&&m&&(t6.fcp={value:v.startTime,unit:"millisecond"})}});return()=>{T(),K(),k?.(),E?.()}}return()=>void 0}({recordClsStandaloneSpans:T,recordLcpStandaloneSpans:K,client:v}),en=new WeakSet;v.on("afterStartPageLoadSpan",m=>{en.add(m)}),v.on("spanEnd",m=>{en.delete(m)&&(et(),function(m,g){let v=(0,eY.Z1)();if(!getBrowserPerformanceAPI()?.getEntries||!v){resetWebVitalState();return}let{spanStreamingEnabled:x,recordClsOnPageloadSpan:k,recordLcpOnPageloadSpan:E}=g,T=msToSec(v);if("pageload"===(0,eF.XU)(m).op){if(function(m){let g=getNavigationEntry(!1);if(!g)return;let{responseStart:v,requestStart:x}=g;x<=v&&(m["ttfb.requestTime"]={value:v-x,unit:"millisecond"})}(t6),x){let setAttr=(g,v,x)=>{let k=x??`browser.web_vital.${g}.value`;m.setAttribute(k,v)};["ttfb","fp","fcp"].forEach(m=>{t6[m]&&setAttr(m,t6[m].value)}),t6["ttfb.requestTime"]&&setAttr("ttfb.requestTime",t6["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else k||delete t6.cls,E||delete t6.lcp,Object.entries(t6).forEach(([g,v])=>{setMeasurement(g,v.value,v.unit,m)}),es&&g.recordLcpOnPageloadSpan&&(es.element&&m.setAttribute("lcp.element",htmlTreeAsString_htmlTreeAsString(es.element)),es.id&&m.setAttribute("lcp.id",es.id),es.url&&m.setAttribute("lcp.url",es.url.trim().slice(0,200)),null!=es.loadTime&&m.setAttribute("lcp.loadTime",es.loadTime),null!=es.renderTime&&m.setAttribute("lcp.renderTime",es.renderTime),m.setAttribute("lcp.size",es.size)),el?.sources&&g.recordClsOnPageloadSpan&&el.sources.forEach((g,v)=>m.setAttribute(`cls.source.${v+1}`,htmlTreeAsString_htmlTreeAsString(g.node)));m.setAttribute(x?"browser.performance.time_origin":"performance.timeOrigin",T),m.setAttribute(x?"browser.performance.navigation.activation_start":"performance.activationStart",getActivationStart())}resetWebVitalState()}(m,{recordClsOnPageloadSpan:!1===T,recordLcpOnPageloadSpan:!1===K,spanStreamingEnabled:x}))}),x?(g.has("lcp")||function(m){let g,v=0;if(!supportsWebVital("largest-contentful-paint"))return;let x=addLcpInstrumentationHandler(({metric:m})=>{let x=m.entries[m.entries.length-1];x&&isValidLcpMetric(m.value)&&(v=m.value,g=x)},!0);listenForWebVitalReportEvents(m,(m,k,E)=>{(function(m,g,v,x){if(!isValidLcpMetric(m))return;let k=(0,eY.Z1)()||0,E=msToSec(k),T=msToSec(k+(g?.startTime||0)),K=g?htmlTreeAsString_htmlTreeAsString(g.element):"Largest contentful paint",et={};g?.element&&(et["browser.web_vital.lcp.element"]=htmlTreeAsString_htmlTreeAsString(g.element)),g?.id&&(et["browser.web_vital.lcp.id"]=g.id),g?.url&&(et["browser.web_vital.lcp.url"]=g.url),g?.loadTime!=null&&(et["browser.web_vital.lcp.load_time"]=g.loadTime),g?.renderTime!=null&&(et["browser.web_vital.lcp.render_time"]=g.renderTime),g?.size!=null&&(et["browser.web_vital.lcp.size"]=g.size),_emitWebVitalSpan({name:K,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:m,attributes:et,parentSpan:v,reportEvent:x,startTime:E,endTime:T})})(v,g,E,m),x()})}(v),g.has("cls")||function(m){let g,v=0;
21if(!supportsWebVital("layout-shift"))return;let x=addClsInstrumentationHandler(({metric:m})=>{let x=m.entries[m.entries.length-1];x&&(v=m.value,g=x)},!0);listenForWebVitalReportEvents(m,(m,k,E)=>{(function(m,g,v,x){let k=g?msToSec(((0,eY.Z1)()||0)+g.startTime):(0,eY.ph)(),E=g?htmlTreeAsString_htmlTreeAsString(g.sources[0]?.node):"Layout shift",T={};g?.sources&&g.sources.forEach((m,g)=>{T[`browser.web_vital.cls.source.${g+1}`]=htmlTreeAsString_htmlTreeAsString(m.node)}),_emitWebVitalSpan({name:E,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:m,attributes:T,parentSpan:v,reportEvent:x,startTime:k})})(v,g,E,m),x()})}(v),g.has("inp")||function(){let m=getBrowserPerformanceAPI();m&&(0,eY.Z1)()&&addInpInstrumentationHandler(({metric:m})=>{if(null==m.value)return;let g=msToSec(m.value);if(g>60)return;let v=m.entries.find(g=>g.duration===m.value&&ni[g.name]);v&&function(m,g){var v;let x=msToSec((0,eY.Z1)()+g.startTime),k=msToSec(m),E=ni[g.name],T=null!=(v=g.interactionId)?nn.get(v):void 0,K=(0,eF.HN)(),et=K?(0,eF.Gx)(K):void 0,en=T?.span||et,er=en?(0,eF.FS)(en).name:(0,eA.nZ)().getScopeData().transactionName,ei=T?.elementName||htmlTreeAsString_htmlTreeAsString(g.target);_emitWebVitalSpan({name:ei,op:`ui.interaction.${E}`,origin:"auto.http.browser.inp",metricName:"inp",value:m,attributes:{[eL.JQ]:g.duration,[ty]:er,[tv]:er},startTime:x,endTime:x+k,parentSpan:en})}(m.value,v)})}()):g.has("inp")||function(){let m=getBrowserPerformanceAPI();if(m&&(0,eY.Z1)()){let m=addInpInstrumentationHandler(_onInp);return()=>{m()}}return()=>void 0}()},afterAllSetup(){g.has("inp")||function(){let m=Object.keys(ni);function captureElementFromEvent(m){let g=m.target;if(!g)return;let v=htmlTreeAsString_htmlTreeAsString(g),x=Math.round(m.timeStamp);if(nr.set(x,v),nr.size>50){let m=nr.keys().next().value;void 0!==m&&nr.delete(m)}}isBrowser()&&m.forEach(m=>{tu.addEventListener(m,captureElementFromEvent,{capture:!0,passive:!0})});let handleEntries=({entries:m})=>{let g=(0,eF.HN)(),v=g&&(0,eF.Gx)(g);m.forEach(m=>{if(!("duration"in m))return;let g=m.interactionId;if(null==g||nn.has(g))return;let x=m.target?htmlTreeAsString_htmlTreeAsString(m.target):function(m){let g=Math.round(m.startTime),v=nr.get(g);if(!v)for(let m=-5;m<=5;m++){let x=nr.get(g+m);if(x){v=x;break}}return v||"<unknown>"}(m);if(nt.length>10){let m=nt.shift();nn.delete(m)}nt.push(g),nn.set(g,{span:v,elementName:x})})};addPerformanceInstrumentationHandler("event",handleEntries),addPerformanceInstrumentationHandler("first-input",handleEntries)}()}}},ns="sentry_previous_trace";function spanContextSampled(m){return 1===m.traceFlags}var no=v(61874),nl=v(51159);function baggageHeaderHasSentryBaggageValues(m){return"string"==typeof m&&m.split(",").some(m=>m.trim().startsWith(no.lq))}function getFetchSpanAttributes(m,g,v,x){let k={url:stripDataUrlContent(m),type:"fetch","http.method":v,[eL.S3]:x,[eL.$J]:"http.client"};return g&&(isURLObjectRelative(g)||(k[tg]=stripDataUrlContent(g.href),k[tb]=stripDataUrlContent(g.href),k["server.address"]=g.host),g.search&&(k["http.query"]=g.search),g.hash&&(k["http.fragment"]=g.hash)),k}let nc=Symbol.for("sentry__originalRequestBody");function serializeFormData(m){return new URLSearchParams(m).toString()}function getBodyString(m,g=eE.fF){try{if("string"==typeof m)return[m];if(m instanceof URLSearchParams)return[m.toString()];if(m instanceof FormData)return[serializeFormData(m)];if(!m)return[void 0]}catch(m){return[void 0,"BODY_PARSE_ERROR"]}return[void 0,"UNPARSEABLE_BODY_TYPE"]}function getFetchRequestArgBody(m=[]){if(m.length>=2&&m[1]&&"object"==typeof m[1]&&"body"in m[1])return m[1].body;if(m.length>=1&&m[0]instanceof Request){let g=m[0],v=g[nc];if(void 0!==v)return v}}function parseXhrResponseHeaders(m){let g;try{g=m.getAllResponseHeaders()}catch(m){return{}}return g?g.split("\r\n").reduce((m,g)=>{let[v,x]=g.split(": ");return x&&(m[v.toLowerCase()]=x),m},{}):{}}function getFullURL(m){try{let g=new URL(m,tt.location.origin);return g.href}catch{return}}function createHeadersSafely(m){try{return new Headers(m)}catch{return}}let nd={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function addHTTPTimings(m,g){let{url:v}=(0,eF.XU)(m).data;if(!v||"string"!=typeof v)return;let onEntryFound=()=>void setTimeout(x);if(hasSpanStreamingEnabled(g)){let g=m.end.bind(m);m.end=m=>{let v=m??(0,eY.ph)(),k=!1,endSpanAndCleanup=()=>{k||(k=!0,setTimeout(x),g(v),clearTimeout(E))};
21onEntryFound=endSpanAndCleanup;let E=setTimeout(endSpanAndCleanup,300)}}let x=addPerformanceInstrumentationHandler("resource",({entries:g})=>{g.forEach(g=>{"resource"===g.entryType&&"initiatorType"in g&&"string"==typeof g.nextHopProtocol&&("fetch"===g.initiatorType||"xmlhttprequest"===g.initiatorType)&&g.name.endsWith(v)&&(m.setAttributes(resourceTimingToSpanAttributes(g)),onEntryFound())})})}let np=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function isBotUserAgent(){let m=tt.navigator;return!!m?.userAgent&&np.test(m.userAgent)}let nm={...tU,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...nd},browserTracingIntegration=(m={})=>{let g,v;"enableElementTiming"in m&&(0,eE.Cf)(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let x={name:void 0,source:void 0},k=tt.document,{enableInp:E,enableLongTask:T,enableLongAnimationFrame:K,_experiments:{enableInteractions:et,enableStandaloneClsSpans:en,enableStandaloneLcpSpans:er},beforeStartSpan:ei,idleTimeout:es,finalTimeout:el,childSpanTimeout:ec,markBackgroundSpan:eu,traceFetch:ed,traceXHR:ep,trackFetchStreamPerformance:em,shouldCreateSpanForRequest:ef,enableHTTPTimings:eh,ignoreResourceSpans:eg,ignorePerformanceApiSpans:ev,instrumentPageLoad:ey,instrumentNavigation:eb,detectRedirects:ex,linkPreviousTrace:e_,consistentTraceSampling:ew,enableReportPageLoaded:eS,onRequestSpanStart:eC,onRequestSpanEnd:ej}={...nm,...m},eN=isBotUserAgent();function _createRouteSpan(m,g,E=!0,T){let K="pageload"===g.op,et=g.name,en=ei?ei(g):g,er=parseStringToURLObject(T||getLocationHref()),eu={...er?.pathname&&{[tx]:er.pathname},...er&&!isURLObjectRelative(er)&&{[tb]:er.href},...en.attributes};if(et!==en.name&&(eu[eL.Zj]="custom"),en.attributes=eu,!E){let m=(0,eY.yW)();startInactiveSpan({...en,startTime:m}).end(m);return}x.name=en.name,x.source=eu[eL.Zj];let ed=startIdleSpan(en,{idleTimeout:es,finalTimeout:el,childSpanTimeout:ec,disableAutoFinish:K,beforeSpanEnd:g=>{(function(m,g){let v=getBrowserPerformanceAPI(),x=(0,eY.Z1)();if(!v?.getEntries||!x)return;let{spanStreamingEnabled:k,ignorePerformanceApiSpans:E,ignoreResourceSpans:T}=g,K=msToSec(x),et=v.getEntries(),{op:en,start_timestamp:er}=(0,eF.XU)(m);et.slice(t4).forEach(g=>{let v=msToSec(g.startTime),x=msToSec(Math.max(0,g.duration));if("navigation"!==en||!er||!(K+v<er))switch(g.entryType){case"navigation":["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(v=>{_addPerformanceNavigationTiming(m,g,v,K)}),_addPerformanceNavigationTiming(m,g,"secureConnection",K,"TLS/SSL"),_addPerformanceNavigationTiming(m,g,"fetch",K,"cache"),_addPerformanceNavigationTiming(m,g,"domainLookup",K,"DNS"),function(m,g,v){let x=v+msToSec(g.requestStart),k=v+msToSec(g.responseEnd),E=v+msToSec(g.responseStart);g.responseEnd&&(startAndEndSpan(m,x,k,{op:"browser.request",name:g.name,attributes:{[eL.S3]:"auto.ui.browser.metrics"}}),startAndEndSpan(m,E,k,{op:"browser.response",name:g.name,attributes:{[eL.S3]:"auto.ui.browser.metrics"}}))}(m,g,K);break;case"mark":case"paint":case"measure":(function(m,g,v,x,k,E){if(function(m){if(m?.entryType==="measure")try{return"Components ⚛"===m.detail.devtools.track}catch{return}}(g)||["mark","measure"].includes(g.entryType)&&(0,eT.U0)(g.name,E))return;let T=getNavigationEntry(!1),K=msToSec(T?T.requestStart:0),et=k+Math.max(v,K),en=k+v,er=en+x,ei={[eL.S3]:"auto.resource.browser.metrics"};et!==en&&(ei["sentry.browser.measure_happened_before_request"]=!0,ei["sentry.browser.measure_start_time"]=et),function(m,g){try{let v=g.detail;if(!v)return;if("object"==typeof v){for(let[g,x]of Object.entries(v))if(x&&(0,eX.pt)(x))m[`sentry.browser.measure.detail.${g}`]=x;else if(void 0!==x)try{m[`sentry.browser.measure.detail.${g}`]=JSON.stringify(x)}catch{}return}if((0,eX.pt)(v)){m["sentry.browser.measure.detail"]=v;return}try{m["sentry.browser.measure.detail"]=JSON.stringify(v)}catch{}}catch{}}(ei,g),et<=er&&startAndEndSpan(m,et,er,{name:g.name,op:g.entryType,attributes:ei})})(m,g,v,x,K,E);break;case"resource":(function(m,g,v,x,k,E,T){if("xmlhttprequest"===g.initiatorType||"fetch"===g.initiatorType)return;let K=g.initiatorType?`resource.${g.initiatorType}`:"resource.other";if(T?.includes(K))return;let et={[eL.S3]:"auto.resource.browser.metrics"},en=parseUrl(v);
21en.protocol&&(et["url.scheme"]=en.protocol.split(":").pop()),en.host&&(et["server.address"]=en.host),et["url.same_origin"]=v.includes(tu.location.origin),et[tb]=v,function(m,g,v){v.forEach(([v,x])=>{let k=m[v];null!=k&&("number"==typeof k&&k<2147483647||"string"==typeof k)&&(g[x]=k)})}(g,et,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);let er={...et,...resourceTimingToSpanAttributes(g)},ei=E+x,es=ei+k;startAndEndSpan(m,ei,es,{name:v.replace(tu.location.origin,""),op:K,attributes:er})})(m,g,g.name,v,x,K,T)}}),t4=Math.max(et.length-1,0),function(m,g){let v=tu.navigator;if(!v)return;let x=v.connection;x&&(x.effectiveType&&m.setAttribute(g?"network.connection.effective_type":"effectiveConnectionType",x.effectiveType),x.type&&m.setAttribute(g?"network.connection.type":"connectionType",x.type),isMeasurementValue(x.rtt)&&(g?m.setAttribute("network.connection.rtt",x.rtt):"pageload"===(0,eF.XU)(m).op&&setMeasurement("connection.rtt",x.rtt,"millisecond"))),isMeasurementValue(v.deviceMemory)&&(g?m.setAttribute("device.memory.estimated_capacity",v.deviceMemory):m.setAttribute("deviceMemory",`${v.deviceMemory} GB`)),isMeasurementValue(v.hardwareConcurrency)&&(g?m.setAttribute("device.processor_count",v.hardwareConcurrency):m.setAttribute("hardwareConcurrency",String(v.hardwareConcurrency)))}(m,k)})(g,{ignoreResourceSpans:eg,ignorePerformanceApiSpans:ev,spanStreamingEnabled:hasSpanStreamingEnabled(m)}),(0,eM.xp)(m,nf,void 0);let x=(0,eA.nZ)(),k=x.getPropagationContext();x.setPropagationContext({...k,traceId:ed.spanContext().traceId,sampled:(0,eF.Tt)(ed),dsc:(0,eU.jC)(g)}),K&&(v=void 0)},trimIdleSpanEndTimestamp:!eS});function emitFinish(){k&&["interactive","complete"].includes(k.readyState)&&(m.emit("idleSpanEnableAutoFinish",ed),k.removeEventListener("readystatechange",emitFinish))}K&&eS&&(v=ed),(0,eM.xp)(m,nf,ed),K&&!eS&&k&&(k.addEventListener("readystatechange",emitFinish),emitFinish())}return{name:"BrowserTracing",setup(m){if(!eN){if(function(){tz||(tz=!0,addGlobalErrorInstrumentationHandler(errorCallback),addGlobalUnhandledRejectionInstrumentationHandler(errorCallback));function errorCallback(){let m=(0,eF.HN)(),g=m&&(0,eF.Gx)(m);if(g){let m="internal_error";eR.X&&eE.fF.log(`[Tracing] Root span: ${m} -> Global error occurred`),g.setStatus({code:tB.jt,message:m})}}}(),K&&ek.GLOBAL_OBJ.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?function(){let m=new PerformanceObserver(m=>{let g=(0,eF.HN)();if(g)for(let v of m.getEntries()){if(!v.scripts[0])continue;let m=msToSec((0,eY.Z1)()+v.startTime),{start_timestamp:x,op:k}=(0,eF.XU)(g);if("navigation"===k&&x&&m<x)continue;let E=msToSec(v.duration),T={[eL.S3]:"auto.ui.browser.metrics"},K=v.scripts[0],{invoker:et,invokerType:en,sourceURL:er,sourceFunctionName:ei,sourceCharPosition:es}=K;T["browser.script.invoker"]=et,T["browser.script.invoker_type"]=en,er&&(T["code.filepath"]=er),ei&&(T["code.function"]=ei),-1!==es&&(T["browser.script.source_char_position"]=es),startAndEndSpan(g,m,m+E,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:T})}});m.observe({type:"long-animation-frame",buffered:!0})}():T&&addPerformanceInstrumentationHandler("longtask",({entries:m})=>{let g=(0,eF.HN)();if(!g)return;let{op:v,start_timestamp:x}=(0,eF.XU)(g);for(let k of m){let m=msToSec((0,eY.Z1)()+k.startTime),E=msToSec(k.duration);"navigation"===v&&x&&m<x||startAndEndSpan(g,m,m+E,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[eL.S3]:"auto.ui.browser.metrics"}})}}),et&&addPerformanceInstrumentationHandler("event",({entries:m})=>{let g=(0,eF.HN)();if(g){for(let v of m)if("click"===v.name){let m=msToSec((0,eY.Z1)()+v.startTime),x=msToSec(v.duration),k={name:htmlTreeAsString_htmlTreeAsString(v.target),op:`ui.interaction.${v.name}`,startTime:m,attributes:{[eL.S3]:"auto.ui.browser.metrics"}},E=getComponentName(v.target);E&&(k.attributes["ui.component_name"]=E),startAndEndSpan(g,m,m+x,k)}}}),ex&&k){let interactionHandler=()=>{g=(0,eY.ph)()};addEventListener("click",interactionHandler,{capture:!0}),addEventListener("keydown",interactionHandler,{capture:!0,passive:!0})}m.on("startNavigationSpan",(v,x)=>{if((0,eA.s3)()!==m)return;if(x?.isRedirect){_createRouteSpan(m,{op:"navigation.redirect",...v},!1,x.url);return}g=void 0,maybeEndActiveSpan(),(0,eA.aF)().setPropagationContext({traceId:(0,tF.H)(),sampleRand:Math.random(),propagationSpanId:(0,tM.f)()?void 0:(0,tF.M)()});let k=(0,eA.nZ)();k.setPropagationContext({traceId:(0,tF.H)(),sampleRand:Math.random(),propagationSpanId:(0,tM.f)()?void 0:(0,tF.M)()}),k.setSDKProcessingMetadata({normalizedRequest:void 0}),_createRouteSpan(m,{op:"navigation",...v,parentSpan:null,forceTransaction:!0},!0,x?.url)}),m.on("startPageLoadSpan",(g,v={})=>
21{if((0,eA.s3)()!==m)return;maybeEndActiveSpan();let x=v.sentryTrace||getMetaContent("sentry-trace")||getServerTiming("sentry-trace"),k=v.baggage||getMetaContent("baggage")||getServerTiming("baggage"),E=(0,tV.pT)(x,k),T=(0,eA.nZ)();T.setPropagationContext(E),(0,tM.f)()||(T.getPropagationContext().propagationSpanId=(0,tF.M)()),T.setSDKProcessingMetadata({normalizedRequest:getHttpRequestData()}),_createRouteSpan(m,{op:"pageload",...g})}),m.on("endPageloadSpan",()=>{eS&&v&&(v.setAttribute(eL.ju,"reportPageLoaded"),v.end())})}function maybeEndActiveSpan(){let g=m[nf];g&&!(0,eF.XU)(g).timestamp&&(g.setAttribute(eL.ju,"cancelled"),g.end())}},afterAllSetup(m){if(eN)return;m.addIntegration&&!m.getIntegrationByName?.(na)&&m.addIntegration(webVitalsIntegration({ignore:E?[]:["inp"],_experiments:{enableStandaloneClsSpans:en,enableStandaloneLcpSpans:er}}));let v=getLocationHref();if("off"!==e_&&function(m,{linkPreviousTrace:g,consistentTraceSampling:v}){let x="session-storage"===g,k=x?function(){try{let m=tt.sessionStorage?.getItem(ns);return JSON.parse(m)}catch{return}}():void 0;m.on("spanStart",m=>{if((0,eF.Gx)(m)!==m)return;let g=(0,eA.nZ)().getPropagationContext();k=function(m,g,v){let x=(0,eF.XU)(g),k={spanContext:g.spanContext(),startTimestamp:x.start_timestamp,sampleRate:function(){try{let m=Number(x.data?.[eL.TE]??v.dsc?.sample_rate);return Number.isNaN(m)?0:m}catch{return 0}}(),sampleRand:v.sampleRand};if(!m)return k;let E=m.spanContext;return E.traceId===x.trace_id?m:(Date.now()/1e3-m.startTimestamp<=3600&&(g.addLink({context:E,attributes:{[eL.lH]:"previous_trace"}}),g.setAttribute("sentry.previous_trace",`${E.traceId}-${E.spanId}-${spanContextSampled(E)?1:0}`)),k)}(k,m,g),x&&function(m){try{tt.sessionStorage.setItem(ns,JSON.stringify(m))}catch(m){}}(k)});let E=!0;v&&m.on("beforeSampling",m=>{if(!k)return;let g=(0,eA.nZ)(),v=g.getPropagationContext();if(E&&v.parentSpanId){E=!1;return}g.setPropagationContext({...v,dsc:{...v.dsc,sample_rate:String(k.sampleRate),sampled:String(spanContextSampled(k.spanContext))},sampleRand:k.sampleRand}),m.parentSampled=spanContextSampled(k.spanContext),m.parentSampleRate=k.sampleRate,m.spanAttributes={...m.spanAttributes,[eL.iT]:k.sampleRate}})}(m,{linkPreviousTrace:e_,consistentTraceSampling:ew}),tt.location){if(ey){let g=(0,eY.Z1)();startBrowserTracingPageLoadSpan(m,{name:tt.location.pathname,startTime:g?g/1e3:void 0,attributes:{[eL.Zj]:"url",[eL.S3]:"auto.pageload.browser"}})}eb&&addHistoryInstrumentationHandler(({to:x,from:k})=>{if(void 0===k&&v?.indexOf(x)!==-1){v=void 0;return}v=void 0;let E=parseStringToURLObject(x),T=m[nf],K=T&&ex&&function(m,g){let v=(0,eF.XU)(m),x=(0,eY.yW)(),k=v.start_timestamp;return!(x-k>1.5)&&(!g||!(x-g<=1.5))}(T,g);startBrowserTracingNavigationSpan(m,{name:E?.pathname||tt.location.pathname,attributes:{[eL.Zj]:"url",[eL.S3]:"auto.navigation.browser"}},{url:x,isRedirect:K})})}eu&&tt.document&&tt.document.addEventListener("visibilitychange",()=>{let m=(0,eF.HN)();if(!m)return;let g=(0,eF.Gx)(m);if(tt.document.hidden&&g){let{op:m,status:v}=(0,eF.XU)(g);v||g.setStatus({code:tB.jt,message:"cancelled"}),g.setAttribute("sentry.cancellation_reason","document.hidden"),g.end()}}),et&&function(m,g,v,x,k){let E;let T=tt.document;T&&addEventListener("click",()=>{let T=m[nf];if(T){let m=(0,eF.XU)(T).op;if(["navigation","pageload"].includes(m))return}E&&(E.setAttribute(eL.ju,"interactionInterrupted"),E.end(),E=void 0),k.name&&(E=startIdleSpan({name:k.name,op:"ui.action.click",attributes:{[eL.Zj]:k.source||"url"}},{idleTimeout:g,finalTimeout:v,childSpanTimeout:x}))},{capture:!0})}(m,es,el,ec,x),function(m,g){let{traceFetch:v,traceXHR:x,shouldCreateSpanForRequest:k,enableHTTPTimings:E,tracePropagationTargets:T,onRequestSpanStart:K,onRequestSpanEnd:et}={...nd,...g},en="function"==typeof k?k:m=>!0,shouldAttachHeadersWithTargets=m=>(function(m,g){let v=getLocationHref();if(v){let x,k;try{x=new URL(m,v),k=new URL(v).origin}catch{return!1}let E=x.origin===k;return g?(0,eT.U0)(x.toString(),g)||E&&(0,eT.U0)(x.pathname,g):E}{let v=!!m.match(/^\/(?!\/)/);return g?(0,eT.U0)(m,g):v}})(m,T),er={},ei=m.getOptions().propagateTraceparent;v&&addFetchInstrumentationHandler(g=>{let v=function(m,g,v,x,k){if(!m.fetchData)return;let{method:E,url:T}=m.fetchData,K=(0,tM.f)()&&g(T);if(m.endTimestamp){let g=m.fetchData.__span;if(!g)return;let v=x[g];v&&(K&&(function(m,g){if(g.response){(0,tB.Q0)(m,g.response.status);let v=g.response?.headers?.get("content-length");if(v){let g=parseInt(v);g>0&&m.setAttribute("http.response_content_length",g)}}else g.error&&m.setStatus({code:tB.jt,message:"internal_error"});m.end()}(v,m),function(m,g,v){let x="object"==typeof v&&null!==v?v.onRequestSpanEnd:void 0;x?.(m,{headers:g.response?.headers,error:g.error})}(v,m,k)),delete x[g]);return}let{spanOrigin:et="auto.http.browser",propagateTraceparent:en=!1}="object"==typeof k?k:{spanOrigin:k},er=(0,eA.s3)(),ei=!!(0,eF.HN)(),es=ei||!!er&&hasSpanStreamingEnabled(er),el=K&&es?startInactiveSpan(function(m,g,v){if(m.startsWith("data:")){let x=stripDataUrlContent(m);return{name:`${g} ${x}`,attributes:getFetchSpanAttributes(m,void 0,g,v)}}let x=parseStringToURLObject(m),k=x?getSanitizedUrlStringFromUrlObject(x):m;return{name:`${g} ${k}`,attributes:getFetchSpanAttributes(m,x,g,v)}}(T,E,et)):new tL.b,ec=spanIsIgnored(el)&&ei?void 0:el;if(K&&!es&&er?.recordDroppedEvent("no_parent_span","span"),m.fetchData.__span=el.spanContext().spanId,x[el.spanContext().spanId]=el,v(m.fetchData.url)){let g=m.args[0],v={...m.args[1]||{}},x=function(m,g,v,x){let k=(0,nl.u)({span:v,propagateTraceparent:x}),E=k["sentry-trace"],T=k.baggage,K=k.traceparent;if(!E)return;let et=g.headers||((0,eX.gJ)(m)?m.headers:void 0);if(!et)return{"sentry-trace":E,...T&&{baggage:T},...K&&{traceparent:K}};if("undefined"!=typeof Headers&&(0,eX.V9)(et,Headers)){let m=new Headers(et);if(m.get("sentry-trace")||m.set("sentry-trace",E),x&&K&&!m.get("traceparent")&&m.set("traceparent",K),T){let g=m.get("baggage");g?baggageHeaderHasSentryBaggageValues(g)||m.set("baggage",`${g},${T}`):m.set("baggage",T)}return m}if(Array.isArray(et)&&et.every(m=>Array.isArray(m)&&2===m.length&&"string"==typeof m[0])){let m=[...et];m.find(m=>"sentry-trace"===m[0])||m.push(["sentry-trace",E]),x&&K&&!m.find(m=>"traceparent"===m[0])&&m.push(["traceparent",K]);let g=et.find(m=>"baggage"===m[0]&&"string"==typeof m[1]&&baggageHeaderHasSentryBaggageValues(m[1]));return T&&!g&&m.push(["baggage",T]),m}{let m="sentry-trace"in et?et["sentry-trace"]:void 0,g="traceparent"in et?et.traceparent:void 0,v="baggage"in et?et.baggage:void 0,k=v?Array.isArray(v)?[...v]:[v]:[],en=v&&(Array.isArray(v)?v.find(m=>baggageHeaderHasSentryBaggageValues(m)):baggageHeaderHasSentryBaggageValues(v));T&&!en&&k.push(T);let er=Object.assign({},et,{"sentry-trace":m??E,...k.length>0&&{baggage:k.join(",")}});return x&&K&&!g&&(er.traceparent=K),er}}(g,v,(0,tM.f)()&&es?ec:void 0,en);x&&(m.args[1]=v,v.headers=x)}if(er){let g={input:m.args,response:m.response,startTimestamp:m.startTimestamp,endTimestamp:m.endTimestamp};er.emit("beforeOutgoingRequestSpan",el,g)}return el}(g,en,shouldAttachHeadersWithTargets,er,{propagateTraceparent:ei,onRequestSpanEnd:et});if(v){let x=getFullURL(g.fetchData.url),k=x?parseUrl(x).host:void 0,T=x?stripDataUrlContent(x):void 0;v.setAttributes({[tg]:T,[tb]:T,"server.address":k}),E&&addHTTPTimings(v,m),K?.(v,{headers:g.headers})}}),x&&addXhrInstrumentationHandler(g=>{let v=function(m,g,v,x,k,E){let T=m.xhr,K=T?.[td];if(!T||T.__sentry_own_request__||!K)return;let{url:et,method:en}
21=K,er=(0,tM.f)()&&g(et);if(m.endTimestamp){let g=T.__sentry_xhr_span_id__;if(!g)return;let v=x[g];v&&(er&&void 0!==K.status_code&&((0,tB.Q0)(v,K.status_code),v.end(),E?.(v,{headers:createHeadersSafely(parseXhrResponseHeaders(T)),error:m.error})),delete x[g]);return}let ei=getFullURL(et),es=ei?parseUrl(ei):parseUrl(et),el=ei?stripDataUrlContent(ei):void 0,ec=stripDataUrlContent(stripUrlQueryAndFragment(et)),eu=(0,eA.s3)(),ed=!!(0,eF.HN)(),ep=ed||!!eu&&hasSpanStreamingEnabled(eu),em=er&&ep?startInactiveSpan({name:`${en} ${ec}`,attributes:{url:stripDataUrlContent(et),type:"xhr","http.method":en,"http.url":el,[tb]:el,"server.address":es?.host,[eL.S3]:"auto.http.browser",[eL.$J]:"http.client",...es?.search&&{"http.query":es?.search},...es?.hash&&{"http.fragment":es?.hash}}}):new tL.b,ef=spanIsIgnored(em)&&ed?void 0:em;return er&&!ep&&eu?.recordDroppedEvent("no_parent_span","span"),T.__sentry_xhr_span_id__=em.spanContext().spanId,x[T.__sentry_xhr_span_id__]=em,v(et)&&function(m,g,v){let{"sentry-trace":x,baggage:k,traceparent:E}=(0,nl.u)({span:g,propagateTraceparent:v});x&&function(m,g,v,x){let k=m.__sentry_xhr_v3__?.request_headers;if(!k?.["sentry-trace"]&&m.setRequestHeader)try{if(m.setRequestHeader("sentry-trace",g),x&&!k?.traceparent&&m.setRequestHeader("traceparent",x),v){let g=k?.baggage;g&&g.split(",").some(m=>m.trim().startsWith("sentry-"))||m.setRequestHeader("baggage",v)}}catch{}}(m,x,k,E)}(T,(0,tM.f)()&&ep?ef:void 0,k),eu&&eu.emit("beforeOutgoingRequestSpan",em,m),em}(g,en,shouldAttachHeadersWithTargets,er,ei,et);v&&(E&&addHTTPTimings(v,m),K?.(v,{headers:createHeadersSafely(g.xhr.__sentry_xhr_v3__?.request_headers)}))})}(m,{traceFetch:ed,traceXHR:ep,tracePropagationTargets:m.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:ef,enableHTTPTimings:eh,onRequestSpanStart:eC,onRequestSpanEnd:ej}),em&&m.addIntegration(fetchStreamPerformanceIntegration())}}};function startBrowserTracingPageLoadSpan(m,g,v){m.emit("startPageLoadSpan",g,v),(0,eA.nZ)().setTransactionName(g.name);let x=m[nf];return x&&m.emit("afterStartPageLoadSpan",x),x}function startBrowserTracingNavigationSpan(m,g,v){let{url:x,isRedirect:k}=v||{};m.emit("beforeStartNavigationSpan",g,{isRedirect:k,url:x}),m.emit("startNavigationSpan",g,{isRedirect:k,url:x});let E=(0,eA.nZ)();return E.setTransactionName(g.name),x&&!k&&E.setSDKProcessingMetadata({normalizedRequest:{...getHttpRequestData(),url:x}}),m[nf]}function getMetaContent(m){let g=tt.document,v=g?.querySelector(`meta[name=${m}]`);return v?.getAttribute("content")||void 0}function getServerTiming(m){let g=tt.performance?.getEntriesByType?.("navigation")[0],v=g?.serverTiming?.find(g=>g.name===m);return v?.description}let nf="_sentry_idleSpan";function location_getAbsoluteUrl(m){try{let g=new URL(m,tu.location.origin);return g.toString()}catch{return m}}let ng=ek.GLOBAL_OBJ,nv=null,ny=new Map,nb=new Map;function getRouteSpecificity(m){let g=m.split("/").filter(Boolean),v=0;for(let m of g)if(m.startsWith(":")){let g=m.substring(1);g.endsWith("*?")?v+=1e3:g.endsWith("*")?v+=100:v+=10}if(g.length>0){let m=1/g.length;v+=m}return v}function getCompiledRegex(m){if(ny.has(m))return ny.get(m)??null;try{let g=new RegExp(m);return ny.set(m,g),g}catch(m){return null}}function getManifest(){if(!ng?._sentryRouteManifest||"string"!=typeof ng._sentryRouteManifest)return null;let m=ng._sentryRouteManifest;if(nv&&eh===m)return nv;ny.clear(),nb.clear();let g={staticRoutes:[],dynamicRoutes:[],isrRoutes:[]};try{if(g=JSON.parse(m),!Array.isArray(g.staticRoutes)||!Array.isArray(g.dynamicRoutes))return null;return nv=g,eh=m,g}catch{return null}}let maybeParameterizeRoute=m=>{let g=getManifest();if(!g)return;let v=m.length>1&&m.endsWith("/")?m.slice(0,-1):m;if(nb.has(v))return nb.get(v);let{staticRoutes:x,dynamicRoutes:k}=g;if(!Array.isArray(x)||!Array.isArray(k))return;let E=function(m,g,v){let x=[];if(g.some(g=>g.path===m))return x;for(let g of v)if(g.regex){let v=getCompiledRegex(g.regex);v?.test(m)&&x.push(g.path)}if(!m.startsWith("/:")){for(let g of v)if(g.hasOptionalPrefix&&g.regex){let v="/"===m?"/SENTRY_OPTIONAL_PREFIX":`/SENTRY_OPTIONAL_PREFIX${m}`,k=getCompiledRegex(g.regex);k?.test(v)&&x.push(g.path)}}return x}(v,x,k),T=E.sort((m,g)=>getRouteSpecificity(m)-getRouteSpecificity(g))[0];
21return nb.set(v,T),T};var nx=v(93542);function stripTrailingSlash(m){return m.length>1&&m.endsWith("/")?m.slice(0,-1):m}let n_="incomplete-app-router-transaction",nw={current:void 0},nS=ek.GLOBAL_OBJ,nC=ek.GLOBAL_OBJ;function transactionNameifyRouterArgument(m){try{return new URL(m,"http://example.com/").pathname}catch{return"/"}}let nk=new WeakSet;function patchRouter(m,g,v){nk.has(g)||(nk.add(g),["back","forward","push","replace"].forEach(x=>{g?.[x]&&(g[x]=new Proxy(g[x],{apply(g,k,E){let T=n_,K={[eL.$J]:"navigation",[eL.S3]:"auto.navigation.nextjs.app_router_instrumentation",[eL.Zj]:"url"},et=E[0],en=nx.env._sentryBasePath??nC._sentryBasePath,er=en&&"string"==typeof et&&!et.startsWith(en)?`${en}${et}`:et;"push"===x?(T=stripTrailingSlash(transactionNameifyRouterArgument(er)),K["navigation.type"]="router.push"):"replace"===x?(T=stripTrailingSlash(transactionNameifyRouterArgument(er)),K["navigation.type"]="router.replace"):"back"===x?K["navigation.type"]="router.back":"forward"===x&&(K["navigation.type"]="router.forward");let ei=maybeParameterizeRoute(T),es="back"===x||"forward"===x?void 0:location_getAbsoluteUrl(er);return v.current=startBrowserTracingNavigationSpan(m,{name:ei??T,attributes:{...K,[eL.Zj]:ei?"route":"url",...ei&&{[t_]:ei}}},es?{url:es}:void 0),g.apply(k,E)}}))}))}var nE=v(5632);let nj=nE.events?nE:nE.default,nN=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function resolve(...m){let g="",v=!1;for(let x=m.length-1;x>=-1&&!v;x--){let k=x>=0?m[x]:"/";k&&(g=`${k}/${g}`,v="/"===k.charAt(0))}return g=(function(m,g){let v=0;for(let g=m.length-1;g>=0;g--){let x=m[g];"."===x?m.splice(g,1):".."===x?(m.splice(g,1),v++):v&&(m.splice(g,1),v--)}if(g)for(;v--;v)m.unshift("..");return m})(g.split("/").filter(m=>!!m),!v).join("/"),(v?"/":"")+g||"."}function trim(m){let g=0;for(;g<m.length&&""===m[g];g++);let v=m.length-1;for(;v>=0&&""===m[v];v--);return g>v?[]:m.slice(g,v-g+1)}let rewriteFramesIntegration=(m={})=>{let g=m.root,v=m.prefix||"app:///",x="window"in ek.GLOBAL_OBJ&&!!ek.GLOBAL_OBJ.window,k=m.iteratee||function({isBrowser:m,root:g,prefix:v}){return x=>{if(!x.filename)return x;let k=/^[a-zA-Z]:\\/.test(x.filename)||x.filename.includes("\\")&&!x.filename.includes("/"),E=/^\//.test(x.filename);if(m){if(g){let m=x.filename;0===m.indexOf(g)&&(x.filename=m.replace(g,v))}}else if(k||E){var T;let m;let E=k?x.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):x.filename,K=g?function(m,g){m=resolve(m).slice(1),g=resolve(g).slice(1);let v=trim(m.split("/")),x=trim(g.split("/")),k=Math.min(v.length,x.length),E=k;for(let m=0;m<k;m++)if(v[m]!==x[m]){E=m;break}let T=[];for(let m=E;m<v.length;m++)T.push("..");return(T=T.concat(x.slice(E))).join("/")}(g,E):(m=function(m){let g=m.length>1024?`<truncated>${m.slice(-1024)}`:m,v=nN.exec(g);return v?v.slice(1):[]}(E)[2]||"",T&&m.slice(-1*T.length)===T&&(m=m.slice(0,m.length-T.length)),m);x.filename=`${v}${K}`}return x}}({isBrowser:x,root:g,prefix:v});return{name:"RewriteFrames",processEvent(m){let g=m;return m.exception&&Array.isArray(m.exception.values)&&(g=function(m){try{return{...m,exception:{...m.exception,values:m.exception.values.map(m=>{var g;return{...m,...m.stacktrace&&{stacktrace:{...g=m.stacktrace,frames:g?.frames?.map(m=>k(m))}}}})}}}catch{return m}}(g)),g}}},nR=/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js(:\d+)*$/,nextjsClientStackFrameNormalizationIntegration=({assetPrefix:m,basePath:g,rewriteFramesAssetPrefixPath:v,experimentalThirdPartyOriginStackFrames:x})=>{let k=rewriteFramesIntegration({iteratee:k=>{if(x){let v="undefined"!=typeof window&&window.location?window.location.origin:"";if(k.filename?.startsWith(v)&&!k.filename.endsWith(".js"))return k;if(m)k.filename?.startsWith(m)&&(k.filename=k.filename.replace(m,"app://"));else if(g)try{let{origin:m}=new URL(k.filename);m===v&&(k.filename=k.filename?.replace(m,"app://").replace(g,""))}catch{}}else try{let{origin:m}=new URL(k.filename);k.filename=k.filename?.replace(m,"app://").replace(v,"")}catch{}return x?k.filename?.includes("/_next")&&(k.filename=decodeURI(k.filename)):k.filename?.startsWith("app:///_next")&&(k.filename=decodeURI(k.filename)),k.filename?.match(nR)&&(k.in_app=!1),k}});return{...k,name:"NextjsClientStackFrameNormalization"}},nI=new class{constructor(m){this._maxSize=m,this._cache=new Map}get size(){return this._cache.size}get(m){let g=this._cache.get(m);
21if(void 0!==g)return this._cache.delete(m),this._cache.set(m,g),g}set(m,g){if(this._cache.size>=this._maxSize){let m=this._cache.keys().next().value;this._cache.delete(m)}this._cache.set(m,g)}remove(m){let g=this._cache.get(m);return g&&this._cache.delete(m),g}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let m=[];return this._cache.forEach(g=>m.push(g)),m}}(100);var nP=v(93542);let nT=!1,nO=ek.GLOBAL_OBJ;function removeTrailingSlash(m){return"/"===m[m.length-1]?m.slice(0,-1):m}let nA=ek.GLOBAL_OBJ,nM="sentryReplaySession",nD="Unable to send Replay";var nL=Object.defineProperty,__defNormalProp=(m,g,v)=>g in m?nL(m,g,{enumerable:!0,configurable:!0,writable:!0,value:v}):m[g]=v,__publicField=(m,g,v)=>__defNormalProp(m,"symbol"!=typeof g?g+"":g,v),nF=((eg=nF||{})[eg.Document=0]="Document",eg[eg.DocumentType=1]="DocumentType",eg[eg.Element=2]="Element",eg[eg.Text=3]="Text",eg[eg.CDATA=4]="CDATA",eg[eg.Comment=5]="Comment",eg);function isShadowRoot(m){let g=m?.host;return g?.shadowRoot===m}function isNativeShadowDom(m){return"[object ShadowRoot]"===Object.prototype.toString.call(m)}function stringifyStylesheet(m){try{var g;let v=m.rules||m.cssRules;return v?((g=Array.from(v,stringifyRule).join("")).includes(" background-clip: text;")&&!g.includes(" -webkit-background-clip: text;")&&(g=g.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),g):null}catch(m){return null}}function stringifyRule(m){let g;if("styleSheet"in m)try{g=stringifyStylesheet(m.styleSheet)||function(m){let{cssText:g}=m;if(g.split('"').length<3)return g;let v=["@import",`url(${JSON.stringify(m.href)})`];return""===m.layerName?v.push("layer"):m.layerName&&v.push(`layer(${m.layerName})`),m.supportsText&&v.push(`supports(${m.supportsText})`),m.media.length&&v.push(m.media.mediaText),v.join(" ")+";"}(m)}catch(m){}else if("selectorText"in m){let g=m.cssText,v=m.selectorText.includes(":"),x="string"==typeof m.style.all&&m.style.all;if(x&&(g=function(m){let g="";for(let v=0;v<m.style.length;v++){let x=m.style,k=x[v],E=x.getPropertyPriority(k);g+=`${k}:${x.getPropertyValue(k)}${E?" !important":""};`}return`${m.selectorText} { ${g} }`}(m)),v&&(g=g.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),v||x)return g}return g||m.cssText}let Mirror=class Mirror{constructor(){__publicField(this,"idNodeMap",new Map),__publicField(this,"nodeMetaMap",new WeakMap)}getId(m){if(!m)return -1;let g=this.getMeta(m)?.id;return g??-1}getNode(m){return this.idNodeMap.get(m)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(m){return this.nodeMetaMap.get(m)||null}removeNodeFromMap(m){let g=this.getId(m);this.idNodeMap.delete(g),m.childNodes&&m.childNodes.forEach(m=>this.removeNodeFromMap(m))}has(m){return this.idNodeMap.has(m)}hasNode(m){return this.nodeMetaMap.has(m)}add(m,g){let v=g.id;this.idNodeMap.set(v,m),this.nodeMetaMap.set(m,g)}replace(m,g){let v=this.getNode(m);if(v){let m=this.nodeMetaMap.get(v);m&&this.nodeMetaMap.set(g,m)}this.idNodeMap.set(m,g)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function shouldMaskInput({maskInputOptions:m,tagName:g,type:v}){return"OPTION"===g&&(g="SELECT"),!!(m[g.toLowerCase()]||v&&m[v]||"password"===v||"INPUT"===g&&!v&&m.text)}function maskInputValue({isMasked:m,element:g,value:v,maskInputFn:x}){let k=v||"";return m?(x&&(k=x(k,g)),"*".repeat(k.length)):k}function toLowerCase(m){return m.toLowerCase()}function toUpperCase(m){return m.toUpperCase()}let nZ="__rrweb_original__";function getInputType(m){let g=m.type;return m.hasAttribute("data-rr-is-password")?"password":g?toLowerCase(g):null}function getInputValue(m,g,v){return"INPUT"===g&&("radio"===v||"checkbox"===v)?m.getAttribute("value")||"":m.value}function extractFileExtension(m,g){let v;try{v=new URL(m,g??window.location.href)}catch(m){return null}let x=v.pathname.match(/\.([0-9a-z]+)(?:$)/i);return x?.[1]??null}let nB={};function getImplementation$1(m){let g=nB[m];if(g)return g;let v=window.document,x=window[m];if(v&&"function"==typeof v.createElement)try{let g=v.createElement("iframe");g.hidden=!0,v.head.appendChild(g);let k=g.contentWindow;k&&k[m]&&(x=k[m]),v.head.removeChild(g)}catch(m){}return nB[m]=x.bind(window)}function setTimeout$1(...m){return getImplementation$1("setTimeout")(...m)}function clearTimeout$1(...m){return getImplementation$1("clearTimeout")(...m)}function getIFrameContentDocument$1(m){try{return m.contentDocument}catch{}}let n$=1,nU=RegExp("[^a-z0-9-_:]");function genId(){return n$++}let nz=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,nV=/^(?:[a-z+]+:)?\/\//i,nq=/^www\..*/i,nH=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(m,g){return(m||"").replace(nz,(m,v,x,k,E,T)=>{let K=x||E||T,et=v||k||"";if(!K)return m;if(nV.test(K)||nq.test(K)||nH.test(K))return`url(${et}${K}${et})`;if("/"===K[0])return`url(${et}${(g.indexOf("//")>-1?g.split("/").slice(0,3).join("/"):g.split("/")[0]).split("?")[0]+K}${et})`;let en=g.split("/"),er=K.split("/");for(let m of(en.pop(),er))"."!==m&&(".."===m?en.pop():en.push(m));return`url(${et}${en.join("/")}${et})`})}let nW=/^[^ \t\n\r\u000c]+/,nK=/^[, \t\n\r\u000c]+/,nG=new WeakMap;function absoluteToDoc(m,g){return g&&""!==g.trim()?getHref(m,g):g}function getHref(m,g){let v=nG.get(m);
21if(v||(v=m.createElement("a"),nG.set(m,v)),g){if(g.startsWith("blob:")||g.startsWith("data:"))return g}else g="";return v.setAttribute("href",g),v.href}function transformAttribute(m,g,v,x,k,E,T){if(!x)return x;if("src"===v||"href"===v&&!("use"===g&&"#"===x[0])||"xlink:href"===v&&"#"!==x[0]||"background"===v&&("table"===g||"td"===g||"th"===g))return absoluteToDoc(m,x);if("srcset"===v)return function(m,g){if(""===g.trim())return g;let v=0;function collectCharacters(m){let x;let k=m.exec(g.substring(v));return k?(x=k[0],v+=x.length,x):""}let x=[];for(;collectCharacters(nK),!(v>=g.length);){let k=collectCharacters(nW);if(","===k.slice(-1))k=absoluteToDoc(m,k.substring(0,k.length-1)),x.push(k);else{let E="";k=absoluteToDoc(m,k);let T=!1;for(;;){let m=g.charAt(v);if(""===m){x.push((k+E).trim());break}if(T)")"===m&&(T=!1);else{if(","===m){v+=1,x.push((k+E).trim());break}"("===m&&(T=!0)}E+=m,v+=1}}}return x.join(", ")}(m,x);if("style"===v){let g=absoluteToStylesheet(x,getHref(m));return T&&T.size>0&&(g=function(m,g){if(!m||0===g.size)return m;try{let v=m.split(";"),x=[];for(let m of v){if(!(m=m.trim()))continue;let v=m.indexOf(":");if(-1===v){x.push(m);continue}let k=m.slice(0,v).trim();g.has(k)||x.push(m)}return x.join("; ")+(x.length>0&&m.endsWith(";")?";":"")}catch(g){return console.warn("Error filtering CSS properties:",g),m}}(g,T)),g}return"object"===g&&"data"===v?absoluteToDoc(m,x):"function"==typeof E?E(v,x,k):x}function ignoreAttribute(m,g,v){return("video"===m||"audio"===m)&&"autoplay"===g}function distanceToMatch(m,g,v=1/0,x=0){return!m||m.nodeType!==m.ELEMENT_NODE||x>v?-1:g(m)?x:distanceToMatch(m.parentNode,g,v,x+1)}function createMatchPredicate(m,g){return v=>{if(null===v)return!1;try{if(m){if("string"==typeof m){if(v.matches(`.${m}`))return!0}else if(function(m,g){for(let v=m.classList.length;v--;){let x=m.classList[v];if(g.test(x))return!0}return!1}(v,m))return!0}if(g&&v.matches(g))return!0;return!1}catch{return!1}}}function needMaskingText(m,g,v,x,k,E){try{let T=m.nodeType===m.ELEMENT_NODE?m:m.parentElement;if(null===T)return!1;if("INPUT"===T.tagName){let m=T.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(m))return!0}let K=-1,et=-1;if(E){if((et=distanceToMatch(T,createMatchPredicate(x,k)))<0)return!0;K=distanceToMatch(T,createMatchPredicate(g,v),et>=0?et:1/0)}else{if((K=distanceToMatch(T,createMatchPredicate(g,v)))<0)return!1;et=distanceToMatch(T,createMatchPredicate(x,k),K>=0?K:1/0)}return K>=0?!(et>=0)||K<=et:!(et>=0)&&!!E}catch(m){}return!!E}function lowerIfExists(m){return null==m?"":m.toLowerCase()}function serializeNodeWithId(m,g){let v;let{doc:x,mirror:k,blockClass:E,blockSelector:T,unblockSelector:K,maskAllText:et,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,skipChild:el=!1,inlineStylesheet:ed=!0,maskInputOptions:ep={},maskAttributeFn:em,maskTextFn:ef,maskInputFn:eh,slimDOMOptions:eg,dataURLOptions:ev={},inlineImages:ey=!1,recordCanvas:eb=!1,onSerialize:ex,onIframeLoad:e_,iframeLoadTimeout:ew=5e3,onBlockedImageLoad:eS,onStylesheetLoad:eC,stylesheetLoadTimeout:ek=5e3,keepIframeSrcFn:eE=()=>!1,newlyAddedElement:ej=!1,ignoreCSSAttributes:eN}=g,{preserveWhiteSpace:eR=!0}=g,eI=function(m,g){let{doc:v,mirror:x,blockClass:k,blockSelector:E,unblockSelector:T,maskAllText:K,maskAttributeFn:et,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,inlineStylesheet:el,maskInputOptions:ed={},maskTextFn:ep,maskInputFn:em,dataURLOptions:ef={},inlineImages:eh,recordCanvas:eg,keepIframeSrcFn:ev,newlyAddedElement:ey=!1,ignoreCSSAttributes:eb}=g,ex=function(m,g){if(!g.hasNode(m))return;let v=g.getId(m);return 1===v?void 0:v}(v,x);switch(m.nodeType){case m.DOCUMENT_NODE:if("CSS1Compat"!==m.compatMode)return{type:nF.Document,childNodes:[],compatMode:m.compatMode};return{type:nF.Document,childNodes:[]};case m.DOCUMENT_TYPE_NODE:return{type:nF.DocumentType,name:m.name,publicId:m.publicId,systemId:m.systemId,rootId:ex};case m.ELEMENT_NODE:return function(m,g){let v;let{doc:x,blockClass:k,blockSelector:E,unblockSelector:T,inlineStylesheet:K,maskInputOptions:et={},maskAttributeFn:en,maskInputFn:er,dataURLOptions:ei={},inlineImages:es,recordCanvas:el,keepIframeSrcFn:ed,newlyAddedElement:ep=!1,rootId:em,maskTextClass:ef,unmaskTextClass:eh,maskTextSelector:eg,unmaskTextSelector:ev,ignoreCSSAttributes:ey}=g,eb=function(m,g,v,x){try{if(x&&m.matches(x))return!1;if("string"==typeof g){if(m.classList.contains(g))return!0}else for(let v=m.classList.length;v--;){let x=m.classList[v];if(g.test(x))return!0}if(v)return m.matches(v)}catch(m){}return!1}(m,k,E,T),ex=function(m){if(m instanceof HTMLFormElement)return"form";let g=toLowerCase(m.tagName);return nU.test(g)?"div":g}(m),e_={},ew=m.attributes.length;for(let g=0;g<ew;g++){let v=m.attributes[g];v.name&&!ignoreAttribute(ex,v.name,v.value)&&(e_[v.name]=transformAttribute(x,ex,toLowerCase(v.name),v.value,m,en,ey))}if("link"===ex&&K){let g=Array.from(x.styleSheets).find(g=>g.href===m.href),v=null;g&&(v=stringifyStylesheet(g)),v&&(e_.rel=null,e_.href=null,e_.crossorigin=null,e_._cssText=absoluteToStylesheet(v,g.href))}if("style"===ex&&m.sheet&&!(m.innerText||m.textContent||"").trim().length){let g=stringifyStylesheet(m.sheet);g&&(e_._cssText=absoluteToStylesheet(g,getHref(x)))}if("input"===ex||"textarea"===ex||"select"===ex||"option"===ex){let g=getInputType(m),v=getInputValue(m,toUpperCase(ex),g),x=m.checked;if("submit"!==g&&"button"!==g&&v){let x=needMaskingText(m,ef,eg,eh,ev,shouldMaskInput({type:g,tagName:toUpperCase(ex),maskInputOptions:et}));e_.value=maskInputValue({isMasked:x,element:m,value:v,maskInputFn:er})}x&&(e_.checked=x)}if("option"===ex&&(m.selected&&!et.select?e_.selected=!0:delete e_.selected),"canvas"===ex&&el){if("2d"===m.__context)!function(m){let g=m.getContext("2d");if(!g)return!0;for(let v=0;v<m.width;v+=50)for(let x=0;x<m.height;x+=50){let k=g.getImageData,E=nZ in k?k[nZ]:k,T=new Uint32Array(E.call(g,v,x,Math.min(50,m.width-v),Math.min(50,m.height-x)).data.buffer);if(T.some(m=>0!==m))return!1}return!0}(m)&&(e_.rr_dataURL=m.toDataURL(ei.type,ei.quality));else if(!("__context"in m)){let g=m.toDataURL(ei.type,ei.quality),v=x.createElement("canvas");v.width=m.width,v.height=m.height;let k=v.toDataURL(ei.type,ei.quality);g!==k&&(e_.rr_dataURL=g)}}if("img"===ex&&es){ec||(eu=(ec=x.createElement("canvas")).getContext("2d"));let g=m.currentSrc||m.getAttribute("src")||"<unknown-src>",v=m.crossOrigin,recordInlineImage=()=>{m.removeEventListener("load",recordInlineImage);
21try{ec.width=m.naturalWidth,ec.height=m.naturalHeight,eu.drawImage(m,0,0),e_.rr_dataURL=ec.toDataURL(ei.type,ei.quality)}catch(v){if("anonymous"!==m.crossOrigin){m.crossOrigin="anonymous",m.complete&&0!==m.naturalWidth?recordInlineImage():m.addEventListener("load",recordInlineImage);return}console.warn(`Cannot inline img src=${g}! Error: ${v}`)}"anonymous"===m.crossOrigin&&(v?e_.crossOrigin=v:m.removeAttribute("crossorigin"))};m.complete&&0!==m.naturalWidth?recordInlineImage():m.addEventListener("load",recordInlineImage)}if(("audio"===ex||"video"===ex)&&(e_.rr_mediaState=m.paused?"paused":"played",e_.rr_mediaCurrentTime=m.currentTime),!ep&&(m.scrollLeft&&(e_.rr_scrollLeft=m.scrollLeft),m.scrollTop&&(e_.rr_scrollTop=m.scrollTop)),eb){let{width:g,height:v}=m.getBoundingClientRect();e_={class:e_.class,rr_width:`${g}px`,rr_height:`${v}px`}}"iframe"!==ex||ed(e_.src)||(eb||getIFrameContentDocument$1(m)||(e_.rr_src=e_.src),delete e_.src);try{customElements.get(ex)&&(v=!0)}catch(m){}return{type:nF.Element,tagName:ex,attributes:e_,childNodes:[],isSVG:!!("svg"===m.tagName||m.ownerSVGElement)||void 0,needBlock:eb,rootId:em,isCustom:v}}(m,{doc:v,blockClass:k,blockSelector:E,unblockSelector:T,inlineStylesheet:el,maskAttributeFn:et,maskInputOptions:ed,maskInputFn:em,dataURLOptions:ef,inlineImages:eh,recordCanvas:eg,keepIframeSrcFn:ev,newlyAddedElement:ey,rootId:ex,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,ignoreCSSAttributes:eb});case m.TEXT_NODE:return function(m,g){let{maskAllText:v,maskTextClass:x,unmaskTextClass:k,maskTextSelector:E,unmaskTextSelector:T,maskTextFn:K,maskInputOptions:et,maskInputFn:en,rootId:er}=g,ei=m.parentNode&&m.parentNode.tagName,es=m.textContent,el="STYLE"===ei||void 0,ec="SCRIPT"===ei||void 0,eu="TEXTAREA"===ei||void 0;if(el&&es){try{m.nextSibling||m.previousSibling||m.parentNode.sheet?.cssRules&&(es=stringifyStylesheet(m.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,m)}es=absoluteToStylesheet(es,getHref(g.doc))}ec&&(es="SCRIPT_PLACEHOLDER");let ed=needMaskingText(m,x,E,k,T,v);if(el||ec||eu||!es||!ed||(es=K?K(es,m.parentElement):es.replace(/[\S]/g,"*")),eu&&es&&(et.textarea||ed)&&(es=en?en(es,m.parentNode):es.replace(/[\S]/g,"*")),"OPTION"===ei&&es){let g=shouldMaskInput({type:null,tagName:ei,maskInputOptions:et});es=maskInputValue({isMasked:needMaskingText(m,x,E,k,T,g),element:m,value:es,maskInputFn:en})}return{type:nF.Text,textContent:es||"",isStyle:el,rootId:er}}(m,{doc:v,maskAllText:K,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,maskTextFn:ep,maskInputOptions:ed,maskInputFn:em,rootId:ex});case m.CDATA_SECTION_NODE:return{type:nF.CDATA,textContent:"",rootId:ex};case m.COMMENT_NODE:return{type:nF.Comment,textContent:m.textContent||"",rootId:ex};default:return!1}}(m,{doc:x,mirror:k,blockClass:E,blockSelector:T,maskAllText:et,unblockSelector:K,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,inlineStylesheet:ed,maskInputOptions:ep,maskAttributeFn:em,maskTextFn:ef,maskInputFn:eh,dataURLOptions:ev,inlineImages:ey,recordCanvas:eb,keepIframeSrcFn:eE,newlyAddedElement:ej,ignoreCSSAttributes:eN});if(!eI)return console.warn(m,"not serialized"),null;v=k.hasNode(m)?k.getId(m):!function(m,g){if(g.comment&&m.type===nF.Comment)return!0;if(m.type===nF.Element){if(g.script&&("script"===m.tagName||"link"===m.tagName&&("preload"===m.attributes.rel||"modulepreload"===m.attributes.rel)||"link"===m.tagName&&"prefetch"===m.attributes.rel&&"string"==typeof m.attributes.href&&"js"===extractFileExtension(m.attributes.href))||g.headFavicon&&("link"===m.tagName&&"shortcut icon"===m.attributes.rel||"meta"===m.tagName&&(lowerIfExists(m.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===lowerIfExists(m.attributes.name)||"icon"===lowerIfExists(m.attributes.rel)||"apple-touch-icon"===lowerIfExists(m.attributes.rel)||"shortcut icon"===lowerIfExists(m.attributes.rel))))return!0;if("meta"===m.tagName){if(g.headMetaDescKeywords&&lowerIfExists(m.attributes.name).match(/^description|keywords$/)||g.headMetaSocial&&(lowerIfExists(m.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(m.attributes.name).match(/^(og|twitter):/)||"pinterest"===lowerIfExists(m.attributes.name)))return!0;
21if(g.headMetaRobots&&("robots"===lowerIfExists(m.attributes.name)||"googlebot"===lowerIfExists(m.attributes.name)||"bingbot"===lowerIfExists(m.attributes.name)))return!0;if(g.headMetaHttpEquiv&&void 0!==m.attributes["http-equiv"])return!0;else if(g.headMetaAuthorship&&("author"===lowerIfExists(m.attributes.name)||"generator"===lowerIfExists(m.attributes.name)||"framework"===lowerIfExists(m.attributes.name)||"publisher"===lowerIfExists(m.attributes.name)||"progid"===lowerIfExists(m.attributes.name)||lowerIfExists(m.attributes.property).match(/^article:/)||lowerIfExists(m.attributes.property).match(/^product:/)))return!0;else if(g.headMetaVerification&&("google-site-verification"===lowerIfExists(m.attributes.name)||"yandex-verification"===lowerIfExists(m.attributes.name)||"csrf-token"===lowerIfExists(m.attributes.name)||"p:domain_verify"===lowerIfExists(m.attributes.name)||"verify-v1"===lowerIfExists(m.attributes.name)||"verification"===lowerIfExists(m.attributes.name)||"shopify-checkout-api-token"===lowerIfExists(m.attributes.name)))return!0}}return!1}(eI,eg)&&(eR||eI.type!==nF.Text||eI.isStyle||eI.textContent.trim().length)?genId():-2;let eP=Object.assign(eI,{id:v});if(k.add(m,eP),-2===v)return null;ex&&ex(m);let eT=!el;if(eP.type===nF.Element){eT=eT&&!eP.needBlock;let g=m.shadowRoot;g&&isNativeShadowDom(g)&&(eP.isShadowHost=!0)}if((eP.type===nF.Document||eP.type===nF.Element)&&eT){eg.headWhitespace&&eP.type===nF.Element&&"head"===eP.tagName&&(eR=!1);let g={doc:x,mirror:k,blockClass:E,blockSelector:T,maskAllText:et,unblockSelector:K,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,skipChild:el,inlineStylesheet:ed,maskInputOptions:ep,maskAttributeFn:em,maskTextFn:ef,maskInputFn:eh,slimDOMOptions:eg,dataURLOptions:ev,inlineImages:ey,recordCanvas:eb,preserveWhiteSpace:eR,onSerialize:ex,onIframeLoad:e_,iframeLoadTimeout:ew,onBlockedImageLoad:eS,onStylesheetLoad:eC,stylesheetLoadTimeout:ek,keepIframeSrcFn:eE,ignoreCSSAttributes:eN},v=m.childNodes?Array.from(m.childNodes):[];for(let m of v){let v=serializeNodeWithId(m,g);v&&eP.childNodes.push(v)}if(m.nodeType===m.ELEMENT_NODE&&m.shadowRoot)for(let v of Array.from(m.shadowRoot.childNodes)){let x=serializeNodeWithId(v,g);x&&(isNativeShadowDom(m.shadowRoot)&&(x.isShadow=!0),eP.childNodes.push(x))}}if(m.parentNode&&isShadowRoot(m.parentNode)&&isNativeShadowDom(m.parentNode)&&(eP.isShadow=!0),eP.type!==nF.Element||"iframe"!==eP.tagName||eP.needBlock||function(m,g,v){let x;let k=function(m){try{return m.contentWindow}catch{}}(m);if(!k)return;let E=!1;try{x=k.document.readyState}catch(m){return}if("complete"!==x){let x=setTimeout$1(()=>{E||(g(),E=!0)},v);m.addEventListener("load",()=>{clearTimeout$1(x),E=!0,g()});return}let T="about:blank";if(k.location.href!==T||m.src===T||""===m.src)return setTimeout$1(g,0),m.addEventListener("load",g);m.addEventListener("load",g)}(m,()=>{let g=getIFrameContentDocument$1(m);if(g&&e_){let v=serializeNodeWithId(g,{doc:g,mirror:k,blockClass:E,blockSelector:T,unblockSelector:K,maskAllText:et,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,skipChild:!1,inlineStylesheet:ed,maskInputOptions:ep,maskAttributeFn:em,maskTextFn:ef,maskInputFn:eh,slimDOMOptions:eg,dataURLOptions:ev,inlineImages:ey,recordCanvas:eb,preserveWhiteSpace:eR,onSerialize:ex,onIframeLoad:e_,iframeLoadTimeout:ew,onStylesheetLoad:eC,stylesheetLoadTimeout:ek,keepIframeSrcFn:eE,ignoreCSSAttributes:eN});v&&e_(m,v)}},ew),eP.type===nF.Element&&"img"===eP.tagName&&!m.complete&&eP.needBlock){let updateImageDimensions=()=>{if(m.isConnected&&!m.complete&&eS)try{let g=m.getBoundingClientRect();g.width>0&&g.height>0&&eS(m,eP,g)}catch(m){}m.removeEventListener("load",updateImageDimensions)};m.isConnected&&m.addEventListener("load",updateImageDimensions)}return eP.type===nF.Element&&"link"===eP.tagName&&"string"==typeof eP.attributes.rel&&("stylesheet"===eP.attributes.rel||"preload"===eP.attributes.rel&&"string"==typeof eP.attributes.href&&"css"===extractFileExtension(eP.attributes.href))&&function(m,g,v){let x,k=!1;try{x=m.sheet}catch(m){x=null}if(x)return;let E=setTimeout$1(()=>{k||(g(),k=!0)},v);m.addEventListener("load",()=>{clearTimeout$1(E),k=!0,g()})}(m,()=>{if(eC){let g=serializeNodeWithId(m,{doc:x,mirror:k,blockClass:E,blockSelector:T,unblockSelector:K,maskAllText:et,maskTextClass:en,unmaskTextClass:er,maskTextSelector:ei,unmaskTextSelector:es,skipChild:!1,inlineStylesheet:ed,maskInputOptions:ep,maskAttributeFn:em,maskTextFn:ef,maskInputFn:eh,slimDOMOptions:eg,dataURLOptions:ev,inlineImages:ey,recordCanvas:eb,preserveWhiteSpace:eR,onSerialize:ex,onIframeLoad:e_,iframeLoadTimeout:ew,onStylesheetLoad:eC,stylesheetLoadTimeout:ek,
21keepIframeSrcFn:eE,ignoreCSSAttributes:eN});g&&eC(m,g)}},ek),eP.type===nF.Element&&delete eP.needBlock,eP}function esm_on(m,g,v=document){let x={capture:!0,passive:!0};return v.addEventListener(m,g,x),()=>v.removeEventListener(m,g,x)}let nQ="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",nY={map:{},getId:()=>(console.error(nQ),-1),getNode:()=>(console.error(nQ),null),removeNodeFromMap(){console.error(nQ)},has:()=>(console.error(nQ),!1),reset(){console.error(nQ)}};function throttle$1(m,g,v={}){let x=null,k=0;return function(...E){let T=Date.now();k||!1!==v.leading||(k=T);let K=g-(T-k),et=this;K<=0||K>g?(x&&(function(...m){getImplementation("clearTimeout")(...m)}(x),x=null),k=T,m.apply(et,E)):x||!1===v.trailing||(x=setTimeout$2(()=>{k=!1===v.leading?0:Date.now(),x=null,m.apply(et,E)},K))}}function patch(m,g,v){try{if(!(g in m))return()=>{};let x=m[g],k=v(x);return"function"==typeof k&&(k.prototype=k.prototype||{},Object.defineProperties(k,{__rrweb_original__:{enumerable:!1,value:x}})),m[g]=k,()=>{m[g]=x}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(nY=new Proxy(nY,{get:(m,g,v)=>("map"===g&&console.error(nQ),Reflect.get(m,g,v))}));let nX=Date.now;function getWindowScroll(m){let g=m.document;return{left:g.scrollingElement?g.scrollingElement.scrollLeft:void 0!==m.pageXOffset?m.pageXOffset:g?.documentElement.scrollLeft||g?.body?.parentElement?.scrollLeft||g?.body?.scrollLeft||0,top:g.scrollingElement?g.scrollingElement.scrollTop:void 0!==m.pageYOffset?m.pageYOffset:g?.documentElement.scrollTop||g?.body?.parentElement?.scrollTop||g?.body?.scrollTop||0}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function closestElementOfNode$1(m){if(!m)return null;try{let g=m.nodeType===m.ELEMENT_NODE?m:m.parentElement;return g}catch(m){return null}}function isBlocked(m,g,v,x,k){if(!m)return!1;let E=closestElementOfNode$1(m);if(!E)return!1;let T=createMatchPredicate(g,v);if(!k){let m=x&&E.matches(x);return T(E)&&!m}let K=distanceToMatch(E,T),et=-1;return!(K<0)&&(x&&(et=distanceToMatch(E,createMatchPredicate(null,x))),K>-1&&et<0||K<et)}function isIgnored(m,g){return -2===g.getId(m)}function legacy_isTouchEvent(m){return!!m.changedTouches}function isSerializedIframe(m,g){return!!("IFRAME"===m.nodeName&&g.getMeta(m))}function isSerializedStylesheet(m,g){return!!("LINK"===m.nodeName&&m.nodeType===m.ELEMENT_NODE&&m.getAttribute&&"stylesheet"===m.getAttribute("rel")&&g.getMeta(m))}function hasShadowRoot(m){return!!m?.shadowRoot}/[1-9][0-9]{12}/.test(Date.now().toString())||(nX=()=>new Date().getTime());let StyleSheetMirror=class StyleSheetMirror{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(m){return this.styleIDMap.get(m)??-1}has(m){return this.styleIDMap.has(m)}add(m,g){let v;return this.has(m)?this.getId(m):(v=void 0===g?this.id++:g,this.styleIDMap.set(m,v),this.idStyleMap.set(v,m),v)}getStyle(m){return this.idStyleMap.get(m)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function getShadowHost(m){let g=null;return m.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&m.getRootNode().host&&(g=m.getRootNode().host),g}function inDom(m){let g=m.ownerDocument;return!!g&&(g.contains(m)||function(m){let g=m.ownerDocument;if(!g)return!1;let v=function(m){let g,v=m;for(;g=getShadowHost(v);)v=g;return v}(m);return g.contains(v)}(m))}let nJ={};function getImplementation(m){let g=nJ[m];if(g)return g;let v=window.document,x=window[m];if(v&&"function"==typeof v.createElement)try{let g=v.createElement("iframe");g.hidden=!0,v.head.appendChild(g);let k=g.contentWindow;k&&k[m]&&(x=k[m]),v.head.removeChild(g)}catch(m){}return nJ[m]=x.bind(window)}function setTimeout$2(...m){return getImplementation("setTimeout")(...m)}var n0=((ev=n0||{})[ev.DomContentLoaded=0]="DomContentLoaded",ev[ev.Load=1]="Load",ev[ev.FullSnapshot=2]="FullSnapshot",ev[ev.IncrementalSnapshot=3]="IncrementalSnapshot",ev[ev.Meta=4]="Meta",ev[ev.Custom=5]="Custom",ev[ev.Plugin=6]="Plugin",ev),n1=((ey=n1||{})[ey.Mutation=0]="Mutation",ey[ey.MouseMove=1]="MouseMove",ey[ey.MouseInteraction=2]="MouseInteraction",ey[ey.Scroll=3]="Scroll",ey[ey.ViewportResize=4]="ViewportResize",ey[ey.Input=5]="Input",ey[ey.TouchMove=6]="TouchMove",ey[ey.MediaInteraction=7]="MediaInteraction",ey[ey.StyleSheetRule=8]="StyleSheetRule",ey[ey.CanvasMutation=9]="CanvasMutation",ey[ey.Font=10]="Font",ey[ey.Log=11]="Log",ey[ey.Drag=12]="Drag",ey[ey.StyleDeclaration=13]="StyleDeclaration",ey[ey.Selection=14]="Selection",ey[ey.AdoptedStyleSheet=15]="AdoptedStyleSheet",ey[ey.CustomElement=16]="CustomElement",ey),n2=((eb=n2||{})[eb.MouseUp=0]="MouseUp",eb[eb.MouseDown=1]="MouseDown",eb[eb.Click=2]="Click",eb[eb.ContextMenu=3]="ContextMenu",eb[eb.DblClick=4]="DblClick",eb[eb.Focus=5]="Focus",eb[eb.Blur=6]="Blur",eb[eb.TouchStart=7]="TouchStart",eb[eb.TouchMove_Departed=8]="TouchMove_Departed",eb[eb.TouchEnd=9]="TouchEnd",eb[eb.TouchCancel=10]="TouchCancel",eb),n3=((ex=n3||{})[ex.Mouse=0]="Mouse",ex[ex.Pen=1]="Pen",ex[ex.Touch=2]="Touch",ex),n5=((e_=n5||{})[e_.Play=0]="Play",e_[e_.Pause=1]="Pause",e_[e_.Seeked=2]="Seeked",e_[e_.VolumeChange=3]="VolumeChange",e_[e_.RateChange=4]="RateChange",e_);let callbackWrapper=m=>ed?(...g)=>{try{return m(...g)}catch(m){if(ed&&!0===ed(m))return()=>{};throw m}}:m;for(var n4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
21+/",n6="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n7=0;n7<n4.length;n7++)n6[n4.charCodeAt(n7)]=n7;let CanvasManagerNoop=class CanvasManagerNoop{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function getIFrameContentDocument(m){try{return m.contentDocument}catch(m){}}function getIFrameContentWindow(m){try{return m.contentWindow}catch(m){}}let StyleDeclarationParser=class StyleDeclarationParser{constructor(m){this.doc=m,this.unattachedDoc=null}parse(m){return this.parseWithConstructableStylesheet(m)||this.parseWithDetachedElement(m)}parseWithConstructableStylesheet(m){if("undefined"==typeof CSSStyleSheet||"function"!=typeof CSSStyleSheet.prototype.replaceSync)return null;try{let g=new CSSStyleSheet;g.replaceSync(`x { ${m} }`);let v=g.cssRules[0];if(!v||v.type!==CSSRule.STYLE_RULE)return null;return v.style}catch{return null}}parseWithDetachedElement(m){let g=this.getUnattachedDoc().createElement("span");return g.setAttribute("style",m),g.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};let DoubleLinkedList=class DoubleLinkedList{constructor(){this.length=0,this.head=null,this.tail=null}get(m){if(m>=this.length)throw Error("Position outside of list range");let g=this.head;for(let v=0;v<m;v++)g=g?.next||null;return g}addNode(m){let g={value:m,previous:null,next:null};if(m.__ln=g,m.previousSibling&&"__ln"in m.previousSibling){let v=m.previousSibling.__ln.next;g.next=v,g.previous=m.previousSibling.__ln,m.previousSibling.__ln.next=g,v&&(v.previous=g)}else if(m.nextSibling&&"__ln"in m.nextSibling&&m.nextSibling.__ln.previous){let v=m.nextSibling.__ln.previous;g.previous=v,g.next=m.nextSibling.__ln,m.nextSibling.__ln.previous=g,v&&(v.next=g)}else this.head&&(this.head.previous=g),g.next=this.head,this.head=g;null===g.next&&(this.tail=g),this.length++}removeNode(m){let g=m.__ln;this.head&&(g.previous?(g.previous.next=g.next,g.next?g.next.previous=g.previous:this.tail=g.previous):(this.head=g.next,this.head?this.head.previous=null:this.tail=null),m.__ln&&delete m.__ln,this.length--)}};let moveKey=(m,g)=>`${m}@${g}`;let MutationBuffer=class MutationBuffer{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=m=>{m.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let m=[],g=new Set,v=new DoubleLinkedList,getNextId=m=>{let g=m,v=-2;for(;-2===v;)v=(g=g&&g.nextSibling)&&this.mirror.getId(g);return v},pushAdd=x=>{if(!x.parentNode||!inDom(x))return;let k=isShadowRoot(x.parentNode)?this.mirror.getId(getShadowHost(x)):this.mirror.getId(x.parentNode),E=getNextId(x);if(-1===k||-1===E)return v.addNode(x);let T=serializeNodeWithId(x,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{isSerializedIframe(m,this.mirror)&&!isBlocked(m,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(m),isSerializedStylesheet(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),hasShadowRoot(x)&&this.shadowDomManager.addShadowRoot(x.shadowRoot,this.doc)},onIframeLoad:(m,g)=>{if(isBlocked(m,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(m,g);let v=getIFrameContentWindow(m);v&&this.canvasManager.addWindow(v),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,g)=>{this.stylesheetManager.attachLinkElement(m,g)},onBlockedImageLoad:(m,g,{width:v,height:x})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:g.id,attributes:{style:{width:`${v}px`,height:`${x}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});T&&(m.push({parentId:k,nextId:E,node:T}),g.add(T.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let m of this.movedSet)(!isParentRemoved(this.removes,m,this.mirror)||this.movedSet.has(m.parentNode))&&pushAdd(m);for(let m of this.addedSet)isAncestorInSet(this.droppedSet,m)||isParentRemoved(this.removes,m,this.mirror)?isAncestorInSet(this.movedSet,m)?pushAdd(m):this.droppedSet.add(m):pushAdd(m);let x=null;for(;v.length;){let m=null;if(x){let g=this.mirror.getId(x.value.parentNode),v=getNextId(x.value);-1!==g&&-1!==v&&(m=x)}if(!m){let g=v.tail;for(;g;){let v=g;if(g=g.previous,v){let g=this.mirror.getId(v.value.parentNode),x=getNextId(v.value);if(-1===x)continue;if(-1!==g){m=v;break}{let g=v.value;if(g.parentNode&&g.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let x=g.parentNode.host,k=this.mirror.getId(x);if(-1!==k){m=v;break}}}}}}if(!m){for(;v.head;)v.removeNode(v.head.value);break}x=m.previous,v.removeNode(m.value),pushAdd(m.value)}let k={texts:this.texts.map(m=>({id:this.mirror.getId(m.node),value:m.value})).filter(m=>!g.has(m.id)).filter(m=>this.mirror.has(m.id)),attributes:this.attributes.map(m=>{let{attributes:g}=m;if("string"==typeof g.style){let v=JSON.stringify(m.styleDiff),x=JSON.stringify(m._unchangedStyles);v.length<g.style.length&&(v+x).split("var(").length===g.style.split("var(").length&&(g.style=m.styleDiff)}return{id:this.mirror.getId(m.node),attributes:g}}).filter(m=>!g.has(m.id)).filter(m=>this.mirror.has(m.id)),removes:this.removes,adds:m};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(k))},this.processMutation=m=>{if(!isIgnored(m.target,this.mirror))switch(m.type){case"characterData":{let g=m.target.textContent;isBlocked(m.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||g===m.oldValue||this.texts.push({value:needMaskingText(m.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&g?this.maskTextFn?this.maskTextFn(g,closestElementOfNode$1(m.target)):g.replace(/[\S]/g,"*"):g,node:m.target});break}case"attributes":{let g=m.target,v=m.attributeName,x=m.target.getAttribute(v);
21if("value"===v){let v=getInputType(g),k=g.tagName;x=getInputValue(g,k,v);let E=shouldMaskInput({maskInputOptions:this.maskInputOptions,tagName:k,type:v}),T=needMaskingText(m.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,E);x=maskInputValue({isMasked:T,element:g,value:x,maskInputFn:this.maskInputFn})}if(isBlocked(m.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||x===m.oldValue)return;let k=this.attributeMap.get(m.target);if("IFRAME"===g.tagName&&"src"===v&&!this.keepIframeSrcFn(x)){let m=getIFrameContentDocument(g);if(m)return;v="rr_src"}if(k||(k={node:m.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(k),this.attributeMap.set(m.target,k)),"type"===v&&"INPUT"===g.tagName&&"password"===(m.oldValue||"").toLowerCase()&&g.setAttribute("data-rr-is-password","true"),!ignoreAttribute(g.tagName,v)&&(k.attributes[v]=transformAttribute(this.doc,toLowerCase(g.tagName),toLowerCase(v),x,g,this.maskAttributeFn),"style"===v)){let v=m.oldValue?this.styleDeclarationParser.parse(m.oldValue):null;for(let m of Array.from(g.style)){let x=g.style.getPropertyValue(m),E=g.style.getPropertyPriority(m);x!==(v?.getPropertyValue(m)||"")||E!==(v?.getPropertyPriority(m)||"")?""===E?k.styleDiff[m]=x:k.styleDiff[m]=[x,E]:k._unchangedStyles[m]=[x,E]}if(v)for(let m of Array.from(v))""===g.style.getPropertyValue(m)&&(k.styleDiff[m]=!1)}break}case"childList":if(isBlocked(m.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;m.addedNodes.forEach(g=>this.genAdds(g,m.target)),m.removedNodes.forEach(g=>{let v=this.mirror.getId(g),x=isShadowRoot(m.target)?this.mirror.getId(m.target.host):this.mirror.getId(m.target);isBlocked(m.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||isIgnored(g,this.mirror)||-1===this.mirror.getId(g)||(this.addedSet.has(g)?(deepDelete(this.addedSet,g),this.droppedSet.add(g)):this.addedSet.has(m.target)&&-1===v||function isAncestorRemoved(m,g){if(isShadowRoot(m))return!1;let v=g.getId(m);return!g.has(v)||(!m.parentNode||m.parentNode.nodeType!==m.DOCUMENT_NODE)&&(!m.parentNode||isAncestorRemoved(m.parentNode,g))}(m.target,this.mirror)||(this.movedSet.has(g)&&this.movedMap[moveKey(v,x)]?deepDelete(this.movedSet,g):this.removes.push({parentId:x,id:v,isShadow:!!(isShadowRoot(m.target)&&isNativeShadowDom(m.target))||void 0})),this.mapRemoves.push(g))})}},this.genAdds=(m,g)=>{if(!this.processedNodeManager.inOtherBuffer(m,this)&&!(this.addedSet.has(m)||this.movedSet.has(m))){if(this.mirror.hasNode(m)){if(isIgnored(m,this.mirror))return;this.movedSet.add(m);let v=null;g&&this.mirror.hasNode(g)&&(v=this.mirror.getId(g)),v&&-1!==v&&(this.movedMap[moveKey(this.mirror.getId(m),v)]=!0)}else this.addedSet.add(m),this.droppedSet.delete(m);!isBlocked(m,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&(m.childNodes&&m.childNodes.forEach(m=>this.genAdds(m)),hasShadowRoot(m)&&m.shadowRoot.childNodes.forEach(g=>{this.processedNodeManager.add(g,this),this.genAdds(g,m)}))}}}init(m){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(g=>{this[g]=m[g]}),this.styleDeclarationParser=new StyleDeclarationParser(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function deepDelete(m,g){m.delete(g),g.childNodes?.forEach(g=>deepDelete(m,g))}function isParentRemoved(m,g,v){return 0!==m.length&&function(m,g,v){let x=g.parentNode;for(;x;){let g=v.getId(x);if(m.some(m=>m.id===g))return!0;x=x.parentNode}return!1}(m,g,v)}function isAncestorInSet(m,g){return 0!==m.size&&function _isAncestorInSet(m,g){let{parentNode:v}=g;return!!v&&(!!m.has(v)||_isAncestorInSet(m,v))}(m,g)}let n8=[];function esm_getEventTarget(m){try{if("composedPath"in m){let g=m.composedPath();if(g.length)return g[0]}else if("path"in m&&m.path.length)return m.path[0]}catch{}return m&&m.target}function initMutationObserver(m,g){let v=new MutationBuffer;n8.push(v),v.init(m);let x=window.MutationObserver||window.__rrMutationObserver,k=window?.Zone?.__symbol__?.("MutationObserver");k&&window[k]&&(x=window[k]);let E=new x(callbackWrapper(g=>{m.onMutation&&!1===m.onMutation(g)||v.processMutations.bind(v)(g)}));return E.observe(g,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),E}function initScrollObserver({scrollCb:m,doc:g,mirror:v,blockClass:x,blockSelector:k,unblockSelector:E,sampling:T}){let K=callbackWrapper(throttle$1(callbackWrapper(T=>{let K=esm_getEventTarget(T);if(!K||isBlocked(K,x,k,E,!0))return;let et=v.getId(K);if(K===g&&g.defaultView){let v=getWindowScroll(g.defaultView);m({id:et,x:v.left,y:v.top})}else m({id:et,x:K.scrollLeft,y:K.scrollTop})}),T.scroll||100));return esm_on("scroll",K,g)}let n9=["INPUT","TEXTAREA","SELECT"],rt=new WeakMap;function getNestedCSSRulePositions(m){return function(m,g){if(hasNestedCSSRule("CSSGroupingRule")&&m.parentRule instanceof CSSGroupingRule||hasNestedCSSRule("CSSMediaRule")&&m.parentRule instanceof CSSMediaRule||hasNestedCSSRule("CSSSupportsRule")&&m.parentRule instanceof CSSSupportsRule||hasNestedCSSRule("CSSConditionRule")&&m.parentRule instanceof CSSConditionRule){let v=Array.from(m.parentRule.cssRules),x=v.indexOf(m);g.unshift(x)}else if(m.parentStyleSheet){let v=Array.from(m.parentStyleSheet.cssRules),x=v.indexOf(m);g.unshift(x)}return g}(m,[])}function getIdAndStyleId(m,g,v){let x,k;return m?(m.ownerNode?x=g.getId(m.ownerNode):k=v.getId(m),{styleId:k,id:x}):{}}function initAdoptedStyleSheetObserver({mirror:m,stylesheetManager:g},v){let x=null;
21x="#document"===v.nodeName?m.getId(v):m.getId(v.host);let k="#document"===v.nodeName?v.defaultView?.Document:v.ownerDocument?.defaultView?.ShadowRoot,E=k?.prototype?Object.getOwnPropertyDescriptor(k?.prototype,"adoptedStyleSheets"):void 0;return null!==x&&-1!==x&&k&&E?(Object.defineProperty(v,"adoptedStyleSheets",{configurable:E.configurable,enumerable:E.enumerable,get(){return E.get?.call(this)},set(m){let v=E.set?.call(this,m);if(null!==x&&-1!==x)try{g.adoptStyleSheets(m,x)}catch(m){}return v}}),callbackWrapper(()=>{Object.defineProperty(v,"adoptedStyleSheets",{configurable:E.configurable,enumerable:E.enumerable,get:E.get,set:E.set})})):()=>{}}function initObservers(m,g={}){let v;let x=m.doc.defaultView;if(!x)return()=>{};m.recordDOM&&(v=initMutationObserver(m,m.doc));let k=function({mousemoveCb:m,sampling:g,doc:v,mirror:x}){let k;if(!1===g.mousemove)return()=>{};let E="number"==typeof g.mousemove?g.mousemove:50,T="number"==typeof g.mousemoveCallback?g.mousemoveCallback:500,K=[],et=throttle$1(callbackWrapper(g=>{let v=Date.now()-k;m(K.map(m=>(m.timeOffset-=v,m)),g),K=[],k=null}),T),en=callbackWrapper(throttle$1(callbackWrapper(m=>{let g=esm_getEventTarget(m),{clientX:v,clientY:E}=legacy_isTouchEvent(m)?m.changedTouches[0]:m;k||(k=nX()),K.push({x:v,y:E,id:x.getId(g),timeOffset:nX()-k}),et("undefined"!=typeof DragEvent&&m instanceof DragEvent?n1.Drag:m instanceof MouseEvent?n1.MouseMove:n1.TouchMove)}),E,{trailing:!1})),er=[esm_on("mousemove",en,v),esm_on("touchmove",en,v),esm_on("drag",en,v)];return callbackWrapper(()=>{er.forEach(m=>m())})}(m),E=function({mouseInteractionCb:m,doc:g,mirror:v,blockClass:x,blockSelector:k,unblockSelector:E,sampling:T}){if(!1===T.mouseInteraction)return()=>{};let K=!0===T.mouseInteraction||void 0===T.mouseInteraction?{}:T.mouseInteraction,et=[],en=null,getHandler=g=>T=>{let K=esm_getEventTarget(T);if(isBlocked(K,x,k,E,!0))return;let et=null,er=g;if("pointerType"in T){switch(T.pointerType){case"mouse":et=n3.Mouse;break;case"touch":et=n3.Touch;break;case"pen":et=n3.Pen}et===n3.Touch?n2[g]===n2.MouseDown?er="TouchStart":n2[g]===n2.MouseUp&&(er="TouchEnd"):n3.Pen}else legacy_isTouchEvent(T)&&(et=n3.Touch);null!==et?(en=et,(er.startsWith("Touch")&&et===n3.Touch||er.startsWith("Mouse")&&et===n3.Mouse)&&(et=null)):n2[g]===n2.Click&&(et=en,en=null);let ei=legacy_isTouchEvent(T)?T.changedTouches[0]:T;if(!ei)return;let es=v.getId(K),{clientX:el,clientY:ec}=ei;callbackWrapper(m)({type:n2[er],id:es,x:el,y:ec,...null!==et&&{pointerType:et}})};return Object.keys(n2).filter(m=>Number.isNaN(Number(m))&&!m.endsWith("_Departed")&&!1!==K[m]).forEach(m=>{let v=toLowerCase(m),x=getHandler(m);if(window.PointerEvent)switch(n2[m]){case n2.MouseDown:case n2.MouseUp:v=v.replace("mouse","pointer");break;case n2.TouchStart:case n2.TouchEnd:return}et.push(esm_on(v,x,g))}),callbackWrapper(()=>{et.forEach(m=>m())})}(m),T=initScrollObserver(m),K=function({viewportResizeCb:m},{win:g}){let v=-1,x=-1,k=callbackWrapper(throttle$1(callbackWrapper(()=>{let g=getWindowHeight(),k=getWindowWidth();(v!==g||x!==k)&&(m({width:Number(k),height:Number(g)}),v=g,x=k)}),200));return esm_on("resize",k,g)}(m,{win:x}),et=function({inputCb:m,doc:g,mirror:v,blockClass:x,blockSelector:k,unblockSelector:E,ignoreClass:T,ignoreSelector:K,maskInputOptions:et,maskInputFn:en,sampling:er,userTriggeredOnInput:ei,maskTextClass:es,unmaskTextClass:el,maskTextSelector:ec,unmaskTextSelector:eu}){function eventHandler(m){let v=esm_getEventTarget(m),er=m.isTrusted,ed=v&&toUpperCase(v.tagName);if("OPTION"===ed&&(v=v.parentElement),!v||!ed||0>n9.indexOf(ed)||isBlocked(v,x,k,E,!0))return;let ep=v;if(ep.classList.contains(T)||K&&ep.matches(K))return;let em=getInputType(v),ef=getInputValue(ep,ed,em),eh=!1,eg=shouldMaskInput({maskInputOptions:et,tagName:ed,type:em}),ev=needMaskingText(v,es,ec,el,eu,eg);("radio"===em||"checkbox"===em)&&(eh=v.checked),ef=maskInputValue({isMasked:ev,element:v,value:ef,maskInputFn:en}),cbWithDedup(v,ei?{text:ef,isChecked:eh,userTriggered:er}:{text:ef,isChecked:eh});let ey=v.name;"radio"===em&&ey&&eh&&g.querySelectorAll(`input[type="radio"][name="${ey}"]`).forEach(m=>{if(m!==v){let g=maskInputValue({isMasked:ev,element:m,value:getInputValue(m,ed,em),maskInputFn:en});cbWithDedup(m,ei?{text:g,isChecked:!eh,userTriggered:!1}:{text:g,isChecked:!eh})}})}function cbWithDedup(g,x){let k=rt.get(g);if(!k||k.text!==x.text||k.isChecked!==x.isChecked){rt.set(g,x);let k=v.getId(g);callbackWrapper(m)({...x,id:k})}}let ed="last"===er.input?["change"]:["input","change"],ep=ed.map(m=>esm_on(m,callbackWrapper(eventHandler),g)),em=g.defaultView;if(!em)return()=>{ep.forEach(m=>m())};let ef=em.Object.getOwnPropertyDescriptor(em.HTMLInputElement.prototype,"value"),eh=[[em.HTMLInputElement.prototype,"value"],[em.HTMLInputElement.prototype,"checked"],[em.HTMLSelectElement.prototype,"value"],[em.HTMLTextAreaElement.prototype,"value"],[em.HTMLSelectElement.prototype,"selectedIndex"],[em.HTMLOptionElement.prototype,"selected"]];return ef&&ef.set&&ep.push(...eh.map(m=>(function hookSetter(m,g,v,x,k=window){let E=k.Object.getOwnPropertyDescriptor(m,g);return k.Object.defineProperty(m,g,x?v:{set(m){setTimeout$2(()=>{v.set.call(this,m)},0),E&&E.set&&E.set.call(this,m)}}),()=>
21hookSetter(m,g,E||{},!0)})(m[0],m[1],{set(){callbackWrapper(eventHandler)({target:this,isTrusted:!1})}},!1,em))),callbackWrapper(()=>{ep.forEach(m=>m())})}(m),en=function({mediaInteractionCb:m,blockClass:g,blockSelector:v,unblockSelector:x,mirror:k,sampling:E,doc:T}){let K=callbackWrapper(T=>throttle$1(callbackWrapper(E=>{let K=esm_getEventTarget(E);if(!K||isBlocked(K,g,v,x,!0))return;let{currentTime:et,volume:en,muted:er,playbackRate:ei}=K;m({type:T,id:k.getId(K),currentTime:et,volume:en,muted:er,playbackRate:ei})}),E.media||500)),et=[esm_on("play",K(n5.Play),T),esm_on("pause",K(n5.Pause),T),esm_on("seeked",K(n5.Seeked),T),esm_on("volumechange",K(n5.VolumeChange),T),esm_on("ratechange",K(n5.RateChange),T)];return callbackWrapper(()=>{et.forEach(m=>m())})}(m),styleSheetObserver=()=>{},adoptedStyleSheetObserver=()=>{},styleDeclarationObserver=()=>{},fontObserver=()=>{};m.recordDOM&&(styleSheetObserver=function({styleSheetRuleCb:m,mirror:g,stylesheetManager:v},{win:x}){let k,E;if(!x.CSSStyleSheet||!x.CSSStyleSheet.prototype)return()=>{};let T=x.CSSStyleSheet.prototype.insertRule;x.CSSStyleSheet.prototype.insertRule=new Proxy(T,{apply:callbackWrapper((x,k,E)=>{let[T,K]=E,{id:et,styleId:en}=getIdAndStyleId(k,g,v.styleMirror);return(et&&-1!==et||en&&-1!==en)&&m({id:et,styleId:en,adds:[{rule:T,index:K}]}),x.apply(k,E)})});let K=x.CSSStyleSheet.prototype.deleteRule;x.CSSStyleSheet.prototype.deleteRule=new Proxy(K,{apply:callbackWrapper((x,k,E)=>{let[T]=E,{id:K,styleId:et}=getIdAndStyleId(k,g,v.styleMirror);return(K&&-1!==K||et&&-1!==et)&&m({id:K,styleId:et,removes:[{index:T}]}),x.apply(k,E)})}),x.CSSStyleSheet.prototype.replace&&(k=x.CSSStyleSheet.prototype.replace,x.CSSStyleSheet.prototype.replace=new Proxy(k,{apply:callbackWrapper((x,k,E)=>{let[T]=E,{id:K,styleId:et}=getIdAndStyleId(k,g,v.styleMirror);return(K&&-1!==K||et&&-1!==et)&&m({id:K,styleId:et,replace:T}),x.apply(k,E)})})),x.CSSStyleSheet.prototype.replaceSync&&(E=x.CSSStyleSheet.prototype.replaceSync,x.CSSStyleSheet.prototype.replaceSync=new Proxy(E,{apply:callbackWrapper((x,k,E)=>{let[T]=E,{id:K,styleId:et}=getIdAndStyleId(k,g,v.styleMirror);return(K&&-1!==K||et&&-1!==et)&&m({id:K,styleId:et,replaceSync:T}),x.apply(k,E)})}));let et={};canMonkeyPatchNestedCSSRule("CSSGroupingRule")?et.CSSGroupingRule=x.CSSGroupingRule:(canMonkeyPatchNestedCSSRule("CSSMediaRule")&&(et.CSSMediaRule=x.CSSMediaRule),canMonkeyPatchNestedCSSRule("CSSConditionRule")&&(et.CSSConditionRule=x.CSSConditionRule),canMonkeyPatchNestedCSSRule("CSSSupportsRule")&&(et.CSSSupportsRule=x.CSSSupportsRule));let en={};return Object.entries(et).forEach(([x,k])=>{en[x]={insertRule:k.prototype.insertRule,deleteRule:k.prototype.deleteRule},k.prototype.insertRule=new Proxy(en[x].insertRule,{apply:callbackWrapper((x,k,E)=>{let[T,K]=E,{id:et,styleId:en}=getIdAndStyleId(k.parentStyleSheet,g,v.styleMirror);return(et&&-1!==et||en&&-1!==en)&&m({id:et,styleId:en,adds:[{rule:T,index:[...getNestedCSSRulePositions(k),K||0]}]}),x.apply(k,E)})}),k.prototype.deleteRule=new Proxy(en[x].deleteRule,{apply:callbackWrapper((x,k,E)=>{let[T]=E,{id:K,styleId:et}=getIdAndStyleId(k.parentStyleSheet,g,v.styleMirror);return(K&&-1!==K||et&&-1!==et)&&m({id:K,styleId:et,removes:[{index:[...getNestedCSSRulePositions(k),T]}]}),x.apply(k,E)})})}),callbackWrapper(()=>{x.CSSStyleSheet.prototype.insertRule=T,x.CSSStyleSheet.prototype.deleteRule=K,k&&(x.CSSStyleSheet.prototype.replace=k),E&&(x.CSSStyleSheet.prototype.replaceSync=E),Object.entries(et).forEach(([m,g])=>{g.prototype.insertRule=en[m].insertRule,g.prototype.deleteRule=en[m].deleteRule})})}(m,{win:x}),adoptedStyleSheetObserver=initAdoptedStyleSheetObserver(m,m.doc),styleDeclarationObserver=function({styleDeclarationCb:m,mirror:g,ignoreCSSAttributes:v,stylesheetManager:x},{win:k}){let E=k.CSSStyleDeclaration.prototype.setProperty;k.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:callbackWrapper((k,T,K)=>{let[et,en,er]=K;if(v.has(et))return E.apply(T,[et,en,er]);let{id:ei,styleId:es}=getIdAndStyleId(T.parentRule?.parentStyleSheet,g,x.styleMirror);return(ei&&-1!==ei||es&&-1!==es)&&m({id:ei,styleId:es,set:{property:et,value:en,priority:er},index:getNestedCSSRulePositions(T.parentRule)}),k.apply(T,K)})});let T=k.CSSStyleDeclaration.prototype.removeProperty;return k.CSSStyleDeclaration.prototype.removeProperty=new Proxy(T,{apply:callbackWrapper((k,E,K)=>{let[et]=K;if(v.has(et))return T.apply(E,[et]);let{id:en,styleId:er}=getIdAndStyleId(E.parentRule?.parentStyleSheet,g,x.styleMirror);return(en&&-1!==en||er&&-1!==er)&&m({id:en,styleId:er,remove:{property:et},index:getNestedCSSRulePositions(E.parentRule)}),k.apply(E,K)})}),callbackWrapper(()=>{k.CSSStyleDeclaration.prototype.setProperty=E,k.CSSStyleDeclaration.prototype.removeProperty=T})}(m,{win:x}),m.collectFonts&&(fontObserver=function({fontCb:m,doc:g}){let v=g.defaultView;if(!v)return()=>{};let x=[],k=new WeakMap,E=v.FontFace;v.FontFace=function(m,g,v){let x=new E(m,g,v);return k.set(x,{family:m,buffer:"string"!=typeof g,descriptors:v,fontSource:"string"==typeof g?g:JSON.stringify(Array.from(new Uint8Array(g)))}),x};let T=patch(g.fonts,"add",function(g){return function(v){return setTimeout$2(callbackWrapper(()=>{let g=k.get(v);g&&(m(g),k.delete(v))}),0),g.apply(this,[v])}});return x.push(()=>{v.FontFace=E}),x.push(T),callbackWrapper(()=>{x.forEach(m=>m())})}(m)));let er=function(m){let{doc:g,mirror:v,blockClass:x,blockSelector:k,unblockSelector:E,selectionCb:T}=m,K=!0,et=callbackWrapper(()=>{let m=g.getSelection();if(!m||K&&m?.isCollapsed)return;K=m.isCollapsed||!1;let et=[],en=m.rangeCount||0;for(let g=0;g<en;g++){let T=m.getRangeAt(g),{startContainer:K,startOffset:en,endContainer:er,endOffset:ei}=T,es=isBlocked(K,x,k,E,!0)||isBlocked(er,x,k,E,!0);es||et.push({start:v.getId(K),startOffset:en,end:v.getId(er),endOffset:ei})}T({ranges:et})});return et(),esm_on("selectionchange",et)}(m),ei=function({doc:m,customElementCb:g}){let v=m.defaultView;if(!v||!v.customElements)return()=>{};let x=patch(v.customElements,"define",function(m){return function(v,x,k){try{g({define:{name:v}})}catch(m){}return m.apply(this,[v,x,k])}});return x}(m),es=[];for(let g of m.plugins)es.push(g.observer(g.callback,x,g.options));return callbackWrapper(()=>{n8.forEach(m=>m.reset()),v?.disconnect(),k(),E(),T(),K(),et(),en(),styleSheetObserver(),adoptedStyleSheetObserver(),styleDeclarationObserver(),fontObserver(),er(),ei(),es.forEac
21h(m=>m())})}function hasNestedCSSRule(m){return void 0!==window[m]}function canMonkeyPatchNestedCSSRule(m){return!!(void 0!==window[m]&&window[m].prototype&&"insertRule"in window[m].prototype&&"deleteRule"in window[m].prototype)}let CrossOriginIframeMirror=class CrossOriginIframeMirror{constructor(m){this.generateIdFn=m,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(m,g,v,x){let k=v||this.getIdToRemoteIdMap(m),E=x||this.getRemoteIdToIdMap(m),T=k.get(g);return T||(T=this.generateIdFn(),k.set(g,T),E.set(T,g)),T}getIds(m,g){let v=this.getIdToRemoteIdMap(m),x=this.getRemoteIdToIdMap(m);return g.map(g=>this.getId(m,g,v,x))}getRemoteId(m,g,v){let x=v||this.getRemoteIdToIdMap(m);if("number"!=typeof g)return g;let k=x.get(g);return k||-1}getRemoteIds(m,g){let v=this.getRemoteIdToIdMap(m);return g.map(g=>this.getRemoteId(m,g,v))}reset(m){if(!m){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(m),this.iframeRemoteIdToIdMap.delete(m)}getIdToRemoteIdMap(m){let g=this.iframeIdToRemoteIdMap.get(m);return g||(g=new Map,this.iframeIdToRemoteIdMap.set(m,g)),g}getRemoteIdToIdMap(m){let g=this.iframeRemoteIdToIdMap.get(m);return g||(g=new Map,this.iframeRemoteIdToIdMap.set(m,g)),g}};let IframeManagerNoop=class IframeManagerNoop{constructor(){this.crossOriginIframeMirror=new CrossOriginIframeMirror(genId),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}};let IframeManager=class IframeManager{constructor(m){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new CrossOriginIframeMirror(genId),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=m.mutationCb,this.wrappedEmit=m.wrappedEmit,this.stylesheetManager=m.stylesheetManager,this.recordCrossOriginIframes=m.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=m.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(m){this.iframes.set(m,!0);let g=getIFrameContentWindow(m);g&&this.crossOriginIframeMap.set(g,m)}addLoadListener(m){this.loadListener=m}attachIframe(m,g){this.mutationCb({adds:[{parentId:this.mirror.getId(m),nextId:null,node:g}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&getIFrameContentWindow(m)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(m);let v=getIFrameContentDocument(m);v&&v.adoptedStyleSheets&&v.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(v.adoptedStyleSheets,this.mirror.getId(v))}handleMessage(m){if("rrweb"!==m.data.type||m.origin!==m.data.origin)return;let g=m.source;if(!g)return;let v=this.crossOriginIframeMap.get(m.source);if(!v)return;let x=this.transformCrossOriginEvent(v,m.data.event);x&&this.wrappedEmit(x,m.data.isCheckout)}transformCrossOriginEvent(m,g){switch(g.type){case n0.FullSnapshot:{this.crossOriginIframeMirror.reset(m),this.crossOriginIframeStyleMirror.reset(m),this.replaceIdOnNode(g.data.node,m);let v=g.data.node.id;return this.crossOriginIframeRootIdMap.set(m,v),this.patchRootIdOnNode(g.data.node,v),{timestamp:g.timestamp,type:n0.IncrementalSnapshot,data:{source:n1.Mutation,adds:[{parentId:this.mirror.getId(m),nextId:null,node:g.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case n0.Meta:case n0.Load:case n0.DomContentLoaded:break;case n0.Plugin:return g;case n0.Custom:return this.replaceIds(g.data.payload,m,["id","parentId","previousId","nextId"]),g;case n0.IncrementalSnapshot:switch(g.data.source){case n1.Mutation:return g.data.adds.forEach(g=>{this.replaceIds(g,m,["parentId","nextId","previousId"]),this.replaceIdOnNode(g.node,m);let v=this.crossOriginIframeRootIdMap.get(m);v&&this.patchRootIdOnNode(g.node,v)}),g.data.removes.forEach(g=>{this.replaceIds(g,m,["parentId","id"])}),g.data.attributes.forEach(g=>{this.replaceIds(g,m,["id"])}
21),g.data.texts.forEach(g=>{this.replaceIds(g,m,["id"])}),g;case n1.Drag:case n1.TouchMove:case n1.MouseMove:return g.data.positions.forEach(g=>{this.replaceIds(g,m,["id"])}),g;case n1.ViewportResize:return!1;case n1.MediaInteraction:case n1.MouseInteraction:case n1.Scroll:case n1.CanvasMutation:case n1.Input:return this.replaceIds(g.data,m,["id"]),g;case n1.StyleSheetRule:case n1.StyleDeclaration:return this.replaceIds(g.data,m,["id"]),this.replaceStyleIds(g.data,m,["styleId"]),g;case n1.Font:return g;case n1.Selection:return g.data.ranges.forEach(g=>{this.replaceIds(g,m,["start","end"])}),g;case n1.AdoptedStyleSheet:return this.replaceIds(g.data,m,["id"]),this.replaceStyleIds(g.data,m,["styleIds"]),g.data.styles?.forEach(g=>{this.replaceStyleIds(g,m,["styleId"])}),g}}return!1}replace(m,g,v,x){for(let k of x)(Array.isArray(g[k])||"number"==typeof g[k])&&(Array.isArray(g[k])?g[k]=m.getIds(v,g[k]):g[k]=m.getId(v,g[k]));return g}replaceIds(m,g,v){return this.replace(this.crossOriginIframeMirror,m,g,v)}replaceStyleIds(m,g,v){return this.replace(this.crossOriginIframeStyleMirror,m,g,v)}replaceIdOnNode(m,g){this.replaceIds(m,g,["id","rootId"]),"childNodes"in m&&m.childNodes.forEach(m=>{this.replaceIdOnNode(m,g)})}patchRootIdOnNode(m,g){m.type===nF.Document||m.rootId||(m.rootId=g),"childNodes"in m&&m.childNodes.forEach(m=>{this.patchRootIdOnNode(m,g)})}};let ShadowDomManagerNoop=class ShadowDomManagerNoop{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}};let ShadowDomManager=class ShadowDomManager{constructor(m){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=m.mutationCb,this.scrollCb=m.scrollCb,this.bypassOptions=m.bypassOptions,this.mirror=m.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(m,g){if(!isNativeShadowDom(m)||this.shadowDoms.has(m))return;this.shadowDoms.add(m),this.bypassOptions.canvasManager.addShadowRoot(m);let v=initMutationObserver({...this.bypassOptions,doc:g,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},m);this.restoreHandlers.push(()=>v.disconnect()),this.restoreHandlers.push(initScrollObserver({...this.bypassOptions,scrollCb:this.scrollCb,doc:m,mirror:this.mirror})),setTimeout$2(()=>{m.adoptedStyleSheets&&m.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(m.adoptedStyleSheets,this.mirror.getId(m.host)),this.restoreHandlers.push(initAdoptedStyleSheetObserver({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},m))},0)}observeAttachShadow(m){let g=getIFrameContentDocument(m),v=getIFrameContentWindow(m);g&&v&&this.patchAttachShadow(v.Element,g)}patchAttachShadow(m,g){let v=this;this.restoreHandlers.push(patch(m.prototype,"attachShadow",function(m){return function(x){let k=m.call(this,x);return this.shadowRoot&&inDom(this)&&v.addShadowRoot(this.shadowRoot,g),k}}))}reset(){this.restoreHandlers.forEach(m=>{try{m()}catch(m){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}};let StylesheetManager=class StylesheetManager{constructor(m){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=m.mutationCb,this.adoptedStyleSheetCb=m.adoptedStyleSheetCb}attachLinkElement(m,g){"_cssText"in g.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:g.id,attributes:g.attributes}]}),this.trackLinkElement(m)}trackLinkElement(m){this.trackedLinkElements.has(m)||(this.trackedLinkElements.add(m),this.trackStylesheetInLinkElement(m))}adoptStyleSheets(m,g){if(0===m.length)return;let v={id:g,styleIds:[]},x=[];for(let g of m){let m;this.styleMirror.has(g)?m=this.styleMirror.getId(g):(m=this.styleMirror.add(g),x.push({styleId:m,rules:Array.from(g.rules||CSSRule,(m,g)=>({rule:stringifyRule(m),index:g}))})),v.styleIds.push(m)}x.length>0&&(v.styles=x),this.adoptedStyleSheetCb(v)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(m){}};let ProcessedNodeManager=class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(m,g){let v=this.nodeMap.get(m);return v&&Array.from(v).some(m=>m!==g)}add(m,g){this.active||(this.active=!0,function(...m){getImplementation("requestAnimationFrame")(...m)}(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(m,(this.nodeMap.get(m)||new Set).add(g))}destroy(){}};try{if(2!==Array.from([1],m=>2*m)[0]){let m=document.createElement("iframe");document.body.appendChild(m),Array.from=m.contentWindow?.Array.from||Array.from,document.body.removeChild(m)}}catch(m){console.debug("Unable to override Array.from",m)}let rn=new Mirror;function record(m={}){let g;let{emit:v,checkoutEveryNms:x,checkoutEveryNth:k,blockClass:E="rr-block",blockSelector:T=null,unblockSelector:K=null,ignoreClass:et="rr-ignore",ignoreSelector:en=null,maskAllText:er=!1,maskTextClass:ei="rr-mask",unmaskTextClass:es=null,maskTextSelector:el=null,unmaskTextSelector:ec=null,inlineStylesheet:eu=!0,maskAllInputs:ef,maskInputOptions:eh,slimDOMOptions:eg,maskAttributeFn:ev,maskInputFn:ey,maskTextFn:eb,maxCanvasSize:ex=null,packFn:e_,sampling:ew={},dataURLOptions:eS={},mousemoveWait:eC,recordDOM:ek=!0,recordCanvas:eE=!1,recordCrossOriginIframes:ej=!1,recordAfter:eN="DOMContentLoaded"===m.recordAfter?m.recordAfter:"load",userTriggeredOnInput:eR=!1,collectFonts:eI=!1,inlineImages:eP=!1,plugins:eT,keepIframeSrcFn:eO=()=>!1,ignoreCSSAttributes:eA=new Set([]),errorHandler:eM,onMutation:eD,getCanvasManager:eL}=m;ed=eM;let eF=!ej||window.parent===window,eZ=!1;if(!eF)try{window.parent.document&&(eZ=!1)}catch(m){eZ=!0}if(eF&&!v)throw Error("emit function is required");if(!eF&&!eZ)return()=>{};void 0!==eC&&void 0===ew.mousemove&&(ew.mousemove=eC),rn.reset();let eB=!0===ef?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==eh?eh:{},e$=!0===eg||"all"===eg?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===eg,headMetaDescKeywords:"all"===eg}:eg||{};!function(m=window){"NodeList"in m&&!m.NodeList.prototype.forEach&&(m.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in m&&!m.DOMTokenList.prototype.forEach&&(m.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...m)=>{let g=m[0];if(!(0 in m))throw TypeError("1 argument is required");do if(this===g)return!0;while(g=g&&g.parentNode);return!1})}();let eU=0,eventProcessor=m=>{for(let g of eT||[])g.eventProcessor&&(m=g.eventProcessor(m));return e_&&!eZ&&(m=e_(m)),m};ep=(m,E)=>{if(m.timestamp=nX(),n8[0]?.isFrozen()&&m.type!==n0.FullSnapshot&&!(m.type===n0.IncrementalSnapshot&&m.data.source===n1.Mutation)&&n8.forEach(m=>m.unfreeze()),eF)v?.(eventProcessor(m),E);else if(eZ){let g={type:"rrweb",event:eventProcessor(m),origin:window.location.origin,isCheckout:E};window.parent.postMessage(g,"*")}if(m.type===n0.FullSnapshot)g=m,eU=0;else if(m.type===n0.IncrementalSnapshot){if(m.data.source===n1.Mutation&&m.data.isAttachIframe)return;eU++;let v=k&&eU>=k,E=x&&g&&m.timestamp-g.timestamp>x;(v||E)&&takeFullSnapshot2(!0)}};let wrappedMutationEmit=m=>{ep({type:n0.IncrementalSnapshot,data:{source:n1.Mutation,...m}})},wrappedScrollEmit=m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.Scroll,...m}}),wrappedCanvasMutationEmit=m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.CanvasMutation,...m}}),ez=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.AdoptedStyleSheet,...m}})}),eV="boolean"==typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new IframeManagerNoop:new IframeManager({mirror:rn,mutationCb:wrappedMutationEmit,stylesheetManager:ez,recordCrossOriginIframes:ej,wrappedEmit:ep});for(let m of eT||[])m.getMirror&&m.getMirror({nodeMirror:rn,crossOriginIframeMirror:eV.crossOriginIframeMirror,crossOriginIframeStyleMirror:eV.crossOriginIframeStyleMirror});let eq=new ProcessedNodeManager,eH=function(m,g){try{return m?m(g):new CanvasManagerNoop}catch{return console.warn("Unable to initialize CanvasManager"),new CanvasManagerNoop}}(eL,{mirror:rn,win:window,mutationCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.CanvasMutation,...m}}),recordCanvas:eE,blockClass:E,blockSelector:T,unblockSelector:K,maxCanvasSize:ex,sampling:ew.canvas,dataURLOptions:eS,errorHandler:eM}),eW="boolean"==typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new ShadowDomManagerNoop:new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{onMutation:eD,blockClass:E,blockSelector:T,unblockSelector:K,maskAllText:er,maskTextClass:ei,unmaskTextClass:es,maskTextSelector:el,unmaskTextSelector:ec,inlineStylesheet:eu,maskInputOptions:eB,dataURLOptions:eS,maskAttributeFn:ev,maskTextFn:eb,maskInputFn:ey,recordCanvas:eE,inlineImages:eP,sampling:ew,slimDOMOptions:e$,iframeManager:eV,stylesheetManager:ez,canvasManager:eH,keepIframeSrcFn:eO,processedNodeManager:eq,ignoreCSSAttributes:eA},mirror:rn}),takeFullSnapshot2=(m=!1)=>
21{if(!ek)return;ep({type:n0.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}},m),ez.reset(),eW.init(),n8.forEach(m=>m.lock());let g=function(m,g){let{mirror:v=new Mirror,blockClass:x="rr-block",blockSelector:k=null,unblockSelector:E=null,maskAllText:T=!1,maskTextClass:K="rr-mask",unmaskTextClass:et=null,maskTextSelector:en=null,unmaskTextSelector:er=null,inlineStylesheet:ei=!0,inlineImages:es=!1,recordCanvas:el=!1,maskAllInputs:ec=!1,maskAttributeFn:eu,maskTextFn:ed,maskInputFn:ep,slimDOM:em=!1,dataURLOptions:ef,preserveWhiteSpace:eh,onSerialize:eg,onIframeLoad:ev,iframeLoadTimeout:ey,onBlockedImageLoad:eb,onStylesheetLoad:ex,stylesheetLoadTimeout:e_,keepIframeSrcFn:ew=()=>!1,ignoreCSSAttributes:eS=new Set([])}=g||{},eC=!0===ec?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===ec?{}:ec,ek=!0===em||"all"===em?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===em,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===em?{}:em;return serializeNodeWithId(m,{doc:m,mirror:v,blockClass:x,blockSelector:k,unblockSelector:E,maskAllText:T,maskTextClass:K,unmaskTextClass:et,maskTextSelector:en,unmaskTextSelector:er,skipChild:!1,inlineStylesheet:ei,maskInputOptions:eC,maskAttributeFn:eu,maskTextFn:ed,maskInputFn:ep,slimDOMOptions:ek,dataURLOptions:ef,inlineImages:es,recordCanvas:el,preserveWhiteSpace:eh,onSerialize:eg,onIframeLoad:ev,iframeLoadTimeout:ey,onBlockedImageLoad:eb,onStylesheetLoad:ex,stylesheetLoadTimeout:e_,keepIframeSrcFn:ew,newlyAddedElement:!1,ignoreCSSAttributes:eS})}(document,{mirror:rn,blockClass:E,blockSelector:T,unblockSelector:K,maskAllText:er,maskTextClass:ei,unmaskTextClass:es,maskTextSelector:el,unmaskTextSelector:ec,inlineStylesheet:eu,maskAllInputs:eB,maskAttributeFn:ev,maskInputFn:ey,maskTextFn:eb,slimDOM:e$,dataURLOptions:eS,recordCanvas:eE,inlineImages:eP,onSerialize:m=>{isSerializedIframe(m,rn)&&eV.addIframe(m),isSerializedStylesheet(m,rn)&&ez.trackLinkElement(m),hasShadowRoot(m)&&eW.addShadowRoot(m.shadowRoot,document)},onIframeLoad:(m,g)=>{eV.attachIframe(m,g);let v=getIFrameContentWindow(m);v&&eH.addWindow(v),eW.observeAttachShadow(m)},onStylesheetLoad:(m,g)=>{ez.attachLinkElement(m,g)},onBlockedImageLoad:(m,g,{width:v,height:x})=>{wrappedMutationEmit({adds:[],removes:[],texts:[],attributes:[{id:g.id,attributes:{style:{width:`${v}px`,height:`${x}px`}}}]})},keepIframeSrcFn:eO,ignoreCSSAttributes:eA});if(!g)return console.warn("Failed to snapshot the document");ep({type:n0.FullSnapshot,data:{node:g,initialOffset:getWindowScroll(window)}}),n8.forEach(m=>m.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ez.adoptStyleSheets(document.adoptedStyleSheets,rn.getId(document))};em=takeFullSnapshot2;try{let m=[],observe=m=>callbackWrapper(initObservers)({onMutation:eD,mutationCb:wrappedMutationEmit,mousemoveCb:(m,g)=>ep({type:n0.IncrementalSnapshot,data:{source:g,positions:m}}),mouseInteractionCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.MouseInteraction,...m}}),scrollCb:wrappedScrollEmit,viewportResizeCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.ViewportResize,...m}}),inputCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.Input,...m}}),mediaInteractionCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.MediaInteraction,...m}}),styleSheetRuleCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.StyleSheetRule,...m}}),styleDeclarationCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.StyleDeclaration,...m}}),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:m=>ep({type:n0.IncrementalSnapshot,data:{source:n1.Font,...m}}),selectionCb:m=>{ep({type:n0.IncrementalSnapshot,data:{source:n1.Selection,...m}})},customElementCb:m=>{ep({type:n0.IncrementalSnapshot,data:{source:n1.CustomElement,...m}})},blockClass:E,ignoreClass:et,ignoreSelector:en,maskAllText:er,maskTextClass:ei,unmaskTextClass:es,maskTextSelector:el,unmaskTextSelector:ec,maskInputOptions:eB,inlineStylesheet:eu,sampling:ew,recordDOM:ek,recordCanvas:eE,inlineImages:eP,userTriggeredOnInput:eR,collectFonts:eI,doc:m,maskAttributeFn:ev,maskInputFn:ey,maskTextFn:eb,keepIframeSrcFn:eO,blockSelector:T,unblockSelector:K,slimDOMOptions:e$,dataURLOptions:eS,mirror:rn,iframeManager:eV,stylesheetManager:ez,shadowDomManager:eW,processedNodeManager:eq,canvasManager:eH,ignoreCSSAttributes:eA,plugins:eT?.filter(m=>m.observer)?.map(m=>({observer:m.observer,options:m.options,callback:g=>ep({type:n0.Plugin,data:{plugin:m.name,payload:g}})}))||[]},{});eV.addLoadListener(g=>{try{m.push(observe(g.contentDocument))}catch(m){console.warn(m)}});let init=()=>{takeFullSnapshot2(),m.push(observe(document))};return"interactive"===document.readyState||"complete"===document.readyState?init():(m.push(esm_on("DOMContentLoaded",()=>{ep({type:n0.DomContentLoaded,data:{}}),"DOMContentLoaded"===eN&&init()})),m.push(esm_on("load",()=>{ep({type:n0.Load,data:{}}),"load"===eN&&init()}
21,window))),()=>{m.forEach(m=>m()),eq.destroy(),em=void 0,ed=void 0}}catch(m){console.warn(m)}}function timestampToMs(m){return m>9999999999?m:1e3*m}function timestampToS(m){return m>9999999999?m/1e3:m}function addBreadcrumbEvent(m,g){"sentry.transaction"!==g.category&&(["ui.click","ui.input"].includes(g.category)?m.triggerUserActivity():m.checkAndHandleExpiredSession(),m.addUpdate(()=>(m.throttledAddEvent({type:n0.Custom,timestamp:1e3*(g.timestamp||0),data:{tag:"breadcrumb",payload:(0,eB.Fv)(g,10,1e3)}}),"console"===g.category)))}function getClosestInteractive(m){let g=m.closest("button,a");return g||m}function getClickTargetNode(m){let g=getTargetNode(m);return g&&g instanceof Element?getClosestInteractive(g):g}function getTargetNode(m){return(0,eX.yD)(m)&&"target"in m?m.target:m}record.mirror=rn,record.takeFullSnapshot=function(m){if(!em)throw Error("please take full snapshot after start recording");em(m)},(ew=eC||(eC={}))[ew.NotStarted=0]="NotStarted",ew[ew.Running=1]="Running",ew[ew.Stopped=2]="Stopped";let ri=new Set([n1.Mutation,n1.StyleSheetRule,n1.StyleDeclaration,n1.AdoptedStyleSheet,n1.CanvasMutation,n1.Selection,n1.MediaInteraction]);let ClickDetector=class ClickDetector{constructor(m,g,v=addBreadcrumbEvent){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=g.timeout/1e3,this._threshold=g.threshold/1e3,this._scrollTimeout=g.scrollTimeout/1e3,this._replay=m,this._ignoreSelector=g.ignoreSelector,this._addBreadcrumbEvent=v}addListeners(){var m;let g=(m=()=>{this._lastMutation=nowInSeconds()},ef||(ef=[],(0,eM.hl)(nA,"open",function(m){return function(...g){if(ef)try{ef.forEach(m=>m())}catch{}return m.apply(nA,g)}})),ef.push(m),()=>{let g=ef?ef.indexOf(m):-1;g>-1&&ef.splice(g,1)});this._teardown=()=>{g(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(m,g){var v;if(v=this._ignoreSelector,!rs.includes(g.tagName)||"INPUT"===g.tagName&&!["submit","button"].includes(g.getAttribute("type")||"")||"A"===g.tagName&&(g.hasAttribute("download")||g.hasAttribute("target")&&"_self"!==g.getAttribute("target"))||v&&g.matches(v)||!(m.data&&"number"==typeof m.data.nodeId&&m.timestamp))return;let x={timestamp:timestampToS(m.timestamp),clickBreadcrumb:m,clickCount:0,node:g};this._clicks.some(m=>m.node===x.node&&1>Math.abs(m.timestamp-x.timestamp))||(this._clicks.push(x),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(m=Date.now()){this._lastMutation=timestampToS(m)}registerScroll(m=Date.now()){this._lastScroll=timestampToS(m)}registerClick(m){let g=getClosestInteractive(m);this._handleMultiClick(g)}_handleMultiClick(m){this._getClicks(m).forEach(m=>{m.clickCount++})}_getClicks(m){return this._clicks.filter(g=>g.node===m)}_checkClicks(){let m=[],g=nowInSeconds();for(let v of(this._clicks.forEach(v=>{!v.mutationAfter&&this._lastMutation&&(v.mutationAfter=v.timestamp<=this._lastMutation?this._lastMutation-v.timestamp:void 0),!v.scrollAfter&&this._lastScroll&&(v.scrollAfter=v.timestamp<=this._lastScroll?this._lastScroll-v.timestamp:void 0),v.timestamp+this._timeout<=g&&m.push(v)}),m)){let m=this._clicks.indexOf(v);m>-1&&(this._generateBreadcrumbs(v),this._clicks.splice(m,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(m){let g=this._replay,v=m.scrollAfter&&m.scrollAfter<=this._scrollTimeout,x=m.mutationAfter&&m.mutationAfter<=this._threshold,{clickCount:k,clickBreadcrumb:E}=m;if(!v&&!x){let v=1e3*Math.min(m.mutationAfter||this._timeout,this._timeout),x=v<1e3*this._timeout?"mutation":"timeout",T={type:"default",message:E.message,timestamp:E.timestamp,category:"ui.slowClickDetected",data:{...E.data,url:nA.location.href,route:g.getCurrentRoute(),timeAfterClickMs:v,endReason:x,clickCount:k||1}};this._addBreadcrumbEvent(g,T);return}if(k>1){let m={type:"default",message:E.message,timestamp:E.timestamp,category:"ui.multiClick",data:{...E.data,url:nA.location.href,route:g.getCurrentRoute(),clickCount:k,metric:!0}};this._addBreadcrumbEvent(g,m)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=getNativeImplementation_setTimeout(()=>this._checkClicks(),1e3)}};let rs=["A","BUTTON","INPUT"];function nowInSeconds(){return Date.now()/1e3}function createBreadcrumb(m){return{timestamp:Date.now()/1e3,type:"default",...m}}var ro=((eS=ro||{})[eS.Document=0]="Document",eS[eS.DocumentType=1]="DocumentType",eS[eS.Element=2]="Element",eS[eS.Text=3]="Text",eS[eS.CDATA=4]="CDATA",eS[eS.Comment=5]="Comment",eS);
21let rl=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]),handleDomListener=m=>g=>{if(!m.isEnabled())return;let v=function(m){let{target:g,message:v}=function(m){let g;let v="click"===m.name,x=null;try{x=v?getClickTargetNode(m.event):getTargetNode(m.event),g=htmlTreeAsString_htmlTreeAsString(x,{maxStringLength:200})||"<unknown>"}catch{g="<unknown>"}return{target:x,message:g}}(m);return createBreadcrumb({category:`ui.${m.name}`,...getBaseDomBreadcrumb(g,v)})}(g);if(!v)return;let x="click"===g.name,k=x?g.event:void 0;x&&m.clickDetector&&k?.target&&!k.altKey&&!k.metaKey&&!k.ctrlKey&&!k.shiftKey&&function(m,g,v){m.handleClick(g,v)}(m.clickDetector,v,getClickTargetNode(g.event)),addBreadcrumbEvent(m,v)};function getBaseDomBreadcrumb(m,g){let v=record.mirror.getId(m),x=v&&record.mirror.getNode(v),k=x&&record.mirror.getMeta(x),E=k&&k.type===ro.Element?k:null;return{message:g,data:E?{nodeId:v,node:{id:v,tagName:E.tagName,textContent:Array.from(E.childNodes).map(m=>m.type===ro.Text&&m.textContent).filter(Boolean).map(m=>m.trim()).join(""),attributes:function(m){let g={};for(let v in!m["data-sentry-component"]&&m["data-sentry-element"]&&(m["data-sentry-component"]=m["data-sentry-element"]),m)if(rl.has(v)){let x=v;("data-testid"===v||"data-test-id"===v)&&(x="testId"),g[x]=m[v]}return g}(E.attributes)}}:{}}}let rc={resource:function(m){let{entryType:g,initiatorType:v,name:x,responseEnd:k,startTime:E,decodedBodySize:T,encodedBodySize:K,responseStatus:et,transferSize:en}=m;return["fetch","xmlhttprequest"].includes(v)?null:{type:`${g}.${v}`,start:esm_getAbsoluteTime(E),end:esm_getAbsoluteTime(k),name:x,data:{size:en,statusCode:et,decodedBodySize:T,encodedBodySize:K}}},paint:function(m){let{duration:g,entryType:v,name:x,startTime:k}=m,E=esm_getAbsoluteTime(k);return{type:v,name:x,start:E,end:E+g,data:void 0}},navigation:function(m){let{entryType:g,name:v,decodedBodySize:x,duration:k,domComplete:E,encodedBodySize:T,domContentLoadedEventStart:K,domContentLoadedEventEnd:et,domInteractive:en,loadEventStart:er,loadEventEnd:ei,redirectCount:es,startTime:el,transferSize:ec,type:eu}=m;return 0===k?null:{type:`${g}.${eu}`,start:esm_getAbsoluteTime(el),end:esm_getAbsoluteTime(E),name:v,data:{size:ec,decodedBodySize:x,encodedBodySize:T,duration:k,domInteractive:en,domContentLoadedEventStart:K,domContentLoadedEventEnd:et,loadEventStart:er,loadEventEnd:ei,domComplete:E,redirectCount:es}}}};function webVitalHandler(m,g){return({metric:v})=>void g.replayPerformanceEntries.push(m(v))}function createPerformanceEntry(m){let g=rc[m.entryType];return g?g(m):null}function esm_getAbsoluteTime(m){return(((0,eY.Z1)()||nA.performance.timeOrigin)+m)/1e3}function getLargestContentfulPaint(m){let g=m.entries[m.entries.length-1],v=g?.element?[g.element]:void 0;return getWebVital(m,"largest-contentful-paint",v)}function getCumulativeLayoutShift(m){let g=[],v=[];for(let x of m.entries)if(void 0!==x.sources){let m=[];for(let g of x.sources)if(g.node){v.push(g.node);let x=record.mirror.getId(g.node);x&&m.push(x)}g.push({value:x.value,nodeIds:m.length?m:void 0})}return getWebVital(m,"cumulative-layout-shift",v,g)}function getInteractionToNextPaint(m){let g=m.entries[m.entries.length-1],v=g?.target?[g.target]:void 0;return getWebVital(m,"interaction-to-next-paint",v)}function getWebVital(m,g,v,x){let k=m.value,E=m.rating,T=esm_getAbsoluteTime(k);return{type:"web-vital",name:g,start:T,end:T,data:{value:k,size:k,rating:E,nodeIds:v?v.map(m=>record.mirror.getId(m)):void 0,attributions:x}}}let rd=["log","warn","error"],rp=function(){let m={exception:()=>void 0,infoTick:()=>void 0,setConfig:m=>{m.captureExceptions,m.traceInternals}};return rd.forEach(g=>{m[g]=()=>void 0}),m}();let EventBufferSizeExceededError=class EventBufferSizeExceededError extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}};let EventBufferArray=class EventBufferArray{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(m){let g=JSON.stringify(m).length;if(this._totalSize+=g,this._totalSize>2e7)throw new EventBufferSizeExceededError;this.events.push(m)}finish(){return new Promise(m=>{let g=this.events;this.clear(),m(JSON.stringify(g))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let m=null;for(let{timestamp:g}of this.events)(null===m||g<m)&&(m=g);return null===m?m:timestampToMs(m)}};let WorkerHandler=class WorkerHandler{constructor(m){this._onMessage=({data:m})=>
21{if("number"!=typeof m.id)return;let g=this._pending.get(m.id);if(g&&g.method===m.method){if(this._pending.delete(m.id),!m.success){g.reject(Error("Error in compression worker"));return}g.resolve(m.response)}},this._worker=m,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise((m,g)=>{this._worker.addEventListener("message",({data:v})=>{v.success?m():g(Error("Received worker message with unsuccessful status"))},{once:!0}),this._worker.addEventListener("error",m=>{g(Error(`Failed to load Replay compression worker: ${m instanceof ErrorEvent&&m.message?m.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})})),this._ensureReadyPromise}destroy(){this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(m=>m.reject(Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(m,g){let v=this._getAndIncrementId();return new Promise((x,k)=>{this._pending.set(v,{method:m,resolve:x,reject:k});try{this._worker.postMessage({id:v,method:m,arg:g})}catch(m){this._pending.delete(v),k(m)}})}_getAndIncrementId(){return this._id++}};let EventBufferCompressionWorker=class EventBufferCompressionWorker{constructor(m){this._worker=new WorkerHandler(m),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(m){let g=timestampToMs(m.timestamp);(!this._earliestTimestamp||g<this._earliestTimestamp)&&(this._earliestTimestamp=g);let v=JSON.stringify(m);return(this._totalSize+=v.length,this._totalSize>2e7)?Promise.reject(new EventBufferSizeExceededError):this._sendEventToWorker(v)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,m=>{})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(m){return this._worker.postMessage("addEvent",m)}async _finishRequest(){let m=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,m}};let EventBufferProxy=class EventBufferProxy{constructor(m){this._fallback=new EventBufferArray,this._compression=new EventBufferCompressionWorker(m),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(m){this._used.hasCheckout=m}set waitForCheckout(m){this._used.waitForCheckout=m}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(m){return this._used.addEvent(m)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(m){return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:m,hasCheckout:g,waitForCheckout:v}=this._fallback,x=[];for(let g of m)x.push(this._compression.addEvent(g));this._compression.hasCheckout=g,this._compression.waitForCheckout=v,this._used=this._compression;try{await Promise.all(x),this._fallback.clear()}catch(m){}}};function hasSessionStorage(){try{return"sessionStorage"in nA&&!!nA.sessionStorage}catch{return!1}}function isSampled(m){return void 0!==m&&Math.random()<m}function saveSession(m){if(hasSessionStorage())try{nA.sessionStorage.setItem(nM,JSON.stringify(m))}catch{}}function makeSession(m){let g=Date.now(),v=m.id||(0,eP.DM)(),x=m.started||g,k=m.lastActivity||g,E=m.segmentId||0,T=m.sampled,K=m.previousSessionId,et=m.dirty||!1;return{id:v,started:x,lastActivity:k,segmentId:E,sampled:T,previousSessionId:K,dirty:et}}function createSession({sessionSampleRate:m,allowBuffering:g,stickySession:v=!1},{previousSessionId:x}={}){let k=isSampled(m)?"session":!!g&&"buffer",E=makeSession({sampled:k,previousSessionId:x});return v&&saveSession(E),E}function isExpired(m,g,v=+new Date){return null===m||void 0===g||g<0||0!==g&&m+g<=v}function shouldRefreshSession(m,{sessionIdleExpire:g,maxReplayDuration:v}){return!!function(m,{maxReplayDuration:g,sessionIdleExpire:v,targetTime:x=Date.now()}){return isExpired(m.started,g,x)||isExpired(m.lastActivity,v,x)}(m,{sessionIdleExpire:g,maxReplayDuration:v})&&("buffer"!==m.sampled||0!==m.segmentId)}function loadOrCreateSession({sessionIdleExpire:m,maxReplayDuration:g,previousSessionId:v},x){let k=x.stickySession&&function(){if(!hasSessionStorage())return null;try{let m=nA.sessionStorage.getItem(nM);if(!m)return null;let g=JSON.parse(m);return makeSession(g)}catch{return null}}();return k?shouldRefreshSession(k,{sessionIdleExpire:m,maxReplayDuration:g})?createSession(x,{previousSessionId:k.id}):k:createSession(x,{previousSessionId:v})}function addEventSync(m,g,v){return!!shouldAddEvent(m,g)&&(_addEvent(m,g,v),!0)}async function _addEvent(m,g,v){let{eventBuffer:x}=m;if(!x||x.waitForCheckout&&!v)return null;let k="buffer"===m.recordingMode;try{v&&k&&x.clear(),v&&(x.hasCheckout=!0,x.waitForCheckout=!1);let E=m.getOptions(),T=function(m,g){try{if("function"==typeof g&&m.type===n0.Custom)return g(m)}catch(m){return null}return m}(g,E.beforeAddRecordingEvent);if(!T)return;return await x.addEvent(T)}
21catch(E){if(!m.isEnabled())return m.handleException(E),null;let g=E&&E instanceof EventBufferSizeExceededError,v=(0,eA.s3)();if(v&&v.recordDroppedEvent(g?"buffer_overflow":"internal_sdk_error","replay"),g&&k)return x.clear(),x.waitForCheckout=!0,null;m.handleException(E),await m.stop({reason:g?"eventBufferOverflow":"eventBufferError"})}}function shouldAddEvent(m,g){if(!m.eventBuffer||m.isPaused()||!m.isEnabled())return!1;let v=timestampToMs(g.timestamp);return!(v+m.timeouts.sessionIdlePause<Date.now())&&!(v>m.getContext().initialTimestamp+m.getOptions().maxReplayDuration)}function addSegmentDetailsToContext(m,g,v){let x=m.getContext();g&&x.traceIds.size<100&&x.traceIds.add(g),v&&x.segmentNames.size<100&&x.segmentNames.add(v)}function esm_isTransactionEvent(m){return"transaction"===m.type}function isFeedbackEvent(m){return"feedback"===m.type}function isBreadcrumbWithCategory(m){return!!m.category}function resetReplayIdOnDynamicSamplingContext(){let m=(0,eA.nZ)().getPropagationContext().dsc;m&&delete m.replay_id;let g=(0,eF.HN)();if(g){let m=(0,eU.jC)(g);delete m.replay_id}}function setReplayIdOnDynamicSamplingContext(m){let g=(0,eA.nZ)().getPropagationContext().dsc;g&&(g.replay_id=m);let v=(0,eF.HN)();if(v){let g=(0,eU.jC)(v);g.replay_id=m}}function createPerformanceSpans(m,g){return g.map(({type:g,start:v,end:x,name:k,data:E})=>{let T=m.throttledAddEvent({type:n0.Custom,timestamp:v,data:{tag:"performanceSpan",payload:{op:g,description:k,startTimestamp:v,endTimestamp:x,data:E}}});return"string"==typeof T?Promise.resolve(null):T})}function addNetworkBreadcrumb(m,g){m.isEnabled()&&null!==g&&!function(m,g){let v=g?.getDsn(),x=g?.getOptions().tunnel;return function(m,g){var v,x;let k=parseStringToURLObject(m);return!(!k||isURLObjectRelative(k))&&!!g&&((v=k.hostname)===(x=g.host)||x.length>0&&v.endsWith(`.${x}`))&&/(^|&|\?)sentry_key=/.test(k.search)}(m,v)||!!x&&removeTrailingSlash(m)===removeTrailingSlash(x)}(g.name,(0,eA.s3)())&&m.addUpdate(()=>(createPerformanceSpans(m,[g]),!0))}function getBodySize(m){if(!m)return;let g=new TextEncoder;try{if("string"==typeof m)return g.encode(m).length;if(m instanceof URLSearchParams)return g.encode(m.toString()).length;if(m instanceof FormData){let v=serializeFormData(m);return g.encode(v).length}if(m instanceof Blob)return m.size;if(m instanceof ArrayBuffer)return m.byteLength}catch{}}function parseContentLengthHeader(m){if(!m)return;let g=parseInt(m,10);return isNaN(g)?void 0:g}function mergeWarning(m,g){if(!m)return{headers:{},size:void 0,_meta:{warnings:[g]}};let v={...m._meta},x=v.warnings||[];return v.warnings=[...x,g],m._meta=v,m}function makeNetworkReplayBreadcrumb(m,g){if(!g)return null;let{startTimestamp:v,endTimestamp:x,url:k,method:E,statusCode:T,request:K,response:et}=g;return{type:m,start:v/1e3,end:x/1e3,name:k,data:{method:E,statusCode:T,request:K,response:et}}}function buildSkippedNetworkRequestOrResponse(m){return{headers:{},size:m,_meta:{warnings:["URL_SKIPPED"]}}}function buildNetworkRequestOrResponse(m,g,v){if(!g&&0===Object.keys(m).length)return;if(!g)return{headers:m};if(!v)return{headers:m,size:g};let x={headers:m,size:g},{body:k,warnings:E}=function(m){if(!m||"string"!=typeof m)return{body:m};let g=m.length>15e4,v=function(m){let g=m[0],v=m[m.length-1];return"["===g&&"]"===v||"{"===g&&"}"===v}(m);if(g){let g=m.slice(0,15e4);return v?{body:g,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${g}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(v)try{let g=JSON.parse(m);return{body:g}}catch{}return{body:m}}(v);return x.body=k,E?.length&&(x._meta={warnings:E}),x}function getAllowedHeaders(m,g){return Object.entries(m).reduce((v,[x,k])=>{let E=x.toLowerCase();return g.includes(E)&&m[x]&&(v[E]=k),v},{})}function urlMatches(m,g){let v=function(m,g=nA.document.baseURI){if(m.startsWith("http://")||m.startsWith("https://")||m.startsWith(nA.location.origin))return m;let v=new URL(m,g);if(v.origin!==new URL(g).origin)return m;let x=v.href;return!m.endsWith("/")&&x.endsWith("/")?x.slice(0,-1):x}(m);return(0,eT.U0)(v,g)}async function captureFetchBreadcrumbToReplay(m,g,v){try{let x=await _prepareFetchData(m,g,v),k=makeNetworkReplayBreadcrumb("resource.fetch",x);
21addNetworkBreadcrumb(v.replay,k)}catch(m){}}async function _prepareFetchData(m,g,v){let x=Date.now(),{startTimestamp:k=x,endTimestamp:E=x}=g,{url:T,method:K,status_code:et=0,request_body_size:en,response_body_size:er}=m.data,ei=urlMatches(T,v.networkDetailAllowUrls)&&!urlMatches(T,v.networkDetailDenyUrls),es=ei?function({networkCaptureBodies:m,networkRequestHeaders:g},v,x){let k=v?1===v.length&&"string"!=typeof v[0]?getHeadersFromOptions(v[0],g):2===v.length?getHeadersFromOptions(v[1],g):{}:{};if(!m)return buildNetworkRequestOrResponse(k,x,void 0);let E=getFetchRequestArgBody(v),[T,K]=getBodyString(E,rp),et=buildNetworkRequestOrResponse(k,x,T);return K?mergeWarning(et,K):et}(v,g.input,en):buildSkippedNetworkRequestOrResponse(en),el=await _getResponseInfo(ei,v,g.response,er);return{startTimestamp:k,endTimestamp:E,url:T,method:K,statusCode:et,request:es,response:el}}async function _getResponseInfo(m,{networkCaptureBodies:g,networkResponseHeaders:v},x,k){if(!m&&void 0!==k)return buildSkippedNetworkRequestOrResponse(k);let E=x?getAllHeaders(x.headers,v):{};if(!x||!g&&void 0!==k)return buildNetworkRequestOrResponse(E,k,void 0);let[T,K]=await _parseFetchResponseBody(x),et=function(m,{networkCaptureBodies:g,responseBodySize:v,captureDetails:x,headers:k}){try{let E=m?.length&&void 0===v?getBodySize(m):v;if(!x)return buildSkippedNetworkRequestOrResponse(E);if(g)return buildNetworkRequestOrResponse(k,E,m);return buildNetworkRequestOrResponse(k,E,void 0)}catch(m){return buildNetworkRequestOrResponse(k,v,void 0)}}(T,{networkCaptureBodies:g,responseBodySize:k,captureDetails:m,headers:E});return K?mergeWarning(et,K):et}async function _parseFetchResponseBody(m){let g=function(m){try{return m.clone()}catch(m){}}(m);if(!g)return[void 0,"BODY_PARSE_ERROR"];try{let m=await new Promise((m,v)=>{let x=getNativeImplementation_setTimeout(()=>v(Error("Timeout while trying to read response body")),500);_getResponseText(g).then(g=>m(g),m=>v(m)).finally(()=>clearTimeout(x))});return[m]}catch(m){if(m instanceof Error&&m.message.indexOf("Timeout")>-1)return[void 0,"BODY_PARSE_TIMEOUT"];return[void 0,"BODY_PARSE_ERROR"]}}function getAllHeaders(m,g){let v={};return g.forEach(g=>{m.get(g)&&(v[g]=m.get(g))}),v}function getHeadersFromOptions(m,g){if(!m)return{};let v=m.headers;return v?v instanceof Headers?getAllHeaders(v,g):Array.isArray(v)?{}:getAllowedHeaders(v,g):{}}async function _getResponseText(m){return await m.text()}async function captureXhrBreadcrumbToReplay(m,g,v){try{let x=function(m,g,v){let x=Date.now(),{startTimestamp:k=x,endTimestamp:E=x,input:T,xhr:K}=g,{url:et,method:en,status_code:er=0,request_body_size:ei,response_body_size:es}=m.data;if(!et)return null;if(!K||!urlMatches(et,v.networkDetailAllowUrls)||urlMatches(et,v.networkDetailDenyUrls)){let m=buildSkippedNetworkRequestOrResponse(ei),g=buildSkippedNetworkRequestOrResponse(es);return{startTimestamp:k,endTimestamp:E,url:et,method:en,statusCode:er,request:m,response:g}}let el=K[td],ec=el?getAllowedHeaders(el.request_headers,v.networkRequestHeaders):{},eu=getAllowedHeaders(parseXhrResponseHeaders(K),v.networkResponseHeaders),[ed,ep]=v.networkCaptureBodies?getBodyString(T,rp):[void 0],[em,ef]=v.networkCaptureBodies?function(m){let g=[];try{return[m.responseText]}catch(m){g.push(m)}try{return function(m,g){try{if("string"==typeof m)return[m];if(m instanceof Document)return[m.body.outerHTML];if("json"===g&&(0,eX.yD)(m))return[JSON.stringify(m)];if(!m)return[void 0]}catch(m){return[void 0,"BODY_PARSE_ERROR"]}return[void 0,"UNPARSEABLE_BODY_TYPE"]}(m.response,m.responseType)}catch(m){g.push(m)}return[void 0]}(K):[void 0],eh=buildNetworkRequestOrResponse(ec,ei,ed),eg=buildNetworkRequestOrResponse(eu,es,em);return{startTimestamp:k,endTimestamp:E,url:et,method:en,statusCode:er,request:ep?mergeWarning(eh,ep):eh,response:ef?mergeWarning(eg,ef):eg}}(m,g,v),k=makeNetworkReplayBreadcrumb("resource.xhr",x);addNetworkBreadcrumb(v.replay,k)}catch(m){}}async function addMemoryEntry(m){try{return Promise.all(createPerformanceSpans(m,[function(m){let{jsHeapSizeLimit:g,totalJSHeapSize:v,usedJSHeapSize:x}=m,k=Date.now()/1e3;return{type:"memory",name:"memory",start:k,end:k,data:{memory:{jsHeapSizeLimit:g,totalJSHeapSize:v,usedJSHeapSize:x}}}}(nA.performance.memory)]))}catch{return[]}}let rm=ek.GLOBAL_OBJ.navigator;async function prepareReplayEvent({client:m,scope:g,replayId:v,event:x}){let k="object"!=typeof m._integrations||null===m._integrations||Array.isArray(m._integrations)?void 0:Object.keys(m._integrations),E={event_id:v,integrations:k};m.emit("preprocessEvent",x,E);let T=await (0,e1.R)(m.getOptions(),x,E,g,m,(0,eA.aF)());if(!T)return null;m.emit("postprocessEvent",T,E),T.platform=T.platform||"javascript";let K=m.getSdkMetadata(),{name:et,version:en,settings:er}=K?.sdk||{};
21return T.sdk={...T.sdk,name:et||"sentry.javascript.unknown",version:en||"0.0.0",settings:er},T}async function sendReplayRequest({recordingData:m,replayId:g,segmentId:v,eventContext:x,timestamp:k,session:E}){var T;let K;let et=function({recordingData:m,headers:g}){let v;let x=`${JSON.stringify(g)}
22`;if("string"==typeof m)v=`${x}${m}`;else{let g=new TextEncoder,k=g.encode(x);(v=new Uint8Array(k.length+m.length)).set(k),v.set(m,k.length)}return v}({recordingData:m,headers:{segment_id:v}}),{urls:en,errorIds:er,traceIds:ei,segmentNames:es,initialTimestamp:el}=x,ec=(0,eA.s3)(),eu=(0,eA.nZ)(),ed=ec?.getTransport(),ep=ec?.getDsn();if(!ec||!ed||!ep||!E.sampled)return Promise.resolve({});let em={type:"replay_event",replay_start_timestamp:el/1e3,timestamp:k/1e3,error_ids:er,trace_ids:ei,segment_names:es,urls:en,replay_id:g,segment_id:v,replay_type:E.sampled},ef=await prepareReplayEvent({scope:eu,client:ec,replayId:g,event:em});if(!ef)return ec.recordDroppedEvent("event_processor","replay"),Promise.resolve({});delete ef.sdkProcessingMetadata;let eh=(T=ec.getOptions().tunnel,createEnvelope(createEventEnvelopeHeaders(ef,getSdkMetadataForEnvelopeHeader(ef),T,ep),[[{type:"replay_event"},ef],[{type:"replay_recording",length:"string"==typeof et?new TextEncoder().encode(et).length:et.length},et]]));try{K=await ed.send(eh)}catch(g){let m=Error(nD);try{m.cause=g}catch{}throw m}let eg=updateRateLimits({},K);if(isRateLimited(eg,"replay"))throw new RateLimitError(eg);if("number"==typeof K.statusCode&&(K.statusCode<200||K.statusCode>=300))throw new TransportStatusCodeError(K.statusCode);return K}let TransportStatusCodeError=class TransportStatusCodeError extends Error{constructor(m){super(`Transport returned status code ${m}`)}};let RateLimitError=class RateLimitError extends Error{constructor(m){super("Rate limit hit"),this.rateLimits=m}};let ReplayDurationLimitError=class ReplayDurationLimitError extends Error{constructor(){super("Session is too long, not sending replay")}};async function sendReplay(m,g={count:0,interval:5e3}){let{recordingData:v,onError:x}=m;if(v.length)try{return await sendReplayRequest(m),!0}catch(v){if(v instanceof TransportStatusCodeError||v instanceof RateLimitError)throw v;if((0,eN.v)("Replays",{_retryCount:g.count}),x&&x(v),g.count>=3){let m=Error(`${nD} - max retries exceeded`);try{m.cause=v}catch{}throw m}return g.interval*=++g.count,new Promise((v,x)=>{getNativeImplementation_setTimeout(async()=>{try{await sendReplay(m,g),v(!0)}catch(m){x(m)}},g.interval)})}}let rf="__THROTTLED";let ReplayContainer=class ReplayContainer{constructor({options:m,recordingOptions:g}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=g,this._options=m,this._debouncedFlush=function(m,g,v){let x,k,E;let T=v?.maxWait?Math.max(v.maxWait,g):0,K=v?.setTimeoutImpl||setTimeout;function invokeFunc(){return cancelTimers(),x=m()}function cancelTimers(){void 0!==k&&clearTimeout(k),void 0!==E&&clearTimeout(E),k=E=void 0}function debounced(){return k&&clearTimeout(k),k=K(invokeFunc,g),T&&void 0===E&&(E=K(invokeFunc,T)),x}return debounced.cancel=cancelTimers,debounced.flush=function(){return void 0!==k||void 0!==E?invokeFunc():x},debounced}(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay,setTimeoutImpl:getNativeImplementation_setTimeout}),this._throttledAddEvent=function(m,g,v){let x=new Map,_cleanup=m=>{let g=m-5;x.forEach((m,v)=>{v<g&&x.delete(v)})},_getTotalCount=()=>[...x.values()].reduce((m,g)=>m+g,0),k=!1;return(...g)=>{let v=Math.floor(Date.now()/1e3);if(_cleanup(v),_getTotalCount()>=300){let m=k;return k=!0,m?"__SKIPPED":rf}k=!1;let E=x.get(v)||0;return x.set(v,E+1),m(...g)}}((m,g)=>shouldAddEvent(this,m)?_addEvent(this,m,g):Promise.resolve(null),0,0);let{slowClickTimeout:v,slowClickIgnoreSelectors:x}=this.getOptions(),k=v?{threshold:Math.min(3e3,v),timeout:v,scrollTimeout:300,ignoreSelector:x?x.join(","):""}:void 0;k&&(this.clickDetector=new ClickDetector(this,k)),this._handleVisibilityChange=()=>{"visible"===nA.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroun
22dTasks()},this._handleWindowBlur=()=>{let m=createBreadcrumb({category:"ui.blur"});this._doChangeToBackgroundTasks(m)},this._handleWindowFocus=()=>{let m=createBreadcrumb({category:"ui.focus"});this._doChangeToForegroundTasks(m)},this._handleKeyboardEvent=m=>{!function(m,g){if(!m.isEnabled())return;m.updateUserActivity();let v=function(m){var g;let{metaKey:v,shiftKey:x,ctrlKey:k,altKey:E,key:T,target:K}=m;if(!K||"INPUT"===(g=K).tagName||"TEXTAREA"===g.tagName||g.isContentEditable||!T)return null;let et=1===T.length;if(!(v||k||E)&&et)return null;let en=htmlTreeAsString_htmlTreeAsString(K,{maxStringLength:200})||"<unknown>",er=getBaseDomBreadcrumb(K,en);return createBreadcrumb({category:"ui.keyDown",message:en,data:{...er.data,metaKey:v,shiftKey:x,ctrlKey:k,altKey:E,key:T}})}(g);v&&addBreadcrumbEvent(m,v)}(this,m)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(m){this._options.onError&&this._options.onError(m)}initializeSampling(m){let{errorSampleRate:g,sessionSampleRate:v}=this._options,x=g<=0&&v<=0;this._requiresManualStart=x,!x&&(this._initializeSessionForSampling(m),this.session)&&!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",this._initializeRecording())}start(){if(this._isEnabled&&"session"===this.recordingMode||this._isEnabled&&"buffer"===this.recordingMode)return;this._updateUserActivity();let m=loadOrCreateSession({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=m,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled)return;let m=loadOrCreateSession({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=m,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{var m;let g;let v=this._canvas;this._stopRecording=record({...this._recordingOptions,..."buffer"===this.recordingMode?{checkoutEveryNms:6e4}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:(m=this,g=!1,(v,x)=>{try{if(!m.checkAndHandleExpiredSession())return;let k=x||!g;g=!0,function(m){let g=m.data;if(m.type===n0.IncrementalSnapshot&&g&&"object"==typeof g&&"source"in g&&g.source===n1.Mutation&&"attributes"in g&&Array.isArray(g.attributes))for(let m of g.attributes){let g=record.mirror.getNode(m.id),v=g&&record.mirror.getMeta(g);if(v?.type===ro.Element)for(let[g,x]of Object.entries(m.attributes))null===x?delete v.attributes[g]:v.attributes[g]=x}}(v),m.clickDetector&&function(m,g){try{if(3!==g.type)return;let{source:v}=g.data;if(ri.has(v)&&m.registerMutation(g.timestamp),v===n1.Scroll&&m.registerScroll(g.timestamp),g.data.source===n1.MouseInteraction){let{type:v,id:x}=g.data,k=record.mirror.getNode(x);k instanceof HTMLElement&&v===n2.Click&&m.registerClick(k)}}catch{}}(m.clickDetector,v),m.addUpdate(()=>{if("buffer"===m.recordingMode&&k&&m.setInitialState(),!addEventSync(m,v,k))return!0;if(!k)return!1;let g=m.session;if(k&&m.session?.segmentId===0&&addEventSync(m,function(m){let g=m.getOptions();return{type:n0.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:m.isRecordingCanvas(),sessionSampleRate:g.sessionSampleRate,errorSampleRate:g.errorSampleRate,useCompressionOption:g.useCompression,blockAllMedia:g.blockAllMedia,maskAllText:g.maskAllText,maskAllInputs:g.maskAllInputs,useCompression:!!m.eventBuffer&&"worker"===m.eventBuffer.type,networkDetailHasUrls:g.networkDetailAllowUrls.length>0,networkCaptureBodies:g.networkCaptureBodies,networkRequestHasHeaders:g.networkRequestHeaders.length>0,networkResponseHasHeaders:g.networkResponseHeaders.length>0}}}}(m),!1),"buffer"===m.recordingMode&&g&&m.eventBuffer&&!g.dirty){let v=m.eventBuffer.getEarliestTimestamp();v&&(g.started=v,m.getOptions().stickySession&&saveSession(g))}
22return!!g?.previousSessionId||("session"===m.recordingMode&&m.flush(),!0)})}catch(g){m.handleException(g)}}),.../iPhone|iPad|iPod/i.test(rm?.userAgent??"")||/Macintosh/i.test(rm?.userAgent??"")&&rm?.maxTouchPoints&&rm?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{},onMutation:this._onMutationHandler.bind(this),...v?{recordCanvas:v.recordCanvas,getCanvasManager:v.getCanvasManager,sampling:v.sampling,dataURLOptions:v.dataURLOptions}:{}})}catch(m){this.handleException(m)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(m){return this.handleException(m),!1}}async stop({forceFlush:m=!1,reason:g}={}){if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer",eA.s3()?.emit("replayEnd",{sessionId:this.session?.id,reason:g??"manual"});try{resetReplayIdOnDynamicSamplingContext(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),m&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,function(){if(hasSessionStorage())try{nA.sessionStorage.removeItem(nM)}catch{}}(),this.session=void 0}catch(m){this.handleException(m)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording())}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording())}async sendBufferedReplayOrFlush({continueRecording:m=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();let g=Date.now();await this.flushImmediate();let v=this.stopRecording();m&&v&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(g),this._updateSessionActivity(g),this._maybeSaveSession(),setReplayIdOnDynamicSamplingContext(this.session.id)),this.startRecording())}addUpdate(m){let g=m();"buffer"!==this.recordingMode&&this._isEnabled&&!0!==g&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(m){if(!m||this.session?.sampled!==!1)return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&isExpired(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let m=`${nA.location.pathname}${nA.location.hash}${nA.location.search}`,g=`${nA.location.origin}${m}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=g,this._context.initialTimestamp=Date.now(),this._context.urls.push(g)}throttledAddEvent(m,g){let v=this._throttledAddEvent(m,g);if(v===rf){let m=createBreadcrumb({category:"replay.throttled"});this.addUpdate(()=>!addEventSync(this,{type:5,timestamp:m.timestamp||0,data:{tag:"breadcrumb",payload:m,metric:!0}}))}return v}getCurrentRoute(){let m=this.lastActiveSpan||(0,eF.HN)(),g=m&&(0,eF.Gx)(m),v=g&&(0,eF.XU)(g).data||{},x=v[eL.Zj];if(g&&x&&["route","custom"].includes(x))return(0,eF.XU)(g).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=function({useCompression:m,workerUrl:g}){if(m&&window.Worker){let m=function(m){try{let g=m||("undefined"!=typeof __SENTRY_EXCLUDE_REPLAY_WORKER__&&__SENTRY_EXCLUDE_REPLAY_WORKER__?"":function(){let m=new Blob(['
vendor: 10,329 bytes, line 22
22var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});
22'],{type:"text/javascript"});return URL.createObjectURL(m)}());if(!g)return;let v=new Worker(g);return new EventBufferProxy(v)}catch(m){}}(g);if(m)return m}return new EventBufferArray}({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&eA.s3()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),"session"===this.recordingMode&&this.session&&setReplayIdOnDynamicSamplingContext(this.session.id)}_initializeSessionForSampling(m){let g=this._options.errorSampleRate>0,v=loadOrCreateSession({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:m},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:g});this.session=v}_checkSession(){if(!this.session)return!1;let m=this.session;return!shouldRefreshSession(m,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(m),!1)}async _refreshSession(m){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(m.id))}_addListeners(){try{nA.document.addEventListener("visibilitychange",this._handleVisibilityChange),nA.addEventListener("blur",this._handleWindowBlur),nA.addEventListener("focus",this._handleWindowFocus),nA.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(function(m){let g=(0,eA.s3)();addClickKeypressInstrumentationHandler(handleDomListener(m)),addHistoryInstrumentationHandler(g=>{if(!m.isEnabled())return;let v=function(m){let{from:g,to:v}=m,x=Date.now()/1e3;return{type:"navigation.push",start:x,end:x,name:v,data:{previous:g}}}(g);null!==v&&(m.getContext().urls.push(v.name),m.triggerUserActivity(),m.addUpdate(()=>(createPerformanceSpans(m,[v]),!1)))}),function(m){let g=(0,eA.s3)();g&&g.on("beforeAddBreadcrumb",g=>(function(m,g){if(!m.isEnabled()||!isBreadcrumbWithCategory(g))return;let v=!isBreadcrumbWithCategory(g)||["fetch","xhr","sentry.event","sentry.transaction"].includes(g.category)||g.category.startsWith("ui.")?null:"console"===g.category?function(m){let g=m.data?.arguments;if(!Array.isArray(g)||0===g.length)return createBreadcrumb(m);let v=!1,x=g.map(m=>{if(!m)return m;if("string"==typeof m)return m.length>5e3?(v=!0,`${m.slice(0,5e3)}\u2026`):m;if("object"==typeof m)try{let g=(0,eB.Fv)(m,7),x=JSON.stringify(g);if(x.length>5e3)return v=!0,`${JSON.stringify(g,null,2).slice(0,5e3)}\u2026`;return g}catch{}return m});return createBreadcrumb({...m,data:{...m.data,arguments:x,...v?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(g):createBreadcrumb(g);v&&addBreadcrumbEvent(m,v)})(m,g))}(m),function(m){let g=(0,eA.s3)();try{let{networkDetailAllowUrls:v,networkDetailDenyUrls:x,networkCaptureBodies:k,networkRequestHeaders:E,networkResponseHeaders:T}=m.getOptions(),K={replay:m,networkDetailAllowUrls:v,networkDetailDenyUrls:x,networkCaptureBodies:k,networkRequestHeaders:E,networkResponseHeaders:T};g&&g.on("beforeAddBreadcrumb",(m,g)=>(function(m,g,v){if(g.data)try{"xhr"===g.category&&v?.xhr&&(function(m,g){let{xhr:v,input:x}=g;if(!v)return;let k=getBodySize(x),E=v.getResponseHeader("content-length")?parseContentLengthHeader(v.getResponseHeader("content-length")):function(m,g){try{let v="json"===g&&(0,eX.yD)(m)?JSON.stringify(m):m;return getBodySize(v)}catch{return}}(v.response,v.responseType);void 0!==k&&(m.data.request_body_size=k),void 0!==E&&(m.data.response_body_size=E)}(g,v),captureXhrBreadcrumbToReplay(g,v,m)),"fetch"===g.category&&v?.input!==void 0&&(function(m,g){let{input:v,response:x}=g,k=v?getFetchRequestArgBody(v):void 0,E=getBodySize(k),T=x?parseContentLengthHeader(x.headers.get("content-length")):void 0;void 0!==E&&(m.data.request_body_size=E),void 0!==T&&(m.data.response_body_size=T)}(g,v),captureFetchBreadcrumbToReplay(g,v,m))}catch(m){}})(K,m,g))}catch{}}(m);let v=Object.assign((g,v)=>{if(m.session&&shouldRefreshSession(m.session,{maxReplayDuration:m.getOptions().maxReplayDuration,sessionIdleExpire:m.timeouts.sessionIdleExpire})&&resetReplayIdOnDynamicSamplingContext(),!m.isEnabled()||m.isPau
22sed())return g;if("replay_event"===g.type)return delete g.breadcrumbs,g;if(g.type&&!esm_isTransactionEvent(g)&&!isFeedbackEvent(g))return g;let x=m.checkAndHandleExpiredSession();if(!x)return resetReplayIdOnDynamicSamplingContext(),g;if(isFeedbackEvent(g))return m.flush(),g.contexts.feedback.replay_id=m.getSessionId(),m.triggerUserActivity(),m.addUpdate(()=>!g.timestamp||(m.throttledAddEvent({type:n0.Custom,timestamp:1e3*g.timestamp,data:{tag:"breadcrumb",payload:{timestamp:g.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:g.event_id}}}}),!1)),g;if(!g.type&&g.exception?.values?.length&&v.originalException?.__rrweb__&&!m.getOptions()._experiments.captureExceptions)return null;let k="buffer"===m.recordingMode&&g.message!==nD&&!!g.exception&&!g.type&&isSampled(m.getOptions().errorSampleRate),E=k||"session"===m.recordingMode;if(E&&(g.tags={...g.tags,replayId:m.getSessionId()}),k&&"buffer"===m.recordingMode&&m.session?.sampled==="buffer"){let g=m.session;g.dirty=!0,m.getOptions().stickySession&&saveSession(g)}return g},{id:"Replay"});(0,eN.Qy)(v),g&&(g.on("beforeSendEvent",g=>{m.isEnabled()&&!g.type&&function(m,g){let v=g.exception?.values?.[0]?.value;if("string"==typeof v&&(v.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||v.match(/(does not match server-rendered HTML|Hydration failed because)/i))){let g=createBreadcrumb({category:"replay.hydrate-error",data:{url:getLocationHref()}});addBreadcrumbEvent(m,g)}}(m,g)}),g.on("afterSendEvent",(g,v)=>{if(!m.isEnabled()||g.type&&!esm_isTransactionEvent(g))return;let x=v.statusCode;if(x&&!(x<200)&&!(x>=300)){if(esm_isTransactionEvent(g)){addSegmentDetailsToContext(m,g.contexts?.trace?.trace_id,g.transaction);return}(function(m,g){let v=m.getContext();if(g.event_id&&v.errorIds.size<100&&v.errorIds.add(g.event_id),"buffer"!==m.recordingMode||!g.tags?.replayId)return;let{beforeErrorSampling:x}=m.getOptions();("function"!=typeof x||x(g))&&getNativeImplementation_setTimeout(async()=>{try{await m.sendBufferedReplayOrFlush()}catch(g){m.handleException(g)}})})(m,g)}}),g.on("createDsc",g=>{let v=m.getSessionId();if(v&&m.isEnabled()&&"session"===m.recordingMode){let x=m.checkAndHandleExpiredSession();x&&(g.replay_id=v)}}),g.on("processSegmentSpan",g=>{m.isEnabled()&&addSegmentDetailsToContext(m,g.trace_id,g.name||void 0)}),g.on("spanStart",g=>{m.lastActiveSpan=g}),g.on("spanEnd",g=>{m.lastActiveSpan=g}),g.on("beforeSendFeedback",async(g,v)=>{let x=m.getSessionId();v?.includeReplay&&m.isEnabled()&&x&&g.contexts?.feedback&&("api"===g.contexts.feedback.source&&await m.sendBufferedReplayOrFlush(),g.contexts.feedback.replay_id=x)}),g.on("openFeedbackWidget",async()=>{await m.sendBufferedReplayOrFlush()}))}(this),this._hasInitializedCoreListeners=!0)}catch(m){this.handleException(m)}this._performanceCleanupCallback=function(m){function addPerformanceEntry(g){m.performanceEntries.includes(g)||m.performanceEntries.push(g)}function onEntries({entries:m}){m.forEach(addPerformanceEntry)}let g=[];return["navigation","paint","resource"].forEach(m=>{g.push(addPerformanceInstrumentationHandler(m,onEntries))}),g.push(addLcpInstrumentationHandler(webVitalHandler(getLargestContentfulPaint,m)),addClsInstrumentationHandler(webVitalHandler(getCumulativeLayoutShift,m)),addInpInstrumentationHandler(webVitalHandler(getInteractionToNextPaint,m))),()=>{g.forEach(m=>m())}}(this)}_removeListeners(){try{nA.document.removeEventListener("visibilitychange",this._handleVisibilityChange),nA.removeEventListener("blur",this._handleWindowBlur),nA.removeEventListener("focus",this._handleWindowFocus),nA.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(m){this.handleException(m)}}_doChangeToBackgroundTasks(m){if(!this.session)return;let g=shouldRefreshSession(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire});if(g){resetReplayIdOnDynamicSamplingContext();return}m&&this._createCustomBreadcrumb(m),this.conditionalFlush()}_doChangeToForegroundTasks(m){if(!this.session)return;let g=this.checkAndHandleExpiredSession();g&&m&&this._createCustomBreadcrumb(m)}_updateUserActivity(m=Date.now()){this._lastActivity=m}_updateSessionActivity(m=Date.now()){this.session&&(this.session.lastActivity=m,this._maybeSaveSession())}_createCustomBreadcrumb(m){this.addUpdate(()=>{this.throttledAddEvent({type:n0.Custom,timestamp:m.timestamp||0,data:{tag:"breadcrumb",payload:m}})})}_addPerformanceEntries(){let m=this.performanceEntries.map(createPerformanceEntry).filter(
22Boolean).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let g=this._context.initialTimestamp/1e3;m=m.filter(m=>m.start>=g)}return Promise.all(createPerformanceSpans(this,m))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:m,eventBuffer:g}=this;if(!m||!g||this._requiresManualStart||m.segmentId)return;let v=g.getEarliestTimestamp();v&&v<this._context.initialTimestamp&&(this._context.initialTimestamp=v)}_popEventContext(){let m={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),m}async _runFlush(){let m=this.getSessionId();if(this.session&&this.eventBuffer&&m&&(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents)&&(await addMemoryEntry(this),this.eventBuffer&&m===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let g=Date.now();if(g-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new ReplayDurationLimitError;let v=this._popEventContext(),x=this.session.segmentId++;this._maybeSaveSession();let k=await this.eventBuffer.finish();await sendReplay({replayId:m,recordingData:k,segmentId:x,eventContext:v,session:this.session,timestamp:g,onError:m=>this.handleException(m)})}catch(g){this.handleException(g),this.stop({reason:"sendError"});let m=(0,eA.s3)();if(m){let v;v=g instanceof RateLimitError?"ratelimit_backoff":g instanceof ReplayDurationLimitError?"invalid":"send_error",m.recordDroppedEvent(v,"replay")}}}async _flush({force:m=!1}={}){if(!this._isEnabled&&!m||!this.checkAndHandleExpiredSession()||!this.session)return;let g=this.session.started,v=Date.now(),x=v-g;this._debouncedFlush.cancel();let k=x<this._options.minReplayDuration,E=x>this._options.maxReplayDuration+5e3;if(k||E){k&&this._debouncedFlush();return}let T=this.eventBuffer;T&&0===this.session.segmentId&&T.hasCheckout;let K=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(m){this.handleException(m)}finally{this._flushLock=void 0,K&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&saveSession(this.session)}_onMutationHandler(m){let{ignoreMutations:g}=this._options._experiments;if(g?.length&&m.some(m=>{let v=function(m){if(!m)return null;try{let g=m.nodeType===m.ELEMENT_NODE?m:m.parentElement;return g}catch{return null}}(m.target),x=g.join(",");return v?.matches(x)}))return!1;let v=m.length,x=this._options.mutationLimit,k=this._options.mutationBreadcrumbLimit,E=x&&v>x;if(v>k||E){let m=createBreadcrumb({category:"replay.mutations",data:{count:v,limit:E}});this._createCustomBreadcrumb(m)}return!E||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}};function getOption(m,g){return[...m,...g].join(",")}let rg='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',rv=["content-length","content-type","accept"],ry=Symbol.for("sentry__originalRequestBody"),rb=!1,rx=!1;function _getMergedNetworkHeaders(m){return[...rv,...m.map(m=>m.toLowerCase())]}var r_=v(93542),rw=v.n(r_);globalThis._sentryRewritesTunnelPath="/monitoring",globalThis.SENTRY_RELEASE={id:"2cb219bdb01611dd2e36cef26a68ed0fecc22b92"},globalThis._sentryBasePath=void 0,globalThis._sentryNextJsVersion="13.5.11",globalThis._sentryRewriteFramesAssetPrefixPath="",globalThis._sentryAssetPrefix=void 0,globalThis._sentryExperimentalThirdPartyOriginStackFrames=void 0,globalThis._sentryRouteManifest='{"isrRoutes":[],"dynamicRoutes":[],"staticRoutes":[]}';let rS=rw().env.SENTRY_DSN||"https://[email protected]/6583558",rC=["/admin","/partner"],rk=["admin","partners"];!function(m){nT&&(0,eE.Cf)(()=>{console.warn("[@sentry/nextjs] You are calling `Sentry.init()` more than once on the client. This can happen if you have both a `sentry.client.config.ts` and a `instrumentation-client.ts` file with `Sentry.init()` calls. It is recommended to call `Sentry.init()` once in `instrumentation-client.ts`.")}),nT=!0,m.debug&&(0,eE.Cf)(()=>{console.warn("[@sentry/nextjs] You have enabled `debug: true`, but Sentry debug logging was removed from your bundle (likely via `withSentryConfig({ disableLogger: true })` / `webpack.treeshake.removeDebugLogging: true`). Set that option to `false` to see Sentry debug output.")}),("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&function(){tt.document&&function(m){let g=maybeParameterizeRoute(m),v=g||m,x=nI.get(v);if(void 0!==x)return x;let k=getManifest();if(!k?.isrRoutes||!Array.isArray(k.isrRoutes)||0===k.isrRoutes.length)return nI.set(v,!1),!1;let E=k.isrRoutes.includes(v);return nI.set(v,E),E}(tt.location.pathname)&&(removeMetaTag("sentry-trace"),removeMetaTag("baggage"));function removeMetaTag(m){try{let g=tt.document.querySelector(`meta[name="${m}"]`);g&&g.remove()}catch{}}}();let g={environment:m.environment||nP.env.SENTRY_ENVIRONMENT||function(m){let g=m?"production":tA.env.VERCEL_ENV;return g?`vercel-${g}`:void 0}(!0)||"production",defaultIntegrations:function(m){let g=getDefaultIntegrations(m);("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&g.push(function(m={}){let g=browserTracingIntegration({...m,instrumentNavigation:!1,instrumentPageLoad:!1,onRequestSpanStart(...g){let[v,{headers:x}]=g;return x?.get("next-router-prefetch")&&v?.setAttribute("http.request.prefetch",!0),m.onRequestSpanStart?.(...g)}}),{instrumentPageLoad:v=!0,instrumentNavigation:x=!0}=m;return{...g,afterAllSetup(m){!isBotUserAgent()&&(x&&function(m){let g=!tt.document.getElementById("__NEXT_DATA__");g?!function(m){tt.addEventListener("popstate",()=>{let g=stripTrailingSlash(tt.location.pathname),v=maybeParameterizeRoute(g);nw.current?.isRecording()?(nw.current.updateName(v??g),nw.current.setAttribute(eL.Zj,v?"route":"url"),v&&nw.current.setAttribute(t_,v),function(m,g,v){m.setAttributes({[tx]:g,[tb]:location_getAbsoluteUrl(v)})}(nw.current,g,tt.location.href)):nw.current=startBrowserTracingNavigationSpan(m,{name:v??g,attributes:{[eL.S3]:"auto.navigation.nextjs.app_router_instrumentation",[eL.Zj]:v?"route":"url","navigation.type":"browser.popstate",...v&&{[t_]:v}}},{url:location_getAbsoluteUrl(g)})});let g=!1,v=0,x=setInterval(()=>{v++;let k=nS?.next?.router??nS?.nd?.router;g||v>500?clearInterval(x):k&&(clearInterval(x),g=!0,patchRouter(m,k,nw),["nd","next"].forEach(g=>{let v=nS[g];v&&(nS[g]=new Proxy(v,{set:(g,v,x)=>("router"===v&&"object"==typeof x&&null!==x&&patchRouter(m,x,nw),g[v]=x,!0)}))}))},20)}(m):nj.events.on("routeChangeStart",g=>{let v,x;let k=stripUrlQueryAndFragment(g),E=function(m){let g=tt.__BUILD_MANIFEST?.sortedPages;if(g)return g.find(g=>{let v=function(m){let g=m.split("/"),v="";g[g.length-1]?.match(/^\[\[\.\.\..+\]\]$/)&&(g.pop(),v="(?:/(.+?))?");let x=g.map(m=>m.replace(/^\[\.\.\..+\]$/,"(.+?)").replace(/^\[.*\]$/,"([^/]+?)")).join("/");return RegExp(`^${x}${v}(?:/)?$`)}(g);return m.match(v)})}(k);E?(v=E,x="route"):(v=k,x="url"),startBrowserTracingNavigationSpan(m,{name:v,attributes:{[eL.$J]:"navigation",[eL.S3]:"auto.navigation.nextjs.pages_router_instrumentation",[eL.Zj]:x,..."route"===x&&{[t_]:v}}},{url:location_getAbsoluteUrl(g)})})}(m),g.afterAllSetup(m),v&&function(m){let g=!tt.document.getElementById("__NEXT_DATA__");g?function(m){let g=stripTrailingSlash(tt.location.pathname),v=maybeParameterizeRoute(g),x=(0,eY.Z1)();startBrowserTracingPageLoadSpan(m,{name:v??g,startTime:x?x/1e3:void 0,attributes:{[eL.$J]:"pageload",[eL.S3]:"auto.pageload.nextjs.app_router_instrumentation",[eL.Zj]:v?"route":"url",...v&&{[t_]:v}}})}(m):function(m){let{route:g,params:v,sentryTrace:x,baggage:k}=function(){let m;let g=tt.document.getElementById("__NEXT_DATA__");if(g?.innerHTML)try{m=JSON.parse(g.innerHTML)}catch{}if(!m)return{};let v={},{page:x,query:k,props:E}=m;return v.route=x,v.params=k,E?.pageProps&&(v.sentryTrace=E.pageProps._sentryTraceData,v.baggage=E.pageProps._sentryBaggage),v}(),E=(0,no.XM)(k),T=g||tt.location.pathname;E?.["sentry-transaction"]&&"/_error"===T&&(T=(T=E["sentry-transaction"]).replace(/^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|TRACE|CONNECT)\s+/i,""));let K=(0,eY.Z1)();startBrowserTracingPageLoadSpan(m,{name:T,startTime:K?K/1e3:void 0,attributes:{[eL.$J]:"pageload",[eL.S3]:"auto.pageload.nextjs.pages_router_instrumentation",[eL.Zj]:g?"route":"url",...g&&{[t_]:g},...v&&{...v}}},{sentryTrace:x,baggage:k})}(m)}(m))}}}());let v=nO._sentryRewriteFramesAssetPrefixPath||"",x=nP.env._sentryAssetPrefix||nO._sentryAssetPrefix,k=nP.env._sentryBasePath||nO._sentryBasePath,E="true"===nP.env._experimentalThirdPartyOriginStackFrames||"true"===nO._experimentalThirdPartyOriginStackFrames;return g.push(nextjsClientStackFrameNormalizationIntegration({assetPrefix:x,basePath:k,rewriteFramesAssetPrefixPath:v,experimentalThirdPartyOriginStackFrames:E})),g}(m),release:"2cb219bdb01611dd2e36cef26a68ed0fecc22b92",...m};(function(m){let g="/monitoring";if(g&&m.dsn){let v=(0,ez.U4)(m.dsn);if(!v)return;let x=v.host.match(/^o(\d+)\.ingest(?:\.([a-z]{2}))?\.sentry\.io$/);if(x){let k=x[1],E=x[2],T=`${g}?o=${k}&p=${v.projectId}`;E&&(T+=`&r=${E}`),m.tunnel=T}}
22})(g),applySdkMetadata(g,"nextjs",["nextjs","react"]),g.ignoreSpans=[...g.ignoreSpans||[],/^\/404$/,RegExp(`^${n_}$`)],function(m){let g={...m};applySdkMetadata(g,"react"),(0,eN.v)("react",{version:tO.version}),function(m={}){let g=!m.skipBrowserExtensionCheck&&!!function(){if(void 0===tt.window||tt.nw)return!1;let m=tt.chrome||tt.browser;if(!m?.runtime?.id)return!1;let g=getLocationHref(),v=tt===tt.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(g);return!v}(),v=null==m.defaultIntegrations?getDefaultIntegrations():m.defaultIntegrations,x={...m,enabled:!g&&m.enabled,stackParser:(0,eZ.Sq)(m.stackParser||tI),integrations:function(m){let g;let v=m.defaultIntegrations||[],x=m.integrations;if(v.forEach(m=>{m.isDefaultInstance=!0}),Array.isArray(x))g=[...v,...x];else if("function"==typeof x){let m=x(v);g=Array.isArray(m)?m:[m]}else g=v;return function(m){let g={};return m.forEach(m=>{let{name:v}=m,x=g[v];x&&!x.isDefaultInstance&&m.isDefaultInstance||(g[v]=m)}),Object.values(g)}(g)}({integrations:m.integrations,defaultIntegrations:v}),transport:m.transport||makeFetchTransport};(0,eB.yo)(normalizeStringifyValue),function(m,g){!0===g.debug&&(eR.X?eE.fF.enable():(0,eE.Cf)(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")}));let v=(0,eA.nZ)();v.update(g.initialScope);let x=new m(g);(0,eA.nZ)().setClient(x),x.init()}(BrowserClient,x)}(g),(0,eB.yo)(sdk_normalizeStringifyValue)}(g);let filterNextRedirectError=(m,g)=>{var v;return(v=g?.originalException,(0,eX.VZ)(v)&&"string"==typeof v.digest&&v.digest.startsWith("NEXT_REDIRECT;")||m.exception?.values?.[0]?.value==="NEXT_REDIRECT")?null:m};filterNextRedirectError.id="NextRedirectErrorFilter",(0,eN.Qy)(filterNextRedirectError)}({dsn:rS,release:rw().env.NEXT_PUBLIC_SENTRY_RELEASE,environment:"production",sendDefaultPii:!0,tracesSampleRate:.1,integrations:[new class{constructor({flushMinDelay:m=5e3,flushMaxDelay:g=5500,minReplayDuration:v=4999,maxReplayDuration:x=36e5,stickySession:k=!0,useCompression:E=!0,workerUrl:T,_experiments:K={},maskAllText:et=!0,maskAllInputs:en=!0,blockAllMedia:er=!0,mutationBreadcrumbLimit:ei=750,mutationLimit:es=1e4,slowClickTimeout:el=7e3,slowClickIgnoreSelectors:ec=[],networkDetailAllowUrls:eu=[],networkDetailDenyUrls:ed=[],networkCaptureBodies:ep=!0,networkRequestHeaders:em=[],networkResponseHeaders:ef=[],mask:eh=[],maskAttributes:eg=["title","placeholder","aria-label"],unmask:ev=[],block:ey=[],unblock:eb=[],ignore:ex=[],maskFn:e_,beforeAddRecordingEvent:ew,beforeErrorSampling:eS,onError:eC,attachRawBodyFromRequest:ek=!1}={}){this.name="Replay";let eE=function({mask:m,unmask:g,block:v,unblock:x,ignore:k}){let E=getOption(m,[".sentry-mask","[data-sentry-mask]"]),T=getOption(g,[]),K={maskTextSelector:E,unmaskTextSelector:T,blockSelector:getOption(v,[".sentry-block","[data-sentry-block]","base","iframe[srcdoc]:not([src])"]),unblockSelector:getOption(x,[]),ignoreSelector:getOption(k,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])};return K}({mask:eh,unmask:ev,block:ey,unblock:eb,ignore:ex});if(this._recordingOptions={maskAllInputs:en,maskAllText:et,maskInputOptions:{password:!0},maskTextFn:e_,maskInputFn:e_,maskAttributeFn:(m,g,v)=>(function({el:m,key:g,maskAttributes:v,maskAllText:x,privacyOptions:k,value:E}){if(k.unmaskTextSelector&&m.matches(k.unmaskTextSelector))return E;let T=v.includes(g),K=x&&"value"===g&&"INPUT"===m.tagName&&["submit","button"].includes(m.getAttribute("type")||"");return T||K?E.replace(/[\S]/g,"*"):E})({maskAttributes:eg,maskAllText:et,privacyOptions:eE,key:m,value:g,el:v}),...eE,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:m=>{try{m.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!K.recordCrossOriginIframes},this._initialOptions={flushMinDelay:m,flushMaxDelay:g,minReplayDuration:Math.min(v,5e4),maxReplayDuration:Math.min(x,36e5),stickySession:k,useCompression:E,workerUrl:T,blockAllMedia:er,maskAllInputs:en,maskAllText:et,mutationBreadcrumbLimit:ei,mutationLimit:es,slowClickTimeout:el,slowClickIgnoreSelectors:ec,networkDetailAllowUrls:eu,networkDetailDenyUrls:ed,networkCaptureBodies:ep,networkRequestHeaders:_getMergedNetworkHeaders(em),networkResponseHeaders:_getMergedNetworkHeaders(ef),beforeAddRecordingEvent:ew,beforeErrorSampling:eS,onError:eC,attachRawBodyFromRequest:ek,_experiments:K},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${rg}`:rg,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&isBrowser())throw Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return rb}set _isInitialized(m){rb=m}afterAllSetup(m){isBrowser()&&!this._replay&&(this._initialOptions.attachRawBodyFromRequest&&function(){if("undefined"==typeof Request||rx)return;let m=Request;try{let SentryRequest=function(g,v){let x=new m(g,v);return v?.body!=null&&(x[ry]=v.body),x};SentryRequest.prototype=m.prototype,ek.GLOBAL_OBJ.Request=SentryRequest,rx=!0}catch{}}(),this._setup(m),this._initialize(m))}start(){this._replay&&this._replay.start()}
22startBuffering(){this._replay&&this._replay.startBuffering()}stop(m){return this._replay?this._replay.stop({forceFlush:m?.flush??"session"===this._replay.recordingMode,reason:"manual"}):Promise.resolve()}flush(m){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(m):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(m){if(this._replay?.isEnabled())return this._replay.getSessionId(m)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(m){let g=this.getReplayId(!0);g&&(safeSetSpanJSONAttributes(m,{"sentry.replay_id":g}),"buffer"===this.getRecordingMode()&&safeSetSpanJSONAttributes(m,{"sentry._internal.replay_is_buffering":!0}))}_initialize(m){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(m),this._replay.initializeSampling())}_setup(m){let g=function(m,g){let v=g.getOptions(),x={sessionSampleRate:0,errorSampleRate:0,...m},k=(0,e0.o)(v.replaysSessionSampleRate),E=(0,e0.o)(v.replaysOnErrorSampleRate);return null==k&&null==E&&(0,eE.Cf)(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),null!=k&&(x.sessionSampleRate=k),null!=E&&(x.errorSampleRate=E),x}(this._initialOptions,m);this._replay=new ReplayContainer({options:g,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(m){try{let g=m.getIntegrationByName("ReplayCanvas");if(!g)return;this._replay._canvas=g.getOptions()}catch{}}}({unblock:[".sentry-unblock, [data-sentry-unblock]"],unmask:[".sentry-unmask, [data-sentry-unmask]"],beforeErrorSampling:m=>{var g;return!rk.includes(null==m?void 0:null===(g=m.tags)||void 0===g?void 0:g.flow)&&!rC.some(m=>window.location.pathname.startsWith(m))}})],ignoreErrors:["Non-Error promise rejection captured with value: Timeout (B)","Non-Error promise rejection captured with value: Timeout (b)","Failed to fetch (www.googletagmanager.com)","reCAPTCHA Timeout","__firefox__","Java object is gone","Java exception was raised during method invocation"],beforeSend:(m,g)=>{var v,x,k,E,T,K,et,en,er,ei,es,el,ec;if(!g.originalException)return m;if((null===(v=g.originalException)||void 0===v?void 0:v.name)==="AxiosError"&&(null===(x=g.originalException.response)||void 0===x?void 0:x.status)===401||(null===(k=g.originalException)||void 0===k?void 0:k.name)==="QueryError"&&!0===g.originalException.isExpected)return null;let eu=window.location.href,ed=(m=>{if(!m)return"unknown";let g=new URL(m).pathname;return g.startsWith("/admin")?"admin":g.startsWith("/partner")?"partners":g.startsWith("/profile")||g.startsWith("/pet")||g.startsWith("/checkout")?"purchase":g.startsWith("/login")?"auth":g.startsWith("/blog")||g.startsWith("/post")?"blog":g.startsWith("/policies/renew")?"renewal":"/"===g||g.startsWith("/landing")?"landing":"other"})(eu);if(m.tags||(m.tags={}),m.tags.flow=ed,(null===(E=g.originalException)||void 0===E?void 0:E.name)==="AxiosError"&&(null===(T=g.originalException.response)||void 0===T?void 0:T.status)){let v=g.originalException.response.status,x=(null===(et=g.originalException.config)||void 0===et?void 0:et.url)||"unknown-endpoint",k=(m=>{if(!m)return"unknown-endpoint";let g=m.split("?")[0];return g.replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,":uuid").replace(/\/\d+/g,"/:id").replace(/\/(?=.*\d)(?=.*[a-z])[a-z0-9]{6,}/gi,"/:code").replace(/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}/gi,":email").replace(/\d{1,2}\.\d{3}\.\d{3}-[\dk]/g,":rut")})(x);m.tags.http_status=v,m.tags.endpoint=k,m.contexts||(m.contexts={}),m.contexts["API Error Details"]={endpoint:x,normalized_endpoint:k,method:null===(er=g.originalException.config)||void 0===er?void 0:null===(en=er.method)||void 0===en?void 0:en.toUpperCase(),status_code:v,response_data:null===(ei=g.originalException.response)||void 0===ei?void 0:ei.data,request_data:null===(es=g.originalException.config)||void 0===es?void 0:es.data},v>=400&&v<500?(m.tags.error_type="client_error",m.tags.client_url=eu,m.fingerprint=["client-error",String(v),k,eu]):v>=500&&(m.tags.error_type="server_error",m.tags.client_url=eu,m.fingerprint=["server-error",String(v),k])}if(null===(K=m.exception)||void 0===K?void 0:K.values)for(let g of m.exception.values){let v=g.stacktrace;if(null==v?void 0:v.frames){let x=v.frames.some(m=>{var g,v;return(null===(g=m.filename)||void 0===g?void 0:g.includes("analytics-js"))||(null===(v=m.filename)||void 0===v?void 0:v.includes("recaptcha"))});if(x&&g.value&&(g.value.includes("null is not an object")||g.value.includes("Cannot read property 'style'")||g.value.includes("Cannot read properties of null")||g.value.includes("E.style")))return null;let k=v.frames.some(m=>{var g,v,x;return(null===(g=m.filename)||void 0===g?void 0:g.includes("PageTranslationRequiredListener.js"))||(null===(v=m.filename)||void 0===v?void 0:v.includes("IABTranslationJS"))||(null===(x=m.filename)||void 0===x?void 0:x.includes("IABUserAgentLanguageDetectionJS"))});if(k)return console.debug("[Sentry] Filtering out Instagram injected script error:",m),null;let E=v.frames.some(m=>{var g,v;return(null===(g=m.filename)||void 0===g?void 0:g.includes("op-cho-bricks"))||(null===(v=m.filename)||void 0===v?void 0:v.includes("cardPayment.js"))});if(E&&(null===(ec=g.value)||void 0===ec?void 0:ec.includes("Could not find the Brick container ID")))return console.debug("[Sentry] Filtering out MercadoPago brick teardown race:",m),null}if(null===(el=g.value)||void 0===el?void 0:el.includes("window.webkit.messageHandlers"))return console.debug("[Sentry] Filtering out webkit.messageHandlers error:",m),null}return m},replaysSessionSampleRate:0,replaysOnErrorSampleRate:.005})},22446:function(m,g){"use strict";
22Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"createAsyncLocalStorage",{enumerable:!0,get:function(){return createAsyncLocalStorage}});let v=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");let FakeAsyncLocalStorage=class FakeAsyncLocalStorage{disable(){throw v}getStore(){}run(){throw v}exit(){throw v}enterWith(){throw v}};let x=globalThis.AsyncLocalStorage;function createAsyncLocalStorage(){return x?new x:new FakeAsyncLocalStorage}("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},25514:function(m,g,v){"use strict";function clientHookInServerComponentError(m){}Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"clientHookInServerComponentError",{enumerable:!0,get:function(){return clientHookInServerComponentError}}),v(43219),v(2784),("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},60085:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),function(m,g){for(var v in g)Object.defineProperty(m,v,{enumerable:!0,get:g[v]})}(g,{ReadonlyURLSearchParams:function(){return ReadonlyURLSearchParams},useSearchParams:function(){return useSearchParams},usePathname:function(){return usePathname},ServerInsertedHTMLContext:function(){return et.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return et.useServerInsertedHTML},useRouter:function(){return useRouter},useParams:function(){return useParams},useSelectedLayoutSegments:function(){return useSelectedLayoutSegments},useSelectedLayoutSegment:function(){return useSelectedLayoutSegment},redirect:function(){return en.redirect},permanentRedirect:function(){return en.permanentRedirect},RedirectType:function(){return en.RedirectType},notFound:function(){return er.notFound}});let x=v(2784),k=v(56415),E=v(17204),T=v(25514),K=v(73801),et=v(93176),en=v(80717),er=v(15519),ei=Symbol("internal for urlsearchparams readonly");function readonlyURLSearchParamsError(){return Error("ReadonlyURLSearchParams cannot be modified")}let ReadonlyURLSearchParams=class ReadonlyURLSearchParams{[Symbol.iterator](){return this[ei][Symbol.iterator]()}append(){throw readonlyURLSearchParamsError()}delete(){throw readonlyURLSearchParamsError()}set(){throw readonlyURLSearchParamsError()}sort(){throw readonlyURLSearchParamsError()}constructor(m){this[ei]=m,this.entries=m.entries.bind(m),this.forEach=m.forEach.bind(m),this.get=m.get.bind(m),this.getAll=m.getAll.bind(m),this.has=m.has.bind(m),this.keys=m.keys.bind(m),this.values=m.values.bind(m),this.toString=m.toString.bind(m),this.size=m.size}};function useSearchParams(){(0,T.clientHookInServerComponentError)("useSearchParams");let m=(0,x.useContext)(E.SearchParamsContext),g=(0,x.useMemo)(()=>m?new ReadonlyURLSearchParams(m):null,[m]);return g}function usePathname(){return(0,T.clientHookInServerComponentError)("usePathname"),(0,x.useContext)(E.PathnameContext)}function useRouter(){(0,T.clientHookInServerComponentError)("useRouter");let m=(0,x.useContext)(k.AppRouterContext);if(null===m)throw Error("invariant expected app router to be mounted");return m}function useParams(){(0,T.clientHookInServerComponentError)("useParams");let m=(0,x.useContext)(k.GlobalLayoutRouterContext),g=(0,x.useContext)(E.PathParamsContext);return(0,x.useMemo)(()=>(null==m?void 0:m.tree)?function getSelectedParams(m,g){void 0===g&&(g={});let v=m[1];for(let m of Object.values(v)){let v=m[0],x=Array.isArray(v),k=x?v[1]:v;if(!k||k.startsWith("__PAGE__"))continue;let E=x&&("c"===v[2]||"oc"===v[2]);E?g[v[0]]=v[1].split("/"):x&&(g[v[0]]=v[1]),g=getSelectedParams(m,g)}return g}(m.tree):g,[null==m?void 0:m.tree,g])}function useSelectedLayoutSegments(m){void 0===m&&(m="children"),(0,T.clientHookInServerComponentError)("useSelectedLayoutSegments");let{tree:g}=(0,x.useContext)(k.LayoutRouterContext);return function getSelectedLayoutSegmentPath(m,g,v,x){let k;if(void 0===v&&(v=!0),void 0===x&&(x=[]),v)k=m[1][g];else{var E;let g=m[1];k=null!=(E=g.children)?E:Object.values(g)[0]}if(!k)return x;let T=k[0],et=(0,K.getSegmentValue)(T);return!et||et.startsWith("__PAGE__")?x:(x.push(et),getSelectedLayoutSegmentPath(k,g,!1,x))}(g,m)}
22function useSelectedLayoutSegment(m){void 0===m&&(m="children"),(0,T.clientHookInServerComponentError)("useSelectedLayoutSegment");let g=useSelectedLayoutSegments(m);return 0===g.length?null:g[0]}("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},15519:function(m,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),function(m,g){for(var v in g)Object.defineProperty(m,v,{enumerable:!0,get:g[v]})}(g,{notFound:function(){return notFound},isNotFoundError:function(){return isNotFoundError}});let v="NEXT_NOT_FOUND";function notFound(){let m=Error(v);throw m.digest=v,m}function isNotFoundError(m){return(null==m?void 0:m.digest)===v}("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},80717:function(m,g,v){"use strict";var x,k;Object.defineProperty(g,"__esModule",{value:!0}),function(m,g){for(var v in g)Object.defineProperty(m,v,{enumerable:!0,get:g[v]})}(g,{RedirectType:function(){return x},getRedirectError:function(){return getRedirectError},redirect:function(){return redirect},permanentRedirect:function(){return permanentRedirect},isRedirectError:function(){return isRedirectError},getURLFromRedirectError:function(){return getURLFromRedirectError},getRedirectTypeFromError:function(){return getRedirectTypeFromError}});let E=v(55280),T="NEXT_REDIRECT";function getRedirectError(m,g,v){void 0===v&&(v=!1);let x=Error(T);x.digest=T+";"+g+";"+m+";"+v;let k=E.requestAsyncStorage.getStore();return k&&(x.mutableCookies=k.mutableCookies),x}function redirect(m,g){throw void 0===g&&(g="replace"),getRedirectError(m,g,!1)}function permanentRedirect(m,g){throw void 0===g&&(g="replace"),getRedirectError(m,g,!0)}function isRedirectError(m){if("string"!=typeof(null==m?void 0:m.digest))return!1;let[g,v,x,k]=m.digest.split(";",4);return g===T&&("replace"===v||"push"===v)&&"string"==typeof x&&("true"===k||"false"===k)}function getURLFromRedirectError(m){return isRedirectError(m)?m.digest.split(";",3)[2]:null}function getRedirectTypeFromError(m){if(!isRedirectError(m))throw Error("Not a redirect error");return m.digest.split(";",3)[1]}(k=x||(x={})).push="push",k.replace="replace",("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},55280:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"requestAsyncStorage",{enumerable:!0,get:function(){return k}});let x=v(22446),k=(0,x.createAsyncLocalStorage)();("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},73801:function(m,g){"use strict";function getSegmentValue(m){return Array.isArray(m)?m[1]:m}Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"getSegmentValue",{enumerable:!0,get:function(){return getSegmentValue}}),("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},64441:function(m,g){"use strict";var v,x;Object.defineProperty(g,"__esModule",{value:!0}),function(m,g){for(var v in g)Object.defineProperty(m,v,{enumerable:!0,get:g[v]})}(g,{PrefetchKind:function(){return v},ACTION_REFRESH:function(){return k},ACTION_NAVIGATE:function(){return E},ACTION_RESTORE:function(){return T},ACTION_SERVER_PATCH:function(){return K},ACTION_PREFETCH:function(){return et},ACTION_FAST_REFRESH:function(){return en},ACTION_SERVER_ACTION:function(){return er}});let k="refresh",E="navigate",T="restore",K="server-patch",et="prefetch",en="fast-refresh",er="server-action";(x=v||(v={})).AUTO="auto",x.FULL="full",x.TEMPORARY="temporary",("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esMo
22dule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},67361:function(m,g,v){"use strict";function getDomainLocale(m,g,v,x){return!1}Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"getDomainLocale",{enumerable:!0,get:function(){return getDomainLocale}}),v(36213),("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},7006:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"Image",{enumerable:!0,get:function(){return eu}});let x=v(43219),k=v(16794),E=k._(v(2784)),T=x._(v(28316)),K=x._(v(35487)),et=v(3476),en=v(66845),er=v(26020);v(69737);let ei=v(89994),es=x._(v(33459)),el={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function handleLoading(m,g,v,x,k,E){let T=null==m?void 0:m.src;if(!m||m["data-loaded-src"]===T)return;m["data-loaded-src"]=T;let K="decode"in m?m.decode():Promise.resolve();K.catch(()=>{}).then(()=>{if(m.parentElement&&m.isConnected){if("empty"!==g&&k(!0),null==v?void 0:v.current){let g=new Event("load");Object.defineProperty(g,"target",{writable:!1,value:m});let x=!1,k=!1;v.current({...g,nativeEvent:g,currentTarget:m,target:m,isDefaultPrevented:()=>x,isPropagationStopped:()=>k,persist:()=>{},preventDefault:()=>{x=!0,g.preventDefault()},stopPropagation:()=>{k=!0,g.stopPropagation()}})}(null==x?void 0:x.current)&&x.current(m)}})}function getDynamicProps(m){let[g,v]=E.version.split("."),x=parseInt(g,10),k=parseInt(v,10);return x>18||18===x&&k>=3?{fetchPriority:m}:{fetchpriority:m}}let ec=(0,E.forwardRef)((m,g)=>{let{src:v,srcSet:x,sizes:k,height:T,width:K,decoding:et,className:en,style:er,fetchPriority:ei,placeholder:es,loading:el,unoptimized:ec,fill:eu,onLoadRef:ed,onLoadingCompleteRef:ep,setBlurComplete:em,setShowAltText:ef,onLoad:eh,onError:eg,...ev}=m;return E.default.createElement("img",{...ev,...getDynamicProps(ei),loading:el,width:K,height:T,decoding:et,"data-nimg":eu?"fill":"1",className:en,style:er,sizes:k,srcSet:x,src:v,ref:(0,E.useCallback)(m=>{g&&("function"==typeof g?g(m):"object"==typeof g&&(g.current=m)),m&&(eg&&(m.src=m.src),m.complete&&handleLoading(m,es,ed,ep,em,ec))},[v,es,ed,ep,em,eg,ec,g]),onLoad:m=>{let g=m.currentTarget;handleLoading(g,es,ed,ep,em,ec)},onError:m=>{ef(!0),"empty"!==es&&em(!0),eg&&eg(m)}})});function ImagePreload(m){let{isAppRouter:g,imgAttributes:v}=m,x={as:"image",imageSrcSet:v.srcSet,imageSizes:v.sizes,crossOrigin:v.crossOrigin,referrerPolicy:v.referrerPolicy,...getDynamicProps(v.fetchPriority)};return g&&T.default.preload?(T.default.preload(v.src,x),null):E.default.createElement(K.default,null,E.default.createElement("link",{key:"__nimg-"+v.src+v.srcSet+v.sizes,rel:"preload",href:v.srcSet?void 0:v.src,...x}))}let eu=(0,E.forwardRef)((m,g)=>{let v=(0,E.useContext)(ei.RouterContext),x=(0,E.useContext)(er.ImageConfigContext),k=(0,E.useMemo)(()=>{let m=el||x||en.imageConfigDefault,g=[...m.deviceSizes,...m.imageSizes].sort((m,g)=>m-g),v=m.deviceSizes.sort((m,g)=>m-g);return{...m,allSizes:g,deviceSizes:v}},[x]),{onLoad:T,onLoadingComplete:K}=m,eu=(0,E.useRef)(T);(0,E.useEffect)(()=>{eu.current=T},[T]);let ed=(0,E.useRef)(K);(0,E.useEffect)(()=>{ed.current=K},[K]);let[ep,em]=(0,E.useState)(!1),[ef,eh]=(0,E.useState)(!1),{props:eg,meta:ev}=(0,et.getImgProps)(m,{defaultLoader:es.default,imgConf:k,blurComplete:ep,showAltText:ef});return E.default.createElement(E.default.Fragment,null,E.default.createElement(ec,{...eg,unoptimized:ev.unoptimized,placeholder:ev.placeholder,fill:ev.fill,onLoadRef:eu,onLoadingCompleteRef:ed,setBlurComplete:em,setShowAltText:eh,ref:g}),ev.priority?E.default.createElement(ImagePreload,{isAppRouter:!v,imgAttributes:eg}):null)});("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},16184:function(m,g,v){"use strict";
22Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"default",{enumerable:!0,get:function(){return Image}});let x=v(43219),k=v(16794),E=k._(v(2784)),T=x._(v(35487)),K=v(66845),et=v(19190),en=v(26020);v(69737);let er=v(36213);function normalizeSrc(m){return"/"===m[0]?m.slice(1):m}let ei={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1},es=new Set,el="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ec=new Map([["default",function(m){let{config:g,src:v,width:x,quality:k}=m;return v.endsWith(".svg")&&!g.dangerouslyAllowSVG?v:(0,er.normalizePathTrailingSlash)(g.path)+"?url="+encodeURIComponent(v)+"&w="+x+"&q="+(k||75)}],["imgix",function(m){let{config:g,src:v,width:x,quality:k}=m,E=new URL(""+g.path+normalizeSrc(v)),T=E.searchParams;return T.set("auto",T.getAll("auto").join(",")||"format"),T.set("fit",T.get("fit")||"max"),T.set("w",T.get("w")||x.toString()),k&&T.set("q",k.toString()),E.href}],["cloudinary",function(m){let{config:g,src:v,width:x,quality:k}=m,E=["f_auto","c_limit","w_"+x,"q_"+(k||"auto")].join(",")+"/";return""+g.path+E+normalizeSrc(v)}],["akamai",function(m){let{config:g,src:v,width:x}=m;return""+g.path+normalizeSrc(v)+"?imwidth="+x}],["custom",function(m){let{src:g}=m;throw Error('Image with src "'+g+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}]]);function isStaticRequire(m){return void 0!==m.default}function generateImgAttrs(m){let{config:g,src:v,unoptimized:x,layout:k,width:E,quality:T,sizes:K,loader:et}=m;if(x)return{src:v,srcSet:void 0,sizes:void 0};let{widths:en,kind:er}=function(m,g,v,x){let{deviceSizes:k,allSizes:E}=m;if(x&&("fill"===v||"responsive"===v)){let m=/(^|\s)(1?\d?\d)vw/g,g=[];for(let v;v=m.exec(x);v)g.push(parseInt(v[2]));if(g.length){let m=.01*Math.min(...g);return{widths:E.filter(g=>g>=k[0]*m),kind:"w"}}return{widths:E,kind:"w"}}if("number"!=typeof g||"fill"===v||"responsive"===v)return{widths:k,kind:"w"};let T=[...new Set([g,2*g].map(m=>E.find(g=>g>=m)||E[E.length-1]))];return{widths:T,kind:"x"}}(g,E,k,K),ei=en.length-1;return{sizes:K||"w"!==er?K:"100vw",srcSet:en.map((m,x)=>et({config:g,src:v,quality:T,width:m})+" "+("w"===er?m:x+1)+er).join(", "),src:et({config:g,src:v,quality:T,width:en[ei]})}}function getInt(m){return"number"==typeof m?m:"string"==typeof m?parseInt(m,10):void 0}function defaultImageLoader(m){var g;let v=(null==(g=m.config)?void 0:g.loader)||"default",x=ec.get(v);if(x)return x(m);throw Error('Unknown "loader" found in "next.config.js". Expected: '+K.VALID_LOADERS.join(", ")+". Received: "+v)}function handleLoading(m,g,v,x,k,E){if(!m||m.src===el||m["data-loaded-src"]===g)return;m["data-loaded-src"]=g;let T="decode"in m?m.decode():Promise.resolve();T.catch(()=>{}).then(()=>{if(m.parentNode&&(es.add(g),"blur"===x&&E(!0),null==k?void 0:k.current)){let{naturalWidth:g,naturalHeight:v}=m;k.current({naturalWidth:g,naturalHeight:v})}})}let ImageElement=m=>{let{imgAttributes:g,heightInt:v,widthInt:x,qualityInt:k,layout:T,className:K,imgStyle:et,blurStyle:en,isLazy:er,placeholder:ei,loading:es,srcString:el,config:ec,unoptimized:eu,loader:ed,onLoadingCompleteRef:ep,setBlurComplete:em,setIntersection:ef,onLoad:eh,onError:eg,isVisible:ev,noscriptSizes:ey,...eb}=m;return es=er?"lazy":es,E.default.createElement(E.default.Fragment,null,E.default.createElement("img",{...eb,...g,decoding:"async","data-nimg":T,className:K,style:{...et,...en},ref:(0,E.useCallback)(m=>{ef(m),(null==m?void 0:m.complete)&&handleLoading(m,el,T,ei,ep,em)},[ef,el,T,ei,ep,em]),onLoad:m=>{let g=m.currentTarget;handleLoading(g,el,T,ei,ep,em),eh&&eh(m)},onError:m=>{"blur"===ei&&em(!0),eg&&eg(m)}}),(er||"blur"===ei)&&E.default.createElement("noscript",null,E.default.createElement("img",{...eb,loading:es,decoding:"async","data-nimg":T,style:et,className:K,...generateImgAttrs({config:ec,src:el,unoptimized:eu,layout:T,width:x,quality:k,sizes:ey,loader:ed})})))};function Image(m){var g;let v,{src:x,sizes:k,unoptimized:er=!1,priority:ec=!1,loading:eu,lazyRoot:ed=null,lazyBoundary:ep,className:em,quality:ef,width:eh,height:eg,style:ev,objectFit:ey,objectPosition:eb,onLoadingComplete:ex,placeholder:e_="empty",blurDataURL:ew,...eS}=m,eC=(0,E.useContext)(en.ImageConfigContext),ek=(0,E.useMemo)(()=>{let m=ei||eC||K.imageConfigDefault,g=[...m.deviceSizes,...m.imageSizes].sort((m,g)=>m-g),v=m.deviceSizes.sort((m,g)=>m-g);return{...m,allSizes:g,deviceSizes:v}},[eC]),eE=k?"responsive":"intrinsic";"layout"in eS&&(eS.layout&&(eE=eS.layout),delete eS.layout);let ej=defaultImageLoader;if("loader"in eS){if(eS.loader){let m=eS.loader;ej=g=>{let{config:v,...x}=g;return m(x)}}delete eS.loader}let eN="";if("object"==typeof(g=x)&&(isStaticRequire(g)||void 0!==g.src)){let m=isStaticRequire(x)?x.default:x;if(!m.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(m));if(ew=ew||m.blurDataURL,eN=m.src,(!eE||"fill"!==eE)&&(eg=eg||m.height,eh=eh||m.width,!m.height||!m.width))throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(m))}let eR=!ec&&("lazy"===eu||void 0===eu);((x="string"==typeof x?x:eN).startsWith("data:")||x.startsWith("blob:"))&&(er=!0,eR=!1),es.has(x)&&(eR=!1),ek.unoptimized&&(er=!0);let[eI,eP]=(0,E.useState)(!1),[eT,eO,eA]=(0,et.useIntersection)({rootRef:ed,rootMargin:ep||"200px",disabled:!eR}),eM=!eR||eO,eD={boxSizing:"border-box",display:"block",overflow:"hidden",
22width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},eL={boxSizing:"border-box",display:"block",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},eF=!1,eZ=getInt(eh),eB=getInt(eg),e$=getInt(ef),eU=Object.assign({},ev,{position:"absolute",top:0,left:0,bottom:0,right:0,boxSizing:"border-box",padding:0,border:"none",margin:"auto",display:"block",width:0,height:0,minWidth:"100%",maxWidth:"100%",minHeight:"100%",maxHeight:"100%",objectFit:ey,objectPosition:eb}),ez="blur"!==e_||eI?{}:{backgroundSize:ey||"cover",backgroundPosition:eb||"0% 0%",filter:"blur(20px)",backgroundImage:'url("'+ew+'")'};if("fill"===eE)eD.display="block",eD.position="absolute",eD.top=0,eD.left=0,eD.bottom=0,eD.right=0;else if(void 0!==eZ&&void 0!==eB){let m=eB/eZ,g=isNaN(m)?"100%":""+100*m+"%";"responsive"===eE?(eD.display="block",eD.position="relative",eF=!0,eL.paddingTop=g):"intrinsic"===eE?(eD.display="inline-block",eD.position="relative",eD.maxWidth="100%",eF=!0,eL.maxWidth="100%",v="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27"+eZ+"%27%20height=%27"+eB+"%27/%3e"):"fixed"===eE&&(eD.display="inline-block",eD.position="relative",eD.width=eZ,eD.height=eB)}let eV={src:el,srcSet:void 0,sizes:void 0};eM&&(eV=generateImgAttrs({config:ek,src:x,unoptimized:er,layout:eE,width:eZ,quality:e$,sizes:k,loader:ej}));let eq=x,eH={imageSrcSet:eV.srcSet,imageSizes:eV.sizes,crossOrigin:eS.crossOrigin,referrerPolicy:eS.referrerPolicy},eW=E.default.useLayoutEffect,eK=(0,E.useRef)(ex),eG=(0,E.useRef)(x);(0,E.useEffect)(()=>{eK.current=ex},[ex]),eW(()=>{eG.current!==x&&(eA(),eG.current=x)},[eA,x]);let eQ={isLazy:eR,imgAttributes:eV,heightInt:eB,widthInt:eZ,qualityInt:e$,layout:eE,className:em,imgStyle:eU,blurStyle:ez,loading:eu,config:ek,unoptimized:er,placeholder:e_,loader:ej,srcString:eq,onLoadingCompleteRef:eK,setBlurComplete:eP,setIntersection:eT,isVisible:eM,noscriptSizes:k,...eS};return E.default.createElement(E.default.Fragment,null,E.default.createElement("span",{style:eD},eF?E.default.createElement("span",{style:eL},v?E.default.createElement("img",{style:{display:"block",maxWidth:"100%",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},alt:"","aria-hidden":!0,src:v}):null):null,E.default.createElement(ImageElement,eQ)),ec?E.default.createElement(T.default,null,E.default.createElement("link",{key:"__nimg-"+eV.src+eV.srcSet+eV.sizes,rel:"preload",as:"image",href:eV.srcSet?void 0:eV.src,...eH})):null)}("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},99938:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"default",{enumerable:!0,get:function(){return em}});let x=v(43219),k=x._(v(2784)),E=v(90038),T=v(65571),K=v(68613),et=v(98318),en=v(24077),er=v(89994),ei=v(56415),es=v(19190),el=v(67361),ec=v(65299),eu=v(64441),ed=new Set;function prefetch(m,g,v,x,k,E){if(!E&&!(0,T.isLocalURL)(g))return;if(!x.bypassPrefetchedCheck){let k=void 0!==x.locale?x.locale:"locale"in m?m.locale:void 0,E=g+"%"+v+"%"+k;
22if(ed.has(E))return;ed.add(E)}let K=E?m.prefetch(g,k):m.prefetch(g,v,x);Promise.resolve(K).catch(m=>{})}function formatStringOrUrl(m){return"string"==typeof m?m:(0,K.formatUrl)(m)}let ep=k.default.forwardRef(function(m,g){let v,x;let{href:K,as:ed,children:ep,prefetch:em=null,passHref:ef,replace:eh,shallow:eg,scroll:ev,locale:ey,onClick:eb,onMouseEnter:ex,onTouchStart:e_,legacyBehavior:ew=!1,...eS}=m;v=ep,ew&&("string"==typeof v||"number"==typeof v)&&(v=k.default.createElement("a",null,v));let eC=k.default.useContext(er.RouterContext),ek=k.default.useContext(ei.AppRouterContext),eE=null!=eC?eC:ek,ej=!eC,eN=!1!==em,eR=null===em?eu.PrefetchKind.AUTO:eu.PrefetchKind.FULL,{href:eI,as:eP}=k.default.useMemo(()=>{if(!eC){let m=formatStringOrUrl(K);return{href:m,as:ed?formatStringOrUrl(ed):m}}let[m,g]=(0,E.resolveHref)(eC,K,!0);return{href:m,as:ed?(0,E.resolveHref)(eC,ed):g||m}},[eC,K,ed]),eT=k.default.useRef(eI),eO=k.default.useRef(eP);ew&&(x=k.default.Children.only(v));let eA=ew?x&&"object"==typeof x&&x.ref:g,[eM,eD,eL]=(0,es.useIntersection)({rootMargin:"200px"}),eF=k.default.useCallback(m=>{(eO.current!==eP||eT.current!==eI)&&(eL(),eO.current=eP,eT.current=eI),eM(m),eA&&("function"==typeof eA?eA(m):"object"==typeof eA&&(eA.current=m))},[eP,eA,eI,eL,eM]);k.default.useEffect(()=>{eE&&eD&&eN&&prefetch(eE,eI,eP,{locale:ey},{kind:eR},ej)},[eP,eI,eD,ey,eN,null==eC?void 0:eC.locale,eE,ej,eR]);let eZ={ref:eF,onClick(m){ew||"function"!=typeof eb||eb(m),ew&&x.props&&"function"==typeof x.props.onClick&&x.props.onClick(m),eE&&!m.defaultPrevented&&function(m,g,v,x,E,K,et,en,er,ei){let{nodeName:es}=m.currentTarget,el="A"===es.toUpperCase();if(el&&(function(m){let g=m.currentTarget,v=g.getAttribute("target");return v&&"_self"!==v||m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||m.nativeEvent&&2===m.nativeEvent.which}(m)||!er&&!(0,T.isLocalURL)(v)))return;m.preventDefault();let navigate=()=>{let m=null==et||et;"beforePopState"in g?g[E?"replace":"push"](v,x,{shallow:K,locale:en,scroll:m}):g[E?"replace":"push"](x||v,{forceOptimisticNavigation:!ei,scroll:m})};er?k.default.startTransition(navigate):navigate()}(m,eE,eI,eP,eh,eg,ev,ey,ej,eN)},onMouseEnter(m){ew||"function"!=typeof ex||ex(m),ew&&x.props&&"function"==typeof x.props.onMouseEnter&&x.props.onMouseEnter(m),eE&&(eN||!ej)&&prefetch(eE,eI,eP,{locale:ey,priority:!0,bypassPrefetchedCheck:!0},{kind:eR},ej)},onTouchStart(m){ew||"function"!=typeof e_||e_(m),ew&&x.props&&"function"==typeof x.props.onTouchStart&&x.props.onTouchStart(m),eE&&(eN||!ej)&&prefetch(eE,eI,eP,{locale:ey,priority:!0,bypassPrefetchedCheck:!0},{kind:eR},ej)}};if((0,et.isAbsoluteUrl)(eP))eZ.href=eP;else if(!ew||ef||"a"===x.type&&!("href"in x.props)){let m=void 0!==ey?ey:null==eC?void 0:eC.locale,g=(null==eC?void 0:eC.isLocaleDomain)&&(0,el.getDomainLocale)(eP,m,null==eC?void 0:eC.locales,null==eC?void 0:eC.domainLocales);eZ.href=g||(0,ec.addBasePath)((0,en.addLocale)(eP,m,null==eC?void 0:eC.defaultLocale))}return ew?k.default.cloneElement(x,eZ):k.default.createElement("a",{...eS,...eZ},v)}),em=ep;("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esModule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},19190:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"useIntersection",{enumerable:!0,get:function(){return useIntersection}});let x=v(2784),k=v(82120),E="function"==typeof IntersectionObserver,T=new Map,K=[];function useIntersection(m){let{rootRef:g,rootMargin:v,disabled:et}=m,en=et||!E,[er,ei]=(0,x.useState)(!1),es=(0,x.useRef)(null),el=(0,x.useCallback)(m=>{es.current=m},[]);(0,x.useEffect)(()=>{if(E){if(en||er)return;let m=es.current;if(m&&m.tagName){let x=function(m,g,v){let{id:x,observer:k,elements:E}=function(m){let g;let v={root:m.root||null,margin:m.rootMargin||""},x=K.find(m=>m.root===v.root&&m.margin===v.margin);if(x&&(g=T.get(x)))return g;let k=new Map,E=new IntersectionObserver(m=>{m.forEach(m=>{let g=k.get(m.target),v=m.isIntersecting||m.intersectionRatio>0;g&&v&&g(v)})},m);return g={id:v,observer:E,elements:k},K.push(v),T.set(v,g),g}(v);return E.set(m,g),k.observe(m),function(){if(E.delete(m),k.unobserve(m),0===E.size){k.disconnect(),T.delete(x);let m=K.findIndex(m=>m.root===x.root&&m.margin===x.margin);m>-1&&K.splice(m,1)}}}(m,m=>m&&ei(m),{root:null==g?void 0:g.current,rootMargin:v});return x}}else if(!er){let m=(0,k.requestIdleCallback)(()=>ei(!0));return()=>(0,k.cancelIdleCallback)(m)}},[en,v,g,er,es.current]);let ec=(0,x.useCallback)(()=>{ei(!1)},[]);return[el,er,ec]}("function"==typeof g.default||"object"==typeof g.default&&null!==g.default)&&void 0===g.default.__esModule&&(Object.defineProperty(g.default,"__esMo
22dule",{value:!0}),Object.assign(g.default,g),m.exports=g.default)},3476:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"getImgProps",{enumerable:!0,get:function(){return getImgProps}}),v(69737);let x=v(90042),k=v(66845);function isStaticRequire(m){return void 0!==m.default}function getInt(m){return void 0===m?m:"number"==typeof m?Number.isFinite(m)?m:NaN:"string"==typeof m&&/^[0-9]+$/.test(m)?parseInt(m,10):NaN}function getImgProps(m,g){var v;let E,T,K,{src:et,sizes:en,unoptimized:er=!1,priority:ei=!1,loading:es,className:el,quality:ec,width:eu,height:ed,fill:ep=!1,style:em,onLoad:ef,onLoadingComplete:eh,placeholder:eg="empty",blurDataURL:ev,fetchPriority:ey,layout:eb,objectFit:ex,objectPosition:e_,lazyBoundary:ew,lazyRoot:eS,...eC}=m,{imgConf:ek,showAltText:eE,blurComplete:ej,defaultLoader:eN}=g,eR=ek||k.imageConfigDefault;if("allSizes"in eR)E=eR;else{let m=[...eR.deviceSizes,...eR.imageSizes].sort((m,g)=>m-g),g=eR.deviceSizes.sort((m,g)=>m-g);E={...eR,allSizes:m,deviceSizes:g}}let eI=eC.loader||eN;delete eC.loader,delete eC.srcSet;let eP="__next_img_default"in eI;if(eP){if("custom"===E.loader)throw Error('Image with src "'+et+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let m=eI;eI=g=>{let{config:v,...x}=g;return m(x)}}if(eb){"fill"===eb&&(ep=!0);let m={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[eb];m&&(em={...em,...m});let g={responsive:"100vw",fill:"100vw"}[eb];g&&!en&&(en=g)}let eT="",eO=getInt(eu),eA=getInt(ed);if("object"==typeof(v=et)&&(isStaticRequire(v)||void 0!==v.src)){let m=isStaticRequire(et)?et.default:et;if(!m.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(m));if(!m.height||!m.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(m));if(T=m.blurWidth,K=m.blurHeight,ev=ev||m.blurDataURL,eT=m.src,!ep){if(eO||eA){if(eO&&!eA){let g=eO/m.width;eA=Math.round(m.height*g)}else if(!eO&&eA){let g=eA/m.height;eO=Math.round(m.width*g)}}else eO=m.width,eA=m.height}}let eM=!ei&&("lazy"===es||void 0===es);(!(et="string"==typeof et?et:eT)||et.startsWith("data:")||et.startsWith("blob:"))&&(er=!0,eM=!1),E.unoptimized&&(er=!0),eP&&et.endsWith(".svg")&&!E.dangerouslyAllowSVG&&(er=!0),ei&&(ey="high");let eD=getInt(ec),eL=Object.assign(ep?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:ex,objectPosition:e_}:{},eE?{}:{color:"transparent"},em),eF=ej||"empty"===eg?null:"blur"===eg?'url("data:image/svg+xml;charset=utf-8,'+(0,x.getImageBlurSvg)({widthInt:eO,heightInt:eA,blurWidth:T,blurHeight:K,blurDataURL:ev||"",objectFit:eL.objectFit})+'")':'url("'+eg+'")',eZ=eF?{backgroundSize:eL.objectFit||"cover",backgroundPosition:eL.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:eF}:{},eB=function(m){let{config:g,src:v,unoptimized:x,width:k,quality:E,sizes:T,loader:K}=m;if(x)return{src:v,srcSet:void 0,sizes:void 0};let{widths:et,kind:en}=function(m,g,v){let{deviceSizes:x,allSizes:k}=m;if(v){let m=/(^|\s)(1?\d?\d)vw/g,g=[];for(let x;x=m.exec(v);x)g.push(parseInt(x[2]));if(g.length){let m=.01*Math.min(...g);return{widths:k.filter(g=>g>=x[0]*m),kind:"w"}}return{widths:k,kind:"w"}}if("number"!=typeof g)return{widths:x,kind:"w"};let E=[...new Set([g,2*g].map(m=>k.find(g=>g>=m)||k[k.length-1]))];return{widths:E,kind:"x"}}(g,k,T),er=et.length-1;return{sizes:T||"w"!==en?T:"100vw",srcSet:et.map((m,x)=>K({config:g,src:v,quality:E,width:m})+" "+("w"===en?m:x+1)+en).join(", "),src:K({config:g,src:v,quality:E,width:et[er]})}}({config:E,src:et,unoptimized:er,width:eO,quality:eD,sizes:en,loader:eI}),e$={...eC,loading:eM?"lazy":es,fetchPriority:ey,width:eO,height:eA,decoding:"async",className:el,style:{...eL,...eZ},sizes:eB.sizes,srcSet:eB.srcSet,src:eB.src},eU={unoptimized:er,priority:ei,placeholder:eg,fill:ep};return{props:e$,meta:eU}}},90042:function(m,g){"use strict";function getImageBlurSvg(m){let{widthInt:g,heightInt:v,blurWidth:x,blurHeight:k,blurDataURL:E,objectFit:T}=m,K=x?40*x:g,et=k?40*k:v,en=K&&et?"viewBox='0 0 "+K+" "+et+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+en+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3Cfe
22ColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(en?"none":"contain"===T?"xMidYMid":"cover"===T?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+E+"'/%3E%3C/svg%3E"}Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"getImageBlurSvg",{enumerable:!0,get:function(){return getImageBlurSvg}})},16099:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),function(m,g){for(var v in g)Object.defineProperty(m,v,{enumerable:!0,get:g[v]})}(g,{unstable_getImgProps:function(){return unstable_getImgProps},default:function(){return et}});let x=v(43219),k=v(3476),E=v(69737),T=v(7006),K=x._(v(33459)),unstable_getImgProps=m=>{(0,E.warnOnce)("Warning: unstable_getImgProps() is experimental and may change or be removed at any time. Use at your own risk.");let{props:g}=(0,k.getImgProps)(m,{defaultLoader:K.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[m,v]of Object.entries(g))void 0===v&&delete g[m];return{props:g}},et=T.Image},33459:function(m,g){"use strict";function defaultLoader(m){let{config:g,src:v,width:x,quality:k}=m;return g.path+"?url="+encodeURIComponent(v)+"&w="+x+"&q="+(k||75)}Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(g,"default",{enumerable:!0,get:function(){return v}}),defaultLoader.__next_img_default=!0;let v=defaultLoader},93176:function(m,g,v){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),function(m,g){for(var v in g)Object.defineProperty(m,v,{enumerable:!0,get:g[v]})}(g,{ServerInsertedHTMLContext:function(){return E},useServerInsertedHTML:function(){return useServerInsertedHTML}});let x=v(16794),k=x._(v(2784)),E=k.default.createContext(null);function useServerInsertedHTML(m){let g=(0,k.useContext)(E);g&&g(m)}},14258:function(m,g,v){var x=v(93542);v(81633);var k=v(2784),E=k&&"object"==typeof k&&"default"in k?k:{default:k};function _defineProperties(m,g){for(var v=0;v<g.length;v++){var x=g[v];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,x.key,x)}}var T=void 0!==x&&x.env&&!0,isString=function(m){return"[object String]"===Object.prototype.toString.call(m)},K=function(){function StyleSheet(m){var g=void 0===m?{}:m,v=g.name,x=void 0===v?"stylesheet":v,k=g.optimizeForSpeed,E=void 0===k?T:k;invariant$1(isString(x),"`name` must be a string"),this._name=x,this._deletedRulePlaceholder="#"+x+"-deleted-rule____{}",invariant$1("boolean"==typeof E,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=E,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var K=document.querySelector('meta[property="csp-nonce"]');this._nonce=K?K.getAttribute("content"):null}var m,g=StyleSheet.prototype;return g.setOptimizeForSpeed=function(m){invariant$1("boolean"==typeof m,"`setOptimizeForSpeed` accepts a boolean"),invariant$1(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=m,this.inject()},g.isOptimizeForSpeed=function(){return this._optimizeForSpeed},g.inject=function(){var m=this;if(invariant$1(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(T||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(g,v){return"number"==typeof v?m._serverSheet.cssRules[v]={cssText:g}:m._serverSheet.cssRules.push({cssText:g}),v},deleteRule:function(g){m._serverSheet.cssRules[g]=null}}},g.getSheetForTag=function(m){if(m.sheet)return m.sheet;for(var g=0;g<document.styleSheets.length;g++)if(document.styleSheets[g].ownerNode===m)return document.styleSheets[g]}
22,g.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},g.insertRule=function(m,g){if(invariant$1(isString(m),"`insertRule` accepts only strings"),this._optimizeForSpeed){var v=this.getSheet();"number"!=typeof g&&(g=v.cssRules.length);try{v.insertRule(m,g)}catch(g){return T||console.warn("StyleSheet: illegal rule: \n\n"+m+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var x=this._tags[g];this._tags.push(this.makeStyleTag(this._name,m,x))}return this._rulesCount++},g.replaceRule=function(m,g){if(this._optimizeForSpeed){var v=this.getSheet();if(g.trim()||(g=this._deletedRulePlaceholder),!v.cssRules[m])return m;v.deleteRule(m);try{v.insertRule(g,m)}catch(x){T||console.warn("StyleSheet: illegal rule: \n\n"+g+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),v.insertRule(this._deletedRulePlaceholder,m)}}else{var x=this._tags[m];invariant$1(x,"old rule at index `"+m+"` not found"),x.textContent=g}return m},g.deleteRule=function(m){if(this._optimizeForSpeed)this.replaceRule(m,"");else{var g=this._tags[m];invariant$1(g,"rule at index `"+m+"` not found"),g.parentNode.removeChild(g),this._tags[m]=null}},g.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
22h(function(m){return m&&m.parentNode.removeChild(m)}),this._tags=[]},g.cssRules=function(){var m=this;return this._tags.reduce(function(g,v){return v?g=g.concat(Array.prototype.map.call(m.getSheetForTag(v).cssRules,function(g){return g.cssText===m._deletedRulePlaceholder?null:g})):g.push(null),g},[])},g.makeStyleTag=function(m,g,v){g&&invariant$1(isString(g),"makeStyleTag accepts only strings as second parameter");var x=document.createElement("style");this._nonce&&x.setAttribute("nonce",this._nonce),x.type="text/css",x.setAttribute("data-"+m,""),g&&x.appendChild(document.createTextNode(g));var k=document.head||document.getElementsByTagName("head")[0];return v?k.insertBefore(x,v):k.appendChild(x),x},_defineProperties(StyleSheet.prototype,[{key:"length",get:function(){return this._rulesCount}}]),m&&_defineProperties(StyleSheet,m),StyleSheet}();function invariant$1(m,g){if(!m)throw Error("StyleSheet: "+g+".")}var stringHash=function(m){for(var g=5381,v=m.length;v;)g=33*g^m.charCodeAt(--v);return g>>>0},et={};function computeId(m,g){if(!g)return"jsx-"+m;var v=String(g),x=m+v;return et[x]||(et[x]="jsx-"+stringHash(m+"-"+v)),et[x]}function computeSelector(m,g){var v=m+g;return et[v]||(et[v]=g.replace(/__jsx-style-dynamic-selector/g,m)),et[v]}var en=function(){function StyleSheetRegistry(m){var g=void 0===m?{}:m,v=g.styleSheet,x=void 0===v?null:v,k=g.optimizeForSpeed,E=void 0!==k&&k;this._sheet=x||new K({name:"styled-jsx",optimizeForSpeed:E}),this._sheet.inject(),x&&"boolean"==typeof E&&(this._sheet.setOptimizeForSpeed(E),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var m=StyleSheetRegistry.prototype;return m.add=function(m){var g=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(m.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(m,g){return m[g]=0,m},{}));var v=this.getIdAndRules(m),x=v.styleId,k=v.rules;if(x in this._instancesCounts){this._instancesCounts[x]+=1;return}var E=k.map(function(m){return g._sheet.insertRule(m)}).filter(function(m){return -1!==m});this._indices[x]=E,this._instancesCounts[x]=1},m.remove=function(m){var g=this,v=this.getIdAndRules(m).styleId;if(function(m,g){if(!m)throw Error("StyleSheetRegistry: "+g+".")}(v in this._instancesCounts,"styleId: `"+v+"` not found"),this._instancesCounts[v]-=1,this._instancesCounts[v]<1){var x=this._fromServer&&this._fromServer[v];x?(x.parentNode.removeChild(x),delete this._fromServer[v]):(this._indices[v].forEach(function(m){return g._sheet.deleteRule(m)}),delete this._indices[v]),delete this._instancesCounts[v]}},m.update=function(m,g){this.add(g),this.remove(m)},m.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},m.cssRules=function(){var m=this,g=this._fromServer?Object.keys(this._fromServer).map(function(g){return[g,m._fromServer[g]]}):[],v=this._sheet.cssRules();return g.concat(Object.keys(this._indices).map(function(g){return[g,m._indices[g].map(function(m){return v[m].cssText}).join(m._optimizeForSpeed?"":"\n")]}).filter(function(m){return!!m[1]}))},m.styles=function(m){var g,v;return g=this.cssRules(),void 0===(v=m)&&(v={}),g.map(function(m){var g=m[0],x=m[1];return E.default.createElement("style",{id:"__"+g,key:"__"+g,nonce:v.nonce?v.nonce:void 0,dangerouslySetInnerHTML:{__html:x}})})},m.getIdAndRules=function(m){var g=m.children,v=m.dynamic,x=m.id;if(v){var k=computeId(x,v);return{styleId:k,rules:Array.isArray(g)?g.map(function(m){return computeSelector(k,m)}):[computeSelector(k,g)]}}return{styleId:computeId(x),rules:Array.isArray(g)?g:[g]}},m.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(m,g){return m[g.id.slice(2)]=g,m},{})},StyleSheetRegistry}(),er=k.createContext(null);er.displayName="StyleSheetContext";var ei=E.default.useInsertionEffect||E.default.useLayoutEffect,es=new en;function JSXStyle(m){var g=es||k.useContext(er);return g&&ei(function(){return g.add(m),function(){g.remove(m)}}
22,[m.id,String(m.dynamic)]),null}JSXStyle.dynamic=function(m){return m.map(function(m){return computeId(m[0],m[1])}).join(" ")},g.style=JSXStyle},37108:function(m,g,v){"use strict";m.exports=v(14258).style},79644:function(m){!function(){var g={675:function(m,g){"use strict";g.byteLength=function(m){var g=getLens(m),v=g[0],x=g[1];return(v+x)*3/4-x},g.toByteArray=function(m){var g,v,E=getLens(m),T=E[0],K=E[1],et=new k((T+K)*3/4-K),en=0,er=K>0?T-4:T;for(v=0;v<er;v+=4)g=x[m.charCodeAt(v)]<<18|x[m.charCodeAt(v+1)]<<12|x[m.charCodeAt(v+2)]<<6|x[m.charCodeAt(v+3)],et[en++]=g>>16&255,et[en++]=g>>8&255,et[en++]=255&g;return 2===K&&(g=x[m.charCodeAt(v)]<<2|x[m.charCodeAt(v+1)]>>4,et[en++]=255&g),1===K&&(g=x[m.charCodeAt(v)]<<10|x[m.charCodeAt(v+1)]<<4|x[m.charCodeAt(v+2)]>>2,et[en++]=g>>8&255,et[en++]=255&g),et},g.fromByteArray=function(m){for(var g,x=m.length,k=x%3,E=[],T=0,K=x-k;T<K;T+=16383)E.push(function(m,g,x){for(var k,E=[],T=g;T<x;T+=3)E.push(v[(k=(m[T]<<16&16711680)+(m[T+1]<<8&65280)+(255&m[T+2]))>>18&63]+v[k>>12&63]+v[k>>6&63]+v[63&k]);return E.join("")}(m,T,T+16383>K?K:T+16383));return 1===k?E.push(v[(g=m[x-1])>>2]+v[g<<4&63]+"=="):2===k&&E.push(v[(g=(m[x-2]<<8)+m[x-1])>>10]+v[g>>4&63]+v[g<<2&63]+"="),E.join("")};for(var v=[],x=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array,E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=0,K=E.length;T<K;++T)v[T]=E[T],x[E.charCodeAt(T)]=T;function getLens(m){var g=m.length;if(g%4>0)throw Error("Invalid string. Length must be a multiple of 4");var v=m.indexOf("=");-1===v&&(v=g);var x=v===g?0:4-v%4;return[v,x]}x["-".charCodeAt(0)]=62,x["_".charCodeAt(0)]=63},72:function(m,g,v){"use strict";/*!
23 * The buffer module from node.js, for the browser.
24 *
25 * @author   Feross Aboukhadijeh <https://feross.org>
26 * @license  MIT
27 */var x=v(675),k=v(783),E="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function createBuffer(m){if(m>2147483647)throw RangeError('The value "'+m+'" is invalid for option "size"');var g=new Uint8Array(m);return Object.setPrototypeOf(g,Buffer.prototype),g}function Buffer(m,g,v){if("number"==typeof m){if("string"==typeof g)throw TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(m)}return from(m,g,v)}function from(m,g,v){if("string"==typeof m)return function(m,g){if(("string"!=typeof g||""===g)&&(g="utf8"),!Buffer.isEncoding(g))throw TypeError("Unknown encoding: "+g);var v=0|byteLength(m,g),x=createBuffer(v),k=x.write(m,g);return k!==v&&(x=x.slice(0,k)),x}(m,g);if(ArrayBuffer.isView(m))return fromArrayLike(m);if(null==m)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(isInstance(m,ArrayBuffer)||m&&isInstance(m.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(isInstance(m,SharedArrayBuffer)||m&&isInstance(m.buffer,SharedArrayBuffer)))return function(m,g,v){var x;if(g<0||m.byteLength<g)throw RangeError('"offset" is outside of buffer bounds');if(m.byteLength<g+(v||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(x=void 0===g&&void 0===v?new Uint8Array(m):void 0===v?new Uint8Array(m,g):new Uint8Array(m,g,v),Buffer.prototype),x}(m,g,v);if("number"==typeof m)throw TypeError('The "value" argument must not be of type number. Received type number');var x=m.valueOf&&m.valueOf();if(null!=x&&x!==m)return Buffer.from(x,g,v);var k=function(m){if(Buffer.isBuffer(m)){var g,v=0|checked(m.length),x=createBuffer(v);return 0===x.length||m.copy(x,0,0,v),x}return void 0!==m.length?"number"!=typeof m.length||(g=m.length)!=g?createBuffer(0):fromArrayLike(m):"Buffer"===m.type&&Array.isArray(m.data)?fromArrayLike(m.data):void 0}(m);if(k)return k;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof m[Symbol.toPrimitive])return Buffer.from(m[Symbol.toPrimitive]("string"),g,v);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}function assertSize(m){if("number"!=typeof m)throw TypeError('"size" argument must be of type number');
27if(m<0)throw RangeError('The value "'+m+'" is invalid for option "size"')}function allocUnsafe(m){return assertSize(m),createBuffer(m<0?0:0|checked(m))}function fromArrayLike(m){for(var g=m.length<0?0:0|checked(m.length),v=createBuffer(g),x=0;x<g;x+=1)v[x]=255&m[x];return v}function checked(m){if(m>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|m}function byteLength(m,g){if(Buffer.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||isInstance(m,ArrayBuffer))return m.byteLength;if("string"!=typeof m)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);var v=m.length,x=arguments.length>2&&!0===arguments[2];if(!x&&0===v)return 0;for(var k=!1;;)switch(g){case"ascii":case"latin1":case"binary":return v;case"utf8":case"utf-8":return utf8ToBytes(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*v;case"hex":return v>>>1;case"base64":return base64ToBytes(m).length;default:if(k)return x?-1:utf8ToBytes(m).length;g=(""+g).toLowerCase(),k=!0}}function slowToString(m,g,v){var k,E,T=!1;if((void 0===g||g<0)&&(g=0),g>this.length||((void 0===v||v>this.length)&&(v=this.length),v<=0||(v>>>=0)<=(g>>>=0)))return"";for(m||(m="utf8");;)switch(m){case"hex":return function(m,g,v){var x=m.length;(!g||g<0)&&(g=0),(!v||v<0||v>x)&&(v=x);for(var k="",E=g;E<v;++E)k+=K[m[E]];return k}(this,g,v);case"utf8":case"utf-8":return utf8Slice(this,g,v);case"ascii":return function(m,g,v){var x="";v=Math.min(m.length,v);for(var k=g;k<v;++k)x+=String.fromCharCode(127&m[k]);return x}(this,g,v);case"latin1":case"binary":return function(m,g,v){var x="";v=Math.min(m.length,v);for(var k=g;k<v;++k)x+=String.fromCharCode(m[k]);return x}(this,g,v);case"base64":return k=g,E=v,0===k&&E===this.length?x.fromByteArray(this):x.fromByteArray(this.slice(k,E));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(m,g,v){for(var x=m.slice(g,v),k="",E=0;E<x.length;E+=2)k+=String.fromCharCode(x[E]+256*x[E+1]);return k}(this,g,v);default:if(T)throw TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),T=!0}}function swap(m,g,v){var x=m[g];m[g]=m[v],m[v]=x}function bidirectionalIndexOf(m,g,v,x,k){var E;if(0===m.length)return -1;if("string"==typeof v?(x=v,v=0):v>2147483647?v=2147483647:v<-2147483648&&(v=-2147483648),(E=v=+v)!=E&&(v=k?0:m.length-1),v<0&&(v=m.length+v),v>=m.length){if(k)return -1;v=m.length-1}else if(v<0){if(!k)return -1;v=0}if("string"==typeof g&&(g=Buffer.from(g,x)),Buffer.isBuffer(g))return 0===g.length?-1:arrayIndexOf(m,g,v,x,k);if("number"==typeof g)return(g&=255,"function"==typeof Uint8Array.prototype.indexOf)?k?Uint8Array.prototype.indexOf.call(m,g,v):Uint8Array.prototype.lastIndexOf.call(m,g,v):arrayIndexOf(m,[g],v,x,k);throw TypeError("val must be string, number or Buffer")}function arrayIndexOf(m,g,v,x,k){var E,T=1,K=m.length,et=g.length;if(void 0!==x&&("ucs2"===(x=String(x).toLowerCase())||"ucs-2"===x||"utf16le"===x||"utf-16le"===x)){if(m.length<2||g.length<2)return -1;T=2,K/=2,et/=2,v/=2}function read(m,g){return 1===T?m[g]:m.readUInt16BE(g*T)}if(k){var en=-1;for(E=v;E<K;E++)if(read(m,E)===read(g,-1===en?0:E-en)){if(-1===en&&(en=E),E-en+1===et)return en*T}else -1!==en&&(E-=E-en),en=-1}else for(v+et>K&&(v=K-et),E=v;E>=0;E--){for(var er=!0,ei=0;ei<et;ei++)if(read(m,E+ei)!==read(g,ei)){er=!1;break}if(er)return E}return -1}function utf8Slice(m,g,v){v=Math.min(m.length,v);for(var x=[],k=g;k<v;){var E,T,K,et,en=m[k],er=null,ei=en>239?4:en>223?3:en>191?2:1;if(k+ei<=v)switch(ei){case 1:en<128&&(er=en);break;case 2:(192&(E=m[k+1]))==128&&(et=(31&en)<<6|63&E)>127&&(er=et);break;case 3:E=m[k+1],T=m[k+2],(192&E)==128&&(192&T)==128&&(et=(15&en)<<12|(63&E)<<6|63&T)>2047&&(et<55296||et>57343)&&(er=et);break;case 4:E=m[k+1],T=m[k+2],K=m[k+3],(192&E)==128&&(192&T)==128&&(192&K)==128&&(et=(15&en)<<18|(63&E)<<12|(63&T)<<6|63&K)>65535&&et<1114112&&(er=et)}null===er?(er=65533,ei=1):er>65535&&(er-=65536,x.push(er>>>10&1023|55296),er=56320|1023&er),x.push(er),k+=ei}return function(m){var g=m.length;if(g<=4096)return String.fromCharCode.apply(String,m);for(var v="",x=0;x<g;)v+=String.fromCharCode.apply(String,m.slice(x,x+=4096));return v}(x)}function checkOffset(m,g,v){if(m%1!=0||m<0)throw RangeError("offset is not uint");if(m+g>v)throw RangeError("Trying to access beyond buffer length")}function checkInt(m,g,v,x,k,E){if(!Buffer.isBuffer(m))throw TypeError('"buffer" argument must be a Buffer instance');if(g>k||g<E)throw RangeError('"value" argument is out of bounds');if(v+x>m.length)throw RangeError("Index out of range")}
vendor: 13,368 bytes, line 27
27function checkIEEE754(m,g,v,x,k,E){if(v+x>m.length||v<0)throw RangeError("Index out of range")}function writeFloat(m,g,v,x,E){return g=+g,v>>>=0,E||checkIEEE754(m,g,v,4,34028234663852886e22,-34028234663852886e22),k.write(m,g,v,x,23,4),v+4}function writeDouble(m,g,v,x,E){return g=+g,v>>>=0,E||checkIEEE754(m,g,v,8,17976931348623157e292,-17976931348623157e292),k.write(m,g,v,x,52,8),v+8}g.Buffer=Buffer,g.SlowBuffer=function(m){return+m!=m&&(m=0),Buffer.alloc(+m)},g.INSPECT_MAX_BYTES=50,g.kMaxLength=2147483647,Buffer.TYPED_ARRAY_SUPPORT=function(){try{var m=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(m,g),42===m.foo()}catch(m){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(m,g,v){return from(m,g,v)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(m,g,v){return(assertSize(m),m<=0)?createBuffer(m):void 0!==g?"string"==typeof v?createBuffer(m).fill(g,v):createBuffer(m).fill(g):createBuffer(m)},Buffer.allocUnsafe=function(m){return allocUnsafe(m)},Buffer.allocUnsafeSlow=function(m){return allocUnsafe(m)},Buffer.isBuffer=function(m){return null!=m&&!0===m._isBuffer&&m!==Buffer.prototype},Buffer.compare=function(m,g){if(isInstance(m,Uint8Array)&&(m=Buffer.from(m,m.offset,m.byteLength)),isInstance(g,Uint8Array)&&(g=Buffer.from(g,g.offset,g.byteLength)),!Buffer.isBuffer(m)||!Buffer.isBuffer(g))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===g)return 0;for(var v=m.length,x=g.length,k=0,E=Math.min(v,x);k<E;++k)if(m[k]!==g[k]){v=m[k],x=g[k];break}return v<x?-1:x<v?1:0},Buffer.isEncoding=function(m){switch(String(m).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(m,g){if(!Array.isArray(m))throw TypeError('"list" argument must be an Array of Buffers');if(0===m.length)return Buffer.alloc(0);if(void 0===g)for(v=0,g=0;v<m.length;++v)g+=m[v].length;var v,x=Buffer.allocUnsafe(g),k=0;for(v=0;v<m.length;++v){var E=m[v];if(isInstance(E,Uint8Array)&&(E=Buffer.from(E)),!Buffer.isBuffer(E))throw TypeError('"list" argument must be an Array of Buffers');E.copy(x,k),k+=E.length}return x},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var m=this.length;if(m%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var g=0;g<m;g+=2)swap(this,g,g+1);return this},Buffer.prototype.swap32=function(){var m=this.length;if(m%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var g=0;g<m;g+=4)swap(this,g,g+3),swap(this,g+1,g+2);return this},Buffer.prototype.swap64=function(){var m=this.length;if(m%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var g=0;g<m;g+=8)swap(this,g,g+7),swap(this,g+1,g+6),swap(this,g+2,g+5),swap(this,g+3,g+4);return this},Buffer.prototype.toString=function(){var m=this.length;return 0===m?"":0==arguments.length?utf8Slice(this,0,m):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(m){if(!Buffer.isBuffer(m))throw TypeError("Argument must be a Buffer");return this===m||0===Buffer.compare(this,m)},Buffer.prototype.inspect=function(){var m="",v=g.INSPECT_MAX_BYTES;return m=this.toString("hex",0,v).replace(/(.{2})/g,"$1 ").trim(),this.length>v&&(m+=" ... "),"<Buffer "+m+">"},E&&(Buffer.prototype[E]=Buffer.prototype.inspect),Buffer.prototype.compare=function(m,g,v,x,k){if(isInstance(m,Uint8Array)&&(m=Buffer.from(m,m.offset,m.byteLength)),!Buffer.isBuffer(m))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(void 0===g&&(g=0),void 0===v&&(v=m?m.length:0),void 0===x&&(x=0),void 0===k&&(k=this.length),g<0||v>m.length||x<0||k>this.length)throw RangeError("out of range index");if(x>=k&&g>=v)return 0;if(x>=k)return -1;if(g>=v)return 1;if(g>>>=0,v>>>=0,x>>>=0,k>>>=0,this===m)return 0;for(var E=k-x,T=v-g,K=Math.min(E,T),et=this.slice(x,k),en=m.slice(g,v),er=0;er<K;++er)if(et[er]!==en[er]){E=et[er],T=en[er];break}return E<T?-1:T<E?1:0},Buffer.prototype.includes=function(m,g,v){return -1!==this.indexOf(m,g,v)},Buffer.prototype.indexOf=function(m,g,v){return bidirectionalIndexOf(this,m,g,v,!0)},Buffer.prototype.lastIndexOf=function(m,g,v){return bidirectionalIndexOf(this,m,g,v,!1)},Buffer.prototype.write=function(m,g,v,x){if(void 0===g)x="utf8",v=this.length,g=0;else if(void 0===v&&"string"==typeof g)x=g,v=this.length,g=0;else if(isFinite(g))g>>>=0,isFinite(v)?(v>>>=0,void 0===x&&(x="utf8")):(x=v,v=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var k,E,T,K,et,en,er,ei,es,el,ec,eu,ed=this.length-g;if((void 0===v||v>ed)&&(v=ed),m.length>0&&(v<0||g<0)||g>this.length)throw RangeError("Attempt to write outside buffer bounds");x||(x="utf8");for(var ep=!1;;)switch(x){case"hex":return function(m,g,v,x){v=Number(v)||0;var k=m.length-v;x?(x=Number(x))>k&&(x=k):x=k;var E=g.length;x>E/2&&(x=E/2);for(var T=0;T<x;++T){var K=parseInt(g.substr(2*T,2),16);if(K!=K)break;m[v+T]=K}return T}(this,m,g,v);case"utf8":case"utf-8":return et=g,en=v,blitBuffer(utf8ToBytes(m,this.length-et),this,et,en);case"ascii":return er=g,ei=v,blitBuffer(asciiToBytes(m),this,er,ei);case"latin1":case"binary":return k=this,E=m,T=g,K=v,blitBuffer(asciiToBytes(E),k,T,K);case"base64":return es=g,el=v,blitBuffer(base64ToBytes(m),this,es,el);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ec=g,eu=v,blitBuffer(function(m,g){for(var v,x,k=[],E=0;E<m.length&&!((g-=2)<0);++E)x=(v=m.charCodeAt(E))>>8,k.push(v%256),k.push(x);return k}(m,this.length-ec),this,ec,eu);default:if(ep)throw TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),ep=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.slice=function(m,g){var v=this.length;m=~~m,g=void 0===g?v:~~g,m<0?(m+=v)<0&&(m=0):m>v&&(m=v),g<0?(g+=v)<0&&(g=0):g>v&&(g=v),g<m&&(g=m);var x=this.subarray(m,g);return Object.setPrototypeOf(x,Buffer.prototype),x},Buffer.prototype.readUIntLE=function(m,g,v){m>>>=0,g>>>=0,v||checkOffset(m,g,this.length);for(var x=this[m],k=1,E=0;++E<g&&(k*=256);)x+=this[m+E]*k;return x},Buffer.prototype.readUIntBE=function(m,g,v){m>>>=0,g>>>=0,v||checkOffset(m,g,this.length);for(var x=this[m+--g],k=1;g>0&&(k*=256);)x+=this[m+--g]*k;return x},Buffer.prototype.readUInt8=function(m,g){return m>>>=0,g||checkOffset(m,1,this.length),this[m]},Buffer.prototype.readUInt16LE=function(m,g){return m>>>=0,g||checkOffset(m,2,this.length),this[m]|this[m+1]<<8},Buffer.prototype.readUInt16BE=function(m,g){return m>>>=0,g||checkOffset(m,2,this.length),this[m]<<8|this[m+1]},Buffer.prototype.readUInt32LE=function(m,g){return m>>>=0,g||checkOffset(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+16777216*this[m+3]},Buffer.prototype.readUInt32BE=function(m,g){return m>>>=0,g||checkOffset(m,4,this.length),16777216*this[m]+(this[m+1]<<16|this[m+2]<<8|this[m+3])},Buffer.prototype.readIntLE=function(m,g,v){m>>>=0,g>>>=0,v||checkOffset(m,g,this.length);for(var x=this[m],k=1,E=0;++E<g&&(k*=256);)x+=this[m+E]*k;return x>=(k*=128)&&(x-=Math.pow(2,8*g)),x},Buffer.prototype.readIntBE=function(m,g,v){m>>>=0,g>>>=0,v||checkOffset(m,g,this.length);for(var x=g,k=1,E=this[m+--x];x>0&&(k*=256);)E+=this[m+--x]*k;return E>=(k*=128)&&(E-=Math.pow(2,8*g)),E},Buffer.prototype.readInt8=function(m,g){return(m>>>=0,g||checkOffset(m,1,this.length),128&this[m])?-((255-this[m]+1)*1):this[m]},Buffer.prototype.readInt16LE=function(m,g){m>>>=0,g||checkOffset(m,2,this.length);var v=this[m]|this[m+1]<<8;return 32768&v?4294901760|v:v},Buffer.prototype.readInt16BE=function(m,g){m>>>=0,g||checkOffset(m,2,this.length);var v=this[m+1]|this[m]<<8;return 32768&v?4294901760|v:v},Buffer.prototype.readInt32LE=function(m,g){return m>>>=0,g||checkOffset(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},Buffer.prototype.readInt32BE=function(m,g){return m>>>=0,g||checkOffset(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},Buffer.prototype.readFloatLE=function(m,g){return m>>>=0,g||checkOffset(m,4,this.length),k.read(this,m,!0,23,4)},Buffer.prototype.readFloatBE=function(m,g){return m>>>=0,g||checkOffset(m,4,this.length),k.read(this,m,!1,23,4)},Buffer.prototype.readDoubleLE=function(m,g){return m>>>=0,g||checkOffset(m,8,this.length),k.read(this,m,!0,52,8)},Buffer.prototype.readDoubleBE=function(m,g){return m>>>=0,g||checkOffset(m,8,this.length),k.read(this,m,!1,52,8)},Buffer.prototype.writeUIntLE=function(m,g,v,x){if(m=+m,g>>>=0,v>>>=0,!x){var k=Math.pow(2,8*v)-1;checkInt(this,m,g,v,k,0)}var E=1,T=0;for(this[g]=255&m;++T<v&&(E*=256);)this[g+T]=m/E&255;return g+v},Buffer.prototype.writeUIntBE=function(m,g,v,x){if(m=+m,g>>>=0,v>>>=0,!x){var k=Math.pow(2,8*v)-1;checkInt(this,m,g,v,k,0)}var E=v-1,T=1;for(this[g+E]=255&m;--E>=0&&(T*=256);)this[g+E]=m/T&255;return g+v},Buffer.prototype.writeUInt8=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,1,255,0),this[g]=255&m,g+1},Buffer.prototype.writeUInt16LE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,2,65535,0),this[g]=255&m,this[g+1]=m>>>8,g+2},Buffer.prototype.writeUInt16BE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,2,65535,0),this[g]=m>>>8,this[g+1]=255&m,g+2},Buffer.prototype.writeUInt32LE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,4,4294967295,0),this[g+3]=m>>>24,this[g+2]=m>>>16,this[g+1]=m>>>8,this[g]=255&m,g+4},Buffer.prototype.writeUInt32BE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,4,4294967295,0),this[g]=m>>>24,this[g+1]=m>>>16,this[g+2]=m>>>8,this[g+3]=255&m,g+4},Buffer.prototype.writeIntLE=function(m,g,v,x){if(m=+m,g>>>=0,!x){var k=Math.pow(2,8*v-1);checkInt(this,m,g,v,k-1,-k)}var E=0,T=1,K=0;for(this[g]=255&m;++E<v&&(T*=256);)m<0&&0===K&&0!==this[g+E-1]&&(K=1),this[g+E]=(m/T>>0)-K&255;return g+v},Buffer.prototype.writeIntBE=function(m,g,v,x){if(m=+m,g>>>=0,!x){var k=Math.pow(2,8*v-1);checkInt(this,m,g,v,k-1,-k)}var E=v-1,T=1,K=0;for(this[g+E]=255&m;--E>=0&&(T*=256);)m<0&&0===K&&0!==this[g+E+1]&&(K=1),this[g+E]=(m/T>>0)-K&255;return g+v},Buffer.prototype.writeInt8=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,1,127,-128),m<0&&(m=255+m+1),this[g]=255&m,g+1},Buffer.prototype.writeInt16LE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,2,32767,-32768),this[g]=255&m,this[g+1]=m>>>8,g+2},Buffer.prototype.writeInt16BE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,2,32767,-32768),this[g]=m>>>8,this[g+1]=255&m,g+2},Buffer.prototype.writeInt32LE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,4,2147483647,-2147483648),this[g]=255&m,this[g+1]=m>>>8,this[g+2]=m>>>16,this[g+3]=m>>>24,g+4},Buffer.prototype.writeInt32BE=function(m,g,v){return m=+m,g>>>=0,v||checkInt(this,m,g,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[g]=m>>>24,this[g+1]=m>>>16,this[g+2]=m>>>8,this[g+3]=255&m,g+4},Buffer.prototype.writeFloatLE=function(m,g,v){return writeFloat(this,m,g,!0,v)},Buffer.prototype.writeFloatBE=function(m,g,v){return writeFloat(this,m,g,!1,v)},Buffer.prototype.writeDoubleLE=function(m,g,v){return writeDouble(this,m,g,!0,v)},Buffer.prototype.writeDoubleBE=function(m,g,v){return writeDouble(this,m,g,!1,v)},Buffer.prototype.copy=function(m,g,v,x){if(!Buffer.isBuffer(m))throw TypeError("argument should be a Buffer");if(v||(v=0),x||0===x||(x=this.length),g>=m.length&&(g=m.length),g||(g=0),x>0&&x<v&&(x=v),x===v||0===m.length||0===this.length)return 0;if(g<0)throw RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw RangeError("Index out of range");if(x<0)throw RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),m.length-g<x-v&&(x=m.length-g+v);var k=x-v;if(this===m&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(g,v,x);else if(this===m&&v<g&&g<x)for(var E=k-1;E>=0;--E)m[E+g]=this[E+v];else Uint8Array.prototype.set.call(m,this.subarray(v,x),g);return k},Buffer.prototype.fill=function(m,g,v,x){if("string"==typeof m){if("string"==typeof g?(x=g,g=0,v=this.length):"string"==typeof v&&(x=v,v=this.length),void 0!==x&&"string"!=typeof x)throw TypeError("encoding must be a string");if("string"==typeof x&&!Buffer.isEncoding(x))throw TypeError("Unknown encoding: "+x);if(1===m.length){var k,E=m.charCodeAt(0);("utf8"===x&&E<128||"latin1"===x)&&(m=E)}}else"number"==typeof m?m&=255:"boolean"==typeof m&&(m=Number(m));if(g<0||this.length<g||this.length<v)throw RangeError("Out of range index");if(v<=g)return this;if(g>>>=0,v=void 0===v?this.length:v>>>0,m||(m=0),"number"==typeof m)for(k=g;k<v;++k)this[k]=m;else{var T=Buffer.isBuffer(m)?m:Buffer.from(m,x),K=T.length;
27if(0===K)throw TypeError('The value "'+m+'" is invalid for argument "value"');for(k=0;k<v-g;++k)this[k+g]=T[k%K]}return this};var T=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(m,g){g=g||1/0;for(var v,x=m.length,k=null,E=[],T=0;T<x;++T){if((v=m.charCodeAt(T))>55295&&v<57344){if(!k){if(v>56319||T+1===x){(g-=3)>-1&&E.push(239,191,189);continue}k=v;continue}if(v<56320){(g-=3)>-1&&E.push(239,191,189),k=v;continue}v=(k-55296<<10|v-56320)+65536}else k&&(g-=3)>-1&&E.push(239,191,189);if(k=null,v<128){if((g-=1)<0)break;E.push(v)}else if(v<2048){if((g-=2)<0)break;E.push(v>>6|192,63&v|128)}else if(v<65536){if((g-=3)<0)break;E.push(v>>12|224,v>>6&63|128,63&v|128)}else if(v<1114112){if((g-=4)<0)break;E.push(v>>18|240,v>>12&63|128,v>>6&63|128,63&v|128)}else throw Error("Invalid code point")}return E}function asciiToBytes(m){for(var g=[],v=0;v<m.length;++v)g.push(255&m.charCodeAt(v));return g}function base64ToBytes(m){return x.toByteArray(function(m){if((m=(m=m.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;m.length%4!=0;)m+="=";return m}(m))}function blitBuffer(m,g,v,x){for(var k=0;k<x&&!(k+v>=g.length)&&!(k>=m.length);++k)g[k+v]=m[k];return k}function isInstance(m,g){return m instanceof g||null!=m&&null!=m.constructor&&null!=m.constructor.name&&m.constructor.name===g.name}var K=function(){for(var m="0123456789abcdef",g=Array(256),v=0;v<16;++v)for(var x=16*v,k=0;k<16;++k)g[x+k]=m[v]+m[k];return g}()},783:function(m,g){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */g.read=function(m,g,v,x,k){var E,T,K=8*k-x-1,et=(1<<K)-1,en=et>>1,er=-7,ei=v?k-1:0,es=v?-1:1,el=m[g+ei];for(ei+=es,E=el&(1<<-er)-1,el>>=-er,er+=K;er>0;E=256*E+m[g+ei],ei+=es,er-=8);for(T=E&(1<<-er)-1,E>>=-er,er+=x;er>0;T=256*T+m[g+ei],ei+=es,er-=8);if(0===E)E=1-en;else{if(E===et)return T?NaN:(el?-1:1)*(1/0);T+=Math.pow(2,x),E-=en}return(el?-1:1)*T*Math.pow(2,E-x)},g.write=function(m,g,v,x,k,E){var T,K,et,en=8*E-k-1,er=(1<<en)-1,ei=er>>1,es=23===k?5960464477539062e-23:0,el=x?0:E-1,ec=x?1:-1,eu=g<0||0===g&&1/g<0?1:0;for(isNaN(g=Math.abs(g))||g===1/0?(K=isNaN(g)?1:0,T=er):(T=Math.floor(Math.log(g)/Math.LN2),g*(et=Math.pow(2,-T))<1&&(T--,et*=2),T+ei>=1?g+=es/et:g+=es*Math.pow(2,1-ei),g*et>=2&&(T++,et/=2),T+ei>=er?(K=0,T=er):T+ei>=1?(K=(g*et-1)*Math.pow(2,k),T+=ei):(K=g*Math.pow(2,ei-1)*Math.pow(2,k),T=0));k>=8;m[v+el]=255&K,el+=ec,K/=256,k-=8);for(T=T<<k|K,en+=k;en>0;m[v+el]=255&T,el+=ec,T/=256,en-=8);m[v+el-ec]|=128*eu}}},v={};function __nccwpck_require__(m){var x=v[m];if(void 0!==x)return x.exports;var k=v[m]={exports:{}},E=!0;try{g[m](k,k.exports,__nccwpck_require__),E=!1}finally{E&&delete v[m]}return k.exports}__nccwpck_require__.ab="//";var x=__nccwpck_require__(72);m.exports=x}()},81633:function(){},19178:function(){},95715:function(m){m.exports={style:{fontFamily:"'__DM_Sans_6f7b8a', '__DM_Sans_Fallback_6f7b8a'",fontStyle:"normal"},className:"__className_6f7b8a"}},97729:function(m,g,v){m.exports=v(35487)},96577:function(m,g,v){m.exports=v(16099)},38421:function(m,g,v){m.exports=v(16184)},39097:function(m,g,v){m.exports=v(99938)},82876:function(m,g,v){m.exports=v(60085)},5632:function(m,g,v){m.exports=v(65123)},45847:function(m,g,v){m.exports=v(22898)},68262:function(m,g,v){"use strict";var x=v(23586);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,m.exports=function(){function shim(m,g,v,k,E,T){if(T!==x){var K=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}}function getShim(){return shim}shim.isRequired=shim;var m={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return m.PropTypes=m,m}},13980:function(m,g,v){m.exports=v(68262)()},23586:function(m){"use strict";m.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},36794:function(m,g,v){"use strict";
27Object.defineProperty(g,"__esModule",{value:!0}),g.CopyToClipboard=void 0;var x=_interopRequireDefault(v(50381)),k=_interopRequireDefault(v(2784)),E=["text","onCopy","options","children"];function _interopRequireDefault(m){return m&&m.__esModule?m:{default:m}}function _typeof(m){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(m)}function ownKeys(m,g){var v=Object.keys(m);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(m);g&&(x=x.filter(function(g){return Object.getOwnPropertyDescriptor(m,g).enumerable})),v.push.apply(v,x)}return v}function _objectSpread(m){for(var g=1;g<arguments.length;g++){var v=null!=arguments[g]?arguments[g]:{};g%2?ownKeys(Object(v),!0).forEach(function(g){_defineProperty(m,g,v[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(v)):ownKeys(Object(v)).forEach(function(g){Object.defineProperty(m,g,Object.getOwnPropertyDescriptor(v,g))})}return m}function _defineProperties(m,g){for(var v=0;v<g.length;v++){var x=g[v];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,_toPropertyKey(x.key),x)}}function _isNativeReflectConstruct(){try{var m=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(m){}return(_isNativeReflectConstruct=function(){return!!m})()}function _getPrototypeOf(m){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(m){return m.__proto__||Object.getPrototypeOf(m)})(m)}function _setPrototypeOf(m,g){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,g){return m.__proto__=g,m})(m,g)}function _defineProperty(m,g,v){return(g=_toPropertyKey(g))in m?Object.defineProperty(m,g,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[g]=v,m}function _toPropertyKey(m){var g=function(m,g){if("object"!=_typeof(m)||!m)return m;var v=m[Symbol.toPrimitive];if(void 0!==v){var x=v.call(m,g||"default");if("object"!=_typeof(x))return x;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===g?String:Number)(m)}(m,"string");return"symbol"==_typeof(g)?g:g+""}var T=g.CopyToClipboard=function(m){var g,v;function CopyToClipboard(){!function(m,g){if(!(m instanceof g))throw TypeError("Cannot call a class as a function")}
27(this,CopyToClipboard);for(var m,g,v,E=arguments.length,T=Array(E),K=0;K<E;K++)T[K]=arguments[K];return g=CopyToClipboard,v=[].concat(T),g=_getPrototypeOf(g),_defineProperty(m=function(m,g){if(g&&("object"==_typeof(g)||"function"==typeof g))return g;if(void 0!==g)throw TypeError("Derived constructors may only return object or undefined");return function(m){if(void 0===m)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return m}(m)}(this,_isNativeReflectConstruct()?Reflect.construct(g,v||[],_getPrototypeOf(this).constructor):g.apply(this,v)),"onClick",function(g){var v=m.props,E=v.text,T=v.onCopy,K=v.children,et=v.options,en=k.default.Children.only(K),er=(0,x.default)(E,et);T&&T(E,er),null!=en&&en.props&&"function"==typeof en.props.onClick&&en.props.onClick(g)}),m}return function(m,g){if("function"!=typeof g&&null!==g)throw TypeError("Super expression must either be null or a function");m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),g&&_setPrototypeOf(m,g)}(CopyToClipboard,m),g=[{key:"render",value:function(){var m=this.props,g=(m.text,m.onCopy,m.options,m.children),v=function(m,g){if(null==m)return{};var v,x,k=function(m,g){if(null==m)return{};var v={};for(var x in m)if(({}).hasOwnProperty.call(m,x)){if(-1!==g.indexOf(x))continue;v[x]=m[x]}return v}(m,g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);for(x=0;x<E.length;x++)v=E[x],-1===g.indexOf(v)&&({}).propertyIsEnumerable.call(m,v)&&(k[v]=m[v])}return k}(m,E),x=k.default.Children.only(g);return k.default.cloneElement(x,_objectSpread(_objectSpread({},v),{},{onClick:this.onClick}))}}],_defineProperties(CopyToClipboard.prototype,g),v&&_defineProperties(CopyToClipboard,v),Object.defineProperty(CopyToClipboard,"prototype",{writable:!1}),CopyToClipboard}(k.default.PureComponent);_defineProperty(T,"defaultProps",{onCopy:void 0,options:void 0})},72282:function(m,g,v){"use strict";var x=v(36794).CopyToClipboard;x.CopyToClipboard=x,m.exports=x},3176:function(m,g,v){"use strict";v.d(g,{Z:function(){return eu}});var x,k,E=v(2784),T=v(13980),K=v.n(T),et=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function _extends(){return(_extends=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)Object.prototype.hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(this,arguments)}function _assertThisInitialized(m){if(void 0===m)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function _setPrototypeOf(m,g){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,g){return m.__proto__=g,m})(m,g)}var en=function(m){function ReCAPTCHA(){var g;return(g=m.call(this)||this).handleExpired=g.handleExpired.bind(_assertThisInitialized(g)),g.handleErrored=g.handleErrored.bind(_assertThisInitialized(g)),g.handleChange=g.handleChange.bind(_assertThisInitialized(g)),g.handleRecaptchaRef=g.handleRecaptchaRef.bind(_assertThisInitialized(g)),g}ReCAPTCHA.prototype=Object.create(m.prototype),ReCAPTCHA.prototype.constructor=ReCAPTCHA,_setPrototypeOf(ReCAPTCHA,m);var g=ReCAPTCHA.prototype;return g.getCaptchaFunction=function(m){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[m]:this.props.grecaptcha[m]:null},g.getValue=function(){var m=this.getCaptchaFunction("getResponse");return m&&void 0!==this._widgetId?m(this._widgetId):null},g.getWidgetId=function(){return this.props.grecaptcha&&void 0!==this._widgetId?this._widgetId:null},g.execute=function(){var m=this.getCaptchaFunction("execute");if(m&&void 0!==this._widgetId)return m(this._widgetId);this._executeRequested=!0},g.executeAsync=function(){var m=this;return new Promise(function(g,v){m.executionResolve=g,m.executionReject=v,m.execute()})},g.reset=function(){var m=this.getCaptchaFunction("reset");m&&void 0!==this._widgetId&&m(this._widgetId)},g.forceReset=function(){var m=this.getCaptchaFunction("reset");m&&m()},g.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},g.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},g.handleChange=function(m){this.props.onChange&&this.props.onChange(m),this.executionResolve&&(this.executionResolve(m),delete this.executionReject,delete this.executionResolve)},g.explicitRender=function(){var m=this.getCaptchaFunction("render");if(m&&void 0===this._widgetId){var g=document.createElement("div");this._widgetId=m(g,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(g)}this._executeRequested&&this.props.grecaptcha&&void 0!==this._widgetId&&(this._executeRequested=!1,this.execute())},g.componentDidMount=function(){this.explicitRender()},g.componentDidUpdate=function(){this.explicitRender()},g.handleRecaptchaRef=function(m){this.captcha=m},g.render=function(){var m=this.props,g=(m.sitekey,m.onChange,m.theme,m.type,m.tabindex,m.onExpired,m.onErrored,m.size,m.stoken,m.grecaptcha,m.badge,m.hl,m.isolated,function(m,g){if(null==m)return{};var v,x,k={},E=Object.keys(m);for(x=0;x<E.length;x++)v=E[x],g.indexOf(v)>=0||(k[v]=m[v]);return k}(m,et));return E.createElement("div",_extends({},g,{ref:this.handleRecaptchaRef}))},ReCAPTCHA}(E.Component);en.displayName="ReCAPTCHA",en.propTypes={sitekey:K().string.isRequired,onChange:K().func,grecaptcha:K().object,theme:K().oneOf(["dark","light"]),type:K().oneOf(["image","audio"]),tabindex:K().number,onExpired:K().func,onErrored:K().func,size:K().oneOf(["compact","normal","invisible"]),stoken:K().string,hl:K().string,badge:K().oneOf(["bottomright","bottomleft","inline"]),isolated:K().bool}
vendor: 6,471 bytes, lines 27-34
27,en.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var er=v(73463),ei=v.n(er);function async_script_loader_extends(){return(async_script_loader_extends=Object.assign||function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)Object.prototype.hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(this,arguments)}var es={},el=0,ec="onloadcallback";function getOptions(){return"undefined"!=typeof window&&window.recaptchaOptions||{}}var eu=(x=function(){var m=getOptions(),g=m.useRecaptchaNet?"recaptcha.net":"www.google.com";return m.enterprise?"https://"+g+"/recaptcha/enterprise.js?onload="+ec+"&render=explicit":"https://"+g+"/recaptcha/api.js?onload="+ec+"&render=explicit"},k=(k={callbackName:ec,globalName:"grecaptcha",attributes:getOptions().nonce?{nonce:getOptions().nonce}:{}})||{},function(m){var g=m.displayName||m.name||"Component",v=function(g){function AsyncScriptLoader(m,v){var x;return(x=g.call(this,m,v)||this).state={},x.__scriptURL="",x}AsyncScriptLoader.prototype=Object.create(g.prototype),AsyncScriptLoader.prototype.constructor=AsyncScriptLoader,AsyncScriptLoader.__proto__=g;var v=AsyncScriptLoader.prototype;return v.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+el++),this.__scriptLoaderID},v.setupScriptURL=function(){return this.__scriptURL="function"==typeof x?x():x,this.__scriptURL},v.asyncScriptLoaderHandleLoad=function(m){var g=this;this.setState(m,function(){return g.props.asyncScriptOnLoad&&g.props.asyncScriptOnLoad(g.state)})},v.asyncScriptLoaderTriggerOnScriptLoaded=function(){var m=es[this.__scriptURL];if(!m||!m.loaded)throw Error("Script is not loaded.");for(var g in m.observers)m.observers[g](m);delete window[k.callbackName]},v.componentDidMount=function(){var m=this,g=this.setupScriptURL(),v=this.asyncScriptLoaderGetScriptLoaderID(),x=k,E=x.globalName,T=x.callbackName,K=x.scriptId;if(E&&void 0!==window[E]&&(es[g]={loaded:!0,observers:{}}),es[g]){var et=es[g];if(et&&(et.loaded||et.errored)){this.asyncScriptLoaderHandleLoad(et);return}et.observers[v]=function(g){return m.asyncScriptLoaderHandleLoad(g)};return}var en={};en[v]=function(g){return m.asyncScriptLoaderHandleLoad(g)},es[g]={loaded:!1,observers:en};var er=document.createElement("script");for(var ei in er.src=g,er.async=!0,k.attributes)er.setAttribute(ei,k.attributes[ei]);K&&(er.id=K);var callObserverFuncAndRemoveObserver=function(m){if(es[g]){var v=es[g].observers;for(var x in v)m(v[x])&&delete v[x]}};T&&"undefined"!=typeof window&&(window[T]=function(){return m.asyncScriptLoaderTriggerOnScriptLoaded()}),er.onload=function(){var m=es[g];m&&(m.loaded=!0,callObserverFuncAndRemoveObserver(function(g){return!T&&(g(m),!0)}))},er.onerror=function(){var m=es[g];m&&(m.errored=!0,callObserverFuncAndRemoveObserver(function(g){return g(m),!0}))},document.body.appendChild(er)},v.componentWillUnmount=function(){var m=this.__scriptURL;if(!0===k.removeOnUnmount)for(var g=document.getElementsByTagName("script"),v=0;v<g.length;v+=1)g[v].src.indexOf(m)>-1&&g[v].parentNode&&g[v].parentNode.removeChild(g[v]);var x=es[m];x&&(delete x.observers[this.asyncScriptLoaderGetScriptLoaderID()],!0===k.removeOnUnmount&&delete es[m])},v.render=function(){var g=k.globalName,v=this.props,x=(v.asyncScriptOnLoad,v.forwardedRef),T=function(m,g){if(null==m)return{};var v,x,k={},E=Object.keys(m);for(x=0;x<E.length;x++)g.indexOf(v=E[x])>=0||(k[v]=m[v]);return k}(v,["asyncScriptOnLoad","forwardedRef"]);return g&&"undefined"!=typeof window&&(T[g]=void 0!==window[g]?window[g]:void 0),T.ref=x,(0,E.createElement)(m,T)},AsyncScriptLoader}(E.Component),T=(0,E.forwardRef)(function(m,g){return(0,E.createElement)(v,async_script_loader_extends({},m,{forwardedRef:g}))});return T.displayName="AsyncScriptLoader("+g+")",T.propTypes={asyncScriptOnLoad:K().func},ei()(T,m)})(en)},66866:function(m,g){"use strict";/** @license React v16.13.1
28 * react-is.production.min.js
29 *
30 * Copyright (c) Facebook, Inc. and its affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var v="function"==typeof Symbol&&Symbol.for,x=v?Symbol.for("react.element"):60103,k=v?Symbol.for("react.portal"):60106,E=v?Symbol.for("react.fragment"):60107,T=v?Symbol.for("react.strict_mode"):60108,K=v?Symbol.for("react.profiler"):60114,et=v?Symbol.for("react.provider"):60109,en=v?Symbol.for("react.context"):60110,er=v?Symbol.for("react.async_mode"):60111,ei=v?Symbol.for("react.concurrent_mode"):60111,es=v?Symbol.for("react.forward_ref"):60112,el=v?Symbol.for("react.suspense"):60113,ec=v?Symbol.for("react.suspense_list"):60120,eu=v?Symbol.for("react.memo"):60115,ed=v?Symbol.for("react.lazy"):60116,ep=v?Symbol.for("react.block"):60121,em=v?Symbol.for("react.fundamental"):60117,ef=v?Symbol.for("react.responder"):60118,eh=v?Symbol.for("react.scope"):60119;function z(m){if("object"==typeof m&&null!==m){var g=m.$$typeof;switch(g){case x:switch(m=m.type){case er:case ei:case E:case K:case T:case el:return m;default:switch(m=m&&m.$$typeof){case en:case es:case ed:case eu:case et:return m;default:return g}}case k:return g}}}function A(m){return z(m)===ei}g.AsyncMode=er,g.ConcurrentMode=ei,g.ContextConsumer=en,g.ContextProvider=et,g.Element=x,g.ForwardRef=es,g.Fragment=E,g.Lazy=ed,g.Memo=eu,g.Portal=k,g.Profiler=K,g.StrictMode=T,g.Suspense=el,g.isAsyncMode=function(m){return A(m)||z(m)===er},g.isConcurrentMode=A,g.isContextConsumer=function(m){return z(m)===en},g.isContextProvider=function(m){return z(m)===et},g.isElement=function(m){return"object"==typeof m&&null!==m&&m.$$typeof===x},g.isForwardRef=function(m){return z(m)===es},g.isFragment=function(m){return z(m)===E},g.isLazy=function(m){return z(m)===ed},g.isMemo=function(m){return z(m)===eu},g.isPortal=function(m){return z(m)===k},g.isProfiler=function(m){return z(m)===K},g.isStrictMode=function(m){return z(m)===T},g.isSuspense=function(m){return z(m)===el},g.isValidElementType=function(m){return"string"==typeof m||"function"==typeof m||m===E||m===ei||m===K||m===T||m===el||m===ec||"object"==typeof m&&null!==m&&(m.$$typeof===ed||m.$$typeof===eu||m.$$typeof===et||m.$$typeof===en||m.$$typeof===es||m.$$typeof===em||m.$$typeof===ef||m.$$typeof===eh||m.$$typeof===ep)},g.typeOf=z},48570:function(m,g,v){"use strict";m.exports=v(66866)},44607:function(m,g,v){"use strict";g.Z=void 0;
34var x=function(m,g){if(!g&&m&&m.__esModule)return m;if(null===m||"object"!==_typeof(m)&&"function"!=typeof m)return{default:m};var v=_getRequireWildcardCache(g);if(v&&v.has(m))return v.get(m);var x={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in m)if("default"!==E&&Object.prototype.hasOwnProperty.call(m,E)){var T=k?Object.getOwnPropertyDescriptor(m,E):null;T&&(T.get||T.set)?Object.defineProperty(x,E,T):x[E]=m[E]}return x.default=m,v&&v.set(m,x),x}(v(2784)),k=["placeholder","separator","isLastChild","inputStyle","focus","isDisabled","hasErrored","errorStyle","focusStyle","disabledStyle","shouldAutoFocus","isInputNum","index","value","className","isInputSecure"];function _getRequireWildcardCache(m){if("function"!=typeof WeakMap)return null;var g=new WeakMap,v=new WeakMap;return(_getRequireWildcardCache=function(m){return m?v:g})(m)}function _extends(){return(_extends=Object.assign||function(m){for(var g=1;g<arguments.length;g++){var v=arguments[g];for(var x in v)Object.prototype.hasOwnProperty.call(v,x)&&(m[x]=v[x])}return m}).apply(this,arguments)}function _classCallCheck(m,g){if(!(m instanceof g))throw TypeError("Cannot call a class as a function")}function _defineProperties(m,g){for(var v=0;v<g.length;v++){var x=g[v];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,x.key,x)}}function _createClass(m,g,v){return g&&_defineProperties(m.prototype,g),v&&_defineProperties(m,v),m}function _inherits(m,g){if("function"!=typeof g&&null!==g)throw TypeError("Super expression must either be null or a function");m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),g&&_setPrototypeOf(m,g)}function _setPrototypeOf(m,g){return(_setPrototypeOf=Object.setPrototypeOf||function(m,g){return m.__proto__=g,m})(m,g)}function _createSuper(m){var g=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(m){return!1}}();return function(){var v,x,k=_getPrototypeOf(m);if(g){var E=_getPrototypeOf(this).constructor;x=Reflect.construct(k,arguments,E)}else x=k.apply(this,arguments);return(v=x)&&("object"===_typeof(v)||"function"==typeof v)?v:_assertThisInitialized(this)}}function _assertThisInitialized(m){if(void 0===m)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function _getPrototypeOf(m){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)})(m)}function _defineProperty(m,g,v){return g in m?Object.defineProperty(m,g,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[g]=v,m}function _typeof(m){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(m)}var isStyleObject=function(m){return"object"===_typeof(m)},E=function(m){_inherits(SingleOtpInput,m);var g=_createSuper(SingleOtpInput);function SingleOtpInput(m){var v;return _classCallCheck(this,SingleOtpInput),_defineProperty(_assertThisInitialized(v=g.call(this,m)),"getClasses",function(){for(var m=arguments.length,g=Array(m),v=0;v<m;v++)g[v]=arguments[v];return g.filter(function(m){return!isStyleObject(m)&&!1!==m}).join(" ")}),_defineProperty(_assertThisInitialized(v),"getType",function(){var m=v.props,g=m.isInputSecure,x=m.isInputNum;return g?"password":x?"tel":"text"}),v.input=x.default.createRef(),v}return _createClass(SingleOtpInput,[{key:"componentDidMount",value:function(){var m=this.props,g=m.focus,v=m.shouldAutoFocus,x=this.input.current;x&&g&&v&&x.focus()}},{key:"componentDidUpdate",value:function(m){var g=this.props.focus,v=this.input.current;m.focus!==g&&v&&g&&(v.focus(),v.select())}},{key:"render",value:function(){var m=this.props,g=m.placeholder,v=m.separator,E=m.isLastChild,T=m.inputStyle,K=m.focus,et=m.isDisabled,en=m.hasErrored,er=m.errorStyle,ei=m.focusStyle,es=m.disabledStyle,el=(m.shouldAutoFocus,m.isInputNum),ec=m.index,eu=m.value,ed=m.className,ep=(m.isInputSecure,function(m,g){if(null==m)return{};var v,x,k=function(m,g){if(null==m)return{};var v,x,k={},E=Object.keys(m);for(x=0;x<E.length;x++)v=E[x],g.indexOf(v)>=0||(k[v]=m[v]);return k}(m,g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);for(x=0;x<E.length;x++)v=E[x],!(g.indexOf(v)>=0)&&Object.prototype.propertyIsEnumerable.call(m,v)&&(k[v]=m[v])}return k}(m,k));return x.default.createElement("div",{className:ed,style:{display:"flex",alignItems:"center"}},x.default.createElement("input",_extends({"aria-label":"".concat(0===ec?"Please enter verification code. ":"").concat(el?"Digit":"Character"," ").concat(ec+1),autoComplete:"off",style:Object.assign({width:"1em",textAlign:"center"},isStyleObject(T)&&T,K&&isStyleObject(ei)&&ei,et&&isStyleObject(es)&&es,en&&isStyleObject(er)&&er),placeholder:g,className:this.getClasses(T,K&&ei,et&&es,en&&er),type:this.getType(),maxLength:"1",ref:this.input,disabled:et,value:eu||""},ep)),!E&&v)}}]),SingleOtpInput}
34(x.PureComponent),T=function(m){_inherits(OtpInput,m);var g=_createSuper(OtpInput);function OtpInput(){var m;_classCallCheck(this,OtpInput);for(var v=arguments.length,k=Array(v),T=0;T<v;T++)k[T]=arguments[T];return _defineProperty(_assertThisInitialized(m=g.call.apply(g,[this].concat(k))),"state",{activeInput:0}),_defineProperty(_assertThisInitialized(m),"getOtpValue",function(){return m.props.value?m.props.value.toString().split(""):[]}),_defineProperty(_assertThisInitialized(m),"getPlaceholderValue",function(){var g=m.props,v=g.placeholder,x=g.numInputs;if("string"==typeof v){if(v.length===x)return v;v.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}}),_defineProperty(_assertThisInitialized(m),"handleOtpChange",function(g){(0,m.props.onChange)(g.join(""))}),_defineProperty(_assertThisInitialized(m),"isInputValueValid",function(g){return(m.props.isInputNum?!isNaN(parseInt(g,10)):"string"==typeof g)&&1===g.trim().length}),_defineProperty(_assertThisInitialized(m),"focusInput",function(g){var v=Math.max(Math.min(m.props.numInputs-1,g),0);m.setState({activeInput:v})}),_defineProperty(_assertThisInitialized(m),"focusNextInput",function(){var g=m.state.activeInput;m.focusInput(g+1)}),_defineProperty(_assertThisInitialized(m),"focusPrevInput",function(){var g=m.state.activeInput;m.focusInput(g-1)}),_defineProperty(_assertThisInitialized(m),"changeCodeAtFocus",function(g){var v=m.state.activeInput,x=m.getOtpValue();x[v]=g[0],m.handleOtpChange(x)}),_defineProperty(_assertThisInitialized(m),"handleOnPaste",function(g){g.preventDefault();var v=m.state.activeInput,x=m.props,k=x.numInputs;if(!x.isDisabled){for(var E=m.getOtpValue(),T=v,K=g.clipboardData.getData("text/plain").slice(0,k-v).split(""),et=0;et<k;++et)et>=v&&K.length>0&&(E[et]=K.shift(),T++);m.setState({activeInput:T},function(){m.focusInput(T),m.handleOtpChange(E)})}}),_defineProperty(_assertThisInitialized(m),"handleOnChange",function(g){var v=g.target.value;m.isInputValueValid(v)&&m.changeCodeAtFocus(v)}),_defineProperty(_assertThisInitialized(m),"handleOnKeyDown",function(g){8===g.keyCode||"Backspace"===g.key?(g.preventDefault(),m.changeCodeAtFocus(""),m.focusPrevInput()):46===g.keyCode||"Delete"===g.key?(g.preventDefault(),m.changeCodeAtFocus("")):37===g.keyCode||"ArrowLeft"===g.key?(g.preventDefault(),m.focusPrevInput()):39===g.keyCode||"ArrowRight"===g.key?(g.preventDefault(),m.focusNextInput()):(32===g.keyCode||" "===g.key||"Spacebar"===g.key||"Space"===g.key)&&g.preventDefault()}),_defineProperty(_assertThisInitialized(m),"handleOnInput",function(g){if(m.isInputValueValid(g.target.value))m.focusNextInput();else if(!m.props.isInputNum){var v=g.nativeEvent;null===v.data&&"deleteContentBackward"===v.inputType&&(g.preventDefault(),m.changeCodeAtFocus(""),m.focusPrevInput())}}),_defineProperty(_assertThisInitialized(m),"renderInputs",function(){for(var g=m.state.activeInput,v=m.props,k=v.numInputs,T=v.inputStyle,K=v.focusStyle,et=v.separator,en=v.isDisabled,er=v.disabledStyle,ei=v.hasErrored,es=v.errorStyle,el=v.shouldAutoFocus,ec=v.isInputNum,eu=v.isInputSecure,ed=v.className,ep=[],em=m.getOtpValue(),ef=m.getPlaceholderValue(),eh=m.props["data-cy"],eg=m.props["data-testid"],_loop=function(v){ep.push(x.default.createElement(E,{placeholder:ef&&ef[v],key:v,index:v,focus:g===v,value:em&&em[v],onChange:m.handleOnChange,onKeyDown:m.handleOnKeyDown,onInput:m.handleOnInput,onPaste:m.handleOnPaste,onFocus:function(g){m.setState({activeInput:v}),g.target.select()},onBlur:function(){return m.setState({activeInput:-1})},separator:et,inputStyle:T,focusStyle:K,isLastChild:v===k-1,isDisabled:en,disabledStyle:er,hasErrored:ei,errorStyle:es,shouldAutoFocus:el,isInputNum:ec,isInputSecure:eu,className:ed,"data-cy":eh&&"".concat(eh,"-").concat(v),"data-testid":eg&&"".concat(eg,"-").concat(v)}))},ev=0;ev<k;ev++)_loop(ev);return ep}),m}return _createClass(OtpInput,[{key:"render",value:function(){var m=this.props.containerStyle;return x.default.createElement("div",{style:Object.assign({display:"flex"}
34,isStyleObject(m)&&m),className:isStyleObject(m)?"":m},this.renderInputs())}}]),OtpInput}(x.Component);_defineProperty(T,"defaultProps",{numInputs:4,onChange:function(m){return console.log(m)},isDisabled:!1,shouldAutoFocus:!1,value:"",isInputSecure:!1}),g.Z=T},88965:function(m,g,v){"use strict";v.d(g,{Z:function(){return e_}});var x,k,E,T,K,et,__assign=function(){return(__assign=Object.assign||function(m){for(var g,v=1,x=arguments.length;v<x;v++)for(var k in g=arguments[v])Object.prototype.hasOwnProperty.call(g,k)&&(m[k]=g[k]);return m}).apply(this,arguments)};function __rest(m,g){var v={};for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&0>g.indexOf(x)&&(v[x]=m[x]);if(null!=m&&"function"==typeof Object.getOwnPropertySymbols)for(var k=0,x=Object.getOwnPropertySymbols(m);k<x.length;k++)0>g.indexOf(x[k])&&Object.prototype.propertyIsEnumerable.call(m,x[k])&&(v[x[k]]=m[x[k]]);return v}"function"==typeof SuppressedError&&SuppressedError;var en=v(2784),er="right-scroll-bar-position",ei="width-before-scroll-bar";function assignRef(m,g){return"function"==typeof m?m(g):m&&(m.current=g),m}var es="undefined"!=typeof window?en.useLayoutEffect:en.useEffect,el=new WeakMap,ec=(void 0===x&&(x={}),(void 0===k&&(k=function(m){return m}),E=[],T=!1,K={read:function(){if(T)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return E.length?E[E.length-1]:null},useMedium:function(m){var g=k(m,T);return E.push(g),function(){E=E.filter(function(m){return m!==g})}},assignSyncMedium:function(m){for(T=!0;E.length;){var g=E;E=[],g.forEach(m)}E={push:function(g){return m(g)},filter:function(){return E}}},assignMedium:function(m){T=!0;var g=[];if(E.length){var v=E;E=[],v.forEach(m),g=E}var executeQueue=function(){var v=g;g=[],v.forEach(m)},cycle=function(){return Promise.resolve().then(executeQueue)};cycle(),E={push:function(m){g.push(m),cycle()},filter:function(m){return g=g.filter(m),E}}}}).options=__assign({async:!0,ssr:!1},x),K),nothing=function(){},eu=en.forwardRef(function(m,g){var v,x,k,E,T=en.useRef(null),K=en.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),et=K[0],er=K[1],ei=m.forwardProps,eu=m.children,ed=m.className,ep=m.removeScrollBar,em=m.enabled,ef=m.shards,eh=m.sideCar,eg=m.noRelative,ev=m.noIsolation,ey=m.inert,eb=m.allowPinchZoom,ex=m.as,e_=void 0===ex?"div":ex,ew=m.gapMode,eS=__rest(m,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),eC=(v=[T,g],x=function(m){return v.forEach(function(g){return assignRef(g,m)})},(k=(0,en.useState)(function(){return{value:null,callback:x,facade:{get current(){return k.value},set current(value){var m=k.value;m!==value&&(k.value=value,k.callback(value,m))}}}})[0]).callback=x,E=k.facade,es(function(){var m=el.get(E);if(m){var g=new Set(m),x=new Set(v),k=E.current;g.forEach(function(m){x.has(m)||assignRef(m,null)}),x.forEach(function(m){g.has(m)||assignRef(m,k)})}el.set(E,v)},[v]),E),ek=__assign(__assign({},eS),et);return en.createElement(en.Fragment,null,em&&en.createElement(eh,{sideCar:ec,removeScrollBar:ep,shards:ef,noRelative:eg,noIsolation:ev,inert:ey,setCallbacks:er,allowPinchZoom:!!eb,lockRef:T,gapMode:ew}),ei?en.cloneElement(en.Children.only(eu),__assign(__assign({},ek),{ref:eC})):en.createElement(e_,__assign({},ek,{className:ed,ref:eC}),eu))});eu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eu.classNames={fullWidth:ei,zeroRight:er};var SideCar=function(m){var g=m.sideCar,v=__rest(m,["sideCar"]);if(!g)throw Error("Sidecar: please provide `sideCar` property to import the right car");var x=g.read();if(!x)throw Error("Sidecar medium not found");return en.createElement(x,__assign({},v))};SideCar.isSideCarExport=!0;var stylesheetSingleton=function(){var m=0,g=null;return{add:function(x){if(0==m&&(g=function(){if(!document)return null;var m=document.createElement("style");m.type="text/css";var g=et||v.nc;return g&&m.setAttribute("nonce",g),m}())){var k,E;(k=g).styleSheet?k.styleSheet.cssText=x:k.appendChild(document.createTextNode(x)),E=g,(document.head||document.getElementsByTagName("head")[0]).appendChild(E)}m++},remove:function(){--m||!g||(g.parentNode&&g.parentNode.removeChild(g),g=null)}}},styleHookSingleton=function(){var m=stylesheetSingleton();return function(g,v){en.useEffect(function(){return m.add(g),function(){m.remove()}},[g&&v])}},styleSingleton=function(){var m=styleHookSingleton();return function(g){return m(g.styles,g.dynamic),null}},ed={left:0,top:0,right:0,gap:0},parse=function(m){return parseInt(m||"",10)||0},getOffset=function(m){var g=window.getComputedStyle(document.body),v=g["padding"===m?"paddingLeft":"marginLeft"],x=g["padding"===m?"paddingTop":"marginTop"],k=g["padding"===m?"paddingRight":"marginRight"];return[parse(v),parse(x),parse(k)]},getGapWidth=function(m){if(void 0===m&&(m="margin"),"undefined"==typeof window)return ed;var g=getOffset(m),v=document.documentElement.clientWidth,x=window.innerWidth;return{left:g[0],top:g[1],right:g[2],gap:Math.max(0,x-v+g[2]-g[0])}},ep=styleSingleton(),em="data-scroll-locked",getStyles=function(m,g,v,x){var k=m.left,E=m.top,T=m.right,K=m.gap;return void 0===v&&(v="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(x,";\n   padding-right: ").concat(K,"px ").concat(x,";\n  }\n  body[").concat(em,"] {\n    overflow: hidden ").concat(x,";\n    overscroll-behavior: contain;\n    ").concat([g&&"position: relative ".concat(x,";"),"margin"===v&&"\n    padding-left: ".concat(k,"px;\n    padding-top: ").concat(E,"px;\n    padding-right: ").concat(T,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(K,"px ").concat(x,";\n    "),"padding"===v&&"padding-right: ".concat(K,"px ").concat(x,";
34")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(er," {\n    right: ").concat(K,"px ").concat(x,";\n  }\n  \n  .").concat(ei," {\n    margin-right: ").concat(K,"px ").concat(x,";\n  }\n  \n  .").concat(er," .").concat(er," {\n    right: 0 ").concat(x,";\n  }\n  \n  .").concat(ei," .").concat(ei," {\n    margin-right: 0 ").concat(x,";\n  }\n  \n  body[").concat(em,"] {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(K,"px;\n  }\n")},getCurrentUseCounter=function(){var m=parseInt(document.body.getAttribute(em)||"0",10);return isFinite(m)?m:0},useLockAttribute=function(){en.useEffect(function(){return document.body.setAttribute(em,(getCurrentUseCounter()+1).toString()),function(){var m=getCurrentUseCounter()-1;m<=0?document.body.removeAttribute(em):document.body.setAttribute(em,m.toString())}},[])},RemoveScrollBar=function(m){var g=m.noRelative,v=m.noImportant,x=m.gapMode,k=void 0===x?"margin":x;useLockAttribute();var E=en.useMemo(function(){return getGapWidth(k)},[k]);return en.createElement(ep,{styles:getStyles(E,!g,k,v?"":"!important")})},ef=!1;if("undefined"!=typeof window)try{var eh=Object.defineProperty({},"passive",{get:function(){return ef=!0,!0}});window.addEventListener("test",eh,eh),window.removeEventListener("test",eh,eh)}catch(m){ef=!1}var eg=!!ef&&{passive:!1},elementCanBeScrolled=function(m,g){if(!(m instanceof Element))return!1;var v=window.getComputedStyle(m);return"hidden"!==v[g]&&!(v.overflowY===v.overflowX&&"TEXTAREA"!==m.tagName&&"visible"===v[g])},locationCouldBeScrolled=function(m,g){var v=g.ownerDocument,x=g;do{if("undefined"!=typeof ShadowRoot&&x instanceof ShadowRoot&&(x=x.host),elementCouldBeScrolled(m,x)){var k=getScrollVariables(m,x);if(k[1]>k[2])return!0}x=x.parentNode}while(x&&x!==v.body);return!1},elementCouldBeScrolled=function(m,g){return"v"===m?elementCanBeScrolled(g,"overflowY"):elementCanBeScrolled(g,"overflowX")},getScrollVariables=function(m,g){return"v"===m?[g.scrollTop,g.scrollHeight,g.clientHeight]:[g.scrollLeft,g.scrollWidth,g.clientWidth]},handleScroll=function(m,g,v,x,k){var E,T=(E=window.getComputedStyle(g).direction,"h"===m&&"rtl"===E?-1:1),K=T*x,et=v.target,en=g.contains(et),er=!1,ei=K>0,es=0,el=0;do{if(!et)break;var ec=getScrollVariables(m,et),eu=ec[0],ed=ec[1]-ec[2]-T*eu;(eu||ed)&&elementCouldBeScrolled(m,et)&&(es+=ed,el+=eu);var ep=et.parentNode;et=ep&&ep.nodeType===Node.DOCUMENT_FRAGMENT_NODE?ep.host:ep}while(!en&&et!==document.body||en&&(g.contains(et)||g===et));return ei&&(k&&1>Math.abs(es)||!k&&K>es)?er=!0:!ei&&(k&&1>Math.abs(el)||!k&&-K>el)&&(er=!0),er},getTouchXY=function(m){return"changedTouches"in m?[m.changedTouches[0].clientX,m.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(m){return[m.deltaX,m.deltaY]},extractRef=function(m){return m&&"current"in m?m.current:m},ev=0,ey=[],eb=(ec.useMedium(function(m){var g=en.useRef([]),v=en.useRef([0,0]),x=en.useRef(),k=en.useState(ev++)[0],E=en.useState(styleSingleton)[0],T=en.useRef(m);en.useEffect(function(){T.current=m},[m]),en.useEffect(function(){if(m.inert){document.body.classList.add("block-interactivity-".concat(k));var g=(function(m,g,v){if(v||2==arguments.length)for(var x,k=0,E=g.length;k<E;k++)!x&&k in g||(x||(x=Array.prototype.slice.call(g,0,k)),x[k]=g[k]);return m.concat(x||Array.prototype.slice.call(g))})([m.lockRef.current],(m.shards||[]).map(extractRef),!0).filter(Boolean);return g.forEach(function(m){return m.classList.add("allow-interactivity-".concat(k))}),function(){document.body.classList.remove("block-interactivity-".concat(k)),g.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(k))})}}},[m.inert,m.lockRef.current,m.shards]);var K=en.useCallback(function(m,g){if("touches"in m&&2===m.touches.length||"wheel"===m.type&&m.ctrlKey)return!T.current.allowPinchZoom;var k,E=getTouchXY(m),K=v.current,et="deltaX"in m?m.deltaX:K[0]-E[0],en="deltaY"in m?m.deltaY:K[1]-E[1],er=m.target,ei=Math.abs(et)>Math.abs(en)?"h":"v";if("touches"in m&&"h"===ei&&"range"===er.type)return!1;var es=window.getSelection(),el=es&&es.anchorNode;if(el&&(el===er||el.contains(er)))return!1;var ec=locationCouldBeScrolled(ei,er);if(!ec)return!0;
34if(ec?k=ei:(k="v"===ei?"h":"v",ec=locationCouldBeScrolled(ei,er)),!ec)return!1;if(!x.current&&"changedTouches"in m&&(et||en)&&(x.current=k),!k)return!0;var eu=x.current||k;return handleScroll(eu,g,m,"h"===eu?et:en,!0)},[]),et=en.useCallback(function(m){if(ey.length&&ey[ey.length-1]===E){var v="deltaY"in m?getDeltaXY(m):getTouchXY(m),x=g.current.filter(function(g){var x;return g.name===m.type&&(g.target===m.target||m.target===g.shadowParent)&&(x=g.delta)[0]===v[0]&&x[1]===v[1]})[0];if(x&&x.should){m.cancelable&&m.preventDefault();return}if(!x){var k=(T.current.shards||[]).map(extractRef).filter(Boolean).filter(function(g){return g.contains(m.target)});(k.length>0?K(m,k[0]):!T.current.noIsolation)&&m.cancelable&&m.preventDefault()}}},[]),er=en.useCallback(function(m,v,x,k){var E={name:m,delta:v,target:x,should:k,shadowParent:function(m){for(var g=null;null!==m;)m instanceof ShadowRoot&&(g=m.host,m=m.host),m=m.parentNode;return g}(x)};g.current.push(E),setTimeout(function(){g.current=g.current.filter(function(m){return m!==E})},1)},[]),ei=en.useCallback(function(m){v.current=getTouchXY(m),x.current=void 0},[]),es=en.useCallback(function(g){er(g.type,getDeltaXY(g),g.target,K(g,m.lockRef.current))},[]),el=en.useCallback(function(g){er(g.type,getTouchXY(g),g.target,K(g,m.lockRef.current))},[]);en.useEffect(function(){return ey.push(E),m.setCallbacks({onScrollCapture:es,onWheelCapture:es,onTouchMoveCapture:el}),document.addEventListener("wheel",et,eg),document.addEventListener("touchmove",et,eg),document.addEventListener("touchstart",ei,eg),function(){ey=ey.filter(function(m){return m!==E}),document.removeEventListener("wheel",et,eg),document.removeEventListener("touchmove",et,eg),document.removeEventListener("touchstart",ei,eg)}},[]);var ec=m.removeScrollBar,eu=m.inert;return en.createElement(en.Fragment,null,eu?en.createElement(E,{styles:"\n  .block-interactivity-".concat(k," {pointer-events: none;}\n  .allow-interactivity-").concat(k," {pointer-events: all;}\n")}):null,ec?en.createElement(RemoveScrollBar,{noRelative:m.noRelative,gapMode:m.gapMode}):null)}),SideCar),ex=en.forwardRef(function(m,g){return en.createElement(eu,__assign({},m,{ref:g,sideCar:eb}))});ex.classNames=eu.classNames;var e_=ex},3101:function(m){function clean(m){return"string"==typeof m?m.replace(/^0+|[^0-9kK]+/g,"").toUpperCase():""}m.exports={validate:function(m){if("string"!=typeof m||/^0+/.test(m)||!/^0*(\d{1,3}(\.?\d{3})*)-?([\dkK])$/.test(m))return!1;let g=parseInt((m=clean(m)).slice(0,-1),10),v=0,x=1;for(;g>0;)x=(x+g%10*(9-v++%6))%11,g=Math.floor(g/10);let k=x>0?""+(x-1):"K";return k===m.slice(-1)},clean,format:function(m,g={dots:!0}){let v;if(m=clean(m),g.dots){v=m.slice(-4,-1)+"-"+m.substr(m.length-1);for(let g=4;g<m.length;g+=3)v=m.slice(-3-g,-g)+"."+v}else v=m.slice(0,-1)+"-"+m.substr(m.length-1);return v},getCheckDigit:function(m){let g=Array.from(clean(m),Number);if(0===g.length||g.includes(NaN))throw Error(`"${m}" as RUT is invalid`);let v=g.reverse().reduce((m,g,v)=>m+g*(v%6+2),0),x=11-v%11;return 10===x?"K":11===x?"0":x.toString()}}},91706:function(m){m.exports=function(){var m=document.getSelection();if(!m.rangeCount)return function(){};for(var g=document.activeElement,v=[],x=0;x<m.rangeCount;x++)v.push(m.getRangeAt(x));switch(g.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":g.blur();break;default:g=null}return m.removeAllRanges(),function(){"Caret"===m.type&&m.removeAllRanges(),m.rangeCount||v.forEach(function(g){m.addRange(g)}),g&&g.focus()}}},75969:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(13421);function readCookie(m,g){void 0===g&&(g={});var v,x=m&&"j"===m[0]&&":"===m[1]?m.substr(2):m;if(void 0===(v=g.doNotParse)&&(v=!x||"{"!==x[0]&&"["!==x[0]&&'"'!==x[0]),!v)try{return JSON.parse(x)}catch(m){}return m}var __assign=function(){return(__assign=Object.assign||function(m){for(var g,v=1,x=arguments.length;v<x;v++)for(var k in g=arguments[v])Object.prototype.hasOwnProperty.call(g,k)&&(m[k]=g[k]);return m}).apply(this,arguments)},k=function(){function Cookies(m,g){var v=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies="string"==typeof m?x.Q(m,g):"object"==typeof m&&null!==m?m:{},new Promise(function(){v.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie}).catch(function(){})}return Cookies.prototype._updateBrowserValues=function(m){this.HAS_DOCUMENT_COOKIE&&(this.cookies=x.Q(document.cookie,m))},Cookies.prototype._emitChange=function(m){for(var g=0;g<this.changeListeners.length;++g)this.changeListeners[g](m)},Cookies.prototype.get=function(m,g,v){return void 0===g&&(g={}),this._updateBrowserValues(v),readCookie(this.cookies[m],g)},Cookies.prototype.getAll=function(m,g){void 0===m&&(m={}),this._updateBrowserValues(g);var v={};for(var x in this.cookies)v[x]=readCookie(this.cookies[x],m);return v},Cookies.prototype.set=function(m,g,v){var k;"object"==typeof g&&(g=JSON.stringify(g)),this.cookies=__assign(__assign({},this.cookies),((k={})[m]=g,k)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=x.q(m,g,v)),this._emitChange({name:m,value:g,options:v})},Cookies.prototype.remove=function(m,g){var v=g=__assign(__assign({},g),{expires:new Date(1970,1,1,0,0,1),maxAge:0}
34);this.cookies=__assign({},this.cookies),delete this.cookies[m],this.HAS_DOCUMENT_COOKIE&&(document.cookie=x.q(m,"",v)),this._emitChange({name:m,value:void 0,options:g})},Cookies.prototype.addChangeListener=function(m){this.changeListeners.push(m)},Cookies.prototype.removeChangeListener=function(m){var g=this.changeListeners.indexOf(m);g>=0&&this.changeListeners.splice(g,1)},Cookies}()},1458:function(m,g,v){"use strict";/**
35 * @license React
36 * use-sync-external-store-shim.production.js
37 *
38 * Copyright (c) Meta Platforms, Inc. and affiliates.
39 *
40 * This source code is licensed under the MIT license found in the
41 * LICENSE file in the root directory of this source tree.
42 */var x=v(2784),k="function"==typeof Object.is?Object.is:function(m,g){return m===g&&(0!==m||1/m==1/g)||m!=m&&g!=g},E=x.useState,T=x.useEffect,K=x.useLayoutEffect,et=x.useDebugValue;function checkIfSnapshotChanged(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!k(m,v)}catch(m){return!0}}var en="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(m,g){return g()}:function(m,g){var v=g(),x=E({inst:{value:v,getSnapshot:g}}),k=x[0].inst,en=x[1];return K(function(){k.value=v,k.getSnapshot=g,checkIfSnapshotChanged(k)&&en({inst:k})},[m,v,g]),T(function(){return checkIfSnapshotChanged(k)&&en({inst:k}),m(function(){checkIfSnapshotChanged(k)&&en({inst:k})})},[m]),et(v),v};g.useSyncExternalStore=void 0!==x.useSyncExternalStore?x.useSyncExternalStore:en},43100:function(m,g,v){"use strict";m.exports=v(1458)},782:function(m,g,v){"use strict";function createJSONStorage(m,g){let v;try{v=m()}catch(m){return}return{getItem:m=>{var x;let parse=m=>null===m?null:JSON.parse(m,null==g?void 0:g.reviver),k=null!=(x=v.getItem(m))?x:null;return k instanceof Promise?k.then(parse):parse(k)},setItem:(m,x)=>v.setItem(m,JSON.stringify(x,null==g?void 0:g.replacer)),removeItem:m=>v.removeItem(m)}}v.d(g,{FL:function(){return createJSONStorage},tJ:function(){return persist}});let toThenable=m=>g=>{try{let v=m(g);if(v instanceof Promise)return v;return{then:m=>toThenable(m)(v),catch(m){return this}}}catch(m){return{then(m){return this},catch:g=>toThenable(g)(m)}}},persist=(m,g)=>(v,x,k)=>{let E,T={storage:createJSONStorage(()=>window.localStorage),partialize:m=>m,version:0,merge:(m,g)=>({...g,...m}),...g},K=!1,et=0,en=new Set,er=new Set,ei=T.storage;if(!ei)return m((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${T.name}', the given storage is currently unavailable.`),v(...m)},x,k);let setItem=()=>{let m=T.partialize({...x()});return ei.setItem(T.name,{state:m,version:T.version})},es=k.setState;k.setState=(m,g)=>(es(m,g),setItem());let el=m((...m)=>(v(...m),setItem()),x,k);k.getInitialState=()=>el;let hydrate=()=>{var m,g;if(!ei)return;let k=++et;K=!1,en.forEach(m=>{var g;return m(null!=(g=x())?g:el)});let es=(null==(g=T.onRehydrateStorage)?void 0:g.call(T,null!=(m=x())?m:el))||void 0;return toThenable(ei.getItem.bind(ei))(T.name).then(m=>{if(m){if("number"!=typeof m.version||m.version===T.version)return[!1,m.state];if(T.migrate){let g=T.migrate(m.state,m.version);return g instanceof Promise?g.then(m=>[!0,m]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(m=>{var g;if(k!==et)return;let[K,en]=m;if(v(E=T.merge(en,null!=(g=x())?g:el),!0),K)return setItem()}).then(()=>{k===et&&(null==es||es(x(),void 0),E=x(),K=!0,er.forEach(m=>m(E)))}).catch(m=>{k===et&&(null==es||es(void 0,m))})};return k.persist={setOptions:m=>{T={...T,...m},m.storage&&(ei=m.storage)},clearStorage:()=>{++et,null==ei||ei.removeItem(T.name)},getOptions:()=>T,rehydrate:()=>hydrate(),hasHydrated:()=>K,onHydrate:m=>(en.add(m),()=>{en.delete(m)}),onFinishHydration:m=>(er.add(m),()=>{er.delete(m)})},T.skipHydration||hydrate(),E||el}},31993:function(m,g,v){"use strict";v.d(g,{U:function(){return create}});var x=v(2784);let createStoreImpl=m=>{let g;let v=new Set,setState=(m,x)=>{let k="function"==typeof m?m(g):m;if(!Object.is(k,g)){let m=g;g=(null!=x?x:"object"!=typeof k||null===k)?k:Object.assign({},g,k),v.forEach(v=>v(g,m))}},getState=()=>g,x={setState,getState,getInitialState:()=>k,subscribe:m=>(v.add(m),()=>v.delete(m))},k=g=m(setState,getState,x);return x},createStore=m=>m?createStoreImpl(m):createStoreImpl,identity=m=>m,createImpl=m=>{let g=createStore(m),useBoundStore=m=>(function(m,g=identity){let v=x.useSyncExternalStore(m.subscribe,x.useCallback(()=>g(m.getState()),[m,g]),x.useCallback(()=>g(m.getInitialState()),[m,g]));return x.useDebugValue(v),v})(g,m);return Object.assign(useBoundStore,g),useBoundStore},create=m=>m?createImpl(m):createImpl},88883:function(m,g,v){"use strict";v.d(g,{F:function(){return t}});var x=v(63955);let s=(m,g,v)=>{if(m&&"reportValidity"in m){let k=(0,x.U2)(v,g);m.setCustomValidity(k&&k.message||""),m.reportValidity()}},resolvers_o=(m,g)=>{for(let v in g.fields){let x=g.fields[v];x&&x.ref&&"reportValidity"in x.ref?s(x.ref,v,m):x.refs&&x.refs.forEac
42h(g=>s(g,v,m))}},resolvers_r=(m,g)=>{g.shouldUseNativeValidation&&resolvers_o(m,g);let v={};for(let k in m){let E=(0,x.U2)(g.fields,k),T=Object.assign(m[k]||{},{ref:E&&E.ref});if(i(g.names||Object.keys(m),k)){let m=Object.assign({},(0,x.U2)(v,k));(0,x.t8)(m,"root",T),(0,x.t8)(v,k,m)}else(0,x.t8)(v,k,T)}return v},i=(m,g)=>m.some(m=>m.startsWith(g+"."));var n=function(m,g){for(var v={};m.length;){var k=m[0],E=k.code,T=k.message,K=k.path.join(".");if(!v[K]){if("unionErrors"in k){var et=k.unionErrors[0].errors[0];v[K]={message:et.message,type:et.code}}else v[K]={message:T,type:E}}if("unionErrors"in k&&k.unionErrors.forEach(function(g){return g.errors.forEach(function(g){return m.push(g)})}),g){var en=v[K].types,er=en&&en[k.code];v[K]=(0,x.KN)(K,g,v,E,er?[].concat(er,k.message):k.message)}m.shift()}return v},t=function(m,g,v){return void 0===v&&(v={}),function(x,k,E){try{return Promise.resolve(function(k,T){try{var K=Promise.resolve(m["sync"===v.mode?"parse":"parseAsync"](x,g)).then(function(m){return E.shouldUseNativeValidation&&resolvers_o({},E),{errors:{},values:v.raw?x:m}})}catch(m){return T(m)}return K&&K.then?K.then(void 0,T):K}(0,function(m){if(Array.isArray(null==m?void 0:m.errors))return{values:{},errors:resolvers_r(n(m.errors,!E.shouldUseNativeValidation&&"all"===E.criteriaMode),E)};throw m}))}catch(m){return Promise.reject(m)}}}},80106:function(m,g,v){"use strict";function clamp(m,[g,v]){return Math.min(v,Math.max(g,m))}v.d(g,{u:function(){return clamp}}),(0,Object.defineProperty)(clamp,"name",{value:"clamp",configurable:!0})},17998:function(m,g,v){"use strict";v.d(g,{Mj:function(){return composeEventHandlers}});var x=Object.defineProperty,__name=(m,g)=>x(m,"name",{value:g,configurable:!0}),k=!!("undefined"!=typeof window&&window.document&&window.document.createElement);function composeEventHandlers(m,g,{checkForDefaultPrevented:v=!0}={}){return __name(function(x){if(m?.(x),!1===v||!x||!x.defaultPrevented)return g?.(x)},"handleEvent")}function getOwnerDocument(m){if(!k)throw Error("Cannot access document outside of the DOM");return m?.ownerDocument??document}function isFrame(m){return"IFRAME"===m.tagName}__name(composeEventHandlers,"composeEventHandlers"),__name(function(m){if(!k)throw Error("Cannot access window outside of the DOM");return m?.ownerDocument?.defaultView??window},"getOwnerWindow"),__name(getOwnerDocument,"getOwnerDocument"),__name(function getActiveElement(m,g=!1){let{activeElement:v}=getOwnerDocument(m);if(!v?.nodeName)return null;if(isFrame(v)&&v.contentDocument)return getActiveElement(v.contentDocument.body,g);if(g){let m=v.getAttribute("aria-activedescendant");if(m){let g=getOwnerDocument(v).getElementById(m);if(g)return g}}return v},"getActiveElement"),__name(isFrame,"isFrame")},39933:function(m,g,v){"use strict";v.d(g,{v:function(){return x}});var x=!1},62172:function(m,g,v){"use strict";v.d(g,{B:function(){return createCollection}});var x=v(2784),k=v(92211),E=v(62656),T=v(49815),K=v(52322),et=Object.defineProperty,__name=(m,g)=>et(m,"name",{value:g,configurable:!0});function createCollection(m){let g=m+"CollectionProvider",[v,et]=(0,k.b)(g),[en,er]=v(g,{collectionRef:{current:null},itemMap:new Map}),ei=__name(m=>{let{scope:g,children:v}=m,k=x.useRef(null),E=x.useRef(new Map).current;return(0,K.jsx)(en,{scope:g,itemMap:E,collectionRef:k,children:v})},"CollectionProvider");ei.displayName=g;let es=m+"CollectionSlot",el=(0,T.Z8)(es),ec=x.forwardRef((m,g)=>{let{scope:v,children:x}=m,k=er(es,v),T=(0,E.e)(g,k.collectionRef);return(0,K.jsx)(el,{ref:T,children:x})});ec.displayName=es;let eu=m+"CollectionItemSlot",ed="data-radix-collection-item",ep=(0,T.Z8)(eu),em=x.forwardRef((m,g)=>{let{scope:v,children:k,...T}=m,et=x.useRef(null),en=(0,E.e)(g,et),ei=er(eu,v);return x.useEffect(()=>(ei.itemMap.set(et,{ref:et,...T}),()=>void ei.itemMap.delete(et))),(0,K.jsx)(ep,{[ed]:"",ref:en,children:k})});function useCollection(g){let v=er(m+"CollectionConsumer",g),k=x.useCallback(()=>{let m=v.collectionRef.current;if(!m)return[];let g=Array.from(m.querySelectorAll(`[${ed}]`)),x=Array.from(v.itemMap.values()),k=x.sort((m,v)=>g.indexOf(m.ref.current)-g.indexOf(v.ref.current));return k},[v.collectionRef,v.itemMap]);return k}return em.displayName=eu,__name(useCollection,"useCollection"),[{Provider:ei,Slot:ec,ItemSlot:em},useCollection,et]}__name(createCollection,"createCollection");var en=new WeakMap,er=class _OrderedDict extends Map{static{__name(this,"OrderedDict")}#e;constructor(m){super(m),this.#e=[...super.keys()],en.set(this,!0)}set(m,g){return en.get(this)&&(this.has(m)?this.#e[this.#e.indexOf(m)]=m:this.#e.push(m)),super.set(m,g),this}insert(m,g,v){let x;let k=this.has(g),E=this.#e.length,T=toSafeInteger(m),K=T>=0?T:E+T,et=K<0||K>=E?-1:K;if(et===this.size||k&&et===this.size-1||-1===et)return this.set(g,v),this;let en=this.size+(k?0:1);T<0&&K++;let er=[...this.#e],ei=!1;for(let m=K;m<en;m++)if(K===m){let E=er[m];er[m]===g&&(E=er[m+1]),k&&this.delete(g),x=this.get(E),this.set(g,v)}else{ei||er[m-1]!==g||(ei=!0);let v=er[ei?m:m-1],k=x;x=this.get(v),this.delete(v),this.set(v,k)}return this}with(m,g,v){let x=new _OrderedDict(this);return x.insert(m,g,v),x}before(m){let g=this.#e.indexOf(m)-1;if(!(g<0))return this.entryAt(g)}setBefore(m,g,v){let x=this.#e.indexOf(m);return -1===x?this:this.insert(x,g,v)}
42after(m){let g=this.#e.indexOf(m);if(-1!==(g=-1===g||g===this.size-1?-1:g+1))return this.entryAt(g)}setAfter(m,g,v){let x=this.#e.indexOf(m);return -1===x?this:this.insert(x+1,g,v)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(m){let g=super.delete(m);return g&&this.#e.splice(this.#e.indexOf(m),1),g}deleteAt(m){let g=this.keyAt(m);return void 0!==g&&this.delete(g)}at(m){let g=at(this.#e,m);if(void 0!==g)return this.get(g)}entryAt(m){let g=at(this.#e,m);if(void 0!==g)return[g,this.get(g)]}indexOf(m){return this.#e.indexOf(m)}keyAt(m){return at(this.#e,m)}from(m,g){let v=this.indexOf(m);if(-1===v)return;let x=v+g;return x<0&&(x=0),x>=this.size&&(x=this.size-1),this.at(x)}keyFrom(m,g){let v=this.indexOf(m);if(-1===v)return;let x=v+g;return x<0&&(x=0),x>=this.size&&(x=this.size-1),this.keyAt(x)}find(m,g){let v=0;for(let x of this){if(Reflect.apply(m,g,[x,v,this]))return x;v++}}findIndex(m,g){let v=0;for(let x of this){if(Reflect.apply(m,g,[x,v,this]))return v;v++}return -1}filter(m,g){let v=[],x=0;for(let k of this)Reflect.apply(m,g,[k,x,this])&&v.push(k),x++;return new _OrderedDict(v)}map(m,g){let v=[],x=0;for(let k of this)v.push([k[0],Reflect.apply(m,g,[k,x,this])]),x++;return new _OrderedDict(v)}reduce(...m){let[g,v]=m,x=0,k=v??this.at(0);for(let v of this)k=0===x&&1===m.length?v:Reflect.apply(g,this,[k,v,x,this]),x++;return k}reduceRight(...m){let[g,v]=m,x=v??this.at(-1);for(let v=this.size-1;v>=0;v--){let k=this.at(v);x=v===this.size-1&&1===m.length?k:Reflect.apply(g,this,[x,k,v,this])}return x}toSorted(m){let g=[...this.entries()].sort(m);return new _OrderedDict(g)}toReversed(){let m=new _OrderedDict;
42for(let g=this.size-1;g>=0;g--){let v=this.keyAt(g),x=this.get(v);m.set(v,x)}return m}toSpliced(...m){let g=[...this.entries()];return g.splice(...m),new _OrderedDict(g)}slice(m,g){let v=new _OrderedDict,x=this.size-1;if(void 0===m)return v;m<0&&(m+=this.size),void 0!==g&&g>0&&(x=g-1);for(let g=m;g<=x;g++){let m=this.keyAt(g),x=this.get(m);v.set(m,x)}return v}every(m,g){let v=0;for(let x of this){if(!Reflect.apply(m,g,[x,v,this]))return!1;v++}return!0}some(m,g){let v=0;for(let x of this){if(Reflect.apply(m,g,[x,v,this]))return!0;v++}return!1}};function at(m,g){if("at"in Array.prototype)return Array.prototype.at.call(m,g);let v=toSafeIndex(m,g);return -1===v?void 0:m[v]}function toSafeIndex(m,g){let v=m.length,x=toSafeInteger(g),k=x>=0?x:v+x;return k<0||k>=v?-1:k}function toSafeInteger(m){return m!=m||0===m?0:Math.trunc(m)}function shallowEqual(m,g){if(m===g)return!0;if("object"!=typeof m||"object"!=typeof g||null==m||null==g)return!1;let v=Object.keys(m),x=Object.keys(g);if(v.length!==x.length)return!1;for(let x of v)if(!Object.prototype.hasOwnProperty.call(g,x)||m[x]!==g[x])return!1;return!0}function isElementPreceding(m,g){return!!(g.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_PRECEDING)}function sortByDocumentPosition(m,g){return m[1].element&&g[1].element?isElementPreceding(m[1].element,g[1].element)?-1:1:0}function getChildListObserver(m){let g=new MutationObserver(g=>{for(let v of g)if("childList"===v.type){m();return}});return g}__name(at,"at"),__name(toSafeIndex,"toSafeIndex"),__name(toSafeInteger,"toSafeInteger"),__name(function(m){let g=m+"CollectionProvider",[v,et]=(0,k.b)(g),[en,ei]=v(g,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new er,setItemMap:__name(()=>void 0,"setItemMap")}),es=__name(({state:m,...g})=>m?(0,K.jsx)(ec,{...g,state:m}):(0,K.jsx)(el,{...g}),"CollectionProvider");es.displayName=g;let el=__name(m=>{let g=useInitCollection();return(0,K.jsx)(ec,{...m,state:g})},"CollectionInit");el.displayName=g+"Init";let ec=__name(m=>{let{scope:g,children:v,state:k}=m,T=x.useRef(null),[et,er]=x.useState(null),ei=(0,E.e)(T,er),[es,el]=k;return x.useEffect(()=>{if(!et)return;let m=getChildListObserver(()=>{});return m.observe(et,{childList:!0,subtree:!0}),()=>{m.disconnect()}},[et]),(0,K.jsx)(en,{scope:g,itemMap:es,setItemMap:el,collectionRef:ei,collectionRefObject:T,collectionElement:et,children:v})},"CollectionProviderImpl");ec.displayName=g+"Impl";let eu=m+"CollectionSlot",ed=(0,T.Z8)(eu),ep=x.forwardRef((m,g)=>{let{scope:v,children:x}=m,k=ei(eu,v),T=(0,E.e)(g,k.collectionRef);return(0,K.jsx)(ed,{ref:T,children:x})});ep.displayName=eu;let em=m+"CollectionItemSlot",ef=(0,T.Z8)(em),eh=x.forwardRef((m,g)=>{let{scope:v,children:k,...T}=m,et=x.useRef(null),[en,es]=x.useState(null),el=(0,E.e)(g,et,es),ec=ei(em,v),{setItemMap:eu}=ec,ed=x.useRef(T);shallowEqual(ed.current,T)||(ed.current=T);let ep=ed.current;return x.useEffect(()=>(eu(m=>en?m.has(en)?m.set(en,{...ep,element:en}).toSorted(sortByDocumentPosition):(m.set(en,{...ep,element:en}),m.toSorted(sortByDocumentPosition)):m),()=>{eu(m=>en&&m.has(en)?(m.delete(en),new er(m)):m)}),[en,ep,eu]),(0,K.jsx)(ef,{"data-radix-collection-item":"",ref:el,children:k})});function useInitCollection(){return x.useState(new er)}function useCollection(g){let{itemMap:v}=ei(m+"CollectionConsumer",g);return v}return eh.displayName=em,__name(useInitCollection,"useInitCollection"),__name(useCollection,"useCollection"),[{Provider:es,Slot:ep,ItemSlot:eh},{createCollectionScope:et,useCollection,useInitCollection}]},"createCollection"),__name(shallowEqual,"shallowEqual"),__name(isElementPreceding,"isElementPreceding"),__name(sortByDocumentPosition,"sortByDocumentPosition"),__name(getChildListObserver,"getChildListObserver")},62656:function(m,g,v){"use strict";v.d(g,{e:function(){return useComposedRefs}});var x=v(2784),k=Object.defineProperty,__name=(m,g)=>k(m,"name",{value:g,configurable:!0});function setRef(m,g){if("function"==typeof m)return m(g);null!=m&&(m.current=g)}function composeRefs(...m){return g=>{let v=!1,x=m.map(m=>{let x=setRef(m,g);return v||"function"!=typeof x||(v=!0),x});if(v)return()=>{for(let g=0;g<x.length;g++){let v=x[g];"function"==typeof v?v():setRef(m[g],null)}}}}function useComposedRefs(...m){return x.useCallback(composeRefs(...m),m)}__name(setRef,"setRef"),__name(composeRefs,"composeRefs"),__name(useComposedRefs,"useComposedRefs")},92211:function(m,g,v){"use strict";v.d(g,{b:function(){return createContextScope}});var x=v(2784),k=v(52322),E=Object.defineProperty,__name=(m,g)=>E(m,"name",{value:g,configurable:!0});function createContextScope(m,g=[]){let v=[];
42function createContext3(g,E){let T=x.createContext(E);T.displayName=g+"Context";let K=v.length;v=[...v,E];let et=__name(g=>{let{scope:v,children:E,...et}=g,en=v?.[m]?.[K]||T,er=x.useMemo(()=>et,Object.values(et));return(0,k.jsx)(en.Provider,{value:er,children:E})},"Provider");function useContext2(v,k,et={}){let{optional:en=!1}=et,er=k?.[m]?.[K]||T,ei=x.useContext(er);if(ei)return ei;if(void 0!==E)return E;if(!en)throw Error(`\`${v}\` must be used within \`${g}\``)}return et.displayName=g+"Provider",__name(useContext2,"useContext"),[et,useContext2]}__name(createContext3,"createContext");let E=__name(()=>{let g=v.map(m=>x.createContext(m));return __name(function(v){let k=v?.[m]||g;return x.useMemo(()=>({[`__scope${m}`]:{...v,[m]:k}}),[v,k])},"useScope")},"createScope");return E.scopeName=m,[createContext3,composeContextScopes(E,...g)]}function composeContextScopes(...m){let g=m[0];if(1===m.length)return g;let v=__name(()=>{let v=m.map(m=>({useScope:m(),scopeName:m.scopeName}));return __name(function(m){let k=v.reduce((g,{useScope:v,scopeName:x})=>{let k=v(m),E=k[`__scope${x}`];return{...g,...E}},{});return x.useMemo(()=>({[`__scope${g.scopeName}`]:k}),[k])},"useComposedScopes")},"createScope");return v.scopeName=g.scopeName,v}__name(function(m,g){let v=x.createContext(g);v.displayName=m+"Context";let E=__name(m=>{let{children:g,...E}=m,T=x.useMemo(()=>E,Object.values(E));return(0,k.jsx)(v.Provider,{value:T,children:g})},"Provider");function useContext2(k,E={}){let{optional:T=!1}=E,K=x.useContext(v);if(K)return K;if(void 0!==g)return g;if(!T)throw Error(`\`${k}\` must be used within \`${m}\``)}return E.displayName=m+"Provider",__name(useContext2,"useContext"),[E,useContext2]},"createContext"),__name(createContextScope,"createContextScope"),__name(composeContextScopes,"composeContextScopes")},11915:function(m,g,v){"use strict";let x;v.d(g,{x8:function(){return e3},VY:function(){return e0},dk:function(){return e2},aV:function(){return eJ},h_:function(){return eX},fC:function(){return eQ},Dx:function(){return e1},xz:function(){return eY}});var k,E=v(2784),T=v.t(E,2);function composeEventHandlers(m,g,{checkForDefaultPrevented:v=!0}={}){return function(x){if(m?.(x),!1===v||!x.defaultPrevented)return g?.(x)}}function setRef(m,g){if("function"==typeof m)return m(g);null!=m&&(m.current=g)}function composeRefs(...m){return g=>{let v=!1,x=m.map(m=>{let x=setRef(m,g);return v||"function"!=typeof x||(v=!0),x});if(v)return()=>{for(let g=0;g<x.length;g++){let v=x[g];"function"==typeof v?v():setRef(m[g],null)}}}}function useComposedRefs(...m){return E.useCallback(composeRefs(...m),m)}"undefined"!=typeof window&&window.document&&window.document.createElement;var K=v(52322),et=globalThis?.document?E.useLayoutEffect:()=>{},en=T[" useId ".trim().toString()]||(()=>void 0),er=0;function useId(m){let[g,v]=E.useState(en());return et(()=>{m||v(m=>m??String(er++))},[m]),m||(g?`radix-${g}`:"")}var ei=T[" useInsertionEffect ".trim().toString()]||et;Symbol("RADIX:SYNC_STATE");var es=v(28316);function createSlot(m){let g=function(m){let g=E.forwardRef((m,g)=>{let{children:v,...x}=m;if(E.isValidElement(v)){let m,k;let T=(m=Object.getOwnPropertyDescriptor(v.props,"ref")?.get)&&"isReactWarning"in m&&m.isReactWarning?v.ref:(m=Object.getOwnPropertyDescriptor(v,"ref")?.get)&&"isReactWarning"in m&&m.isReactWarning?v.props.ref:v.props.ref||v.ref,K=function(m,g){let v={...g};for(let x in g){let k=m[x],E=g[x],T=/^on[A-Z]/.test(x);T?k&&E?v[x]=(...m)=>{let g=E(...m);return k(...m),g}:k&&(v[x]=k):"style"===x?v[x]={...k,...E}:"className"===x&&(v[x]=[k,E].filter(Boolean).join(" "))}return{...m,...v}}(x,v.props);return v.type!==E.Fragment&&(K.ref=g?composeRefs(g,T):T),E.cloneElement(v,K)}return E.Children.count(v)>1?E.Children.only(null):null});return g.displayName=`${m}.SlotClone`,g}(m),v=E.forwardRef((m,v)=>{let{children:x,...k}=m,T=E.Children.toArray(x),et=T.find(isSlottable);if(et){let m=et.props.children,x=T.map(g=>g!==et?g:E.Children.count(m)>1?E.Children.only(null):E.isValidElement(m)?m.props.children:null);return(0,K.jsx)(g,{...k,ref:v,children:E.isValidElement(m)?E.cloneElement(m,void 0,x):null})}return(0,K.jsx)(g,{...k,ref:v,children:x})});return v.displayName=`${m}.Slot`,v}var el=Symbol("radix.slottable");function isSlottable(m){return E.isValidElement(m)&&"function"==typeof m.type&&"__radixId"in m.type&&m.type.__radixId===el}var ec=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((m,g)=>{let v=createSlot(`Primitive.${g}`),x=E.forwardRef((m,x)=>{let{asChild:k,...E}=m,T=k?v:g;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,K.jsx)(T,{...E,ref:x})});return x.displayName=`Primitive.${g}`,{...m,[g]:x}},{});function useCallbackRef(m){let g=E.useRef(m);return E.useEffect(()=>{g.current=m}),E.useMemo(()=>(...m)=>g.current?.(...m),[])}var eu="dismissableLayer.update",ed=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ep=E.forwardRef((m,g)=>{let{disableOutsidePointerEvents:v=!1,onEscapeKeyDown:x,onPointerDownOutside:T,onFocusOutside:et,onInteractOutside:en,onDismiss:er,...ei}=m,es=E.useContext(ed),[el,ep]=E.useState(null),em=el?.ownerDocument??globalThis?.document,[,ef]=E.useState({}),eh=useComposedRefs(g,m=>ep(m)),eg=Array.from(es.layers),[ev]=[...es.layersWithOutsidePointerEventsDisabled].slice(-1),ey=eg.indexOf(ev),eb=el?eg.indexOf(el):-1,ex=es.layersWithOutsidePointerEventsDisabled.size>0,e_=eb>=ey,ew=function(m,g=globalThis?.document){let v=useCallbackRef(m),x=E.useRef(!1),k=E.useRef(()=>{});return E.useEffect(()=>{let handlePointerDown=m=>{if(m.target&&!x.current){let handleAndDispatchPointerDownOutsideEvent2=function(){handleAndDispatchCustomEvent("dismissableLayer.pointerDownOutside",v,x,{discrete:!0})},x={originalEvent:m};"touch"===m.pointerType?(g.removeEventListener("click",k.current),k.current=handleAndDispatchPointerDownOutsideEvent2,g.addEventListener("click",k.current,{once:!0})):handleAndDispatchPointerDownOutsideEvent2()}else g.removeEventListener("click",k.current);x.current=!1},m=window.setTimeout(()=>{g.addEventListener("pointerdown",handlePointerDown)},0);return()=>{window.clearTimeout(m),g.removeEventListener("pointerdown",handlePointerDown),g.removeEventListener("click",k.current)}},[g,v]),{onPointerDownCapture:()=>x.current=!0}}(m=>{let g=m.target,v=[...es.branches].some(m=>m.contains(g));!e_||v||(T?.(m),en?.(m),m.defaultPrevented||er?.())},em),eS=function(m,g=globalThis?.document){let v=useCallbackRef(m),x=E.useRef(!1);return E.useEffect(()=>{let handleFocus=m=>{m.target&&!x.current&&handleAndDispatchCustomEvent("dismissableLayer.focusOutside",v,{originalEvent:m},{discrete:!1})};return g.addEventListener("focusin",handleFocus),()=>g.removeEventListener("focusin",handleFocus)},[g,v]),{onFocusCapture:()=>x.current=!0,onBlurCapture:()=>x.current=!1}}(m=>{let g=m.target,v=[...es.branches].some(m=>m.contains(g));v||(et?.(m),en?.(m),m.defaultPrevented||er?.())},em);return function(m,g=globalThis?.document){let v=function(m){let g=E.useRef(m);return E.useEffect(()=>{g.current=m}),E.useMemo(()=>(...m)=>g.current?.(...m),[])}(m);E.useEffect(()=>{let handleKeyDown=m=>{"Escape"===m.key&&v(m)};return g.addEventListener("keydown",handleKeyDown,{capture:!0}),()=>g.removeEventListener("keydown",handleKeyDown,{capture:!0})},[v,g])}(m=>{let g=eb===es.layers.size-1;g&&(x?.(m),!m.defaultPrevented&&er&&(m.preventDefault(),er()))},em),E.useEffect(()=>
42{if(el)return v&&(0===es.layersWithOutsidePointerEventsDisabled.size&&(k=em.body.style.pointerEvents,em.body.style.pointerEvents="none"),es.layersWithOutsidePointerEventsDisabled.add(el)),es.layers.add(el),dispatchUpdate(),()=>{v&&1===es.layersWithOutsidePointerEventsDisabled.size&&(em.body.style.pointerEvents=k)}},[el,em,v,es]),E.useEffect(()=>()=>{el&&(es.layers.delete(el),es.layersWithOutsidePointerEventsDisabled.delete(el),dispatchUpdate())},[el,es]),E.useEffect(()=>{let handleUpdate=()=>ef({});return document.addEventListener(eu,handleUpdate),()=>document.removeEventListener(eu,handleUpdate)},[]),(0,K.jsx)(ec.div,{...ei,ref:eh,style:{pointerEvents:ex?e_?"auto":"none":void 0,...m.style},onFocusCapture:composeEventHandlers(m.onFocusCapture,eS.onFocusCapture),onBlurCapture:composeEventHandlers(m.onBlurCapture,eS.onBlurCapture),onPointerDownCapture:composeEventHandlers(m.onPointerDownCapture,ew.onPointerDownCapture)})});function dispatchUpdate(){let m=new CustomEvent(eu);document.dispatchEvent(m)}function handleAndDispatchCustomEvent(m,g,v,{discrete:x}){let k=v.originalEvent.target,E=new CustomEvent(m,{bubbles:!1,cancelable:!0,detail:v});(g&&k.addEventListener(m,g,{once:!0}),x)?k&&es.flushSync(()=>k.dispatchEvent(E)):k.dispatchEvent(E)}ep.displayName="DismissableLayer",E.forwardRef((m,g)=>{let v=E.useContext(ed),x=E.useRef(null),k=useComposedRefs(g,x);return E.useEffect(()=>{let m=x.current;if(m)return v.branches.add(m),()=>{v.branches.delete(m)}},[v.branches]),(0,K.jsx)(ec.div,{...m,ref:k})}).displayName="DismissableLayerBranch";var em="focusScope.autoFocusOnMount",ef="focusScope.autoFocusOnUnmount",eh={bubbles:!1,cancelable:!0},eg=E.forwardRef((m,g)=>{let{loop:v=!1,trapped:x=!1,onMountAutoFocus:k,onUnmountAutoFocus:T,...et}=m,[en,er]=E.useState(null),ei=useCallbackRef(k),es=useCallbackRef(T),el=E.useRef(null),eu=useComposedRefs(g,m=>er(m)),ed=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(x){let handleFocusIn2=function(m){if(ed.paused||!en)return;let g=m.target;en.contains(g)?el.current=g:dist_focus(el.current,{select:!0})},handleFocusOut2=function(m){if(ed.paused||!en)return;let g=m.relatedTarget;null===g||en.contains(g)||dist_focus(el.current,{select:!0})};document.addEventListener("focusin",handleFocusIn2),document.addEventListener("focusout",handleFocusOut2);let m=new MutationObserver(function(m){let g=document.activeElement;if(g===document.body)for(let g of m)g.removedNodes.length>0&&dist_focus(en)});return en&&m.observe(en,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",handleFocusIn2),document.removeEventListener("focusout",handleFocusOut2),m.disconnect()}}},[x,en,ed.paused]),E.useEffect(()=>{if(en){ev.add(ed);let m=document.activeElement,g=en.contains(m);if(!g){let g=new CustomEvent(em,eh);en.addEventListener(em,ei),en.dispatchEvent(g),g.defaultPrevented||(function(m,{select:g=!1}={}){let v=document.activeElement;for(let x of m)if(dist_focus(x,{select:g}),document.activeElement!==v)return}(getTabbableCandidates(en).filter(m=>"A"!==m.tagName),{select:!0}),document.activeElement===m&&dist_focus(en))}return()=>{en.removeEventListener(em,ei),setTimeout(()=>{let g=new CustomEvent(ef,eh);en.addEventListener(ef,es),en.dispatchEvent(g),g.defaultPrevented||dist_focus(m??document.body,{select:!0}),en.removeEventListener(ef,es),ev.remove(ed)},0)}}},[en,ei,es,ed]);let ep=E.useCallback(m=>{if(!v&&!x||ed.paused)return;let g="Tab"===m.key&&!m.altKey&&!m.ctrlKey&&!m.metaKey,k=document.activeElement;if(g&&k){let g=m.currentTarget,[x,E]=function(m){let g=getTabbableCandidates(m),v=findVisible(g,m),x=findVisible(g.reverse(),m);return[v,x]}(g),T=x&&E;T?m.shiftKey||k!==E?m.shiftKey&&k===x&&(m.preventDefault(),v&&dist_focus(E,{select:!0})):(m.preventDefault(),v&&dist_focus(x,{select:!0})):k===g&&m.preventDefault()}},[v,x,ed.paused]);return(0,K.jsx)(ec.div,{tabIndex:-1,...et,ref:eu,onKeyDown:ep})});function getTabbableCandidates(m){let g=[],v=document.createTreeWalker(m,NodeFilter.SHOW_ELEMENT,{acceptNode:m=>{let g="INPUT"===m.tagName&&"hidden"===m.type;return m.disabled||m.hidden||g?NodeFilter.FILTER_SKIP:m.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;v.nextNode();)g.push(v.currentNode);return g}function findVisible(m,g){for(let v of m)if(!function(m,{upTo:g}){if("hidden"===getComputedStyle(m).visibility)return!0;for(;m&&(void 0===g||m!==g);){if("none"===getComputedStyle(m).display)return!0;m=m.parentElement}return!1}(v,{upTo:g}))return v}function dist_focus(m,{select:g=!1}={}){if(m&&m.focus){var v;let x=document.activeElement;m.focus({preventScroll:!0}),m!==x&&(v=m)instanceof HTMLInputElement&&"select"in v&&g&&m.select()}}eg.displayName="FocusScope";var ev=(x=[],{add(m){let g=x[0];m!==g&&g?.pause(),(x=arrayRemove(x,m)).unshift(m)},remove(m){x=arrayRemove(x,m),x[0]?.resume()}});function arrayRemove(m,g){let v=[...m],x=v.indexOf(g);return -1!==x&&v.splice(x,1),v}var ey=E.forwardRef((m,g)=>{let{container:v,...x}=m,[k,T]=E.useState(!1);et(()=>T(!0),[]);let en=v||k&&globalThis?.document?.body;return en?es.createPortal((0,K.jsx)(ec.div,{...x,ref:g}),en):null});ey.displayName="Portal";var Presence=m=>{let g,v;let{present:x,children:k}=m,T=function(m){var g;let[v,x]=E.useState(),k=E.useRef(null),T=E.useRef(m),K=E.useRef("none"),en=m?"mounted":"unmounted",[er,ei]=(g={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},E.useReducer((m,v)=>{let x=g[m][v];return x??m},en));return E.useEffect(()=>
42{let m=getAnimationName(k.current);K.current="mounted"===er?m:"none"},[er]),et(()=>{let g=k.current,v=T.current,x=v!==m;if(x){let x=K.current,k=getAnimationName(g);m?ei("MOUNT"):"none"===k||g?.display==="none"?ei("UNMOUNT"):v&&x!==k?ei("ANIMATION_OUT"):ei("UNMOUNT"),T.current=m}},[m,ei]),et(()=>{if(v){let m;let g=v.ownerDocument.defaultView??window,handleAnimationEnd=x=>{let E=getAnimationName(k.current),K=E.includes(CSS.escape(x.animationName));if(x.target===v&&K&&(ei("ANIMATION_END"),!T.current)){let x=v.style.animationFillMode;v.style.animationFillMode="forwards",m=g.setTimeout(()=>{"forwards"===v.style.animationFillMode&&(v.style.animationFillMode=x)})}},handleAnimationStart=m=>{m.target===v&&(K.current=getAnimationName(k.current))};return v.addEventListener("animationstart",handleAnimationStart),v.addEventListener("animationcancel",handleAnimationEnd),v.addEventListener("animationend",handleAnimationEnd),()=>{g.clearTimeout(m),v.removeEventListener("animationstart",handleAnimationStart),v.removeEventListener("animationcancel",handleAnimationEnd),v.removeEventListener("animationend",handleAnimationEnd)}}ei("ANIMATION_END")},[v,ei]),{isPresent:["mounted","unmountSuspended"].includes(er),ref:E.useCallback(m=>{k.current=m?getComputedStyle(m):null,x(m)},[])}}(x),K="function"==typeof k?k({present:T.isPresent}):E.Children.only(k),en=useComposedRefs(T.ref,(g=Object.getOwnPropertyDescriptor(K.props,"ref")?.get)&&"isReactWarning"in g&&g.isReactWarning?K.ref:(g=Object.getOwnPropertyDescriptor(K,"ref")?.get)&&"isReactWarning"in g&&g.isReactWarning?K.props.ref:K.props.ref||K.ref),er="function"==typeof k;return er||T.isPresent?E.cloneElement(K,{ref:en}):null};function getAnimationName(m){return m?.animationName||"none"}Presence.displayName="Presence";var eb=0;function createFocusGuard(){let m=document.createElement("span");return m.setAttribute("data-radix-focus-guard",""),m.tabIndex=0,m.style.outline="none",m.style.opacity="0",m.style.position="fixed",m.style.pointerEvents="none",m}var ex=v(88965),e_=v(49732),ew="Dialog",[eS,eC]=function(m,g=[]){let v=[],createScope=()=>{let g=v.map(m=>E.createContext(m));return function(v){let x=v?.[m]||g;return E.useMemo(()=>({[`__scope${m}`]:{...v,[m]:x}}),[v,x])}};return createScope.scopeName=m,[function(g,x){let k=E.createContext(x),T=v.length;v=[...v,x];let Provider=g=>{let{scope:v,children:x,...et}=g,en=v?.[m]?.[T]||k,er=E.useMemo(()=>et,Object.values(et));return(0,K.jsx)(en.Provider,{value:er,children:x})};return Provider.displayName=g+"Provider",[Provider,function(v,K){let et=K?.[m]?.[T]||k,en=E.useContext(et);if(en)return en;if(void 0!==x)return x;throw Error(`\`${v}\` must be used within \`${g}\``)}]},function(...m){let g=m[0];if(1===m.length)return g;let createScope=()=>{let v=m.map(m=>({useScope:m(),scopeName:m.scopeName}));return function(m){let x=v.reduce((g,{useScope:v,scopeName:x})=>{let k=v(m),E=k[`__scope${x}`];return{...g,...E}},{});return E.useMemo(()=>({[`__scope${g.scopeName}`]:x}),[x])}};return createScope.scopeName=g.scopeName,createScope}(createScope,...g)]}(ew),[ek,eE]=eS(ew),Dialog=m=>{let{__scopeDialog:g,children:v,open:x,defaultOpen:k,onOpenChange:T,modal:et=!0}=m,en=E.useRef(null),er=E.useRef(null),[es,el]=function({prop:m,defaultProp:g,onChange:v=()=>{},caller:x}){let[k,T,K]=function({defaultProp:m,onChange:g}){let[v,x]=E.useState(m),k=E.useRef(v),T=E.useRef(g);return ei(()=>{T.current=g},[g]),E.useEffect(()=>{k.current!==v&&(T.current?.(v),k.current=v)},[v,k]),[v,x,T]}({defaultProp:g,onChange:v}),et=void 0!==m,en=et?m:k;{let g=E.useRef(void 0!==m);E.useEffect(()=>{let m=g.current;if(m!==et){let g=et?"controlled":"uncontrolled";console.warn(`${x} is changing from ${m?"controlled":"uncontrolled"} to ${g}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}g.current=et},[et,x])}let er=E.useCallback(g=>{if(et){let v="function"==typeof g?g(m):g;v!==m&&K.current?.(v)}else T(g)},[et,m,T,K]);return[en,er]}({prop:x,defaultProp:k??!1,onChange:T,caller:ew});return(0,K.jsx)(ek,{scope:g,triggerRef:en,contentRef:er,contentId:u
42seId(),titleId:useId(),descriptionId:useId(),open:es,onOpenChange:el,onOpenToggle:E.useCallback(()=>el(m=>!m),[el]),modal:et,children:v})};Dialog.displayName=ew;var ej="DialogTrigger",eN=E.forwardRef((m,g)=>{let{__scopeDialog:v,...x}=m,k=eE(ej,v),E=useComposedRefs(g,k.triggerRef);return(0,K.jsx)(ec.button,{type:"button","aria-haspopup":"dialog","aria-expanded":k.open,"aria-controls":k.contentId,"data-state":getState(k.open),...x,ref:E,onClick:composeEventHandlers(m.onClick,k.onOpenToggle)})});eN.displayName=ej;var eR="DialogPortal",[eI,eP]=eS(eR,{forceMount:void 0}),DialogPortal=m=>{let{__scopeDialog:g,forceMount:v,children:x,container:k}=m,T=eE(eR,g);return(0,K.jsx)(eI,{scope:g,forceMount:v,children:E.Children.map(x,m=>(0,K.jsx)(Presence,{present:v||T.open,children:(0,K.jsx)(ey,{asChild:!0,container:k,children:m})}))})};DialogPortal.displayName=eR;var eT="DialogOverlay",eO=E.forwardRef((m,g)=>{let v=eP(eT,m.__scopeDialog),{forceMount:x=v.forceMount,...k}=m,E=eE(eT,m.__scopeDialog);return E.modal?(0,K.jsx)(Presence,{present:x||E.open,children:(0,K.jsx)(eM,{...k,ref:g})}):null});eO.displayName=eT;var eA=createSlot("DialogOverlay.RemoveScroll"),eM=E.forwardRef((m,g)=>{let{__scopeDialog:v,...x}=m,k=eE(eT,v);return(0,K.jsx)(ex.Z,{as:eA,allowPinchZoom:!0,shards:[k.contentRef],children:(0,K.jsx)(ec.div,{"data-state":getState(k.open),...x,ref:g,style:{pointerEvents:"auto",...x.style}})})}),eD="DialogContent",eL=E.forwardRef((m,g)=>{let v=eP(eD,m.__scopeDialog),{forceMount:x=v.forceMount,...k}=m,E=eE(eD,m.__scopeDialog);return(0,K.jsx)(Presence,{present:x||E.open,children:E.modal?(0,K.jsx)(eF,{...k,ref:g}):(0,K.jsx)(eZ,{...k,ref:g})})});eL.displayName=eD;var eF=E.forwardRef((m,g)=>{let v=eE(eD,m.__scopeDialog),x=E.useRef(null),k=useComposedRefs(g,v.contentRef,x);return E.useEffect(()=>{let m=x.current;if(m)return(0,e_.Ry)(m)},[]),(0,K.jsx)(eB,{...m,ref:k,trapFocus:v.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(m.onCloseAutoFocus,m=>{m.preventDefault(),v.triggerRef.current?.focus()}),onPointerDownOutside:composeEventHandlers(m.onPointerDownOutside,m=>{let g=m.detail.originalEvent,v=0===g.button&&!0===g.ctrlKey,x=2===g.button||v;x&&m.preventDefault()}),onFocusOutside:composeEventHandlers(m.onFocusOutside,m=>m.preventDefault())})}),eZ=E.forwardRef((m,g)=>{let v=eE(eD,m.__scopeDialog),x=E.useRef(!1),k=E.useRef(!1);return(0,K.jsx)(eB,{...m,ref:g,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:g=>{m.onCloseAutoFocus?.(g),g.defaultPrevented||(x.current||v.triggerRef.current?.focus(),g.preventDefault()),x.current=!1,k.current=!1},onInteractOutside:g=>{m.onInteractOutside?.(g),g.defaultPrevented||(x.current=!0,"pointerdown"!==g.detail.originalEvent.type||(k.current=!0));let E=g.target,T=v.triggerRef.current?.contains(E);T&&g.preventDefault(),"focusin"===g.detail.originalEvent.type&&k.current&&g.preventDefault()}})}),eB=E.forwardRef((m,g)=>{let{__scopeDialog:v,trapFocus:x,onOpenAutoFocus:k,onCloseAutoFocus:T,...et}=m,en=eE(eD,v),er=E.useRef(null),ei=useComposedRefs(g,er);return E.useEffect(()=>{let m=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",m[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",m[1]??createFocusGuard()),eb++,()=>{1===eb&&document.querySelectorAll("[data-radix-focus-guard]").forEach(m=>m.remove()),eb--}},[]),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(eg,{asChild:!0,loop:!0,trapped:x,onMountAutoFocus:k,onUnmountAutoFocus:T,children:(0,K.jsx)(ep,{role:"dialog",id:en.contentId,"aria-describedby":en.descriptionId,"aria-labelledby":en.titleId,"data-state":getState(en.open),...et,ref:ei,onDismiss:()=>en.onOpenChange(!1)})}),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(TitleWarning,{titleId:en.titleId}),(0,K.jsx)(DescriptionWarning,{contentRef:er,descriptionId:en.descriptionId})]})]})}),e$="DialogTitle",eU=E.forwardRef((m,g)=>{let{__scopeDialog:v,...x}=m,k=eE(e$,v);return(0,K.jsx)(ec.h2,{id:k.titleId,...x,ref:g})});eU.displayName=e$;var ez="DialogDescription",eV=E.forwardRef((m,g)=>{let{__scopeDialog:v,...x}=m,k=eE(ez,v);return(0,K.jsx)(ec.p,{id:k.descriptionId,...x,ref:g})});eV.displayName=ez;var eq="DialogClose",eH=E.forwardRef((m,g)=>{let{__scopeDialog:v,...x}=m,k=eE(eq,v);return(0,K.jsx)(ec.button,{type:"button",...x,ref:g,onClick:composeEventHandlers(m.onClick,()=>k.onOpenChange(!1))})});function getState(m){return m?"open":"closed"}eH.displayName=eq;var eW="DialogTitleWarning",[eK,eG]=function(m,g){let v=E.createContext(g),Provider=m=>{let{children:g,...x}=m,k=E.useMemo(()=>x,Object.values(x));return(0,K.jsx)(v.Provider,{value:k,children:g})};return Provider.displayName=m+"Provider",[Provider,function(x){let k=E.useContext(v);if(k)return k;if(void 0!==g)return g;throw Error(`\`${x}\` must be used within \`${m}\``)}]}
42(eW,{contentName:eD,titleName:e$,docsSlug:"dialog"}),TitleWarning=({titleId:m})=>{let g=eG(eW),v=`\`${g.contentName}\` requires a \`${g.titleName}\` for the component to be accessible for screen reader users.
43
44If you want to hide the \`${g.titleName}\`, you can wrap it with our VisuallyHidden component.
45
46For more information, see https://radix-ui.com/primitives/docs/components/${g.docsSlug}`;return E.useEffect(()=>{if(m){let g=document.getElementById(m);g||console.error(v)}},[v,m]),null},DescriptionWarning=({contentRef:m,descriptionId:g})=>{let v=eG("DialogDescriptionWarning"),x=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${v.contentName}}.`;return E.useEffect(()=>{let v=m.current?.getAttribute("aria-describedby");if(g&&v){let m=document.getElementById(g);m||console.warn(x)}},[x,m,g]),null},eQ=Dialog,eY=eN,eX=DialogPortal,eJ=eO,e0=eL,e1=eU,e2=eV,e3=eH},59241:function(m,g,v){"use strict";v.d(g,{gm:function(){return useDirection}});var x=v(2784);v(52322);var k=Object.defineProperty,E=x.createContext(void 0);function useDirection(m){let g=x.useContext(E);return m||g||"ltr"}k(useDirection,"name",{value:"useDirection",configurable:!0})},1352:function(m,g,v){"use strict";v.d(g,{I0:function(){return ep},WL:function(){return useDismissableLayerSurface},XB:function(){return el},fC:function(){return ed}});var x,k=v(2784),E=v(17998),T=v(72714),K=v(62656),et=v(27757),en=v(52322),er=Object.defineProperty,__name=(m,g)=>er(m,"name",{value:g,configurable:!0}),ei="dismissableLayer.update",es=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),el=k.forwardRef(__name(function(m,g){let{disableOutsidePointerEvents:v=!1,deferPointerDownOutside:er=!1,onEscapeKeyDown:el,onPointerDownOutside:ec,onFocusOutside:eu,onInteractOutside:ed,onDismiss:ep,...em}=m,ef=k.useContext(es),[eh,eg]=k.useState(null),ev=eh?.ownerDocument??globalThis?.document,[,ey]=k.useState({}),eb=(0,K.e)(g,eg),ex=Array.from(ef.layers),[e_]=[...ef.layersWithOutsidePointerEventsDisabled].slice(-1),ew=e_?ex.indexOf(e_):-1,eS=eh?ex.indexOf(eh):-1,eC=ef.layersWithOutsidePointerEventsDisabled.size>0,ek=eS>=ew,eE=k.useRef(!1),ej=usePointerDownOutside(m=>{ec?.(m),ed?.(m),m.defaultPrevented||ep?.()},{ownerDocument:ev,deferPointerDownOutside:er,isDeferredPointerDownOutsideRef:eE,dismissableSurfaces:ef.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(m=>{if(!(m instanceof Node))return!1;let g=[...ef.branches].some(g=>g.contains(m));return ek&&!g},[ef.branches,ek])}
46),eN=useFocusOutside(m=>{if(er&&eE.current)return;let g=m.target,v=[...ef.branches].some(m=>m.contains(g));v||(eu?.(m),ed?.(m),m.defaultPrevented||ep?.())},ev),eR=!!eh&&eS===ex.length-1,eI=(0,et.W)(m=>{"Escape"===m.key&&(el?.(m),!m.defaultPrevented&&ep&&(m.preventDefault(),ep()))});return k.useEffect(()=>{if(eR)return ev.addEventListener("keydown",eI,{capture:!0}),()=>ev.removeEventListener("keydown",eI,{capture:!0})},[ev,eR,eI]),k.useEffect(()=>{if(eh)return v&&(0===ef.layersWithOutsidePointerEventsDisabled.size&&(x=ev.body.style.pointerEvents,ev.body.style.pointerEvents="none"),ef.layersWithOutsidePointerEventsDisabled.add(eh)),ef.layers.add(eh),dispatchUpdate(),()=>{v&&(ef.layersWithOutsidePointerEventsDisabled.delete(eh),0===ef.layersWithOutsidePointerEventsDisabled.size&&(ev.body.style.pointerEvents=x))}},[eh,ev,v,ef]),k.useEffect(()=>()=>{eh&&(ef.layers.delete(eh),ef.layersWithOutsidePointerEventsDisabled.delete(eh),dispatchUpdate())},[eh,ef]),k.useEffect(()=>{let m=__name(()=>ey({}),"handleUpdate");return document.addEventListener(ei,m),()=>document.removeEventListener(ei,m)},[]),(0,en.jsx)(T.WV.div,{...em,ref:eb,style:{pointerEvents:eC?ek?"auto":"none":void 0,...m.style},onFocusCapture:(0,E.Mj)(m.onFocusCapture,eN.onFocusCapture),onBlurCapture:(0,E.Mj)(m.onBlurCapture,eN.onBlurCapture),onPointerDownCapture:(0,E.Mj)(m.onPointerDownCapture,ej.onPointerDownCapture)})},"DismissableLayer")),ec=k.forwardRef(__name(function(m,g){let v=k.useContext(es),x=k.useRef(null),E=(0,K.e)(g,x);return k.useEffect(()=>{let m=x.current;if(m)return v.branches.add(m),()=>{v.branches.delete(m)}},[v.branches]),(0,en.jsx)(T.WV.div,{...m,ref:E})},"DismissableLayerBranch"));function useDismissableLayerSurface(){let m=k.useContext(es),[g,v]=k.useState(null);return k.useEffect(()=>{if(g)return m.dismissableSurfaces.add(g),()=>{m.dismissableSurfaces.delete(g)}},[g,m.dismissableSurfaces]),v}__name(useDismissableLayerSurface,"useDismissableLayerSurface");var eu=__name(()=>!0,"IS_TRUE");function usePointerDownOutside(m,g){let{ownerDocument:v=globalThis?.document,deferPointerDownOutside:x=!1,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:T,shouldHandlePointerDownOutside:K=eu}=g,en=(0,et.W)(m),er=k.useRef(!1),ei=k.useRef(!1),es=k.useRef(new Map),el=k.useRef(()=>{});return k.useEffect(()=>{function resetOutsideInteraction(){ei.current=!1,E.current=!1,es.current.clear()}function isOutsideInteractionIntercepted(){return Array.from(es.current.values()).some(Boolean)}function handleInteractionCapture(m){if(!ei.current)return;let g=m.target,v=g instanceof Node&&[...T].some(m=>m.contains(g));v||es.current.set(m.type,!0),"click"===m.type&&window.setTimeout(()=>{ei.current&&el.current()},0)}function handleInteractionBubble(m){ei.current&&es.current.set(m.type,!1)}__name(resetOutsideInteraction,"resetOutsideInteraction"),__name(isOutsideInteractionIntercepted,"isOutsideInteractionIntercepted"),__name(handleInteractionCapture,"handleInteractionCapture"),__name(handleInteractionBubble,"handleInteractionBubble");let m=__name(m=>{if(m.target&&!er.current){let handleAndDispatchPointerDownOutsideEvent2=function(){v.removeEventListener("click",el.current);let m=isOutsideInteractionIntercepted();resetOutsideInteraction(),m||handleAndDispatchCustomEvent("dismissableLayer.pointerDownOutside",en,g,{discrete:!0})};if(__name(handleAndDispatchPointerDownOutsideEvent2,"handleAndDispatchPointerDownOutsideEvent"),!K(m.target)){v.removeEventListener("click",el.current),resetOutsideInteraction(),er.current=!1;return}let g={originalEvent:m};ei.current=!0,E.current=x&&0===m.button,es.current.clear(),x&&0===m.button?(v.removeEventListener("click",el.current),el.current=handleAndDispatchPointerDownOutsideEvent2,v.addEventListener("click",el.current,{once:!0})):handleAndDispatchPointerDownOutsideEvent2()}else v.removeEventListener("click",el.current),resetOutsideInteraction();er.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let m of g)v.addEventListener(m,handleInteractionCapture,!0),v.addEventListener(m,handleInteractionBubble);let k=window.setTimeout(()=>{v.addEventListener("pointerdown",m)}
46,0);return()=>{for(let x of(window.clearTimeout(k),v.removeEventListener("pointerdown",m),v.removeEventListener("click",el.current),g))v.removeEventListener(x,handleInteractionCapture,!0),v.removeEventListener(x,handleInteractionBubble)}},[v,en,x,E,T,K]),{onPointerDownCapture:__name(()=>er.current=!0,"onPointerDownCapture")}}function useFocusOutside(m,g=globalThis?.document){let v=(0,et.W)(m),x=k.useRef(!1);return k.useEffect(()=>{let m=__name(m=>{m.target&&!x.current&&handleAndDispatchCustomEvent("dismissableLayer.focusOutside",v,{originalEvent:m},{discrete:!1})},"handleFocus");return g.addEventListener("focusin",m),()=>g.removeEventListener("focusin",m)},[g,v]),{onFocusCapture:__name(()=>x.current=!0,"onFocusCapture"),onBlurCapture:__name(()=>x.current=!1,"onBlurCapture")}}function dispatchUpdate(){let m=new CustomEvent(ei);document.dispatchEvent(m)}function handleAndDispatchCustomEvent(m,g,v,{discrete:x}){let k=v.originalEvent.target,E=new CustomEvent(m,{bubbles:!1,cancelable:!0,detail:v});g&&k.addEventListener(m,g,{once:!0}),x?(0,T.jH)(k,E):k.dispatchEvent(E)}__name(usePointerDownOutside,"usePointerDownOutside"),__name(useFocusOutside,"useFocusOutside"),__name(dispatchUpdate,"dispatchUpdate"),__name(handleAndDispatchCustomEvent,"handleAndDispatchCustomEvent");var ed=el,ep=ec},11861:function(m,g,v){"use strict";v.d(g,{EW:function(){return useFocusGuards}});var x=v(2784),k=Object.defineProperty,__name=(m,g)=>k(m,"name",{value:g,configurable:!0}),E=0,T=null;function useFocusGuards(){x.useEffect(()=>{T||(T={start:createFocusGuard(),end:createFocusGuard()});let{start:m,end:g}=T;return document.body.firstElementChild!==m&&document.body.insertAdjacentElement("afterbegin",m),document.body.lastElementChild!==g&&document.body.insertAdjacentElement("beforeend",g),E++,()=>{1===E&&(T?.start.remove(),T?.end.remove(),T=null),E=Math.max(0,E-1)}},[])}function createFocusGuard(){let m=document.createElement("span");return m.setAttribute("data-radix-focus-guard",""),m.tabIndex=0,m.style.outline="none",m.style.opacity="0",m.style.position="fixed",m.style.pointerEvents="none",m}__name(function(m){return useFocusGuards(),m.children},"FocusGuards"),__name(useFocusGuards,"useFocusGuards"),__name(createFocusGuard,"createFocusGuard")},22426:function(m,g,v){"use strict";v.d(g,{M:function(){return es}});var x=v(2784),k=v(62656),E=v(72714),T=v(27757),K=v(52322),et=Object.defineProperty,__name=(m,g)=>et(m,"name",{value:g,configurable:!0}),en="focusScope.autoFocusOnMount",er="focusScope.autoFocusOnUnmount",ei={bubbles:!1,cancelable:!0},es=x.forwardRef(__name(function(m,g){let{loop:v=!1,trapped:et=!1,onMountAutoFocus:es,onUnmountAutoFocus:ec,...eu}=m,[ed,ep]=x.useState(null),em=(0,T.W)(es),ef=(0,T.W)(ec),eh=x.useRef(null),eg=(0,k.e)(g,ep),ev=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(et){let handleFocusIn2=function(m){if(ev.paused||!ed)return;let g=m.target;ed.contains(g)?eh.current=g:focus(eh.current,{select:!0})},handleFocusOut2=function(m){if(ev.paused||!ed)return;let g=m.relatedTarget;null===g||ed.contains(g)||focus(eh.current,{select:!0})},handleMutations2=function(m){let g=document.activeElement;if(g===document.body)for(let g of m)g.removedNodes.length>0&&focus(ed)};__name(handleFocusIn2,"handleFocusIn"),__name(handleFocusOut2,"handleFocusOut"),__name(handleMutations2,"handleMutations"),document.addEventListener("focusin",handleFocusIn2),document.addEventListener("focusout",handleFocusOut2);let m=new MutationObserver(handleMutations2);return ed&&m.observe(ed,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",handleFocusIn2),document.removeEventListener("focusout",handleFocusOut2),m.disconnect()}}},[et,ed,ev.paused]),x.useEffect(()=>{if(ed){el.add(ev);let m=document.activeElement,g=ed.contains(m);if(!g){let g=new CustomEvent(en,ei);ed.addEventListener(en,em),ed.dispatchEvent(g),g.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(ed)),{select:!0}),document.activeElement===m&&focus(ed))}return()=>{ed.removeEventListener(en,em),setTimeout(()=>{let g=new CustomEvent(er,ei);ed.addEventListener(er,ef),ed.dispatchEvent(g),g.defaultPrevented||focus(m??document.body,{select:!0}),ed.removeEventListener(er,ef),el.remove(ev)},0)}}},[ed,em,ef,ev]);let ey=x.useCallback(m=>{if(!v&&!et||ev.paused)return;let g="Tab"===m.key&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(g&&x){let g=m.currentTarget,[k,E]=getTabbableEdges(g),T=k&&E;T?m.shiftKey||x!==E?m.shiftKey&&x===k&&(m.preventDefault(),v&&focus(E,{select:!0})):(m.preventDefault(),v&&focus(k,{select:!0})):x===g&&m.preventDefault()}},[v,et,ev.paused]);return(0,K.jsx)(E.WV.div,{tabIndex:-1,...eu,ref:eg,onKeyDown:ey})},"FocusScope"));function focusFirst(m,{select:g=!1}={}
46){let v=document.activeElement;for(let x of m)if(focus(x,{select:g}),document.activeElement!==v)return}function getTabbableEdges(m){let g=getTabbableCandidates(m),v=findVisible(g,m),x=findVisible(g.reverse(),m);return[v,x]}function getTabbableCandidates(m){let g=[],v=document.createTreeWalker(m,NodeFilter.SHOW_ELEMENT,{acceptNode:__name(m=>{let g="INPUT"===m.tagName&&"hidden"===m.type;return m.disabled||m.hidden||g?NodeFilter.FILTER_SKIP:m.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;v.nextNode();)g.push(v.currentNode);return g}function findVisible(m,g){let v="function"==typeof g.checkVisibility&&g.checkVisibility({checkVisibilityCSS:!0});for(let x of m){let m=v?!x.checkVisibility({checkVisibilityCSS:!0}):isHidden(x,{upTo:g});if(!m)return x}}function isHidden(m,{upTo:g}){if("hidden"===getComputedStyle(m).visibility)return!0;for(;m&&(void 0===g||m!==g);){if("none"===getComputedStyle(m).display)return!0;m=m.parentElement}return!1}function isSelectableInput(m){return m instanceof HTMLInputElement&&"select"in m}function focus(m,{select:g=!1}={}){if(m&&m.focus){let v=document.activeElement;m.focus({preventScroll:!0}),m!==v&&isSelectableInput(m)&&g&&m.select()}}__name(focusFirst,"focusFirst"),__name(getTabbableEdges,"getTabbableEdges"),__name(getTabbableCandidates,"getTabbableCandidates"),__name(findVisible,"findVisible"),__name(isHidden,"isHidden"),__name(isSelectableInput,"isSelectableInput"),__name(focus,"focus");var el=createFocusScopesStack();function createFocusScopesStack(){let m=[];return{add(g){let v=m[0];g!==v&&v?.pause(),(m=arrayRemove(m,g)).unshift(g)},remove(g){m=arrayRemove(m,g),m[0]?.resume()}}}function arrayRemove(m,g){let v=[...m],x=v.indexOf(g);return -1!==x&&v.splice(x,1),v}function removeLinks(m){return m.filter(m=>"A"!==m.tagName)}__name(createFocusScopesStack,"createFocusScopesStack"),__name(arrayRemove,"arrayRemove"),__name(removeLinks,"removeLinks")},23372:function(m,g,v){"use strict";v.d(g,{M:function(){return useId}});var x,k=v(2784),E=v(61644),T=Object.defineProperty,K=(x||(x=v.t(k,2)))[" useId ".trim().toString()]||(()=>void 0),et=0;function useId(m){let[g,v]=k.useState(K());return(0,E.b)(()=>{m||v(m=>m??String(et++))},[m]),m||(g?`radix-${g}`:"")}T(useId,"name",{value:"useId",configurable:!0})},66489:function(m,g,v){"use strict";let x;v.d(g,{ee:function(){return eF},VY:function(){return eZ},fC:function(){return eL},D7:function(){return ej}});var k=v(2784);let E=["top","right","bottom","left"],T=Math.min,K=Math.max,et=Math.round,en=Math.floor,createCoords=m=>({x:m,y:m}),er={left:"right",right:"left",bottom:"top",top:"bottom"};function floating_ui_utils_evaluate(m,g){return"function"==typeof m?m(g):m}function floating_ui_utils_getSide(m){return m.split("-")[0]}function floating_ui_utils_getAlignment(m){return m.split("-")[1]}function getOppositeAxis(m){return"x"===m?"y":"x"}function getAxisLength(m){return"y"===m?"height":"width"}function floating_ui_utils_getSideAxis(m){let g=m[0];return"t"===g||"b"===g?"y":"x"}function floating_ui_utils_getOppositeAlignmentPlacement(m){return m.includes("start")?m.replace("start","end"):m.replace("end","start")}let ei=["left","right"],es=["right","left"],el=["top","bottom"],ec=["bottom","top"];function getOppositePlacement(m){let g=floating_ui_utils_getSide(m);return er[g]+m.slice(g.length)}function floating_ui_utils_getPaddingObject(m){return"number"!=typeof m?{top:0,right:0,bottom:0,left:0,...m}:{top:m,right:m,bottom:m,left:m}}function floating_ui_utils_rectToClientRect(m){let{x:g,y:v,width:x,height:k}=m;return{width:x,height:k,top:v,left:g,right:g+x,bottom:v+k,x:g,y:v}}function computeCoordsFromPlacement(m,g,v){let x,{reference:k,floating:E}=m,T=floating_ui_utils_getSideAxis(g),K=getOppositeAxis(floating_ui_utils_getSideAxis(g)),et=getAxisLength(K),en=floating_ui_utils_getSide(g),er="y"===T,ei=k.x+k.width/2-E.width/2,es=k.y+k.height/2-E.height/2,el=k[et]/2-E[et]/2;switch(en){case"top":x={x:ei,y:k.y-E.height};break;case"bottom":x={x:ei,y:k.y+k.height};break;case"right":x={x:k.x+k.width,y:es};break;case"left":x={x:k.x-E.width,y:es};break;default:x={x:k.x,y:k.y}}switch(floating_ui_utils_getAlignment(g)){case"start":x[K]-=el*(v&&er?-1:1);break;case"end":x[K]+=el*(v&&er?-1:1)}return x}async function detectOverflow(m,g){var v;void 0===g&&(g={});let{x,y:k,platform:E,rects:T,elements:K,strategy:et}=m,{boundary:en="clippingAncestors",rootBoundary:er="viewport",elementContext:ei="floating",altBoundary:es=!1,padding:el=0}=floating_ui_utils_evaluate(g,m),ec=floating_ui_utils_getPaddingOb
46ject(el),eu=K[es?"floating"===ei?"reference":"floating":ei],ed=floating_ui_utils_rectToClientRect(await E.getClippingRect({element:null==(v=await (null==E.isElement?void 0:E.isElement(eu)))||v?eu:eu.contextElement||await (null==E.getDocumentElement?void 0:E.getDocumentElement(K.floating)),boundary:en,rootBoundary:er,strategy:et})),ep="floating"===ei?{x,y:k,width:T.floating.width,height:T.floating.height}:T.reference,em=await (null==E.getOffsetParent?void 0:E.getOffsetParent(K.floating)),ef=await (null==E.isElement?void 0:E.isElement(em))&&await (null==E.getScale?void 0:E.getScale(em))||{x:1,y:1},eh=floating_ui_utils_rectToClientRect(E.convertOffsetParentRelativeRectToViewportRelativeRect?await E.convertOffsetParentRelativeRectToViewportRelativeRect({elements:K,rect:ep,offsetParent:em,strategy:et}):ep);return{top:(ed.top-eh.top+ec.top)/ef.y,bottom:(eh.bottom-ed.bottom+ec.bottom)/ef.y,left:(ed.left-eh.left+ec.left)/ef.x,right:(eh.right-ed.right+ec.right)/ef.x}}let computePosition=async(m,g,v)=>{let{placement:x="bottom",strategy:k="absolute",middleware:E=[],platform:T}=v,K=T.detectOverflow?T:{...T,detectOverflow},et=await (null==T.isRTL?void 0:T.isRTL(g)),en=await T.getElementRects({reference:m,floating:g,strategy:k}),{x:er,y:ei}=computeCoordsFromPlacement(en,x,et),es=x,el=0,ec={};for(let v=0;v<E.length;v++){let eu=E[v];if(!eu)continue;let{name:ed,fn:ep}=eu,{x:em,y:ef,data:eh,reset:eg}=await ep({x:er,y:ei,initialPlacement:x,placement:es,strategy:k,middlewareData:ec,rects:en,platform:K,elements:{reference:m,floating:g}});er=null!=em?em:er,ei=null!=ef?ef:ei,ec[ed]={...ec[ed],...eh},eg&&el<50&&(el++,"object"==typeof eg&&(eg.placement&&(es=eg.placement),eg.rects&&(en=!0===eg.rects?await T.getElementRects({reference:m,floating:g,strategy:k}):eg.rects),{x:er,y:ei}=computeCoordsFromPlacement(en,es,et)),v=-1)}return{x:er,y:ei,placement:es,strategy:k,middlewareData:ec}};function getSideOffsets(m,g){return{top:m.top-g.height,right:m.right-g.width,bottom:m.bottom-g.height,left:m.left-g.width}}function isAnySideFullyClipped(m){return E.some(g=>m[g]>=0)}let eu=new Set(["left","top"]);async function convertValueToCoords(m,g){let{placement:v,platform:x,elements:k}=m,E=await (null==x.isRTL?void 0:x.isRTL(k.floating)),T=floating_ui_utils_getSide(v),K=floating_ui_utils_getAlignment(v),et="y"===floating_ui_utils_getSideAxis(v),en=eu.has(T)?-1:1,er=E&&et?-1:1,ei=floating_ui_utils_evaluate(g,m),{mainAxis:es,crossAxis:el,alignmentAxis:ec}="number"==typeof ei?{mainAxis:ei,crossAxis:0,alignmentAxis:null}:{mainAxis:ei.mainAxis||0,crossAxis:ei.crossAxis||0,alignmentAxis:ei.alignmentAxis};return K&&"number"==typeof ec&&(el="end"===K?-1*ec:ec),et?{x:el*er,y:es*en}:{x:es*en,y:el*er}}function hasWindow(){return"undefined"!=typeof window}function getNodeName(m){return isNode(m)?(m.nodeName||"").toLowerCase():"#document"}function getWindow(m){var g;return(null==m||null==(g=m.ownerDocument)?void 0:g.defaultView)||window}function getDocumentElement(m){var g;return null==(g=(isNode(m)?m.ownerDocument:m.document)||window.document)?void 0:g.documentElement}function isNode(m){return!!hasWindow()&&(m instanceof Node||m instanceof getWindow(m).Node)}function isElement(m){return!!hasWindow()&&(m instanceof Element||m instanceof getWindow(m).Element)}function isHTMLElement(m){return!!hasWindow()&&(m instanceof HTMLElement||m instanceof getWindow(m).HTMLElement)}function isShadowRoot(m){return!!hasWindow()&&"undefined"!=typeof ShadowRoot&&(m instanceof ShadowRoot||m instanceof getWindow(m).ShadowRoot)}function isOverflowElement(m){let{overflow:g,overflowX:v,overflowY:x,display:k}=floating_ui_utils_dom_getComputedStyle(m);return/auto|scroll|overlay|hidden|clip/.test(g+x+v)&&"inline"!==k&&"contents"!==k}function isTopLayer(m){try{if(m.matches(":popover-open"))return!0}catch(m){}try{return m.matches(":modal")}catch(m){return!1}}let ed=/transform|translate|scale|rotate|perspective|filter/,ep=/paint|layout|strict|content/,isNotNone=m=>!!m&&"none"!==m;function isContainingBlock(m){let g=isElement(m)?floating_ui_utils_dom_getComputedStyle(m):m;return isNotNone(g.transform)||isNotNone(g.translate)||isNotNone(g.scale)||isNotNone(g.rotate)||isNotNone(g.perspective)||!isWebKit()&&(isNotNone(g.backdropFilter)||isNotNone(g.filter))||ed.test(g.willChange||"")||ep.test(g.contain||"")}function isWebKit(){return null==x&&(x="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),x}function isLastTraversableNode(m){return/^(html|body|#document)$/.test(get
46NodeName(m))}function floating_ui_utils_dom_getComputedStyle(m){return getWindow(m).getComputedStyle(m)}function getNodeScroll(m){return isElement(m)?{scrollLeft:m.scrollLeft,scrollTop:m.scrollTop}:{scrollLeft:m.scrollX,scrollTop:m.scrollY}}function getParentNode(m){if("html"===getNodeName(m))return m;let g=m.assignedSlot||m.parentNode||isShadowRoot(m)&&m.host||getDocumentElement(m);return isShadowRoot(g)?g.host:g}function getOverflowAncestors(m,g,v){var x;void 0===g&&(g=[]),void 0===v&&(v=!0);let k=function getNearestOverflowAncestor(m){let g=getParentNode(m);return isLastTraversableNode(g)?m.ownerDocument?m.ownerDocument.body:m.body:isHTMLElement(g)&&isOverflowElement(g)?g:getNearestOverflowAncestor(g)}(m),E=k===(null==(x=m.ownerDocument)?void 0:x.body),T=getWindow(k);if(!E)return g.concat(k,getOverflowAncestors(k,[],v));{let m=getFrameElement(T);return g.concat(T,T.visualViewport||[],isOverflowElement(k)?k:[],m&&v?getOverflowAncestors(m):[])}}function getFrameElement(m){return m.parent&&Object.getPrototypeOf(m.parent)?m.frameElement:null}function getCssDimensions(m){let g=floating_ui_utils_dom_getComputedStyle(m),v=parseFloat(g.width)||0,x=parseFloat(g.height)||0,k=isHTMLElement(m),E=k?m.offsetWidth:v,T=k?m.offsetHeight:x,K=et(v)!==E||et(x)!==T;return K&&(v=E,x=T),{width:v,height:x,$:K}}function unwrapElement(m){return isElement(m)?m:m.contextElement}function getScale(m){let g=unwrapElement(m);if(!isHTMLElement(g))return createCoords(1);let v=g.getBoundingClientRect(),{width:x,height:k,$:E}=getCssDimensions(g),T=(E?et(v.width):v.width)/x,K=(E?et(v.height):v.height)/k;return T&&Number.isFinite(T)||(T=1),K&&Number.isFinite(K)||(K=1),{x:T,y:K}}let em=createCoords(0);function getVisualOffsets(m){let g=getWindow(m);return isWebKit()&&g.visualViewport?{x:g.visualViewport.offsetLeft,y:g.visualViewport.offsetTop}:em}function getBoundingClientRect(m,g,v,x){var k;void 0===g&&(g=!1),void 0===v&&(v=!1);let E=m.getBoundingClientRect(),T=unwrapElement(m),K=createCoords(1);g&&(x?isElement(x)&&(K=getScale(x)):K=getScale(m));let et=(void 0===(k=v)&&(k=!1),x&&(!k||x===getWindow(T))&&k)?getVisualOffsets(T):createCoords(0),en=(E.left+et.x)/K.x,er=(E.top+et.y)/K.y,ei=E.width/K.x,es=E.height/K.y;if(T){let m=getWindow(T),g=x&&isElement(x)?getWindow(x):x,v=m,k=getFrameElement(v);for(;k&&x&&g!==v;){let m=getScale(k),g=k.getBoundingClientRect(),x=floating_ui_utils_dom_getComputedStyle(k),E=g.left+(k.clientLeft+parseFloat(x.paddingLeft))*m.x,T=g.top+(k.clientTop+parseFloat(x.paddingTop))*m.y;en*=m.x,er*=m.y,ei*=m.x,es*=m.y,en+=E,er+=T,k=getFrameElement(v=getWindow(k))}}return floating_ui_utils_rectToClientRect({width:ei,height:es,x:en,y:er})}function getWindowScrollBarX(m,g){let v=getNodeScroll(m).scrollLeft;return g?g.left+v:getBoundingClientRect(getDocumentElement(m)).left+v}function getHTMLOffset(m,g){let v=m.getBoundingClientRect(),x=v.left+g.scrollLeft-getWindowScrollBarX(m,v),k=v.top+g.scrollTop;return{x,y:k}}function getClientRectFromClippingAncestor(m,g,v){let x;if("viewport"===g)x=function(m,g){let v=getWindow(m),x=getDocumentElement(m),k=v.visualVie
46wport,E=x.clientWidth,T=x.clientHeight,K=0,et=0;if(k){E=k.width,T=k.height;let m=isWebKit();(!m||m&&"fixed"===g)&&(K=k.offsetLeft,et=k.offsetTop)}let en=getWindowScrollBarX(x);if(en<=0){let m=x.ownerDocument,g=m.body,v=getComputedStyle(g),k="CSS1Compat"===m.compatMode&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,T=Math.abs(x.clientWidth-g.clientWidth-k);T<=25&&(E-=T)}else en<=25&&(E+=en);return{width:E,height:T,x:K,y:et}}(m,v);else if("document"===g)x=function(m){let g=getDocumentElement(m),v=getNodeScroll(m),x=m.ownerDocument.body,k=K(g.scrollWidth,g.clientWidth,x.scrollWidth,x.clientWidth),E=K(g.scrollHeight,g.clientHeight,x.scrollHeight,x.clientHeight),T=-v.scrollLeft+getWindowScrollBarX(m),et=-v.scrollTop;return"rtl"===floating_ui_utils_dom_getComputedStyle(x).direction&&(T+=K(g.clientWidth,x.clientWidth)-k),{width:k,height:E,x:T,y:et}}(getDocumentElement(m));else if(isElement(g))x=function(m,g){let v=getBoundingClientRect(m,!0,"fixed"===g),x=v.top+m.clientTop,k=v.left+m.clientLeft,E=isHTMLElement(m)?getScale(m):createCoords(1),T=m.clientWidth*E.x,K=m.clientHeight*E.y,et=k*E.x,en=x*E.y;return{width:T,height:K,x:et,y:en}}(g,v);else{let v=getVisualOffsets(m);x={x:g.x-v.x,y:g.y-v.y,width:g.width,height:g.height}}return floating_ui_utils_rectToClientRect(x)}function isStaticPositioned(m){return"static"===floating_ui_utils_dom_getComputedStyle(m).position}function getTrueOffsetParent(m,g){if(!isHTMLElement(m)||"fixed"===floating_ui_utils_dom_getComputedStyle(m).position)return null;if(g)return g(m);let v=m.offsetParent;return getDocumentElement(m)===v&&(v=v.ownerDocument.body),v}function getOffsetParent(m,g){var v;let x=getWindow(m);if(isTopLayer(m))return x;if(!isHTMLElement(m)){let g=getParentNode(m);for(;g&&!isLastTraversableNode(g);){if(isElement(g)&&!isStaticPositioned(g))return g;g=getParentNode(g)}return x}let k=getTrueOffsetParent(m,g);for(;k&&(v=k,/^(table|td|th)$/.test(getNodeName(v)))&&isStaticPositioned(k);)k=getTrueOffsetParent(k,g);return k&&isLastTraversableNode(k)&&isStaticPositioned(k)&&!isContainingBlock(k)?x:k||function(m){let g=getParentNode(m);for(;isHTMLElement(g)&&!isLastTraversableNode(g);){if(isContainingBlock(g))return g;if(isTopLayer(g))break;g=getParentNode(g)}return null}(m)||x}let getElementRects=async function(m){let g=this.getOffsetParent||getOffsetParent,v=this.getDimensions,x=await v(m.floating);return{reference:function(m,g,v){let x=isHTMLElement(g),k=getDocumentElement(g),E="fixed"===v,T=getBoundingClientRect(m,!0,E,g),K={scrollLeft:0,scrollTop:0},et=createCoords(0);if(x||!x&&!E){if(("body"!==getNodeName(g)||isOverflowElement(k))&&(K=getNodeScroll(g)),x){let m=getBoundingClientRect(g,!0,E,g);et.x=m.x+g.clientLeft,et.y=m.y+g.clientTop}else k&&(et.x=getWindowScrollBarX(k))}E&&!x&&k&&(et.x=getWindowScrollBarX(k));let en=!k||x||E?createCoords(0):getHTMLOffset(k,K),er=T.left+K.scrollLeft-et.x-en.x,ei=T.top+K.scrollTop-et.y-en.y;return{x:er,y:ei,width:T.width,height:T.height}}(m.reference,await g(m.floating),m.strategy),floating:{x:0,y:0,width:x.width,height:x.height}}},ef={convertOffsetParentRelativeRectToViewportRelativeRect:function(m){let{elements:g,rect:v,offsetParent:x,strategy:k}=m,E="fixed"===k,T=getDocumentElement(x),K=!!g&&isTopLayer(g.floating);if(x===T||K&&E)return v;let et={scrollLeft:0,scrollTop:0},en=createCoords(1),er=createCoords(0),ei=isHTMLElement(x);if((ei||!ei&&!E)&&(("body"!==getNodeName(x)||isOverflowElement(T))&&(et=get
46NodeScroll(x)),ei)){let m=getBoundingClientRect(x);en=getScale(x),er.x=m.x+x.clientLeft,er.y=m.y+x.clientTop}let es=!T||ei||E?createCoords(0):getHTMLOffset(T,et);return{width:v.width*en.x,height:v.height*en.y,x:v.x*en.x-et.scrollLeft*en.x+er.x+es.x,y:v.y*en.y-et.scrollTop*en.y+er.y+es.y}},getDocumentElement:getDocumentElement,getClippingRect:function(m){let{element:g,boundary:v,rootBoundary:x,strategy:k}=m,E="clippingAncestors"===v?isTopLayer(g)?[]:function(m,g){let v=g.get(m);if(v)return v;let x=getOverflowAncestors(m,[],!1).filter(m=>isElement(m)&&"body"!==getNodeName(m)),k=null,E="fixed"===floating_ui_utils_dom_getComputedStyle(m).position,T=E?getParentNode(m):m;for(;isElement(T)&&!isLastTraversableNode(T);){let g=floating_ui_utils_dom_getComputedStyle(T),v=isContainingBlock(T);v||"fixed"!==g.position||(k=null);let K=E?!v&&!k:!v&&"static"===g.position&&!!k&&("absolute"===k.position||"fixed"===k.position)||isOverflowElement(T)&&!v&&function hasFixedPositionAncestor(m,g){let v=getParentNode(m);return!(v===g||!isElement(v)||isLastTraversableNode(v))&&("fixed"===floating_ui_utils_dom_getComputedStyle(v).position||hasFixedPositionAncestor(v,g))}(m,T);K?x=x.filter(m=>m!==T):k=g,T=getParentNode(T)}return g.set(m,x),x}(g,this._c):[].concat(v),et=[...E,x],en=getClientRectFromClippingAncestor(g,et[0],k),er=en.top,ei=en.right,es=en.bottom,el=en.left;for(let m=1;m<et.length;m++){let v=getClientRectFromClippingAncestor(g,et[m],k);er=K(v.top,er),ei=T(v.right,ei),es=T(v.bottom,es),el=K(v.left,el)}return{width:ei-el,height:es-er,x:el,y:er}},getOffsetParent,getElementRects,getClientRects:function(m){return Array.from(m.getClientRects())},getDimensions:function(m){let{width:g,height:v}=getCssDimensions(m);return{width:g,height:v}},getScale,isElement:isElement,isRTL:function(m){return"rtl"===floating_ui_utils_dom_getComputedStyle(m).direction}};function rectsAreEqual(m,g){return m.x===g.x&&m.y===g.y&&m.width===g.width&&m.height===g.height}let floating_ui_dom_arrow=m=>({name:"arrow",options:m,async fn(g){let{x:v,y:x,placement:k,rects:E,platform:et,elements:en,middlewareData:er}=g,{element:ei,padding:es=0}=floating_ui_utils_evaluate(m,g)||{};if(null==ei)return{};let el=floating_ui_utils_getPaddingObject(es),ec={x:v,y:x},eu=getOppositeAxis(floating_ui_utils_getSideAxis(k)),ed=getAxisLength(eu),ep=await et.getDimensions(ei),em="y"===eu,ef=em?"clientHeight":"clientWidth",eh=E.reference[ed]+E.reference[eu]-ec[eu]-E.floating[ed],eg=ec[eu]-E.reference[eu],ev=await (null==et.getOffsetParent?void 0:et.getOffsetParent(ei)),ey=ev?ev[ef]:0;ey&&await (null==et.isElement?void 0:et.isElement(ev))||(ey=en.floating[ef]||E.floating[ed]);let eb=ey/2-ep[ed]/2-1,ex=T(el[em?"top":"left"],eb),e_=T(el[em?"bottom":"right"],eb),ew=ey-ep[ed]-e_,eS=ey/2-ep[ed]/2+(eh/2-eg/2),eC=K(ex,T(eS,ew)),ek=!er.arrow&&null!=floating_ui_utils_getAlignment(k)&&eS!==eC&&E.reference[ed]/2-(eS<ex?ex:e_)-ep[ed]/2<0,eE=ek?eS<ex?eS-ex:eS-ew:0;return{[eu]:ec[eu]+eE,data:{[eu]:eC,centerOffset:eS-eC-eE,...ek&&{alignmentOffset:eE}},reset:ek}}}),floating_ui_dom_computePosition=(m,g,v)=>{let x=new Map,k={platform:ef,...v},E={...k.platform,_c:x};return computePosition(m,g,{...k,platform:E})};var eh=v(28316),eg="undefined"!=typeof document?k.useLayoutEffect:function(){};function deepEqual(m,g){let v,x,k;if(m===g)return!0;if(typeof m!=typeof g)return!1;if("function"==typeof m&&m.toString()===g.toString())return!0;if(m&&g&&"object"==typeof m){if(Array.isArray(m)){if((v=m.length)!==g.length)return!1;for(x=v;0!=x--;)if(!deepEqual(m[x],g[x]))return!1;return!0}if((v=(k=Object.keys(m)).length)!==Object.keys(g).length)return!1;for(x=v;0!=x--;)if(!({}).hasOwnProperty.call(g,k[x]))return!1;for(x=v;0!=x--;){let v=k[x];if(("_owner"!==v||!m.$$typeof)&&!deepEqual(m[v],g[v]))return!1}return!0}return m!=m&&g!=g}function getDPR(m){if("undefined"==typeof window)return 1;let g=m.ownerDocument.defaultView||window;return g.devicePixelRatio||1}function roundByDPR(m,g){let v=getDPR(m);return Math.round(g*v)/v}function useLatestRef(m){let g=k.useRef(m);return eg(()=>{g.current=m}),g}let arrow$1=m=>({name:"arrow",options:m,fn(g){let{element:v,padding:x}="function"==typeof m?m(g):m;return v&&({}).hasOwnProperty.call(v,"current")?null!=v.current?floating_ui_dom_arrow({element:v.current,padding:x}).fn(g):{}:v?floating_ui_dom_arrow({element:v,padding:x}).fn(g):{}}}),floating_ui_react_dom_offset=(m,g)=>{var v;let x=(void 0===(v=m)&&(v=0),{name:"offset",options:v,async fn(m){var g,x;let{x:k,y:E,placement:T,middlewareData:K}=m,et=await convertValueToCoords(m,v);return T===(null==(g=K.offset)?void 0:g.placement)&&null!=(x=K.arrow)&&x.alignmentOffset?{}:{x:k+et.x,y:E+et.y,data:{...et,placement:T}}}});return{name:x.name,fn:x.fn,options:[m,g]}},floating_ui_react_dom_shift=(m,g)=>{var v;let x=(void 0===(v=m)&&(v={}),{name:"shift",options:v,async fn(m){let{x:g,y:x,placement:k,platform:E}=m,{mainAxis:et=!0,crossAxis:en=!1,limiter:er={fn:m=>{let{x:g,y:v}=m;return{x:g,y:v}}},...ei}=floating_ui_utils_evaluate(v,m),es={x:g,y:x},el=await E.detectOverflow(m,ei),ec=floating_ui_utils_getSideAxis(floating_ui_utils_getSide(k)),eu=getOppositeAxis(ec),ed=es[eu],ep=es[ec];if(et){let m=ed+el["y"===eu?"top":"left"],g=ed-el["y"===eu?"bottom":"right"];ed=K(m,T(ed,g))}if(en){let m="y"===ec?"top":"left",g="y"===ec?"bottom":"right",v=ep+el[m],x=ep-el[g];ep=K(v,T(ep,x))}let em=er.fn({...m,[eu]:ed,[ec]:ep});return{...em,data:{x:em.x-g,y:em.y-x,enabled:{[eu]:et,[ec]:en}}}}});return{name:x.name,fn:x.fn,options:[m,g]}},floating_ui_react_dom_limitShift=(m,g)=>{var v;let x=(void 0===(v=m)&&(v={}),{options:v,fn(m){let{x:g,y:x,placement:k,rects:E,middlewareData:T}=m,{offset:K=0,mainAxis:et=!0,crossAxis:en=!0}=floating_ui_utils_evaluate(v,m),er={x:g,y:x},ei=floating_ui_utils_getSideAxis(k),es=getOppositeAxis(ei),el=er[es],ec=er[ei],ed=floating_ui_utils_evaluate(K,m),ep="number"==typeof ed?{mainAxis:ed,crossAxis:0}:{mainAxis:0,crossAxis:0,...ed};if(et){let m="y"===es?"height":"width",g=E.reference[es]-E.floating[m]+ep.mainAxis,v=E.reference[es]+E.reference[m]-ep.mainAxis;el<g?el=g:el>v&&(el=v)}if(en){var em,ef;let m="y"===es?"width":"height",g=eu.has(floating_ui_utils_getSide(k)),v=E.reference[ei]-E.floating[m]+(g&&(null==(em=T.offset)?void 0:em[ei])||0)+(g?0:ep.crossAxis),x=E.reference[ei]+E.reference[m]+(g?0:(null==(ef=T.offset)?void 0:ef[ei])||0)-(g?ep.crossAxis:0);ec<v?ec=v:ec>x&&(ec=x)}return{[es]:el,[ei]:ec}}});return{fn:x.fn,options:[m,g]}},floating_ui_react_dom_flip=(m,g)=>{var v;let x=(void 0===(v=m)&&(v={}),{name:"flip",options:v,async fn(m){var g,x,k,E,T;let{placement:K,middlewareData:et,rects:en,initialPlacement:er,platform:eu,elements:ed}=m,{mainAxis:ep=!0,crossAxis:em=!0,fallbackPlacements:ef,fallbackStrategy:eh="bestFit",fallbackAxisSideDirection:eg="none",flipAlignment:ev=!0,...ey}=floating_ui_utils_evaluate(v,m);if(null!=(g=et.arrow)&&g.alignmentOffset)return{};let eb=floating_ui_utils_getSide(K),ex=floating_ui_utils_getSideAxis(er),e_=floating_ui_utils_getSide(er)===er,ew=await (null==eu.isRTL?void 0:eu.isRTL(ed.floating)),eS=ef||(e_||!ev?[getOppositePlacement(er)]:function(m){let g=getOpp
46ositePlacement(m);return[floating_ui_utils_getOppositeAlignmentPlacement(m),g,floating_ui_utils_getOppositeAlignmentPlacement(g)]}(er)),eC="none"!==eg;!ef&&eC&&eS.push(...function(m,g,v,x){let k=floating_ui_utils_getAlignment(m),E=function(m,g,v){switch(m){case"top":case"bottom":if(v)return g?es:ei;return g?ei:es;case"left":case"right":return g?el:ec;default:return[]}}(floating_ui_utils_getSide(m),"start"===v,x);return k&&(E=E.map(m=>m+"-"+k),g&&(E=E.concat(E.map(floating_ui_utils_getOppositeAlignmentPlacement)))),E}(er,ev,eg,ew));let ek=[er,...eS],eE=await eu.detectOverflow(m,ey),ej=[],eN=(null==(x=et.flip)?void 0:x.overflows)||[];if(ep&&ej.push(eE[eb]),em){let m=function(m,g,v){void 0===v&&(v=!1);let x=floating_ui_utils_getAlignment(m),k=getOppositeAxis(floating_ui_utils_getSideAxis(m)),E=getAxisLength(k),T="x"===k?x===(v?"end":"start")?"right":"left":"start"===x?"bottom":"top";return g.reference[E]>g.floating[E]&&(T=getOppositePlacement(T)),[T,getOppositePlacement(T)]}(K,en,ew);ej.push(eE[m[0]],eE[m[1]])}if(eN=[...eN,{placement:K,overflows:ej}],!ej.every(m=>m<=0)){let m=((null==(k=et.flip)?void 0:k.index)||0)+1,g=ek[m];if(g){let v="alignment"===em&&ex!==floating_ui_utils_getSideAxis(g);if(!v||eN.every(m=>floating_ui_utils_getSideAxis(m.placement)!==ex||m.overflows[0]>0))return{data:{index:m,overflows:eN},reset:{placement:g}}}let v=null==(E=eN.filter(m=>m.overflows[0]<=0).sort((m,g)=>m.overflows[1]-g.overflows[1])[0])?void 0:E.placement;if(!v)switch(eh){case"bestFit":{let m=null==(T=eN.filter(m=>{if(eC){let g=floating_ui_utils_getSideAxis(m.placement);return g===ex||"y"===g}return!0}).map(m=>[m.placement,m.overflows.filter(m=>m>0).reduce((m,g)=>m+g,0)]).sort((m,g)=>m[1]-g[1])[0])?void 0:T[0];m&&(v=m);break}case"initialPlacement":v=er}if(K!==v)return{reset:{placement:v}}}return{}}});return{name:x.name,fn:x.fn,options:[m,g]}},floating_ui_react_dom_size=(m,g)=>{var v;let x=(void 0===(v=m)&&(v={}),{name:"size",options:v,async fn(m){var g,x;let k,E;let{placement:et,rects:en,platform:er,elements:ei}=m,{apply:es=()=>{},...el}=floating_ui_utils_evaluate(v,m),ec=await er.detectOverflow(m,el),eu=floating_ui_utils_getSide(et),ed=floating_ui_utils_getAlignment(et),ep="y"===floating_ui_utils_getSideAxis(et),{width:em,height:ef}=en.floating;"top"===eu||"bottom"===eu?(k=eu,E=ed===(await (null==er.isRTL?void 0:er.isRTL(ei.floating))?"start":"end")?"left":"right"):(E=eu,k="end"===ed?"top":"bottom");let eh=ef-ec.top-ec.bottom,eg=em-ec.left-ec.right,ev=T(ef-ec[k],eh),ey=T(em-ec[E],eg),eb=!m.middlewareData.shift,ex=ev,e_=ey;if(null!=(g=m.middlewareData.shift)&&g.enabled.x&&(e_=eg),null!=(x=m.middlewareData.shift)&&x.enabled.y&&(ex=eh),eb&&!ed){let m=K(ec.left,0),g=K(ec.right,0),v=K(ec.top,0),x=K(ec.bottom,0);ep?e_=em-2*(0!==m||0!==g?m+g:K(ec.left,ec.right)):ex=ef-2*(0!==v||0!==x?v+x:K(ec.top,ec.bottom))}await es({...m,availableWidth:e_,availableHeight:ex});let ew=await er.getDimensions(ei.floating);return em!==ew.width||ef!==ew.height?{reset:{rects:!0}}:{}}});return{name:x.name,fn:x.fn,options:[m,g]}},floating_ui_react_dom_hide=(m,g)=>{var v;let x=(void 0===(v=m)&&(v={}),{name:"hide",options:v,async fn(m){let{rects:g,platform:x}=m,{strategy:k="referenceHidden",...E}=floating_ui_utils_evaluate(v,m);switch(k){case"referenceHidden":{let v=await x.detectOverflow(m,{...E,elementContext:"reference"}),k=getSideOffsets(v,g.reference);return{data:{referenceHiddenOffsets:k,referenceHidden:isAnySideFullyClipped(k)}}}case"escaped":{let v=await x.detectOverflow(m,{...E,altBoundary:!0}),k=getSideOffsets(v,g.floating);return{data:{escapedOffsets:k,escaped:isAnySideFullyClipped(k)}}}default:return{}}}});return{name:x.name,fn:x.fn,options:[m,g]}},floating_ui_react_dom_arrow=(m,g)=>{let v=arrow$1(m);return{name:v.name,fn:v.fn,options:[m,g]}};var ev=v(62656),ey=v(92211),eb=v(72714),ex=v(27757),e_=v(61644),ew=v(35019),eS=v(52322),eC=Object.defineProperty,__name=(m,g)=>eC(m,"name",{value:g,configurable:!0}),ek="Popper",[eE,ej]=(0,ey.b)(ek),[eN,eR]=eE(ek),eI=__name(m=>{let{__scopePopper:g,children:v}=m,[x,E]=k.useState(null),[T,K]=k.useState(void 0);return(0,eS.jsx)(eN,{scope:g,anchor:x,onAnchorChange:E,placementState:T,setPlacementState:K,children:v})},"Popper"),eP=k.forwardRef(__name(function(m,g){let{__scopePopper:v,virtualRef:x,...E}=m,T=eR("PopperAnchor",v),K=k.useRef(null),et=T.onAnchorChange,en=k.useCallback(m=>{K.current=m,m&&et(m)},[et]),er=(0,ev.e)(g,en),ei=k.useRef(null);k.useEffect(()=>{if(!x)return;let m=ei.current;ei.current=x.current,m!==ei.current&&et(ei.current)});let es=T.placementState&&getSideAndAlignFromPlacement(T.placementState),el=es?.[0],ec=es?.[1];return x?null:(0,eS.jsx)(eb.WV.div,{"data-radix-popper-side":el,"data-radix-popper-align":ec,...E,ref:er})},"PopperAnchor")),eT="PopperContent",[eO,eA]=eE(eT),eM=k.forwardRef(__name(function(m,g){let{__scopePopper:v,side:x="bottom",sideOffset:E=0,align:et="center",alignOffset:er=0,arrowPadding:ei=0,avoidCollisions:es=!0,collisionBoundary:el=[],collisionPadding:ec=0,sticky:eu="partial",hideWhenDetached:ed=!1,updatePositionStrategy:ep="optimized",onPlaced:em,...ef}=m,ey=eR(eT,v),[eC,ek]=k.useState(null),eE=(0,ev.e)(g,ek),[ej,eN]=k.useState(null),eI=(0,ew.t)(ej),eP=eI?.width??0,eA=eI?.height??0,eM="number"==typeof ec?ec:{top:0,right:0,bottom:0,left:0,...ec},eL=Array.isArray(el)?el:[el],eF=eL.length>0,eZ={padding:eM,boundary:eL.filter(isNotNull),altBoundary:eF},{refs:eB,floatingStyles:e$,placement:eU,isPositioned:ez,middlewareData:eV}=function(m){void 0===m&&(m={});let{placement:g="bottom",strategy:v="absolute",middleware:x=[],platform:E,elements:{reference:T,floating:K}={},transform:et=!0,whileElementsMounted:en,open:er}=m,[ei,es]=k.useState({x:0,y:0,strategy:v,placement:g,middlewareData:{},isPositioned:!1}),[el,ec]=k.useState(x);deepEqual(el,x)||ec(x);let[eu,ed]=k.useState(null),[ep,em]=k.useState(null),ef=k.useCallback(m=>{m!==ex.current&&(ex.current=m,ed(m))},[]),ev=k.useCallback(m=>{m!==e_.current&&(e_.current=m,em(m))},[]),ey=T||eu,eb=K||ep,ex=k.useRef(null),e_=k.useRef(null),ew=k.useRef(ei),eS=null!=en,eC=useLatestRef(en),ek=useLatestRef(E),eE=useLatestRef(er),ej=k.useCallback(()=>
46{if(!ex.current||!e_.current)return;let m={placement:g,strategy:v,middleware:el};ek.current&&(m.platform=ek.current),floating_ui_dom_computePosition(ex.current,e_.current,m).then(m=>{let g={...m,isPositioned:!1!==eE.current};eN.current&&!deepEqual(ew.current,g)&&(ew.current=g,eh.flushSync(()=>{es(g)}))})},[el,g,v,ek,eE]);eg(()=>{!1===er&&ew.current.isPositioned&&(ew.current.isPositioned=!1,es(m=>({...m,isPositioned:!1})))},[er]);let eN=k.useRef(!1);eg(()=>(eN.current=!0,()=>{eN.current=!1}),[]),eg(()=>{if(ey&&(ex.current=ey),eb&&(e_.current=eb),ey&&eb){if(eC.current)return eC.current(ey,eb,ej);ej()}},[ey,eb,ej,eC,eS]);let eR=k.useMemo(()=>({reference:ex,floating:e_,setReference:ef,setFloating:ev}),[ef,ev]),eI=k.useMemo(()=>({reference:ey,floating:eb}),[ey,eb]),eP=k.useMemo(()=>{let m={position:v,left:0,top:0};if(!eI.floating)return m;let g=roundByDPR(eI.floating,ei.x),x=roundByDPR(eI.floating,ei.y);return et?{...m,transform:"translate("+g+"px, "+x+"px)",...getDPR(eI.floating)>=1.5&&{willChange:"transform"}}:{position:v,left:g,top:x}},[v,et,eI.floating,ei.x,ei.y]);return k.useMemo(()=>({...ei,update:ej,refs:eR,elements:eI,floatingStyles:eP}),[ei,ej,eR,eI,eP])}({strategy:"fixed",placement:x+("center"!==et?"-"+et:""),whileElementsMounted:__name((...m)=>{let g=function(m,g,v,x){let k;void 0===x&&(x={});let{ancestorScroll:E=!0,ancestorResize:et=!0,elementResize:er="function"==typeof ResizeObserver,layoutShift:ei="function"==typeof IntersectionObserver,animationFrame:es=!1}=x,el=unwrapElement(m),ec=E||et?[...el?getOverflowAncestors(el):[],...g?getOverflowAncestors(g):[]]:[];ec.forEach(m=>{E&&m.addEventListener("scroll",v,{passive:!0}),et&&m.addEventListener("resize",v)});let eu=el&&ei?function(m,g){let v,x=null,k=getDocumentElement(m);function cleanup(){var m;
46clearTimeout(v),null==(m=x)||m.disconnect(),x=null}return function refresh(E,et){void 0===E&&(E=!1),void 0===et&&(et=1),cleanup();let er=m.getBoundingClientRect(),{left:ei,top:es,width:el,height:ec}=er;if(E||g(),!el||!ec)return;let eu=en(es),ed=en(k.clientWidth-(ei+el)),ep=en(k.clientHeight-(es+ec)),em=en(ei),ef={rootMargin:-eu+"px "+-ed+"px "+-ep+"px "+-em+"px",threshold:K(0,T(1,et))||1},eh=!0;function handleObserve(g){let x=g[0].intersectionRatio;if(x!==et){if(!eh)return refresh();x?refresh(!1,x):v=setTimeout(()=>{refresh(!1,1e-7)},1e3)}1!==x||rectsAreEqual(er,m.getBoundingClientRect())||refresh(),eh=!1}try{x=new IntersectionObserver(handleObserve,{...ef,root:k.ownerDocument})}catch(m){x=new IntersectionObserver(handleObserve,ef)}x.observe(m)}(!0),cleanup}(el,v):null,ed=-1,ep=null;er&&(ep=new ResizeObserver(m=>{let[x]=m;x&&x.target===el&&ep&&g&&(ep.unobserve(g),cancelAnimationFrame(ed),ed=requestAnimationFrame(()=>{var m;null==(m=ep)||m.observe(g)})),v()}),el&&!es&&ep.observe(el),g&&ep.observe(g));let em=es?getBoundingClientRect(m):null;return es&&function frameLoop(){let g=getBoundingClientRect(m);em&&!rectsAreEqual(em,g)&&v(),em=g,k=requestAnimationFrame(frameLoop)}(),v(),()=>{var m;ec.forEach(m=>{E&&m.removeEventListener("scroll",v),et&&m.removeEventListener("resize",v)}),null==eu||eu(),null==(m=ep)||m.disconnect(),ep=null,es&&cancelAnimationFrame(k)}}(...m,{animationFrame:"always"===ep});return g},"whileElementsMounted"),elements:{reference:ey.anchor},middleware:[floating_ui_react_dom_offset({mainAxis:E+eA,alignmentAxis:er}),es&&floating_ui_react_dom_shift({mainAxis:!0,crossAxis:!1,limiter:"partial"===eu?floating_ui_react_dom_limitShift():void 0,...eZ}),es&&floating_ui_react_dom_flip({...eZ}),floating_ui_react_dom_size({...eZ,apply:__name(({elements:m,rects:g,availableWidth:v,availableHeight:x})=>{let{width:k,height:E}=g.reference,T=m.floating.style;T.setProperty("--radix-popper-available-width",`${v}px`),T.setProperty("--radix-popper-available-height",`${x}px`),T.setProperty("--radix-popper-anchor-width",`${k}px`),T.setProperty("--radix-popper-anchor-height",`${E}px`)},"apply")}),ej&&floating_ui_react_dom_arrow({element:ej,padding:ei}),eD({arrowWidth:eP,arrowHeight:eA}),ed&&floating_ui_react_dom_hide({strategy:"referenceHidden",...eZ,boundary:eF?eZ.boundary:void 0})]}),eq=ey.setPlacementState;(0,e_.b)(()=>(eq(eU),()=>{eq(void 0)}),[eU,eq]);let[eH,eW]=getSideAndAlignFromPlacement(eU),eK=(0,ex.W)(em);(0,e_.b)(()=>{ez&&eK?.()},[ez,eK]);let eG=eV.arrow?.x,eQ=eV.arrow?.y,eY=eV.arrow?.centerOffset!==0,[eX,eJ]=k.useState();return(0,e_.b)(()=>{eC&&eJ(window.getComputedStyle(eC).zIndex)},[eC]),(0,eS.jsx)("div",{ref:eB.setFloating,"data-radix-popper-content-wrapper":"",style:{...e$,transform:ez?e$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eX,"--radix-popper-transform-origin":[eV.transformOrigin?.x,eV.transformOrigin?.y].join(" "),...eV.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:m.dir,children:(0,eS.jsx)(eO,{scope:v,placedSide:eH,placedAlign:eW,onArrowChange:eN,arrowX:eG,arrowY:eQ,shouldHideArrow:eY,children:(0,eS.jsx)(eb.WV.div,{"data-side":eH,"data-align":eW,...ef,ref:eE,style:{...ef.style,animation:ez?ef.style?.animation:"none"}})})})},"PopperContent"));function isNotNull(m){return null!==m}__name(isNotNull,"isNotNull");var eD=__name(m=>({name:"transformOrigin",options:m,fn(g){let{placement:v,rects:x,middlewareData:k}=g,E=k.arrow?.centerOffset!==0,T=E?0:m.arrowWidth,K=E?0:m.arrowHeight,[et,en]=getSideAndAlignFromPlacement(v),er={start:"0%",center:"50%",end:"100%"}[en],ei=(k.arrow?.x??0)+T/2,es=(k.arrow?.y??0)+K/2,el="",ec="";return"bottom"===et?(el=E?er:`${ei}px`,ec=`${-K}px`):"top"===et?(el=E?er:`${ei}px`,ec=`${x.floating.height+K}px`):"right"===et?(el=`${-K}px`,ec=E?er:`${es}px`):"left"===et&&(el=`${x.floating.width+K}px`,ec=E?er:`${es}px`),{data:{x:el,y:ec}}}}),"transformOrigin");function getSideAndAlignFromPlacement(m){let[g,v="center"]=m.split("-");return[g,v]}__name(getSideAndAlignFromPlacement,"getSideAndAlignFromPlacement");var eL=eI,eF=eP,eZ=eM},78773:function(m,g,v){"use strict";v.d(g,{h:function(){return en}});var x=v(2784),k=v(28316),E=v(72714),T=v(61644),K=v(52322),et=Object.defineProperty,en=x.forwardRef(et(function(m,g){let{c
46ontainer:v,...et}=m,[en,er]=x.useState(!1);(0,T.b)(()=>er(!0),[]);let ei=v||en&&globalThis?.document?.body;return ei?k.createPortal((0,K.jsx)(E.WV.div,{...et,ref:g}),ei):null},"name",{value:"Portal",configurable:!0}))},79616:function(m,g,v){"use strict";v.d(g,{z:function(){return T}});var x=v(2784),k=v(61644),E=Object.defineProperty,__name=(m,g)=>E(m,"name",{value:g,configurable:!0});function useStateMachine(m,g){return x.useReducer((m,v)=>{let x=g[m][v];return x??m},m)}__name(useStateMachine,"useStateMachine");var T=__name(m=>{let{present:g,children:v}=m,k=usePresence(g),E="function"==typeof v?v({present:k.isPresent}):x.Children.only(v),T=useStableComposedRefs(k.ref,getElementRef(E)),K="function"==typeof v;return K||k.isPresent?x.cloneElement(E,{ref:T}):null},"Presence");function usePresence(m){let[g,v]=x.useState(),E=x.useRef(null),T=x.useRef(m),K=x.useRef("none"),et=x.useRef(void 0),en=m?"mounted":"unmounted",[er,ei]=useStateMachine(en,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{"mounted"===er?(K.current=et.current??getAnimationName(E.current),et.current=void 0):K.current="none"},[er]),(0,k.b)(()=>{let g=E.current,v=T.current,x=v!==m;if(x){let x=K.current,k=getAnimationName(g);m?(et.current=k,ei("MOUNT")):"none"===k||g?.display==="none"?ei("UNMOUNT"):v&&x!==k?ei("ANIMATION_OUT"):ei("UNMOUNT"),T.current=m}},[m,ei]),(0,k.b)(()=>{if(g){let m;let v=g.ownerDocument.defaultView??window,x=__name(x=>{let k=getAnimationName(E.current),K=k.includes(CSS.escape(x.animationName));if(x.target===g&&K&&(ei("ANIMATION_END"),!T.current)){let x=g.style.animationFillMode;g.style.animationFillMode="forwards",m=v.setTimeout(()=>{"forwards"===g.style.animationFillMode&&(g.style.animationFillMode=x)})}},"handleAnimationEnd"),k=__name(m=>{m.target===g&&(K.current=getAnimationName(E.current))},"handleAnimationStart");return g.addEventListener("animationstart",k),g.addEventListener("animationcancel",x),g.addEventListener("animationend",x),()=>{v.clearTimeout(m),g.removeEventListener("animationstart",k),g.removeEventListener("animationcancel",x),g.removeEventListener("animationend",x)}}ei("ANIMATION_END")},[g,ei]),{isPresent:["mounted","unmountSuspended"].includes(er),ref:x.useCallback(m=>{if(m){let g=getComputedStyle(m);E.current=g,et.current=getAnimationName(g)}else E.current=null;v(m)},[])}}function setRef(m,g){if("function"==typeof m)return m(g);null!=m&&(m.current=g)}function useStableComposedRefs(...m){let g=x.useRef(m);return g.current=m,x.useCallback(m=>{let v=g.current,x=!1,k=v.map(g=>{let v=setRef(g,m);return x||"function"!=typeof v||(x=!0),v});if(x)return()=>{for(let m=0;m<k.length;m++){let g=k[m];"function"==typeof g?g():setRef(v[m],null)}}},[])}function getAnimationName(m){return m?.animationName||"none"}function getElementRef(m){let g=Object.getOwnPropertyDescriptor(m.props,"ref")?.get,v=g&&"isReactWarning"in g&&g.isReactWarning;return v?m.ref:(v=(g=Object.getOwnPropertyDescriptor(m,"ref")?.get)&&"isReactWarning"in g&&g.isReactWarning)?m.props.ref:m.props.ref||m.ref}__name(usePresence,"usePresence"),__name(setRef,"setRef"),__name(useStableComposedRefs,"useStableComposedRefs"),__name(getAnimationName,"getAnimationName"),__name(getElementRef,"getElementRef")},72714:function(m,g,v){"use strict";v.d(g,{WV:function(){return et},jH:function(){return dispatchDiscreteCustomEvent}});var x=v(2784),k=v(28316),E=v(49815),T=v(52322),K=Object.defineProperty,et=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((m,g)=>{let v=(0,E.Z8)(`Primitive.${g}`),k=x.forwardRef((m,x)=>{let{asChild:k,...E}=m,K=k?v:g;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,T.jsx)(K,{...E,ref:x})});return k.displayName=`Primitive.${g}`,{...m,[g]:k}},{});function dispatchDiscreteCustomEvent(m,g){m&&k.flushSync(()=>m.dispatchEvent(g))}K(dispatchDiscreteCustomEvent,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0})},49815:function(m,g,v){"use strict";v.d(g,{Z8:function(){return createSlot},sA:function(){return createSlottable}});var x,k=v(2784),E=v(62656),T=Object.defineProperty,__name=(m,g)=>T(m,"name",{value:g,configurable:!0});function createSlot(m){let g=k.forwardRef((g,v)=>{let{children:x,...T}=g,K=null,en=!1,el=[];isLazyComponent(x)&&"function"==typeof es&&(x=es(x._payload)),k.Children.forEac
46h(x,m=>{if(isSlottable(m)){en=!0;let g="child"in m.props?m.props.child:m.props.children;isLazyComponent(g)&&"function"==typeof es&&(g=es(g._payload)),K=et(m,g),el.push(K?.props?.children)}else el.push(m)}),K?K=k.cloneElement(K,void 0,el):!en&&1===k.Children.count(x)&&k.isValidElement(x)&&(K=x);let ec=K?getElementRef(K):void 0,eu=(0,E.e)(v,ec);if(!K){if(x||0===x)throw Error(en?ei(m):er(m));return x}let ed=mergeProps(T,K.props??{});return K.type!==k.Fragment&&(ed.ref=v?eu:ec),k.cloneElement(K,ed)});return g.displayName=`${m}.Slot`,g}__name(createSlot,"createSlot");var K=Symbol.for("radix.slottable");function createSlottable(m){let g=__name(m=>"child"in m?m.children(m.child):m.children,"Slottable");return g.displayName=`${m}.Slottable`,g.__radixId=K,g}__name(createSlottable,"createSlottable");var et=__name((m,g)=>{if("child"in m.props){let g=m.props.child;return k.isValidElement(g)?k.cloneElement(g,void 0,m.props.children(g.props.children)):null}return k.isValidElement(g)?g:null},"getSlottableElementFromSlottable");function mergeProps(m,g){let v={...g};for(let x in g){let k=m[x],E=g[x],T=/^on[A-Z]/.test(x);T?k&&E?v[x]=(...m)=>{let g=E(...m);return k(...m),g}:k&&(v[x]=k):"style"===x?v[x]={...k,...E}:"className"===x&&(v[x]=[k,E].filter(Boolean).join(" "))}return{...m,...v}}function getElementRef(m){let g=Object.getOwnPropertyDescriptor(m.props,"ref")?.get,v=g&&"isReactWarning"in g&&g.isReactWarning;return v?m.ref:(v=(g=Object.getOwnPropertyDescriptor(m,"ref")?.get)&&"isReactWarning"in g&&g.isReactWarning)?m.props.ref:m.props.ref||m.ref}function isSlottable(m){return k.isValidElement(m)&&"function"==typeof m.type&&"__radixId"in m.type&&m.type.__radixId===K}__name(mergeProps,"mergeProps"),__name(getElementRef,"getElementRef"),__name(isSlottable,"isSlottable");var en=Symbol.for("react.lazy");function isLazyComponent(m){return null!=m&&"object"==typeof m&&"$$typeof"in m&&m.$$typeof===en&&"_payload"in m&&isPromiseLike(m._payload)}function isPromiseLike(m){return"object"==typeof m&&null!==m&&"then"in m}__name(isLazyComponent,"isLazyComponent"),__name(isPromiseLike,"isPromiseLike");var er=__name(m=>`${m} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),ei=__name(m=>`${m} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),es=(x||(x=v.t(k,2)))[" use ".trim().toString()]},27757:function(m,g,v){"use strict";v.d(g,{W:function(){return useCallbackRef}});var x=v(2784);function useCallbackRef(m){let g=x.useRef(m);return x.useEffect(()=>{g.current=m}),x.useMemo(()=>(...m)=>g.current?.(...m),[])}(0,Object.defineProperty)(useCallbackRef,"name",{value:"useCallbackRef",configurable:!0})},81057:function(m,g,v){"use strict";v.d(g,{T:function(){return useControllableState}});var x=v(2784),k=v.t(x,2),E=v(39933),T=v(61644),K=Object.defineProperty,et=k[" useEffectEvent ".trim().toString()],en=k[" useInsertionEffect ".trim().toString()];function useEffectEvent(m){if("function"==typeof et)return et(m);let g=x.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof en?en(()=>{g.current=m}):(0,T.b)(()=>{g.current=m}),x.useMemo(()=>(...m)=>g.current?.(...m),[])}K(useEffectEvent,"name",{value:"useEffectEvent",configurable:!0});var er=Object.defineProperty,dist_name=(m,g)=>er(m,"name",{value:g,configurable:!0}),ei=k[" useInsertionEffect ".trim().toString()]||T.b;function useControllableState({prop:m,defaultProp:g,onChange:v=dist_name(()=>{},"onChange"),caller:k}
46){let[T,K,et]=useUncontrolledState({defaultProp:g,onChange:v}),en=void 0!==m,er=en?m:T;if(E.v){let g=x.useRef(void 0!==m);x.useEffect(()=>{let m=g.current;if(m!==en){let g=en?"controlled":"uncontrolled";console.warn(`${k} is changing from ${m?"controlled":"uncontrolled"} to ${g}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}g.current=en},[en,k])}let ei=x.useCallback(g=>{if(en){let v=isFunction(g)?g(m):g;v!==m&&et.current?.(v)}else K(g)},[en,m,K,et]);return[er,ei]}function useUncontrolledState({defaultProp:m,onChange:g}){let[v,k]=x.useState(m),E=x.useRef(v),T=x.useRef(g);return ei(()=>{T.current=g},[g]),x.useEffect(()=>{E.current!==v&&(T.current?.(v),E.current=v)},[v,E]),[v,k,T]}function isFunction(m){return"function"==typeof m}dist_name(useControllableState,"useControllableState"),dist_name(useUncontrolledState,"useUncontrolledState"),dist_name(isFunction,"isFunction");var es=Symbol("RADIX:SYNC_STATE");dist_name(function(m,g,v,k){let{prop:T,defaultProp:K,onChange:et,caller:en}=g,er=void 0!==T,ei=useEffectEvent(et);if(E.v){let m=x.useRef(void 0!==T);x.useEffect(()=>{let g=m.current;if(g!==er){let m=er?"controlled":"uncontrolled";console.warn(`${en} is changing from ${g?"controlled":"uncontrolled"} to ${m}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}m.current=er},[er,en])}let el=[{...v,state:K}];k&&el.push(k);let[ec,eu]=x.useReducer((g,v)=>{if(v.type===es)return{...g,state:v.state};let x=m(g,v);return er&&!Object.is(x.state,g.state)&&ei(x.state),x},...el),ed=ec.state,ep=x.useRef(ed);x.useEffect(()=>{ep.current===ed||(ep.current=ed,er||ei(ed))},[ed,ep,er]);let em=x.useMemo(()=>{let m=void 0!==T;return m?{...ec,state:T}:ec},[ec,T]);return x.useEffect(()=>{er&&!Object.is(T,ec.state)&&eu({type:es,state:T})},[T,ec.state,er]),[em,eu]},"useControllableStateReducer")},61644:function(m,g,v){"use strict";v.d(g,{b:function(){return k}});var x=v(2784),k=globalThis?.document?x.useLayoutEffect:()=>{}},35019:function(m,g,v){"use strict";v.d(g,{t:function(){return useSize}});var x=v(2784),k=v(61644);function useSize(m){let[g,v]=x.useState(void 0);return(0,k.b)(()=>{if(m){v({width:m.offsetWidth,height:m.offsetHeight});let g=new ResizeObserver(g=>{let x,k;if(!Array.isArray(g)||!g.length)return;let E=g[0];if("borderBoxSize"in E){let m=E.borderBoxSize,g=Array.isArray(m)?m[0]:m;x=g.inlineSize,k=g.blockSize}else x=m.offsetWidth,k=m.offsetHeight;v({width:x,height:k})});return g.observe(m,{box:"border-box"}),()=>g.unobserve(m)}v(void 0)},[m]),g}(0,Object.defineProperty)(useSize,"name",{value:"useSize",configurable:!0})},89785:function(m,g,v){"use strict";v.d(g,{C2:function(){return K},TX:function(){return et},fC:function(){return en}});var x=v(2784),k=v(72714),E=v(52322),T=Object.defineProperty,K=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),et=x.forwardRef(T(function(m,g){return(0,E.jsx)(k.WV.span,{...m,ref:g,style:{...K,...m.style}})},"name",{value:"VisuallyHidden",configurable:!0})),en=et},62964:function(m,g,v){"use strict";v.d(g,{G:function(){return getAsyncContextStrategy}});var x=v(79751),k=v(34148);let isActualPromise=m=>m instanceof Promise&&!m[E],E=Symbol("chained PromiseLike"),chainAndCopyPromiseLike=(m,g,v)=>{let x=m.then(m=>(g(m),m),m=>{throw v(m),m});return isActualPromise(x)&&isActualPromise(m)?x:copyProps(m,x)},copyProps=(m,g)=>{if(!g)return m;let v=!1;for(let x in m){if(x in g)continue;v=!0;let k=m[x];"function"==typeof k?Object.defineProperty(g,x,{value:(...g)=>k.apply(m,g),enumerable:!0,configurable:!0,writable:!0}):g[x]=k}return v&&Object.assign(g,{[E]:!0}),g};var T=v(11750);let AsyncContextStack=class AsyncContextStack{constructor(m,g){let v,x;v=m||new k.s,x=g||new k.s,this._stack=[{scope:v}],this._isolationScope=x}withScope(m){let g;let v=this._pushScope();try{g=m(v)}catch(m){throw this._popScope(),m}return(0,T.J8)(g)?chainAndCopyPromiseLike(g,()=>this._popScope(),()=>this._popScope()):(this._popScope(),g)}
46getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let m=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:m}),m}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}};function getAsyncContextStack(){let m=(0,x.cu)(),g=(0,x.qA)(m);return g.stack=g.stack||new AsyncContextStack((0,x.YO)("defaultCurrentScope",()=>new k.s),(0,x.YO)("defaultIsolationScope",()=>new k.s))}function withScope(m){return getAsyncContextStack().withScope(m)}function withSetScope(m,g){let v=getAsyncContextStack();return v.withScope(()=>(v.getStackTop().scope=m,g(m)))}function withIsolationScope(m){return getAsyncContextStack().withScope(()=>m(getAsyncContextStack().getIsolationScope()))}function getAsyncContextStrategy(m){let g=(0,x.qA)(m);return g.acs?g.acs:{withIsolationScope,withScope,withSetScope,withSetIsolationScope:(m,g)=>withIsolationScope(g),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}},79751:function(m,g,v){"use strict";v.d(g,{YO:function(){return getGlobalSingleton},cu:function(){return getMainCarrier},qA:function(){return getSentryCarrier}});var x=v(70385),k=v(81880);function getMainCarrier(){return getSentryCarrier(k.GLOBAL_OBJ),k.GLOBAL_OBJ}function getSentryCarrier(m){let g=m.__SENTRY__=m.__SENTRY__||{};return g.version=g.version||x.J,g[x.J]=g[x.J]||{}}function getGlobalSingleton(m,g,v=k.GLOBAL_OBJ){let E=v.__SENTRY__=v.__SENTRY__||{},T=E[x.J]=E[x.J]||{};return T[m]||(T[m]=g())}},42219:function(m,g,v){"use strict";v.d(g,{J:function(){return x}});let x="production"},41690:function(m,g,v){"use strict";let x;v.d(g,{$e:function(){return withScope},XX:function(){return getTraceContextFromScope},aF:function(){return getIsolationScope},fU:function(){return hasExternalPropagationContext},lW:function(){return getGlobalScope},nZ:function(){return getCurrentScope},s3:function(){return getClient}});
46var k=v(62964),E=v(79751),T=v(34148),K=v(95024);function hasExternalPropagationContext(){return void 0!==x}function getCurrentScope(){let m=(0,E.cu)(),g=(0,k.G)(m);return g.getCurrentScope()}function getIsolationScope(){let m=(0,E.cu)(),g=(0,k.G)(m);return g.getIsolationScope()}function getGlobalScope(){return(0,E.YO)("globalScope",()=>new T.s)}function withScope(...m){let g=(0,E.cu)(),v=(0,k.G)(g);if(2===m.length){let[g,x]=m;return g?v.withSetScope(g,x):v.withScope(x)}return v.withScope(m[0])}function getClient(){return getCurrentScope().getClient()}function getTraceContextFromScope(m){let g=x?.();if(g)return{trace_id:g.traceId,span_id:g.spanId};let v=m.getPropagationContext(),{traceId:k,parentSpanId:E,propagationSpanId:T}=v,et={trace_id:k,span_id:T||(0,K.M)()};return E&&(et.parent_span_id=E),et}},61662:function(m,g,v){"use strict";v.d(g,{X:function(){return x}});let x=!1},86239:function(m,g,v){"use strict";v.d(g,{Qy:function(){return addEventProcessor},Tb:function(){return captureException},_k:function(){return isEnabled},av:function(){return setUser},cg:function(){return captureSession},eN:function(){return captureEvent},v:function(){return setContext},yj:function(){return startSession},yl:function(){return flush}});var x=v(41690),k=v(61662),E=v(79681),T=v(86651),K=v(21068),et=v(20617),en=v(81880);function captureException(m,g){return(0,x.nZ)().captureException(m,(0,K.U0)(g))}function captureEvent(m,g){return(0,x.nZ)().captureEvent(m,g)}function setContext(m,g){(0,x.aF)().setContext(m,g)}function setUser(m){(0,x.aF)().setUser(m)}async function flush(m){let g=(0,x.s3)();return g?g.flush(m):(k.X&&T.fF.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}function isEnabled(){let m=(0,x.s3)();return m?.getOptions().enabled!==!1&&!!m?.getTransport()}function addEventProcessor(m){(0,x.aF)().addEventProcessor(m)}function startSession(m){let g=(0,x.aF)(),{user:v}=(0,et.ZM)(g,(0,x.nZ)()),{userAgent:k}=en.GLOBAL_OBJ.navigator||{},T=(0,E.Hv)({user:v,...k&&{userAgent:k},...m}),K=g.getSession();return K?.status==="ok"&&(0,E.CT)(K,{status:"exited"}),endSession(),g.setSession(T),T}function endSession(){let m=(0,x.aF)(),g=(0,x.nZ)(),v=g.getSession()||m.getSession();v&&(0,E.RJ)(v),_sendSessionUpdate(),m.setSession()}function _sendSessionUpdate(){let m=(0,x.aF)(),g=(0,x.s3)(),v=m.getSession();v&&g&&g.captureSession(v)}function captureSession(m=!1){if(m){endSession();return}_sendSessionUpdate()}},34148:function(m,g,v){"use strict";v.d(g,{s:function(){return Scope}});var x=v(61662),k=v(79681),E=v(86651),T=v(11750),K=v(34276),et=v(87279),en=v(95024),er=v(36882),ei=v(13201),es=v(36953),el=v(64150);let Scope=class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:(0,en.H)(),sampleRand:(0,er.n0)()}}clone(){let m=new Scope;return m._breadcrumbs=[...this._breadcrumbs],m._tags={...this._tags},m._attributes={...this._attributes},m._extra={...this._extra},m._contexts={...this._contexts},this._contexts.flags&&(m._contexts.flags={values:[...this._contexts.flags.values]}),m._user=this._user,m._level=this._level,m._session=this._session,m._transactionName=this._transactionName,m._fingerprint=this._fingerprint,m._eventProcessors=[...this._eventProcessors],m._attachments=[...this._attachments],m._sdkProcessingMetadata={...this._sdkProcessingMetadata},m._propagationContext={...this._propagationContext},m._client=this._client,m._lastEventId=this._lastEventId,m._conversationId=this._conversationId,(0,ei.D)(m,(0,ei.Y)(this)),m}setClient(m){this._client=m}setLastEventId(m){this._lastEventId=m}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(m){this._scopeListeners.push(m)}addEventProcessor(m){return this._eventProcessors.push(m),this}setUser(m){return this._user=m||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&(0,k.CT)(this._session,{user:m}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(m){return this._conversationId=m||void 0,this._notifyScopeListeners(),this}setTags(m){return this._tags={...this._tags,...m},this._notifyScopeListeners(),this}setTag(m,g){return this.setTags({[m]:g})}setAttributes(m){return this._attributes={...this._attributes,...m},this._notifyScopeListeners(),this}setAttribute(m,g){return this.setAttributes({[m]:g})}removeAttribute(m){return m in this._attributes&&(delete this._attributes[m],this._notifyScopeListeners()),this}setExtras(m){return this._extra={...this._extra,...m},this._notifyScopeListeners(),this}setExtra(m,g){return this._extra={...this._extra,[m]:g},this._notifyScopeListeners(),this}setFingerprint(m){return this._fingerprint=m,this._notifyScopeListeners(),this}setLevel(m){return this._level=m,this._notifyScopeListeners(),this}setTransactionName(m){return this._transactionName=m,this._notifyScopeListeners(),this}setContext(m,g){return null===g?delete this._contexts[m]:this._contexts[m]=g,this._notifyScopeListeners(),this}setSession(m){return m?this._session=m:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(m){if(!m)return this;let g="function"==typeof m?m(this):m,v=g instanceof Scope?g.getScopeData():(0,T.PO)(g)?m:void 0,{tags:x,attributes:k,extra:E,user:K,contexts:et,level:en,fingerprint:er=[],propagationContext:ei,conversationId:es}=v||{};return this._tags={...this._tags,...x},this._attributes={...this._attributes,...k},this._extra={...this._extra,...E},this._contexts={...this._contexts,...et},K&&Object.keys(K).length&&(this._user=K),en&&(this._level=en),er.length&&(this._fingerprint=er),ei&&(this._propagationContext=ei),es&&(this._conversationId=es),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,(0,ei.D)(this,void 0),this._attachments=[],this.setPropagationContext({traceId:(0,en.H)(),sampleRand:(0,er.n0)()}),this._notifyScopeListeners(),this}addBreadcrumb(m,g){let v="number"==typeof g?g:100;if(v<=0)return this;let x={timestamp:(0,el.yW)(),...m,message:m.message?(0,es.$G)(m.message,2048):m.message};return this._breadcrumbs.push(x),this._breadcrumbs.length>v&&(this._breadcrumbs=this._breadcrumbs.slice(-v),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(m){return this._attachments.push(m),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:(0,ei.Y)(this),conversationId:this._conversationId}}setSDKProcessingMetadata(m){return this._sdkProcessingMetadata=(0,K.T)(this._sdkProcessingMetadata,m,2),this}setPropagationContext(m){return this._propagationContext=m,this}getPropagationContext(){return this._propagationContext}
46captureException(m,g){let v=g?.event_id||(0,et.DM)();if(!this._client)return x.X&&E.fF.warn("No client configured on scope - will not capture exception!"),v;let k=Error("Sentry syntheticException");return this._client.captureException(m,{originalException:m,syntheticException:k,...g,event_id:v},this),v}captureMessage(m,g,v){let k=v?.event_id||(0,et.DM)();if(!this._client)return x.X&&E.fF.warn("No client configured on scope - will not capture message!"),k;let T=v?.syntheticException??Error(m);return this._client.captureMessage(m,g,{originalException:m,syntheticException:T,...v,event_id:k},this),k}captureEvent(m,g){let v=m.event_id||g?.event_id||(0,et.DM)();return this._client?this._client.captureEvent(m,{...g,event_id:v},this):x.X&&E.fF.warn("No client configured on scope - will not capture event!"),v}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(m=>{m(this)}),this._notifyingListeners=!1)}}},45535:function(m,g,v){"use strict";v.d(g,{$J:function(){return T},Ap:function(){return ed},E1:function(){return er},JQ:function(){return ec},S3:function(){return K},TE:function(){return k},Wb:function(){return ei},Zj:function(){return x},iT:function(){return E},ju:function(){return en},lH:function(){return eu},p6:function(){return el},x0:function(){return et},xF:function(){return es}});let x="sentry.source",k="sentry.sample_rate",E="sentry.previous_trace_sample_rate",T="sentry.op",K="sentry.origin",et="sentry.status.message",en="sentry.idle_span_finish_reason",er="sentry.measurement_unit",ei="sentry.measurement_value",es="sentry.custom_span_name",el="sentry.profile_id",ec="sentry.exclusive_time",eu="sentry.link.type",ed="gen_ai.conversation.id"},79681:function(m,g,v){"use strict";v.d(g,{CT:function(){return updateSession},Hv:function(){return makeSession},RJ:function(){return closeSession}});var x=v(87279),k=v(64150);function makeSession(m){let g=(0,k.ph)(),v={sid:(0,x.DM)(),init:!0,timestamp:g,started:g,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>({sid:`${v.sid}`,init:v.init,started:new Date(1e3*v.started).toISOString(),timestamp:new Date(1e3*v.timestamp).toISOString(),status:v.status,errors:v.errors,did:"number"==typeof v.did||"string"==typeof v.did?`${v.did}`:void 0,duration:v.duration,abnormal_mechanism:v.abnormal_mechanism,attrs:{release:v.release,environment:v.environment,ip_address:v.ipAddress,user_agent:v.userAgent}})};return m&&updateSession(v,m),v}function updateSession(m,g={}){if(!g.user||(!m.ipAddress&&g.user.ip_address&&(m.ipAddress=g.user.ip_address),m.did||g.did||(m.did=g.user.id||g.user.email||g.user.username)),m.timestamp=g.timestamp||(0,k.ph)(),g.abnormal_mechanism&&(m.abnormal_mechanism=g.abnormal_mechanism),g.ignoreDuration&&(m.ignoreDuration=g.ignoreDuration),g.sid&&(m.sid=32===g.sid.length?g.sid:(0,x.DM)()),void 0!==g.init&&(m.init=g.init),!m.did&&g.did&&(m.did=`${g.did}`),"number"==typeof g.started&&(m.started=g.started),m.ignoreDuration)m.duration=void 0;else if("number"==typeof g.duration)m.duration=g.duration;else{let g=m.timestamp-m.started;m.duration=g>=0?g:0}g.release&&(m.release=g.release),g.environment&&(m.environment=g.environment),!m.ipAddress&&g.ipAddress&&(m.ipAddress=g.ipAddress),!m.userAgent&&g.userAgent&&(m.userAgent=g.userAgent),"number"==typeof g.errors&&(m.errors=g.errors),g.status&&(m.status=g.status)}function closeSession(m,g){let v={};g?v={status:g}:"ok"===m.status&&(v={status:"exited"}),updateSession(m,v)}},6262:function(m,g,v){"use strict";v.d(g,{CG:function(){return getDynamicSamplingContextFromScope},Lh:function(){return freezeDscOnSpan},jC:function(){return getDynamicSamplingContextFromSpan}});var x=v(42219),k=v(41690),E=v(45535),T=v(61874),K=v(63197),et=v(21990),en=v(70524),er=v(66603),ei=v(64751),es=v(21458);let el="_frozenDsc";function freezeDscOnSpan(m,g){(0,en.xp)(m,el,g)}function getDynamicSamplingContextFromClient(m,g){let v=g.getOptions(),{publicKey:k}=g.getDsn()||{},E={environment:v.environment||x.J,release:v.release,public_key:k,trace_id:m,org_id:(0,K.du)(g)};return g.emit("createDsc",E),E}function getDynamicSamplingContextFromScope(m,g){let v=g.getPropagationContext();return v.dsc||getDynamicSamplingContextFromClient(v.traceId,m)}function getDynamicSamplingContextFromSpan(m){let g=(0,k.s3)();if(!g)return{};let v=(0,er.Gx)(m),x=(0,er.XU)(v),K=x.data,en=v.spanContext().traceState,ec=en?.get("sentry.sample_rate")??K[E.TE]??K[E.iT];
46function applyLocalSampleRateToDsc(m){return("number"==typeof ec||"string"==typeof ec)&&(m.sample_rate=`${ec}`),m}let eu=v[el];if(eu)return applyLocalSampleRateToDsc(eu);let ed=(0,ei.Z)(v),ep=ed&&"ignored"===v.dropReason;if(ed&&(!(0,et.f)(g.getOptions())||ep)){let m=(0,es.I1)(v).scope;if(m){let v={...getDynamicSamplingContextFromScope(g,m)};return ep&&(v.sampled="false"),applyLocalSampleRateToDsc(v)}}let em=en?.get("sentry.dsc"),ef=em&&(0,T.EN)(em);if(ef)return applyLocalSampleRateToDsc(ef);let eh=getDynamicSamplingContextFromClient(m.spanContext().traceId,g),eg=K[E.Zj]??K["sentry.segment.name.source"],ev=x.description;return"url"!==eg&&ev&&(eh.transaction=ev),(0,et.f)()&&(eh.sampled=String((0,er.Tt)(v)),eh.sample_rand=en?.get("sentry.sample_rand")??es.I1(v).scope?.getPropagationContext().sampleRand.toString()),applyLocalSampleRateToDsc(eh),g.emit("createDsc",eh,v),eh}},64751:function(m,g,v){"use strict";v.d(g,{Z:function(){return spanIsNonRecordingSpan},b:function(){return SentryNonRecordingSpan}});var x=v(70524),k=v(95024),E=v(66603);let T=Symbol.for("sentry.nonRecordingSpan");let SentryNonRecordingSpan=class SentryNonRecordingSpan{constructor(m={}){this._traceId=m.traceId||(0,k.H)(),this._spanId=m.spanId||(0,k.M)(),this.dropReason=m.dropReason,(0,x.xp)(this,T,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:E.ve}}end(m){}setAttribute(m,g){return this}setAttributes(m){return this}setStatus(m){return this}updateName(m){return this}isRecording(){return!1}addEvent(m,g,v){return this}addLink(m){return this}addLinks(m){return this}recordException(m,g){}};function spanIsNonRecordingSpan(m){return!!m&&!0===m[T]}},48485:function(m,g,v){"use strict";v.d(g,{OP:function(){return k},Q0:function(){return setHttpStatus},jt:function(){return E},pq:function(){return x}});let x=0,k=1,E=2;function setHttpStatus(m,g){m.setAttribute("http.response.status_code",g);let v=function(m){if(m<400&&m>=100)return{code:k};if(m>=400&&m<500)switch(m){case 401:return{code:E,message:"unauthenticated"};case 403:return{code:E,message:"permission_denied"};case 404:return{code:E,message:"not_found"};case 409:return{code:E,message:"already_exists"};case 413:return{code:E,message:"failed_precondition"};case 429:return{code:E,message:"resource_exhausted"};case 499:return{code:E,message:"cancelled"};default:return{code:E,message:"invalid_argument"}}if(m>=500&&m<600)switch(m){case 501:return{code:E,message:"unimplemented"};case 503:return{code:E,message:"unavailable"};case 504:return{code:E,message:"deadline_exceeded"}}return{code:E,message:"internal_error"}}(g);"unknown_error"!==v.message&&m.setStatus(v)}},21458:function(m,g,v){"use strict";v.d(g,{I1:function(){return getCapturedScopesOnSpan},Tx:function(){return spanIsTracerProviderSpan},YJ:function(){return setCapturedScopesOnSpan},Yi:function(){return spanShouldInferOtelSource},qN:function(){return markSpanSourceAsExplicit}});var x=v(70524),k=v(66209);let E="_sentryScope",T="_sentryIsolationScope",K=Symbol.for("sentry.otelSourceInference"),et=Symbol.for("sentry.otelSourceExplicitlySet"),en=Symbol.for("sentry.tracerProviderSpan");function setCapturedScopesOnSpan(m,g,v){m&&((0,x.xp)(m,T,(0,k.r)(v)),(0,x.xp)(m,E,g))}function getCapturedScopesOnSpan(m){return{scope:m[E],isolationScope:(0,k.$)(m[T])}}function spanShouldInferOtelSource(m){return!0===m[K]}function markSpanSourceAsExplicit(m){(0,x.xp)(m,et,!0)}function spanIsTracerProviderSpan(m){return!0===m[en]}},61874:function(m,g,v){"use strict";v.d(g,{EN:function(){return baggageHeaderToDynamicSamplingContext},IQ:function(){return dynamicSamplingContextToSentryBaggageHeader},XM:function(){return parseBaggageHeader},lq:function(){return T}});var x=v(61662),k=v(86651),E=v(11750);let T="sentry-";function baggageHeaderToDynamicSamplingContext(m){let g=parseBaggageHeader(m);
46if(!g)return;let v=Object.entries(g).reduce((m,[g,v])=>{if(g.startsWith(T)){let x=g.slice(T.length);m[x]=v}return m},{});return Object.keys(v).length>0?v:void 0}function dynamicSamplingContextToSentryBaggageHeader(m){if(!m)return;let g=Object.entries(m).reduce((m,[g,v])=>(v&&(m[`${T}${g}`]=v),m),{});return function(m){if(0!==Object.keys(m).length)return Object.entries(m).reduce((m,[g,v],E)=>{let T=`${encodeURIComponent(g)}=${encodeURIComponent(v)}`,K=0===E?T:`${m},${T}`;return K.length>8192?(x.X&&k.fF.warn(`Not adding key: ${g} with val: ${v} to baggage header due to exceeding baggage size limits.`),m):K},"")}(g)}function parseBaggageHeader(m){return m&&((0,E.HD)(m)||Array.isArray(m))?Array.isArray(m)?m.reduce((m,g)=>{let v=baggageHeaderToObject(g);return Object.entries(v).forEach(([g,v])=>{m[g]=v}),m},{}):baggageHeaderToObject(m):void 0}function baggageHeaderToObject(m){return m.split(",").map(m=>{let g=m.indexOf("=");if(-1===g)return[];let v=m.slice(0,g),x=m.slice(g+1);return[v,x].map(m=>{try{return decodeURIComponent(m.trim())}catch{return}})}).reduce((m,[g,v])=>(g&&v&&(m[g]=v),m),{})}},86651:function(m,g,v){"use strict";v.d(g,{Cf:function(){return consoleSandbox},LD:function(){return K},RU:function(){return T},fF:function(){return et}});var x=v(79751),k=v(61662),E=v(81880);let T=["debug","info","warn","error","log","assert","trace"],K={};function consoleSandbox(m){if(!("console"in E.GLOBAL_OBJ))return m();let g=E.GLOBAL_OBJ.console,v={},x=Object.keys(K);x.forEach(m=>{let x=K[m];v[m]=g[m],g[m]=x});try{return m()}finally{x.forEach(m=>{g[m]=v[m]})}}function isEnabled(){return _getLoggerSettings().enabled}function _maybeLog(m,...g){k.X&&isEnabled()&&consoleSandbox(()=>{E.GLOBAL_OBJ.console[m](`Sentry Logger [${m}]:`,...g)})}function _getLoggerSettings(){return k.X?(0,x.YO)("loggerSettings",()=>({enabled:!1})):{enabled:!1}}let et={enable:function(){_getLoggerSettings().enabled=!0},disable:function(){_getLoggerSettings().enabled=!1},isEnabled,log:function(...m){_maybeLog("log",...m)},warn:function(...m){_maybeLog("warn",...m)},error:function(...m){_maybeLog("error",...m)}}},63197:function(m,g,v){"use strict";v.d(g,{RA:function(){return dsnToString},U4:function(){return dsnFromString},du:function(){return extractOrgIdFromClient},vK:function(){return makeDsn}});var x=v(61662),k=v(86651);let E=/^o(\d+)\./,T=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function dsnToString(m,g=!1){let{host:v,path:x,pass:k,port:E,projectId:T,protocol:K,publicKey:et}=m;return`${K}://${et}${g&&k?`:${k}`:""}@${v}${E?`:${E}`:""}/${x?`${x}/`:x}${T}`}function dsnFromString(m){let g=T.exec(m);if(!g){(0,k.Cf)(()=>{console.error(`Invalid Sentry Dsn: ${m}`)});return}let[v,x,E="",K="",et="",en=""]=g.slice(1),er="",ei=en,es=ei.split("/");if(es.length>1&&(er=es.slice(0,-1).join("/"),ei=es.pop()),ei){let m=ei.match(/^\d+/);m&&(ei=m[0])}return dsnFromComponents({host:K,pass:E,path:er,projectId:ei,port:et,protocol:v,publicKey:x})}function dsnFromComponents(m){return{protocol:m.protocol,publicKey:m.publicKey||"",pass:m.pass||"",host:m.host,port:m.port||"",path:m.path||"",projectId:m.projectId}}function extractOrgIdFromClient(m){let g;let v=m.getOptions(),{host:x}=m.getDsn()||{};return v.orgId?g=String(v.orgId):x&&(g=function(m){let g=m.match(E);return g?.[1]}(x)),g}function makeDsn(m){let g="string"==typeof m?dsnFromString(m):dsnFromComponents(m);if(g&&function(m){if(!x.X)return!0;let{port:g,projectId:v,protocol:E}=m,T=["protocol","publicKey","host","projectId"].find(g=>!m[g]&&(k.fF.error(`Invalid Sentry Dsn: ${g} missing`),!0));return!T&&(v.match(/^\d+$/)?"http"===E||"https"===E?!(g&&isNaN(parseInt(g,10)))||(k.fF.error(`Invalid Sentry Dsn: Invalid port ${g}`),!1):(k.fF.error(`Invalid Sentry Dsn: Invalid protocol ${E}`),!1):(k.fF.error(`Invalid Sentry Dsn: Invalid projectId ${v}`),!1))}(g))return g}},21990:function(m,g,v){"use strict";v.d(g,{f:function(){return hasSpansEnabled}});var x=v(41690);function hasSpansEnabled(m){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;let g=m||x.s3()?.getOptions();return!!g&&(null!=g.tracesSampleRate||!!g.tracesSampler)}},11750:function(m,g,v){"use strict";v.d(g,{HD:function(){return isString},J8:function(){return isThenable},Kj:function(){return isRegExp},Le:function(){return isParameterizedString},PO:function(){return isPlainObject},TX:function(){return isDOMError},V9:function(){return isInstanceOf},VW:function(){return isErrorEvent},VZ:function(){return isError},cO:function(){return isEvent},fm:function(){return isDOMException},gJ:function(){return isRequest},pt:function(){return isPrimitive},yD:function(){return isObjectLike}});let x=Object.prototype.toString;function isError(m){switch(x.call(m)){case"[object Error]":case"[object E
46xception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return isInstanceOf(m,Error)}}function isBuiltin(m,g){return x.call(m)===`[object ${g}]`}function isErrorEvent(m){return isBuiltin(m,"ErrorEvent")}function isDOMError(m){return isBuiltin(m,"DOMError")}function isDOMException(m){return isBuiltin(m,"DOMException")}function isString(m){return isBuiltin(m,"String")}function isParameterizedString(m){return"object"==typeof m&&null!==m&&"__sentry_template_string__"in m&&"__sentry_template_values__"in m}function isPrimitive(m){return null===m||isParameterizedString(m)||"object"!=typeof m&&"function"!=typeof m}function isPlainObject(m){return isBuiltin(m,"Object")}function isObjectLike(m){return"object"==typeof m&&null!==m}function isEvent(m){return"undefined"!=typeof Event&&isInstanceOf(m,Event)}function isRegExp(m){return isBuiltin(m,"RegExp")}function isThenable(m){return!!(m?.then&&"function"==typeof m.then)}function isInstanceOf(m,g){try{return m instanceof g}catch{return!1}}function isRequest(m){return"undefined"!=typeof Request&&isInstanceOf(m,Request)}},34276:function(m,g,v){"use strict";v.d(g,{T:function(){return function merge(m,g,v=2){if(!g||"object"!=typeof g||v<=0)return g;if(m&&0===Object.keys(g).length)return m;let x={...m};for(let m in g)Object.prototype.hasOwnProperty.call(g,m)&&(x[m]=merge(x[m],g[m],v-1));return x}}})},87279:function(m,g,v){"use strict";let x;v.d(g,{DM:function(){return uuid4},Db:function(){return addExceptionTypeValue},EG:function(){return addExceptionMechanism},YO:function(){return checkOrSetAlreadyCaught},jH:function(){return getEventDescription}});var k=v(70524),E=v(36882),T=v(81880);function uuid4(m=function(){let m=T.GLOBAL_OBJ;return m.crypto||m.msCrypto}()){try{if(m?.randomUUID)return(0,E.Ab)(()=>m.randomUUID()).replace(/-/g,"")}catch{}return x||(x="10000000100040008000100000000000"),x.replace(/[018]/g,m=>(m^(15&16*(0,E.n0)())>>m/4).toString(16))}function getFirstException(m){return m.exception?.values?.[0]}function getEventDescription(m){let{message:g,event_id:v}=m;if(g)return g;let x=getFirstException(m);return x?x.type&&x.value?`${x.type}: ${x.value}`:x.type||x.value||v||"<unknown>":v||"<unknown>"}function addExceptionTypeValue(m,g,v){let x=m.exception=m.exception||{},k=x.values=x.values||[],E=k[0]=k[0]||{};E.value||(E.value=g||""),E.type||(E.type=v||"Error")}function addExceptionMechanism(m,g){let v=getFirstException(m);if(!v)return;let x=v.mechanism;if(v.mechanism={type:"generic",handled:!0,...x,...g},g&&"data"in g){let m={...x?.data,...g.data};v.mechanism.data=m}}function checkOrSetAlreadyCaught(m){if(function(m){try{return m.__sentry_captured__}catch{}}(m))return!0;try{(0,k.xp)(m,"__sentry_captured__",!0)}catch{}return!1}},75437:function(m,g,v){"use strict";let x;v.d(g,{Fv:function(){return normalize},Qy:function(){return function normalizeToSize(m,g=3,v=102400){let x=normalize(m,g);return~-encodeURI(JSON.stringify(x)).split(/%..|./).length>v?normalizeToSize(m,g-1,v):x}},yo:function(){return setNormalizeStringifier},_M:function(){return stringifyValue}});let k=Symbol.for("sentry.skipNormalization"),E=Symbol.for("sentry.overrideNormalizationDepth");var T=v(70524),K=v(48643);function setNormalizeStringifier(m){x=m}function normalize(m,g=100,v=1/0){try{return function visit(m,g,v=1/0,x=1/0,K=function(){let m=new WeakSet;return[function(g){return!!m.has(g)||(m.add(g),!1)},function(g){m.delete(g)}]}()){let[et,en]=K;if(null==g||["boolean","string"].includes(typeof g)||"number"==typeof g&&Number.isFinite(g))return g;let er=stringifyValue(m,g);if(!er.startsWith("[object "))return er;if(g[k])return g;let ei=function(m){let g=m[E];return"number"==typeof g?g:void 0}(g),es=void 0!==ei?ei:v;if(0===es)return er.replace("object ","");if(et(g))return"[Circular ~]";if(g&&"function"==typeof g.toJSON)try{let m=g.toJSON();return visit("",m,es-1,x,K)}catch{}let el=Array.isArray(g)?[]:{},ec=0,eu=(0,T.Sh)(g);for(let m in eu){if(!Object.prototype.hasOwnProperty.call(eu,m))continue;if(ec>=x){el[m]="[MaxProperties ~]";break}let g=eu[m];el[m]=visit(m,g,es-1,x,K),ec++}return en(g),el}("",m,g,v)}catch(m){return{ERROR:`**non-serializable** (${m})`}}}function stringifyValue(m,g){try{if(x){let m=x(g);if(m)return m}if("undefined"!=typeof global&&g===global)return"[Global]";if("number"==typeof g&&!Number.isFinite(g))return`[${g}]`;if("function"==typeof g)return`[Function: ${(0,K.$P)(g)}]`;if("symbol"==typeof g)return`[${String(g)}]`;if("bigint"==typeof g)return`[BigInt: ${String(g)}]`;let m=function(m){let g=Object.getPrototypeOf(m);return g?.constructor?g.constructor.name:"null prototype"}(g);return`[object ${m}]`}catch(m){return`**non-serializable** (${m})`}}},70524:function(m,g,v){"use strict";v.d(g,{$Q:function(){return markFunctionWrapped},HK:function(){return getOriginalFunction},Sh:function(){return convertToPlainObject},hl:function(){return fill},xp:function(){return addNonEnumerableProperty},zf:function(){return extractExceptionKeysForMessage}});var x=v(61662),k=v(86651),E=v(11750);function fill(m,g,v){if(!(g in m))return;let E=m[g];if("function"!=typeof E)return;let T=v(E);"function"==typeof T&&markFunctionWrapped(T,E);try{m[g]=T}catch{x.X&&k.fF.log(`Failed to replace method "${g}" in object`,m)}}function addNonEnumerableProperty(m,g,v){try{Object.defineProperty(m,g,{value:v,writable:!0,configurable:!0})}catch{x.X&&k.fF.log(`Failed to add non-enumerable property "${String(g)}" to object`,m)}}function markFunctionWrapped(m,g){try{let v=g.prototype||{};m.prototype=g.prototype=v,addNonEnumerableProperty(m,"__sentry_original__",g)}catch{}}function getOriginalFunction(m){return m.__sentry_original__}function convertToPlainObject(m){if((0,E.VZ)(m))return{message:m.message,name:m.name,stack:m.stack,...getOwnProperties(m)};if((0,E.cO)(m)){let{type:g,target:v,currentTarget:x,detail:k}=m;return{type:g,target:v,currentTarget:x,...k?{detail:k}:{},...getOwnProperties(m)}}return m}function getOwnProperties(m){return(0,E.yD)(m)?Object.fromEntries(Object.entries(m)):{}}function extractExceptionKeysForMessage(m){let g=Object.keys(convertToPlainObject(m));return g.sort(),g[0]?g.join(", "):"[object has no keys]"}},97680:function(m,g,v){"use strict";function parseSampleRate(m){if("boolean"==typeof m)return Number(m);let g="string"==typeof m?parseFloat(m):m;if(!("number"!=typeof g||isNaN(g))&&!(g<0)&&!(g>1))return g}v.d(g,{o:function(){return parseSampleRate}})},21068:function(m,g,v){"use strict";let x,k,E,T;v.d(g,{U0:function(){return parseEventHintOrCaptureContext},R:function(){return prepareEvent}});var K=v(42219),et=v(61662),en=v(86651),er=v(11750),ei=v(62435),es=v(34148),el=v(81880),ec=v(87279),eu=v(75437),ed=v(20617),ep=v(36953),em=v(64150);function prepareEvent(m,g,v,ef,eh,eg){let{normalizeDepth:ev=3,normalizeMaxBreadth:ey=1e3}
46=m,eb={...g,event_id:g.event_id||v.event_id||(0,ec.DM)(),timestamp:g.timestamp||(0,em.yW)()},ex=v.integrations||m.integrations.map(m=>m.name);(function(m,g){let{environment:v,release:x,dist:k,maxValueLength:E}=g;m.environment=m.environment||v||K.J,!m.release&&x&&(m.release=x),!m.dist&&k&&(m.dist=k);let T=m.request;T?.url&&E&&(T.url=(0,ep.$G)(T.url,E)),E&&m.exception?.values?.forEach(m=>{m.value&&(m.value=ep.$G(m.value,E))})})(eb,m),ex.length>0&&(eb.sdk=eb.sdk||{},eb.sdk.integrations=[...eb.sdk.integrations||[],...ex]),eh&&eh.emit("applyFrameMetadata",g),void 0===g.type&&function(m,g){let v=function(m){let g=el.GLOBAL_OBJ._sentryDebugIds,v=el.GLOBAL_OBJ._debugIds;if(!g&&!v)return{};let K=g?Object.keys(g):[],et=v?Object.keys(v):[];if(T&&K.length===k&&et.length===E)return T;k=K.length,E=et.length,T={},x||(x={});let processDebugIds=(g,v)=>{for(let k of g){let g=v[k],E=x?.[k];if(E&&T&&g)T[E[0]]=g,x&&(x[k]=[E[0],g]);else if(g){let v=m(k);for(let m=v.length-1;m>=0;m--){let E=v[m],K=E?.filename;if(K&&T&&x){T[K]=g,x[k]=[K,g];break}}}}};return g&&processDebugIds(K,g),v&&processDebugIds(et,v),T}(g);m.exception?.values?.forEach(m=>{m.stacktrace?.frames?.forEach(m=>{m.filename&&(m.debug_id=v[m.filename])})})}(eb,m.stackParser);let e_=function(m,g){if(!g)return m;let v=m?m.clone():new es.s;return v.update(g),v}(ef,v.captureContext);v.mechanism&&(0,ec.EG)(eb,v.mechanism);let ew=eh?eh.getEventProcessors():[],eS=(0,ed.ZM)(eg,e_),eC=[...v.attachments||[],...eS.attachments];eC.length&&(v.attachments=eC),(0,ed.gi)(eb,eS);let ek=[...ew,...eS.eventProcessors],eE=v.data&&!0===v.data.__sentry__,ej=eE?(0,ei.WD)(eb):function(m,g,v,x=0){try{let k=function _notifyEventProcessors(m,g,v,x){let k=v[x];if(!m||!k)return m;let E=k({...m},g);return(et.X&&null===E&&en.fF.log(`Event processor "${k.id||"?"}" dropped event`),(0,er.J8)(E))?E.then(m=>_notifyEventProcessors(m,g,v,x+1)):_notifyEventProcessors(E,g,v,x+1)}(g,v,m,x);return(0,er.J8)(k)?k:(0,ei.WD)(k)}catch(m){return(0,ei.$2)(m)}}(ek,eb,v);return ej.then(m=>(m&&function(m){let g={};if(m.exception?.values?.forEach(m=>{m.stacktrace?.frames?.forEach(m=>{m.debug_id&&(m.abs_path?g[m.abs_path]=m.debug_id:m.filename&&(g[m.filename]=m.debug_id),delete m.debug_id)})}),0===Object.keys(g).length)return;m.debug_meta=m.debug_meta||{},m.debug_meta.images=m.debug_meta.images||[];let v=m.debug_meta.images;Object.entries(g).forEach(([m,g])=>{v.push({type:"sourcemap",code_file:m,debug_id:g})})}(m),"number"==typeof ev&&ev>0)?function(m,g,v){if(!m)return null;let x={...m,...m.breadcrumbs&&{breadcrumbs:m.breadcrumbs.map(m=>({...m,...m.data&&{data:(0,eu.Fv)(m.data,g,v)}}))},...m.user&&{user:(0,eu.Fv)(m.user,g,v)},...m.contexts&&{contexts:(0,eu.Fv)(m.contexts,g,v)},...m.extra&&{extra:(0,eu.Fv)(m.extra,g,v)}};return m.contexts?.trace&&x.contexts&&(x.contexts.trace=m.contexts.trace,m.contexts.trace.data&&(x.contexts.trace.data=(0,eu.Fv)(m.contexts.trace.data,g,v))),m.spans&&(x.spans=m.spans.map(m=>({...m,...m.data&&{data:(0,eu.Fv)(m.data,g,v)}}))),m.contexts?.flags&&x.contexts&&(x.contexts.flags=(0,eu.Fv)(m.contexts.flags,3,v)),x}(m,ev,ey):m)}function parseEventHintOrCaptureContext(m){return m?m instanceof es.s||"function"==typeof m||Object.keys(m).some(m=>ef.includes(m))?{captureContext:m}:m:void 0}let ef=["user","level","extra","contexts","tags","fingerprint","propagationContext"]},95024:function(m,g,v){"use strict";v.d(g,{H:function(){return generateTraceId},M:function(){return generateSpanId}});var x=v(87279);function generateTraceId(){return(0,x.DM)()}function generateSpanId(){return(0,x.DM)().substring(16)}},36882:function(m,g,v){"use strict";let x;v.d(g,{Ab:function(){return withRandomSafeContext},lk:function(){return safeDateNow},n0:function(){return safeMathRandom}});var k=v(81880);function withRandomSafeContext(m){if(void 0!==x)return x?x(m):m();let g=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),v=k.GLOBAL_OBJ;return g in v&&"function"==typeof v[g]?(x=v[g])(m):(x=null,m())}function safeMathRandom(){return withRandomSafeContext(()=>Math.random())}function safeDateNow(){return withRandomSafeContext(()=>Date.now())}},20617:function(m,g,v){"use strict";v.d(g,{ZM:function(){return getCombinedScopeData},gi:function(){return applyScopeDataToEvent}});var x=v(41690),k=v(6262),E=v(34276),T=v(66603);function applyScopeDataToEvent(m,g){let{fingerprint:v,span:x,breadcrumbs:E,sdkProcessingMetadata:K}=g;(function(m,g){let{extra:v,tags:x,user:k,contexts:E,level:T,transactionName:K}=g;Object.keys(v).length&&(m.extra={...v,...m.extra}),Object.keys(x).length&&(m.tags={...x,...m.tags}),Object.keys(k).length&&(m.user={...k,...m.user}),Object.keys(E).length&&(m.contexts={...E,...m.contexts}),T&&(m.level=T),K&&"transaction"!==m.type&&(m.transaction=K)}
46)(m,g),x&&function(m,g){m.contexts={trace:(0,T.wy)(g),...m.contexts},m.sdkProcessingMetadata={dynamicSamplingContext:(0,k.jC)(g),...m.sdkProcessingMetadata};let v=(0,T.Gx)(g),x=(0,T.XU)(v).description;x&&!m.transaction&&"transaction"===m.type&&(m.transaction=x)}(m,x),m.fingerprint=m.fingerprint?Array.isArray(m.fingerprint)?m.fingerprint:[m.fingerprint]:[],v&&(m.fingerprint=m.fingerprint.concat(v)),m.fingerprint.length||delete m.fingerprint,function(m,g){let v=[...m.breadcrumbs||[],...g];m.breadcrumbs=v.length?v:void 0}(m,E),m.sdkProcessingMetadata={...m.sdkProcessingMetadata,...K}}function mergeScopeData(m,g){let{extra:v,tags:x,attributes:k,user:T,contexts:K,level:et,sdkProcessingMetadata:en,breadcrumbs:er,fingerprint:ei,eventProcessors:es,attachments:el,propagationContext:ec,transactionName:eu,span:ed}=g;mergeAndOverwriteScopeData(m,"extra",v),mergeAndOverwriteScopeData(m,"tags",x),mergeAndOverwriteScopeData(m,"attributes",k),mergeAndOverwriteScopeData(m,"user",T),mergeAndOverwriteScopeData(m,"contexts",K),m.sdkProcessingMetadata=(0,E.T)(m.sdkProcessingMetadata,en,2),et&&(m.level=et),eu&&(m.transactionName=eu),ed&&(m.span=ed),er.length&&(m.breadcrumbs=[...m.breadcrumbs,...er]),ei.length&&(m.fingerprint=[...m.fingerprint,...ei]),es.length&&(m.eventProcessors=[...m.eventProcessors,...es]),el.length&&(m.attachments=[...m.attachments,...el]),m.propagationContext={...m.propagationContext,...ec}}function mergeAndOverwriteScopeData(m,g,v){m[g]=(0,E.T)(m[g],v,1)}function getCombinedScopeData(m,g){let v=(0,x.lW)().getScopeData();return m&&mergeScopeData(v,m.getScopeData()),g&&mergeScopeData(v,g.getScopeData()),v}},13201:function(m,g,v){"use strict";v.d(g,{D:function(){return _setSpanForScope},Y:function(){return _getSpanForScope}});var x=v(70524),k=v(66209);let E="_sentrySpan";function _setSpanForScope(m,g){g?(0,x.xp)(m,E,(0,k.r)(g)):delete m[E]}function _getSpanForScope(m){return(0,k.$)(m[E])}},66603:function(m,g,v){"use strict";v.d(g,{ve:function(){return eu},i0:function(){return ed},j5:function(){return addChildSpanToSpan},kq:function(){return addStatusMessageAttribute},FF:function(){return convertSpanLinksForEnvelope},HN:function(){return getActiveSpan},Gx:function(){return eh},bD:function(){return getSimpleStatus},Dp:function(){return getSpanDescendants},_4:function(){return getStatusMessage},vq:function(){return getStreamedSpanLinks},ed:function(){return removeChildSpanFromSpan},R6:function(){return showSpanDropWarning},Tt:function(){return spanIsSampled},$k:function(){return spanTimeInputToSeconds},XU:function(){return spanToJSON},FS:function(){return spanToStreamedSpanJSON},wy:function(){return spanToTraceContext},Hb:function(){return spanToTraceHeader},jN:function(){return spanToTraceparentHeader},HR:function(){return spanToTransactionTraceContext},i7:function(){return streamedSpanJsonToSerializedSpan}});var x=v(62964);function serializeAttributes(m,g=!1){let v={};for(let[x,k]of Object.entries(m??{})){let m=function(m,g){let{value:v,unit:x}="object"==typeof m&&null!=m&&!Array.isArray(m)&&Object.keys(m).includes("value")?m:{value:m,unit:void 0},k=function(m){if(Array.isArray(m))return{value:m,type:"array"};let g="string"==typeof m?"string":"boolean"==typeof m?"boolean":"number"!=typeof m||Number.isNaN(m)?null:Number.isInteger(m)?"integer":"double";if(g)return{value:m,type:g}}(v),E=x&&"string"==typeof x?{unit:x}:{};if(k)return{...k,...E};if(!g||"skip-undefined"===g&&void 0===v)return;let T="";try{T=JSON.stringify(v)??""}catch{}return{value:T,type:"string",...E}}(k,g);m&&(v[x]=m)}return v}var k=v(79751),E=v(41690),T=v(45535),K=v(48485),et=v(21458),en=v(70524),er=v(95024),ei=v(64150),es=v(15436),el=v(86651),ec=v(13201);let eu=0,ed=1,ep=!1;function spanToTransactionTraceContext(m){let{spanId:g,traceId:v}=m.spanContext(),{data:x,op:k,parent_span_id:E,status:T,origin:K,links:et}=spanToJSON(m);return{parent_span_id:E,span_id:g,trace_id:v,data:x,op:k,status:T,origin:K,links:et}}function spanToTraceContext(m){let{spanId:g,traceId:v,isRemote:x}=m.spanContext(),k=x?g:spanToJSON(m).parent_span_id,E=(0,et.I1)(m).scope,T=x?E?.getPropagationContext().propagationSpanId||(0,er.M)():g;return{parent_span_id:k,span_id:T,trace_id:v}}function spanToTraceHeader(m){let{traceId:g,spanId:v}=m.spanContext(),x=spanIsSampled(m);return(0,es.$p)(g,v,x)}function spanToTraceparentHeader(m){let{traceId:g,spanId:v}=m.spanContext(),x=spanIsSampled(m);return(0,es.i7)(g,v,x)}function convertSpanLinksForEnvelope(m){return m&&m.length>0?m.map(({context:{spanId:m,traceId:g,traceFlags:v,...x},attributes:k})=>({span_id:m,trace_id:g,sampled:v===ed,attributes:k,...x})):void 0}function getStreamedSpanLinks(m){return m?.length?m.map(({context:{spanId:m,traceId:g,traceFlags:v},attributes:x})=>({span_id:m,trace_id:g,sampled:v===ed,attributes:x})):void 0}function spanTimeInputToSeconds(m){return"number"==typeof m?ensureTimestampInSeconds(m):Array.isArray(m)?m[0]+m[1]/1e9:m instanceof Date?ensureTimestampInSeconds(m.getTime()):(0,ei.ph)()}function ensureTimestampInSeconds(m){return m>9999999999?m/1e3:m}function spanToJSON(m){if(spanIsSentrySpan(m))return m.getSpanJSON();let{spanId:g,traceId:v}=m.spanContext();if(spanIsOpenTelemetrySdkTraceBaseSpan(m)){let{attributes:x,startTime:k,name:E,endTime:K,status:et,links:e
46n}=m;return{span_id:g,trace_id:v,data:x,description:E,parent_span_id:getOtelParentSpanId(m),start_timestamp:spanTimeInputToSeconds(k),timestamp:spanTimeInputToSeconds(K)||void 0,status:getStatusMessage(et),op:x[T.$J],origin:x[T.S3],links:convertSpanLinksForEnvelope(en)}}return{span_id:g,trace_id:v,start_timestamp:0,data:{}}}function spanToStreamedSpanJSON(m){if(spanIsSentrySpan(m))return m.getStreamedSpanJSON();let{spanId:g,traceId:v}=m.spanContext();if(spanIsOpenTelemetrySdkTraceBaseSpan(m)){let{attributes:x,startTime:k,name:E,endTime:T,status:K,links:et}=m;return{name:E,span_id:g,trace_id:v,parent_span_id:getOtelParentSpanId(m),start_timestamp:spanTimeInputToSeconds(k),end_timestamp:spanTimeInputToSeconds(T),is_segment:m===INTERNAL_getSegmentSpan(m),status:getSimpleStatus(K),attributes:addStatusMessageAttribute(x,K),links:getStreamedSpanLinks(et)}}return{span_id:g,trace_id:v,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:m===INTERNAL_getSegmentSpan(m)}}function getOtelParentSpanId(m){return"parentSpanId"in m?m.parentSpanId:"parentSpanContext"in m?m.parentSpanContext?.spanId:void 0}function streamedSpanJsonToSerializedSpan(m){return{...m,attributes:serializeAttributes(m.attributes),links:m.links?.map(m=>({...m,attributes:serializeAttributes(m.attributes)}))}}function spanIsOpenTelemetrySdkTraceBaseSpan(m){return!!m.attributes&&!!m.startTime&&!!m.name&&!!m.endTime&&!!m.status}function spanIsSentrySpan(m){return"function"==typeof m.getSpanJSON}function spanIsSampled(m){let{traceFlags:g}=m.spanContext();return g===ed}function getStatusMessage(m){return m&&m.code!==K.pq?m.code===K.OP?"ok":m.message||"internal_error":void 0}function getSimpleStatus(m){return m&&m.code!==K.OP&&m.code!==K.pq&&"cancelled"!==m.message?"error":"ok"}function addStatusMessageAttribute(m,g){let v="error"===getSimpleStatus(g)?g?.message:void 0;return{...v&&{[T.x0]:v},...m}}let em="_sentryChildSpans",ef="_sentryRootSpan";function addChildSpanToSpan(m,g){let v=m[ef]||m;(0,en.xp)(g,ef,v),m[em]?m[em].add(g):(0,en.xp)(m,em,new Set([g]))}function removeChildSpanFromSpan(m,g){m[em]&&m[em].delete(g)}function getSpanDescendants(m){let g=new Set;return function addSpanChildren(m){if(!g.has(m)&&spanIsSampled(m)){g.add(m);let v=m[em]?Array.from(m[em]):[];for(let m of v)addSpanChildren(m)}}(m),Array.from(g)}let eh=INTERNAL_getSegmentSpan;function INTERNAL_getSegmentSpan(m){return m[ef]||m}function getActiveSpan(){let m=(0,k.cu)(),g=(0,x.G)(m);return g.getActiveSpan?g.getActiveSpan():(0,ec.Y)((0,E.nZ)())}function showSpanDropWarning(){ep||((0,el.Cf)(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ep=!0)}},48643:function(m,g,v){"use strict";v.d(g,{$P:function(){return getFunctionName},Fi:function(){return x},Fr:function(){return getFramesFromEvent},Sq:function(){return stackParserFromStackParserOptions},pE:function(){return createStackParser}});let x="?",k=/\(error: (.*)\)/,E=/captureMessage|captureException/;function createStackParser(...m){let g=m.sort((m,g)=>m[0]-g[0]).map(m=>m[1]);return(m,v=0,T=0)=>{let K=[],et=m.split("\n");for(let m=v;m<et.length;m++){let v=et[m];v.length>1024&&(v=v.slice(0,1024));let x=k.test(v)?v.replace(k,"$1"):v;if(!x.includes("Error: ")){for(let m of g){let g=m(x);if(g){K.push(g);break}}if(K.length>=50+T)break}}return function(m){if(!m.length)return[];let g=Array.from(m);return/sentryWrapped/.test(getLastStackFrame(g).function||"")&&g.pop(),g.reverse(),E.test(getLastStackFrame(g).function||"")&&(g.pop(),E.test(getLastStackFrame(g).function||"")&&g.pop()),g.slice(0,50).map(m=>({...m,filename:m.filename||getLastStackFrame(g).filename,function:m.function||x}))}(K.slice(T))}}function stackParserFromStackParserOptions(m){return Array.isArray(m)?createStackParser(...m):m}function getLastStackFrame(m){return m[m.length-1]||{}}let T="<anonymous>";function getFunctionName(m){try{if(!m||"function"!=typeof m)return T;return m.name||T}catch{return T}}function getFramesFromEvent(m){let g=m.exception;if(g){let m=[];
46try{return g.values.forEach(g=>{g.stacktrace.frames&&m.push(...g.stacktrace.frames)}),m}catch{}}}},36953:function(m,g,v){"use strict";v.d(g,{$G:function(){return truncate},U0:function(){return stringMatchesSomePattern},nK:function(){return safeJoin},zC:function(){return isMatchingPattern}});var x=v(11750),k=v(75437);function truncate(m,g=0){return"string"!=typeof m||0===g?m:m.length<=g?m:`${m.slice(0,g)}...`}function safeJoin(m,g){if(!Array.isArray(m))return"";let v=[];for(let g=0;g<m.length;g++){let E=m[g];(0,x.pt)(E)?v.push(String(E)):E instanceof Error?v.push(E.message?`${E.name}: ${E.message}`:E.name):v.push((0,k._M)(void 0,E))}return v.join(g)}function isMatchingPattern(m,g,v=!1){return!!(0,x.HD)(m)&&((0,x.Kj)(g)?g.test(m):(0,x.HD)(g)?v?m===g:m.includes(g):"function"==typeof g&&g(m))}function stringMatchesSomePattern(m,g=[],v=!1){for(let x of g)if(isMatchingPattern(m,x,v))return!0;return!1}},62435:function(m,g,v){"use strict";v.d(g,{$2:function(){return rejectedSyncPromise},WD:function(){return resolvedSyncPromise}});var x=v(11750);function resolvedSyncPromise(m){return new SyncPromise(g=>{g(m)})}function rejectedSyncPromise(m){return new SyncPromise((g,v)=>{v(m)})}let SyncPromise=class SyncPromise{constructor(m){this._state=0,this._handlers=[],this._runExecutor(m)}then(m,g){return new SyncPromise((v,x)=>{this._handlers.push([!1,g=>{if(m)try{v(m(g))}catch(m){x(m)}else v(g)},m=>{if(g)try{v(g(m))}catch(m){x(m)}else x(m)}]),this._executeHandlers()})}catch(m){return this.then(m=>m,m)}finally(m){return new SyncPromise((g,v)=>{let x,k;return this.then(g=>{k=!1,x=g,m&&m()},g=>{k=!0,x=g,m&&m()}).then(()=>{if(k){v(x);return}g(x)})})}_executeHandlers(){if(0===this._state)return;let m=this._handlers.slice();this._handlers=[],m.forEach(m=>{m[0]||(1===this._state&&m[1](this._value),2===this._state&&m[2](this._value),m[0]=!0)})}_runExecutor(m){let setResult=(m,g)=>{if(0===this._state){if((0,x.J8)(g)){g.then(resolve,reject);return}this._state=m,this._value=g,this._executeHandlers()}},resolve=m=>{setResult(1,m)},reject=m=>{setResult(2,m)};try{m(resolve,reject)}catch(m){reject(m)}}}},64150:function(m,g,v){"use strict";let x;v.d(g,{Z1:function(){return browserPerformanceTimeOrigin},ph:function(){return timestampInSeconds},yW:function(){return dateTimestampInSeconds}});var k=v(36882),E=v(81880);function dateTimestampInSeconds(){return(0,k.lk)()/1e3}function timestampInSeconds(){let m=x??(x=function(){let{performance:m}=E.GLOBAL_OBJ;if(!m?.now||!m.timeOrigin)return dateTimestampInSeconds;let g=m.timeOrigin;return()=>(g+(0,k.Ab)(()=>m.now()))/1e3}());return m()}let T=null;function browserPerformanceTimeOrigin(){return null===T&&(T=function(){let{performance:m}=E.GLOBAL_OBJ;if(!m?.now)return;let g=(0,k.Ab)(()=>m.now()),v=(0,k.lk)(),x=m.timeOrigin;if("number"==typeof x){let m=Math.abs(x+g-v);if(m<3e5)return x}let T=m.timing?.navigationStart;if("number"==typeof T){let m=Math.abs(T+g-v);if(m<3e5)return T}return v-g}()),T}},51159:function(m,g,v){"use strict";v.d(g,{u:function(){return getTraceData}});var x=v(62964),k=v(79751),E=v(41690),T=v(86239),K=v(86651),et=v(66603),en=v(21990),er=v(64751),ei=v(6262),es=v(61874),el=v(15436);function getTraceData(m={}){let g=m.client||(0,E.s3)();if(!(0,T._k)()||!g)return{};let v=(0,k.cu)(),ec=(0,x.G)(v);if(ec.getTraceData)return ec.getTraceData(m);let eu=m.scope||(0,E.nZ)(),ed=m.span||(0,et.HN)(),ep=(0,er.Z)(ed)&&!(0,en.f)(g.getOptions());if(!ed&&(0,E.fU)())return{};let em=ed&&!ep?(0,et.Hb)(ed):function(m){let{traceId:g,sampled:v,propagationSpanId:x}=m.getPropagationContext();return(0,el.$p)(g,x,v)}(eu),ef=ed?(0,ei.jC)(ed):(0,ei.CG)(g,eu),eh=(0,es.IQ)(ef),eg=el.Ke.test(em);if(!eg)return K.fF.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let ev={"sentry-trace":em,baggage:eh};return m.propagateTraceparent&&(ev.traceparent=ed&&!ep?(0,et.jN)(ed):function(m){let{traceId:g,sampled:v,propagationSpanId:x}=m.getPropagationContext();return(0,el.i7)(g,x,v)}(eu)),ev}},15436:function(m,g,v){"use strict";v.d(g,{$p:function(){return generateSentryTraceHeader},Ke:function(){return K},i7:function(){return generateTraceparentHeader},pT:function(){return propagationContextFromHeaders}});var x=v(61874),k=v(97680),E=v(95024),T=v(36882);let K=RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function propagationContextFromHeaders(m,g){let v=function(m){let g;if(!m)return;let v=m.match(K);if(v)return"1"===v[3]?g=!0:"0"===v[3]&&(g=!1),{traceId:v[1],parentSampled:g,parentSpanId:v[2]}}(m),et=(0,x.EN)(g);if(!v?.traceId)return{traceId:(0,E.H)(),sampleRand:(0,T.n0)()};let en=function(m,g){let v=(0,k.o)(g?.sample_rand);if(void 0!==v)return v;let x=(0,k.o)(g?.sample_rate);return x&&m?.parentSampled!==void 0?m.parentSampled?(0,T.n0)()*x:x+(0,T.n0)()*(1-x):(0,T.n0)()}(v,et);et&&(et.sample_rand=en.toString());let{traceId:er,parentSpanId:ei,parentSampled:es}=v;return{traceId:er,parentSpanId:ei,sampled:es,dsc:et||{},sampleRand:en}}function generateSentryTraceHeader(m=(0,E.H)(),g=(0,E.M)(),v){let x="";return void 0!==v&&(x=v?"-1":"-0"),`${m}-${g}${x}`}function generateTraceparentHeader(m=(0,E.H)(),g=(0,E.M)(),v){return`00-${m}-${g}-${v?"01":"00"}`}},70385:function(m,g,v){"use strict";v.d(g,{J:function(){return x}});let x="10.70.0"},66209:function(m,g,v){"use strict";v.d(g,{$:function(){return derefWeakRef},r:function(){return makeWeakRef}});var x=v(81880);function makeWeakRef(m){try{let g=x.GLOBAL_OBJ.WeakRef;if("function"==typeof g)return new g(m)}catch{}return m}function derefWeakRef(m){if(m){if("object"==typeof m&&"deref"in m&&"function"==typeof m.deref)try{return m.deref()}catch{return}return m}}},81880:function(m,g,v){"use strict";v.d(g,{GLOBAL_OBJ:function(){return x}});let x=globalThis},85289:function(m,g,v){"use strict";v.d(g,{j:function(){return E}});var x=v(22436),k=v(36370);let FocusManager=class FocusManager extends x.l{constructor(){super(),this.setup=m=>{if(!k.sk&&window.addEventListener){let listener=()=>m();return window.addEventListener("visibilitychange",listener,!1),window.addEventListener("focus",listener,!1),()=>{window.removeEventListener("visibilitychange",listener),window.removeEventListener("focus",listener)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var m;
46null==(m=this.cleanup)||m.call(this),this.cleanup=void 0}}setEventListener(m){var g;this.setup=m,null==(g=this.cleanup)||g.call(this),this.cleanup=m(m=>{"boolean"==typeof m?this.setFocused(m):this.onFocus()})}setFocused(m){let g=this.focused!==m;g&&(this.focused=m,this.onFocus())}onFocus(){this.listeners.forEach(({listener:m})=>{m()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}};let E=new FocusManager},714:function(m,g,v){"use strict";v.d(g,{_:function(){return x}});let x=console},96278:function(m,g,v){"use strict";v.d(g,{R:function(){return getDefaultState},m:function(){return Mutation}});var x=v(714),k=v(3709),E=v(53429),T=v(3241);let Mutation=class Mutation extends E.F{constructor(m){super(),this.defaultOptions=m.defaultOptions,this.mutationId=m.mutationId,this.mutationCache=m.mutationCache,this.logger=m.logger||x._,this.observers=[],this.state=m.state||getDefaultState(),this.setOptions(m.options),this.scheduleGc()}setOptions(m){this.options={...this.defaultOptions,...m},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(m){this.dispatch({type:"setState",state:m})}addObserver(m){this.observers.includes(m)||(this.observers.push(m),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:m}))}removeObserver(m){this.observers=this.observers.filter(g=>g!==m),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:m})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var m,g;return null!=(m=null==(g=this.retryer)?void 0:g.continue())?m:this.execute()}async execute(){var m,g,v,x,k,E,K,et,en,er,ei,es,el,ec,eu,ed,ep,em,ef,eh;let eg="loading"===this.state.status;try{if(!eg){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(en=(er=this.mutationCache.config).onMutate)?void 0:en.call(er,this.state.variables,this));let m=await (null==(ei=(es=this.options).onMutate)?void 0:ei.call(es,this.state.variables));m!==this.state.context&&this.dispatch({type:"loading",context:m,variables:this.state.variables})}let el=await (()=>{var m;return this.retryer=(0,T.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(m,g)=>{this.dispatch({type:"failed",failureCount:m,error:g})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(m=this.options.retry)?m:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(m=(g=this.mutationCache.config).onSuccess)?void 0:m.call(g,el,this.state.variables,this.state.context,this)),await (null==(v=(x=this.options).onSuccess)?void 0:v.call(x,el,this.state.variables,this.state.context)),await (null==(k=(E=this.mutationCache.config).onSettled)?void 0:k.call(E,el,null,this.state.variables,this.state.context,this)),await (null==(K=(et=this.options).onSettled)?void 0:K.call(et,el,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:el}),el}catch(m){try{throw await (null==(el=(ec=this.mutationCache.config).onError)?void 0:el.call(ec,m,this.state.variables,this.state.context,this)),await (null==(eu=(ed=this.options).onError)?void 0:eu.call(ed,m,this.state.variables,this.state.context)),await (null==(ep=(em=this.mutationCache.config).onSettled)?void 0:ep.call(em,void 0,m,this.state.variables,this.state.context,this)),await (null==(ef=(eh=this.options).onSettled)?void 0:ef.call(eh,void 0,m,this.state.variables,this.state.context)),m}finally{this.dispatch({type:"error",error:m})}}}dispatch(m){this.state=(g=>{switch(m.type){case"failed":return{...g,failureCount:m.failureCount,failureReason:m.error};case"pause":return{...g,isPaused:!0};case"continue":return{...g,isPaused:!1};case"loading":return{...g,context:m.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,T.Kw)(this.options.networkMode),status:"loading",variables:m.variables};case"success":return{...g,data:m.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...g,data:void 0,error:m.error,failureCount:g.failureCount+1,failureReason:m.error,isPau
46sed:!1,status:"error"};case"setState":return{...g,...m.state}}})(this.state),k.V.batch(()=>{this.observers.forEach(g=>{g.onMutationUpdate(m)}),this.mutationCache.notify({mutation:this,type:"updated",action:m})})}};function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}},3709:function(m,g,v){"use strict";v.d(g,{V:function(){return k}});var x=v(36370);let k=function(){let m=[],g=0,notifyFn=m=>{m()},batchNotifyFn=m=>{m()},schedule=v=>{g?m.push(v):(0,x.A4)(()=>{notifyFn(v)})},flush=()=>{let g=m;m=[],g.length&&(0,x.A4)(()=>{batchNotifyFn(()=>{g.forEach(m=>{notifyFn(m)})})})};return{batch:m=>{let v;g++;try{v=m()}finally{--g||flush()}return v},batchCalls:m=>(...g)=>{schedule(()=>{m(...g)})},schedule,setNotifyFunction:m=>{notifyFn=m},setBatchNotifyFunction:m=>{batchNotifyFn=m}}}()},63240:function(m,g,v){"use strict";v.d(g,{N:function(){return T}});var x=v(22436),k=v(36370);let E=["online","offline"];let OnlineManager=class OnlineManager extends x.l{constructor(){super(),this.setup=m=>{if(!k.sk&&window.addEventListener){let listener=()=>m();return E.forEach(m=>{window.addEventListener(m,listener,!1)}),()=>{E.forEach(m=>{window.removeEventListener(m,listener)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var m;null==(m=this.cleanup)||m.call(this),this.cleanup=void 0}}setEventListener(m){var g;this.setup=m,null==(g=this.cleanup)||g.call(this),this.cleanup=m(m=>{"boolean"==typeof m?this.setOnline(m):this.onOnline()})}setOnline(m){let g=this.online!==m;g&&(this.online=m,this.onOnline())}onOnline(){this.listeners.forEach(({listener:m})=>{m()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};let T=new OnlineManager},5165:function(m,g,v){"use strict";v.d(g,{t:function(){return QueryCache}});var x=v(36370),k=v(714),E=v(3709),T=v(3241),K=v(53429);let Query=class Query extends K.F{constructor(m){super(),this.abortSignalConsumed=!1,this.defaultOptions=m.defaultOptions,this.setOptions(m.options),this.observers=[],this.cache=m.cache,this.logger=m.logger||k._,this.queryKey=m.queryKey,this.queryHash=m.queryHash,this.initialState=m.state||function(m){let g="function"==typeof m.initialData?m.initialData():m.initialData,v=void 0!==g,x=v?"function"==typeof m.initialDataUpdatedAt?m.initialDataUpdatedAt():m.initialDataUpdatedAt:0;return{data:g,dataUpdateCount:0,dataUpdatedAt:v?null!=x?x:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:v?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(m){this.options={...this.defaultOptions,...m},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(m,g){let v=(0,x.oE)(this.state.data,m,this.options);return this.dispatch({data:v,type:"success",dataUpdatedAt:null==g?void 0:g.updatedAt,manual:null==g?void 0:g.manual}),v}setState(m,g){this.dispatch({type:"setState",state:m,setStateOptions:g})}cancel(m){var g;let v=this.promise;return null==(g=this.retryer)||g.cancel(m),v?v.then(x.ZT).catch(x.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(m=>!1!==m.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(m=>m.getCurrentResult().isStale)}isStaleByTime(m=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,x.Kp)(this.state.dataUpdatedAt,m)}onFocus(){var m;let g=this.observers.find(m=>m.shouldFetchOnWindowFocus());g&&g.refetch({cancelRefetch:!1}),null==(m=this.retryer)||m.continue()}onOnline(){var m;let g=this.observers.find(m=>m.shouldFetchOnReconnect());g&&g.refetch({cancelRefetch:!1}
46),null==(m=this.retryer)||m.continue()}addObserver(m){this.observers.includes(m)||(this.observers.push(m),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:m}))}removeObserver(m){this.observers.includes(m)&&(this.observers=this.observers.filter(g=>g!==m),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:m}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(m,g){var v,k,E,K;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=g&&g.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(E=this.retryer)||E.continueRetry(),this.promise}if(m&&this.setOptions(m),!this.options.queryFn){let m=this.observers.find(m=>m.options.queryFn);m&&this.setOptions(m.options)}let et=(0,x.G9)(),en={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},addSignalProperty=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>{if(et)return this.abortSignalConsumed=!0,et.signal}})};addSignalProperty(en);let er={fetchOptions:g,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(en)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'")};addSignalProperty(er),null==(v=this.options.behavior)||v.onFetch(er),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(k=er.fetchOptions)?void 0:k.meta))&&this.dispatch({type:"fetch",meta:null==(K=er.fetchOptions)?void 0:K.meta});let onError=m=>{if((0,T.DV)(m)&&m.silent||this.dispatch({type:"error",error:m}),!(0,T.DV)(m)){var g,v,x,k;null==(g=(v=this.cache.config).onError)||g.call(v,m,this),null==(x=(k=this.cache.config).onSettled)||x.call(k,this.state.data,m,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,T.Mz)({fn:er.fetchFn,abort:null==et?void 0:et.abort.bind(et),onSuccess:m=>{var g,v,x,k;if(void 0===m){onError(Error(this.queryHash+" data is undefined"));return}this.setData(m),null==(g=(v=this.cache.config).onSuccess)||g.call(v,m,this),null==(x=(k=this.cache.config).onSettled)||x.call(k,m,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError,onFail:(m,g)=>{this.dispatch({type:"failed",failureCount:m,error:g})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:er.options.retry,retryDelay:er.options.retryDelay,networkMode:er.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(m){this.state=(g=>{var v,x;switch(m.type){case"failed":return{...g,fetchFailureCount:m.failureCount,fetchFailureReason:m.error};case"pause":return{...g,fetchStatus:"paused"};case"continue":return{...g,fetchStatus:"fetching"};case"fetch":return{...g,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(v=m.meta)?v:null,fetchStatus:(0,T.Kw)(this.options.networkMode)?"fetching":"paused",...!g.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...g,data:m.data,dataUpdateCount:g.dataUpdateCount+1,dataUpdatedAt:null!=(x=m.dataUpdatedAt)?x:Date.now(),error:null,isInvalidated:!1,status:"success",...!m.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let k=m.error;if((0,T.DV)(k)&&k.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...g,error:k,errorUpdateCount:g.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:g.fetchFailureCount+1,fetchFailureReason:k,fetchStatus:"idle",status:"error"};case"invalidate":return{...g,isInvalidated:!0};case"setState":return{...g,...m.state}}})(this.state),E.V.batch(()=>{this.observers.forEach(g=>{g.onQueryUpdate(m)}),this.cache.notify({query:this,type:"updated",action:m})})}};var et=v(22436);let QueryCache=class QueryCache extends et.l{constructor(m){super(),this.config=m||{},this.queries=[],this.queriesMap={}}build(m,g,v){var k;let E=g.queryKey,T=null!=(k=g.queryHash)?k:(0,x.Rm)(E,g),K=this.get(T);return K||(K=new Query({cache:this,logger:m.getLogger(),queryKey:E,queryHash:T,options:m.defaultQueryOptions(g),state:v,defaultOptions:m.getQueryDefaults(E)}),this.add(K)),K}add(m){this.queriesMap[m.queryHash]||(this.queriesMap[m.queryHash]=m,this.queries.push(m),this.notify({type:"added",query:m}))}remove(m){let g=this.queriesMap[m.queryHash];g&&(m.destroy(),this.queries=this.queries.filter(g=>g!==m),g===m&&delete this.queriesMap[m.queryHash],this.notify({type:"removed",query:m}))}clear(){E.V.batch(()=>
46{this.queries.forEach(m=>{this.remove(m)})})}get(m){return this.queriesMap[m]}getAll(){return this.queries}find(m,g){let[v]=(0,x.I6)(m,g);return void 0===v.exact&&(v.exact=!0),this.queries.find(m=>(0,x._x)(v,m))}findAll(m,g){let[v]=(0,x.I6)(m,g);return Object.keys(v).length>0?this.queries.filter(m=>(0,x._x)(v,m)):this.queries}notify(m){E.V.batch(()=>{this.listeners.forEach(({listener:g})=>{g(m)})})}onFocus(){E.V.batch(()=>{this.queries.forEach(m=>{m.onFocus()})})}onOnline(){E.V.batch(()=>{this.queries.forEach(m=>{m.onOnline()})})}}},83393:function(m,g,v){"use strict";v.d(g,{S:function(){return QueryClient}});var x=v(36370),k=v(5165),E=v(3709),T=v(96278),K=v(22436);let MutationCache=class MutationCache extends K.l{constructor(m){super(),this.config=m||{},this.mutations=[],this.mutationId=0}build(m,g,v){let x=new T.m({mutationCache:this,logger:m.getLogger(),mutationId:++this.mutationId,options:m.defaultMutationOptions(g),state:v,defaultOptions:g.mutationKey?m.getMutationDefaults(g.mutationKey):void 0});return this.add(x),x}add(m){this.mutations.push(m),this.notify({type:"added",mutation:m})}remove(m){this.mutations=this.mutations.filter(g=>g!==m),this.notify({type:"removed",mutation:m})}clear(){E.V.batch(()=>{this.mutations.forEach(m=>{this.remove(m)})})}getAll(){return this.mutations}find(m){return void 0===m.exact&&(m.exact=!0),this.mutations.find(g=>(0,x.X7)(m,g))}findAll(m){return this.mutations.filter(g=>(0,x.X7)(m,g))}notify(m){E.V.batch(()=>{this.listeners.forEach(({listener:g})=>{g(m)})})}resumePausedMutations(){var m;return this.resuming=(null!=(m=this.resuming)?m:Promise.resolve()).then(()=>{let m=this.mutations.filter(m=>
46m.state.isPaused);return E.V.batch(()=>m.reduce((m,g)=>m.then(()=>g.continue().catch(x.ZT)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}};var et=v(85289),en=v(63240);function getNextPageParam(m,g){return null==m.getNextPageParam?void 0:m.getNextPageParam(g[g.length-1],g)}var er=v(714);let QueryClient=class QueryClient{constructor(m={}){this.queryCache=m.queryCache||new k.t,this.mutationCache=m.mutationCache||new MutationCache,this.logger=m.logger||er._,this.defaultOptions=m.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=et.j.subscribe(()=>{et.j.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=en.N.subscribe(()=>{en.N.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var m,g;this.mountCount--,0===this.mountCount&&(null==(m=this.unsubscribeFocus)||m.call(this),this.unsubscribeFocus=void 0,null==(g=this.unsubscribeOnline)||g.call(this),this.unsubscribeOnline=void 0)}isFetching(m,g){let[v]=(0,x.I6)(m,g);return v.fetchStatus="fetching",this.queryCache.findAll(v).length}isMutating(m){return this.mutationCache.findAll({...m,fetching:!0}).length}getQueryData(m,g){var v;return null==(v=this.queryCache.find(m,g))?void 0:v.state.data}ensureQueryData(m,g,v){let k=(0,x._v)(m,g,v),E=this.getQueryData(k.queryKey);return E?Promise.resolve(E):this.fetchQuery(k)}getQueriesData(m){return this.getQueryCache().findAll(m).map(({queryKey:m,state:g})=>{let v=g.data;return[m,v]})}setQueryData(m,g,v){let k=this.queryCache.find(m),E=null==k?void 0:k.state.data,T=(0,x.SE)(g,E);if(void 0===T)return;let K=(0,x._v)(m),et=this.defaultQueryOptions(K);return this.queryCache.build(this,et).setData(T,{...v,manual:!0})}setQueriesData(m,g,v){return E.V.batch(()=>this.getQueryCache().findAll(m).map(({queryKey:m})=>[m,this.setQueryData(m,g,v)]))}getQueryState(m,g){var v;return null==(v=this.queryCache.find(m,g))?void 0:v.state}removeQueries(m,g){let[v]=(0,x.I6)(m,g),k=this.queryCache;E.V.batch(()=>{k.findAll(v).forEach(m=>{k.remove(m)})})}resetQueries(m,g,v){let[k,T]=(0,x.I6)(m,g,v),K=this.queryCache,et={type:"active",...k};return E.V.batch(()=>
46(K.findAll(k).forEach(m=>{m.reset()}),this.refetchQueries(et,T)))}cancelQueries(m,g,v){let[k,T={}]=(0,x.I6)(m,g,v);void 0===T.revert&&(T.revert=!0);let K=E.V.batch(()=>this.queryCache.findAll(k).map(m=>m.cancel(T)));return Promise.all(K).then(x.ZT).catch(x.ZT)}invalidateQueries(m,g,v){let[k,T]=(0,x.I6)(m,g,v);return E.V.batch(()=>{var m,g;if(this.queryCache.findAll(k).forEach(m=>{m.invalidate()}),"none"===k.refetchType)return Promise.resolve();let v={...k,type:null!=(m=null!=(g=k.refetchType)?g:k.type)?m:"active"};return this.refetchQueries(v,T)})}refetchQueries(m,g,v){let[k,T]=(0,x.I6)(m,g,v),K=E.V.batch(()=>this.queryCache.findAll(k).filter(m=>!m.isDisabled()).map(m=>{var g;return m.fetch(void 0,{...T,cancelRefetch:null==(g=null==T?void 0:T.cancelRefetch)||g,meta:{refetchPage:k.refetchPage}})})),et=Promise.all(K).then(x.ZT);return null!=T&&T.throwOnError||(et=et.catch(x.ZT)),et}fetchQuery(m,g,v){let k=(0,x._v)(m,g,v),E=this.defaultQueryOptions(k);void 0===E.retry&&(E.retry=!1);let T=this.queryCache.build(this,E);return T.isStaleByTime(E.staleTime)?T.fetch(E):Promise.resolve(T.state.data)}prefetchQuery(m,g,v){return this.fetchQuery(m,g,v).then(x.ZT).catch(x.ZT)}fetchInfiniteQuery(m,g,v){let k=(0,x._v)(m,g,v);return k.behavior={onFetch:m=>{m.fetchFn=()=>{var g,v,x,k,E,T,K;let et;let en=null==(g=m.fetchOptions)?void 0:null==(v=g.meta)?void 0:v.refetchPage,er=null==(x=m.fetchOptions)?void 0:null==(k=x.meta)?void 0:k.fetchMore,ei=null==er?void 0:er.pageParam,es=(null==er?void 0:er.direction)==="forward",el=(null==er?void 0:er.direction)==="backward",ec=(null==(E=m.state.data)?void 0:E.pages)||[],eu=(null==(T=m.state.data)?void 0:T.pageParams)||[],ed=eu,ep=!1,addSignalProperty=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{var g,v;return null!=(g=m.signal)&&g.aborted?ep=!0:null==(v=m.signal)||v.addEventListener("abort",()=>{ep=!0}),m.signal}})},em=m.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+m.options.queryHash+"'")),buildNewPages=(m,g,v,x)=>(ed=x?[g,...ed]:[...ed,g],x?[v,...m]:[...m,v]),fetchPage=(g,v,x,k)=>{if(ep)return Promise.reject("Cancelled");if(void 0===x&&!v&&g.length)return Promise.resolve(g);let E={queryKey:m.queryKey,pageParam:x,meta:m.options.meta};addSignalProperty(E);let T=em(E),K=Promise.resolve(T).then(m=>buildNewPages(g,x,m,k));return K};if(ec.length){if(es){let g=void 0!==ei,v=g?ei:getNextPageParam(m.options,ec);et=fetchPage(ec,g,v)}else if(el){let g=void 0!==ei,v=g?ei:null==(K=m.options).getPreviousPageParam?void 0:K.getPreviousPageParam(ec[0],ec);et=fetchPage(ec,g,v,!0)}else{ed=[];let g=void 0===m.options.getNextPageParam,v=!en||!ec[0]||en(ec[0],0,ec);et=v?fetchPage([],g,eu[0]):Promise.resolve(buildNewPages([],eu[0],ec[0]));for(let v=1;v<ec.length;v++)et=et.then(x=>{let k=!en||!ec[v]||en(ec[v],v,ec);if(k){let k=g?eu[v]:getNextPageParam(m.options,x);return fetchPage(x,g,k)}return Promise.resolve(buildNewPages(x,eu[v],ec[v]))})}}else et=fetchPage([]);let ef=et.then(m=>({pages:m,pageParams:ed}));return ef}}},this.fetchQuery(k)}prefetchInfiniteQuery(m,g,v){return this.fetchInfiniteQuery(m,g,v).then(x.ZT).catch(x.ZT)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(m){this.defaultOptions=m}setQueryDefaults(m,g){let v=this.queryDefaults.find(g=>(0,x.yF)(m)===(0,x.yF)(g.queryKey));v?v.defaultOptions=g:this.queryDefaults.push({queryKey:m,defaultOptions:g})}getQueryDefaults(m){if(!m)return;let g=this.queryDefaults.find(g=>(0,x.to)(m,g.queryKey));return null==g?void 0:g.defaultOptions}setMutationDefaults(m,g){let v=this.mutationDefaults.find(g=>(0,x.yF)(m)===(0,x.yF)(g.mutationKey));v?v.defaultOptions=g:this.mutationDefaults.push({mutationKey:m,defaultOptions:g})}getMutationDefaults(m){if(!m)return;let g=this.mutationDefaults.find(g=>(0,x.to)(m,g.mutationKey));return null==g?void 0:g.defaultOptions}defaultQueryOptions(m){if(null!=m&&m._defaulted)return m;let g={...this.defaultOptions.queries,...this.getQueryDefaults(null==m?void 0:m.queryKey),...m,_defaulted:!0};return!g.queryHash&&g.queryKey&&(g.queryHash=(0,x.Rm)(g.queryKey,g)),void 0===g.refetchOnReconnect&&(g.refetchOnReconnect="always"!==g.networkMode),void 0===g.useErrorBoundary&&(g.useErrorBoundary=!!g.suspense),g}defaultMutationOptions(m){return null!=m&&m._defaulted?m:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==m?void 0:m.mutationKey),...m,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}},91578:function(m,g,v){"use strict";v.d(g,{z:function(){return QueryObserver}});var x=v(36370),k=v(3709),E=v(85289),T=v(22436),K=v(3241);let QueryObserver=class QueryObserver extends T.l{constructor(m,g){super(),this.client=m,this.options=g,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(g)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),shouldFetchOnMount(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(m,g){let v=this.options,k=this.currentQuery;if(this.options=this.client.defaultQueryOptions(m),(0,x.VS)(v,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=v.queryKey),this.updateQuery();let E=this.hasListeners();E&&shouldFetchOptionally(this.currentQuery,k,this.options,v)&&this.executeFetch(),this.updateResult(g),E&&(this.currentQuery!==k||this.options.enabled!==v.enabled||this.options.staleTime!==v.staleTime)&&this.updateStaleTimeout();let T=this.computeRefetchInterval();E&&(this.currentQuery!==k||this.options.enabled!==v.enabled||T!==this.currentRefetchInterval)&&this.updateRefetchInterval(T)}getOptimisticResult(m){let g=this.client.getQueryCache().build(this.client,m),v=this.createResult(g,m);return m.keepPreviousData||(void 0!==m.placeholderData?!v.isPlaceholderData:(0,x.VS)(this.getCurrentResult(),v))||(this.currentResult=v,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),v}getCurrentResult(){return this.currentResult}trackResult(m){let g={};return Object.keys(m).forEach(v=>{Object.defineProperty(g,v,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(v),m[v])})}),g}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:m,...g}={}){return this.fetch({...g,meta:{refetchPage:m}})}fetchOptimistic(m){let g=this.client.defaultQueryOptions(m),v=this.client.getQueryCache().build(this.client,g);return v.isFetchingOptimistic=!0,v.fetch().then(()=>this.createResult(v,g))}fetch(m){var g;return this.executeFetch({...m,cancelRefetch:null==(g=m.cancelRefetch)||g}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(m){this.updateQuery();let g=this.currentQuery.fetch(this.options,m);return null!=m&&m.throwOnError||(g=g.catch(x.ZT)),g}updateStaleTimeout(){if(this.clearStaleTimeout(),x.sk||this.currentResult.isStale||!(0,x.PN)(this.options.staleTime))return;let m=(0,x.Kp)(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},m+1)}computeRefetchInterval(){var m;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(m=this.options.refetchInterval)&&m}updateRefetchInterval(m){this.clearRefetchInterval(),this.currentRefetchInterval=m,!x.sk&&!1!==this.options.enabled&&(0,x.PN)(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>
46{(this.options.refetchIntervalInBackground||E.j.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(m,g){let v;let k=this.currentQuery,E=this.options,T=this.currentResult,et=this.currentResultState,en=this.currentResultOptions,er=m!==k,ei=er?m.state:this.currentQueryInitialState,es=er?this.currentResult:this.previousQueryResult,{state:el}=m,{dataUpdatedAt:ec,error:eu,errorUpdatedAt:ed,fetchStatus:ep,status:em}=el,ef=!1,eh=!1;if(g._optimisticResults){let v=this.hasListeners(),x=!v&&shouldFetchOnMount(m,g),T=v&&shouldFetchOptionally(m,k,g,E);(x||T)&&(ep=(0,K.Kw)(m.options.networkMode)?"fetching":"paused",ec||(em="loading")),"isRestoring"===g._optimisticResults&&(ep="idle")}if(g.keepPreviousData&&!el.dataUpdatedAt&&null!=es&&es.isSuccess&&"error"!==em)v=es.data,ec=es.dataUpdatedAt,em=es.status,ef=!0;else if(g.select&&void 0!==el.data){if(T&&el.data===(null==et?void 0:et.data)&&g.select===this.selectFn)v=this.selectResult;else try{this.selectFn=g.select,v=g.select(el.data),v=(0,x.oE)(null==T?void 0:T.data,v,g),this.selectResult=v,this.selectError=null}catch(m){this.selectError=m}}else v=el.data;if(void 0!==g.placeholderData&&void 0===v&&"loading"===em){let m;if(null!=T&&T.isPlaceholderData&&g.placeholderData===(null==en?void 0:en.placeholderData))m=T.data;else if(m="function"==typeof g.placeholderData?g.placeholderData():g.placeholderData,g.select&&void 0!==m)try{m=g.select(m),this.selectError=null}catch(m){this.selectError=m}void 0!==m&&(em="success",v=(0,x.oE)(null==T?void 0:T.data,m,g),eh=!0)}this.selectError&&(eu=this.selectError,v=this.selectResult,ed=Date.now(),em="error");let eg="fetching"===ep,ev="loading"===em,ey="error"===em,eb={status:em,fetchStatus:ep,isLoading:ev,isSuccess:"success"===em,isError:ey,isInitialLoading:ev&&eg,data:v,dataUpdatedAt:ec,error:eu,errorUpdatedAt:ed,failureCount:el.fetchFailureCount,failureReason:el.fetchFailureReason,errorUpdateCount:el.errorUpdateCount,isFetched:el.dataUpdateCount>0||el.errorUpdateCount>0,isFetchedAfterMount:el.dataUpdateCount>ei.dataUpdateCount||el.errorUpdateCount>ei.errorUpdateCount,isFetching:eg,isRefetching:eg&&!ev,isLoadingError:ey&&0===el.dataUpdatedAt,isPaused:"paused"===ep,isPlaceholderData:eh,isPreviousData:ef,isRefetchError:ey&&0!==el.dataUpdatedAt,isStale:isStale(m,g),refetch:this.refetch,remove:this.remove};return eb}updateResult(m){let g=this.currentResult,v=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,(0,x.VS)(v,g))return;this.currentResult=v;let k={cache:!0};(null==m?void 0:m.listeners)!==!1&&(()=>{if(!g)return!0;let{notifyOnChangeProps:m}=this.options,v="function"==typeof m?m():m;if("all"===v||!v&&!this.trackedProps.size)return!0;let x=new Set(null!=v?v:this.trackedProps);return this.options.useErrorBoundary&&x.add("error"),Object.keys(this.currentResult).some(m=>{let v=this.currentResult[m]!==g[m];return v&&x.has(m)})})()&&(k.listeners=!0),this.notify({...k,...m})}updateQuery(){let m=this.client.getQueryCache().build(this.client,this.options);if(m===this.currentQuery)return;let g=this.currentQuery;this.currentQuery=m,this.currentQueryInitialState=m.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==g||g.removeObserver(this),m.addObserver(this))}onQueryUpdate(m){let g={};"success"===m.type?g.onSuccess=!m.manual:"error"!==m.type||(0,K.DV)(m.error)||(g.onError=!0),this.updateResult(g),this.hasListeners()&&this.updateTimers()}notify(m){k.V.batch(()=>{var g,v,x,k,E,T,K,et;m.onSuccess?(null==(g=(v=this.options).onSuccess)||g.call(v,this.currentResult.data),null==(x=(k=this.options).onSettled)||x.call(k,this.currentResult.data,null)):m.onError&&(null==(E=(T=this.options).onError)||E.call(T,this.currentResult.error),null==(K=(et=this.options).onSettled)||K.call(et,void 0,this.currentResult.error)),m.listeners&&this.listeners.forEac
46h(({listener:m})=>{m(this.currentResult)}),m.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}};function shouldFetchOnMount(m,g){return!1!==g.enabled&&!m.state.dataUpdatedAt&&!("error"===m.state.status&&!1===g.retryOnMount)||m.state.dataUpdatedAt>0&&shouldFetchOn(m,g,g.refetchOnMount)}function shouldFetchOn(m,g,v){if(!1!==g.enabled){let x="function"==typeof v?v(m):v;return"always"===x||!1!==x&&isStale(m,g)}return!1}function shouldFetchOptionally(m,g,v,x){return!1!==v.enabled&&(m!==g||!1===x.enabled)&&(!v.suspense||"error"!==m.state.status)&&isStale(m,v)}function isStale(m,g){return m.isStaleByTime(g.staleTime)}},53429:function(m,g,v){"use strict";v.d(g,{F:function(){return Removable}});var x=v(36370);let Removable=class Removable{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,x.PN)(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(m){this.cacheTime=Math.max(this.cacheTime||0,null!=m?m:x.sk?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}},3241:function(m,g,v){"use strict";v.d(g,{DV:function(){return isCancelledError},Kw:function(){return canFetch},Mz:function(){return createRetryer}});var x=v(85289),k=v(63240),E=v(36370);function defaultRetryDelay(m){return Math.min(1e3*2**m,3e4)}function canFetch(m){return(null!=m?m:"online")!=="online"||k.N.isOnline()}let CancelledError=class CancelledError{constructor(m){this.revert=null==m?void 0:m.revert,this.silent=null==m?void 0:m.silent}};function isCancelledError(m){return m instanceof CancelledError}function createRetryer(m){let g,v,T,K=!1,et=0,en=!1,er=new Promise((m,g)=>{v=m,T=g}),shouldPause=()=>!x.j.isFocused()||"always"!==m.networkMode&&!k.N.isOnline(),resolve=x=>{en||(en=!0,null==m.onSuccess||m.onSuccess(x),null==g||g(),v(x))},reject=v=>{en||(en=!0,null==m.onError||m.onError(v),null==g||g(),T(v))},pause=()=>new Promise(v=>{g=m=>{let g=en||!shouldPause();return g&&v(m),g},null==m.onPause||m.onPause()}).then(()=>{g=void 0,en||null==m.onContinue||m.onContinue()}),run=()=>{let g;if(!en){try{g=m.fn()}catch(m){g=Promise.reject(m)}Promise.resolve(g).then(resolve).catch(g=>{var v,x;if(en)return;let k=null!=(v=m.retry)?v:3,T=null!=(x=m.retryDelay)?x:defaultRetryDelay,er="function"==typeof T?T(et,g):T,ei=!0===k||"number"==typeof k&&et<k||"function"==typeof k&&k(et,g);if(K||!ei){reject(g);return}et++,null==m.onFail||m.onFail(et,g),(0,E.Gh)(er).then(()=>{if(shouldPause())return pause()}).then(()=>{K?reject(g):run()})})}};return canFetch(m.networkMode)?run():pause().then(run),{promise:er,cancel:g=>{en||(reject(new CancelledError(g)),null==m.abort||m.abort())},continue:()=>{let m=null==g?void 0:g();return m?er:Promise.resolve()},cancelRetry:()=>{K=!0},continueRetry:()=>{K=!1}}}},22436:function(m,g,v){"use strict";v.d(g,{l:function(){return Subscribable}});let Subscribable=class Subscribable{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(m){let g={listener:m};return this.listeners.add(g),this.onSubscribe(),()=>{this.listeners.delete(g),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},36370:function(m,g,v){"use strict";v.d(g,{A4:function(){return scheduleMicrotask},G9:function(){return getAbortController},Gh:function(){return sleep},I6:function(){return parseFilterArgs},Kp:function(){return timeUntilStale},PN:function(){return isValidTimeout},Rc:function(){return replaceAt},Rm:function(){return hashQueryKeyByOptions},SE:function(){return functionalUpdate},VS:function(){return shallowEqualObjects},X7:function(){return matchMutation},ZT:function(){return noop},_v:function(){return parseQueryArgs},_x:function(){return matchQuery},e5:function(){return difference},lV:function(){return parseMutationArgs},oE:function(){return replaceData},sk:function(){return x},to:function(){return partialMatchKey},yF:function(){return hashQueryKey}});let x="undefined"==typeof window||"Deno"in window;function noop(){}function functionalUpdate(m,g){return"function"==typeof m?m(g):m}function isValidTimeout(m){return"number"==typeof m&&m>=0&&m!==1/0}function difference(m,g){return m.filter(m=>!g.includes(m))}function replaceAt(m,g,v){let x=m.slice(0);return x[g]=v,x}function timeUntilStale(m,g){return Math.max(m+(g||0)-Date.now(),0)}function parseQueryArgs(m,g,v){return isQueryKey(m)?"function"==typeof g?{...v,queryKey:m,queryFn:g}:{...g,queryKey:m}:m}function parseMutationArgs(m,g,v){return isQueryKey(m)?"function"==typeof g?{...v,mutationKey:m,mutationFn:g}:{...g,mutationKey:m}:"function"==typeof m?{...g,mutationFn:m}:{...m}}function parseFilterArgs(m,g,v){return isQueryKey(m)?[{...g,queryKey:m},v]:[m||{},g]}function matchQuery(m,g){let{type:v="all",exact:x,fetchStatus:k,predicate:E,queryKey:T,stale:K}=m;if(isQueryKey(T)){if(x){if(g.queryHash!==hashQueryKeyByOptions(T,g.options))return!1}else{if(!partialDeepEqual(g.queryKey,T))return!1}}if("all"!==v){let m=g.isActive();if("active"===v&&!m||"inactive"===v&&m)return!1}return("boolean"!=typeof K||g.isStale()===K)&&(void 0===k||k===g.state.fetchStatus)&&(!E||!!E(g))}function matchMutation(m,g){let{exact:v,fetching:x,predicate:k,mutationKey:E}=m;
46if(isQueryKey(E)){if(!g.options.mutationKey)return!1;if(v){if(hashQueryKey(g.options.mutationKey)!==hashQueryKey(E))return!1}else{if(!partialDeepEqual(g.options.mutationKey,E))return!1}}return("boolean"!=typeof x||"loading"===g.state.status===x)&&(!k||!!k(g))}function hashQueryKeyByOptions(m,g){let v=(null==g?void 0:g.queryKeyHashFn)||hashQueryKey;return v(m)}function hashQueryKey(m){return JSON.stringify(m,(m,g)=>isPlainObject(g)?Object.keys(g).sort().reduce((m,v)=>(m[v]=g[v],m),{}):g)}function partialMatchKey(m,g){return partialDeepEqual(m,g)}function partialDeepEqual(m,g){return m===g||typeof m==typeof g&&!!m&&!!g&&"object"==typeof m&&"object"==typeof g&&!Object.keys(g).some(v=>!partialDeepEqual(m[v],g[v]))}function shallowEqualObjects(m,g){if(m&&!g||g&&!m)return!1;for(let v in m)if(m[v]!==g[v])return!1;return!0}function isPlainArray(m){return Array.isArray(m)&&m.length===Object.keys(m).length}function isPlainObject(m){if(!hasObjectPrototype(m))return!1;let g=m.constructor;if(void 0===g)return!0;let v=g.prototype;return!!(hasObjectPrototype(v)&&v.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(m){return"[object Object]"===Object.prototype.toString.call(m)}function isQueryKey(m){return Array.isArray(m)}function sleep(m){return new Promise(g=>{setTimeout(g,m)})}function scheduleMicrotask(m){sleep(0).then(m)}function getAbortController(){if("function"==typeof AbortController)return new AbortController}function replaceData(m,g,v){return null!=v.isDataEqual&&v.isDataEqual(m,g)?m:"function"==typeof v.structuralSharing?v.structuralSharing(m,g):!1!==v.structuralSharing?function replaceEqualDeep(m,g,v=0){if(m===g)return m;if(v>500)return g;let x=isPlainArray(m)&&isPlainArray(g);if(x||isPlainObject(m)&&isPlainObject(g)){let k=x?m.length:Object.keys(m).length,E=x?g:Object.keys(g),T=E.length,K=x?[]:{},et=0;for(let k=0;k<T;k++){let T=x?k:E[k];K[T]=replaceEqualDeep(m[T],g[T],v+1),K[T]===m[T]&&et++}return k===T&&et===k?m:K}return g}(m,g):g}},55830:function(m,g,v){"use strict";v.d(g,{NL:function(){return useQueryClient},aH:function(){return QueryClientProvider}});var x=v(2784);let k=x.createContext(void 0),E=x.createContext(!1);function getQueryClientContext(m,g){return m||(g&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=k),window.ReactQueryClientContext):k)}let useQueryClient=({context:m}={})=>{let g=x.useContext(getQueryClientContext(m,x.useContext(E)));if(!g)throw Error("No QueryClient set, use QueryClientProvider to set one");return g},QueryClientProvider=({client:m,children:g,context:v,contextSharing:k=!1})=>{x.useEffect(()=>(m.mount(),()=>{m.unmount()}),[m]);let T=getQueryClientContext(v,k);return x.createElement(E.Provider,{value:!v&&k},x.createElement(T.Provider,{value:m},g))}},92985:function(m,g,v){"use strict";let x;v.d(g,{_:function(){return useQueryErrorResetBoundary}});var k=v(2784);let E=k.createContext((x=!1,{clearReset:()=>{x=!1},reset:()=>{x=!0},isReset:()=>x})),useQueryErrorResetBoundary=()=>k.useContext(E)},8879:function(m,g,v){"use strict";v.d(g,{JN:function(){return useClearResetErrorBoundary},KJ:function(){return getHasError},pf:function(){return ensurePreventErrorBoundaryRetry}});var x=v(2784),k=v(99189);let ensurePreventErrorBoundaryRetry=(m,g)=>
46{(m.suspense||m.useErrorBoundary)&&!g.isReset()&&(m.retryOnMount=!1)},useClearResetErrorBoundary=m=>{x.useEffect(()=>{m.clearReset()},[m])},getHasError=({result:m,errorResetBoundary:g,useErrorBoundary:v,query:x})=>m.isError&&!g.isReset()&&!m.isFetching&&(0,k.L)(v,[m.error,x])},62257:function(m,g,v){"use strict";v.d(g,{S:function(){return useIsRestoring}});var x=v(2784);let k=x.createContext(!1),useIsRestoring=()=>x.useContext(k);k.Provider},87167:function(m,g,v){"use strict";v.d(g,{Fb:function(){return ensureStaleTime},SB:function(){return shouldSuspend},Z$:function(){return willFetch},j8:function(){return fetchOptimistic}});let ensureStaleTime=m=>{m.suspense&&("number"!=typeof m.staleTime&&(m.staleTime=1e3),"number"==typeof m.cacheTime&&(m.cacheTime=Math.max(m.cacheTime,1e3)))},willFetch=(m,g)=>m.isLoading&&m.isFetching&&!g,shouldSuspend=(m,g,v)=>(null==m?void 0:m.suspense)&&willFetch(g,v),fetchOptimistic=(m,g,v)=>g.fetchOptimistic(m).then(({data:g})=>{null==m.onSuccess||m.onSuccess(g),null==m.onSettled||m.onSettled(g,null)}).catch(g=>{v.clearReset(),null==m.onError||m.onError(g),null==m.onSettled||m.onSettled(void 0,g)})},62350:function(m,g,v){"use strict";v.d(g,{D:function(){return useMutation}});var x=v(2784),k=v(36370),E=v(96278),T=v(3709),K=v(22436);let MutationObserver=class MutationObserver extends K.l{constructor(m,g){super(),this.client=m,this.setOptions(g),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(m){var g;let v=this.options;this.options=this.client.defaultMutationOptions(m),(0,k.VS)(v,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(g=this.currentMutation)||g.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var m;null==(m=this.currentMutation)||m.removeObserver(this)}}onMutationUpdate(m){this.updateResult();let g={listeners:!0};"success"===m.type?g.onSuccess=!0:"error"===m.type&&(g.onError=!0),this.notify(g)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(m,g){return this.mutateOptions=g,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==m?m:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let m=this.currentMutation?this.currentMutation.state:(0,E.R)(),g="loading"===m.status,v={...m,isLoading:g,isPending:g,isSuccess:"success"===m.status,isError:"error"===m.status,isIdle:"idle"===m.status,mutate:this.mutate,reset:this.reset};this.currentResult=v}notify(m){T.V.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var g,v,x,k,E,T,K,et;m.onSuccess?(null==(g=(v=this.mutateOptions).onSuccess)||g.call(v,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(x=(k=this.mutateOptions).onSettled)||x.call(k,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):m.onError&&(null==(E=(T=this.mutateOptions).onError)||E.call(T,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(K=(et=this.mutateOptions).onSettled)||K.call(et,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}m.listeners&&this.listeners.forEach(({listener:m})=>{m(this.currentResult)})})}};var et=v(29930),en=v(55830),er=v(99189);function useMutation(m,g,v){let E=(0,k.lV)(m,g,v),K=(0,en.NL)({context:E.context}),[ei]=x.useState(()=>new MutationObserver(K,E));x.useEffect(()=>{ei.setOptions(E)},[ei,E]);let es=(0,et.$)(x.useCallback(m=>ei.subscribe(T.V.batchCalls(m)),[ei]),()=>ei.getCurrentResult(),()=>ei.getCurrentResult()),el=x.useCallback((m,g)=>{ei.mutate(m,g).catch(noop)},[ei]);if(es.error&&(0,er.L)(ei.options.useErrorBoundary,[es.error]))throw es.error;return{...es,mutate:el,mutateAsync:es.mutate}}function noop(){}},7040:function(m,g,v){"use strict";v.d(g,{a:function(){return useQuery}});var x=v(36370),k=v(91578),E=v(2784),T=v(3709),K=v(29930),et=v(92985),en=v(55830),er=v(62257),ei=v(8879),es=v(87167);function useQuery(m,g,v){let el=(0,x._v)(m,g,v);return function(m,g){let v=(0,en.NL)({context:m.context}),x=(0,er.S)(),k=(0,et._)(),el=v.defaultQueryOptions(m);el._optimisticResults=x?"isRestoring":"optimistic",el.onError&&(el.onError=T.V.batchCalls(el.onError)),el.onSuccess&&(el.onSuccess=T.V.batchCalls(el.onSuccess)),el.onSettled&&(el.onSettled=T.V.batchCalls(el.onSettled)),(0,es.Fb)(el),(0,ei.pf)(el,k),(0,ei.JN)(k);let[ec]=E.useState(()=>new g(v,el)),eu=ec.getOptimisticResult(el);if((0,K.$)(E.useCallback(m=>{let g=x?()=>void 0:ec.subscribe(T.V.batchCalls(m));return ec.updateResult(),g},[ec,x]),()=>ec.getCurrentResult(),()=>ec.getCurrentResult()),E.useEffect(()=>{ec.setOptions(el,{listeners:!1})},[el,ec]),(0,es.SB)(el,eu,x))throw(0,es.j8)(el,ec,k);if((0,ei.KJ)({result:eu,errorResetBoundary:k,useErrorBoundary:el.useErrorBoundary,query:ec.getCurrentQuery()}))throw eu.error;return el.notifyOnChangeProps?eu:ec.trackResult(eu)}(el,k.z)}},29930:function(m,g,v){"use strict";v.d(g,{$:function(){return k}});var x=v(43100);let k=x.useSyncExternalStore},99189:function(m,g,v){"use strict";function shouldThrowError(m,g){return"function"==typeof m?m(...g):!!m}v.d(g,{L:function(){return shouldThrowError}})},10929:function(m,g,v){"use strict";v.d(g,{j:function(){return cva}});var x=v(40489);let falsyToString=m=>"boolean"==typeof m?`${m}`:0===m?"0":m,k=x.W,cva=(m,g)=>v=>{var x;if((null==g?void 0:g.variants)==null)return k(m,null==v?void 0:v.class,null==v?void 0:v.className);let{variants:E,defaultVariants:T}=g,K=Object.keys(E).map(m=>{let g=null==v?void 0:v[m],x=null==T?void 0:T[m];if(null===g)return null;let k=falsyToString(g)||falsyToString(x);return E[m][k]}
46),et=v&&Object.entries(v).reduce((m,g)=>{let[v,x]=g;return void 0===x||(m[v]=x),m},{}),en=null==g?void 0:null===(x=g.compoundVariants)||void 0===x?void 0:x.reduce((m,g)=>{let{class:v,className:x,...k}=g;return Object.entries(k).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...T,...et}[g]):({...T,...et})[g]===v})?[...m,v,x]:m},[]);return k(m,K,en,null==v?void 0:v.class,null==v?void 0:v.className)}},40489:function(m,g,v){"use strict";function clsx(){for(var m,g,v=0,x="",k=arguments.length;v<k;v++)(m=arguments[v])&&(g=function r(m){var g,v,x="";if("string"==typeof m||"number"==typeof m)x+=m;else if("object"==typeof m){if(Array.isArray(m)){var k=m.length;for(g=0;g<k;g++)m[g]&&(v=r(m[g]))&&(x&&(x+=" "),x+=v)}else for(v in m)m[v]&&(x&&(x+=" "),x+=v)}return x}(m))&&(x&&(x+=" "),x+=g);return x}v.d(g,{W:function(){return clsx}}),g.Z=clsx},10763:function(m,g,v){"use strict";v.d(g,{Z:function(){return createLucideIcon}});var x=v(2784);/**
47 * @license lucide-react v1.31.0 - ISC
48 *
49 * This source code is licensed under the ISC license.
50 * See the LICENSE file in the root directory of this source tree.
51 */let mergeClasses=(...m)=>m.filter((m,g,v)=>!!m&&""!==m.trim()&&v.indexOf(m)===g).join(" ").trim(),toKebabCase=m=>m.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),toCamelCase=m=>m.replace(/^([A-Z])|[\s-_]+(\w)/g,(m,g,v)=>v?v.toUpperCase():g.toLowerCase()),toPascalCase=m=>{let g=toCamelCase(m);return g.charAt(0).toUpperCase()+g.slice(1)};/**
52 * @license lucide-react v1.31.0 - ISC
53 *
54 * This source code is licensed under the ISC license.
55 * See the LICENSE file in the root directory of this source tree.
56 */var k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
57 * @license lucide-react v1.31.0 - ISC
58 *
59 * This source code is licensed under the ISC license.
60 * See the LICENSE file in the root directory of this source tree.
61 */let hasA11yProp=m=>{for(let g in m)if(g.startsWith("aria-")||"role"===g||"title"===g)return!0;return!1},E=(0,x.createContext)({}),useLucideContext=()=>(0,x.useContext)(E),T=(0,x.forwardRef)(({color:m,size:g,strokeWidth:v,absoluteStrokeWidth:E,className:T="",children:K,iconNode:et,...en},er)=>{let{size:ei=24,strokeWidth:es=2,absoluteStrokeWidth:el=!1,color:ec="currentColor",className:eu=""}=useLucideContext()??{},ed=E??el?24*Number(v??es)/Number(g??ei):v??es;return(0,x.createElement)("svg",{ref:er,...k,width:g??ei??k.width,height:g??ei??k.height,stroke:m??ec,strokeWidth:ed,className:mergeClasses("lucide",eu,T),...!K&&!hasA11yProp(en)&&{"aria-hidden":"true"},...en},[...et.map(([m,g])=>(0,x.createElement)(m,g)),...Array.isArray(K)?K:[K]])}),createLucideIcon=(m,g)=>{let v=(0,x.forwardRef)(({className:v,...k},E)=>(0,x.createElement)(T,{ref:E,iconNode:g,className:mergeClasses(`lucide-${toKebabCase(toPascalCase(m))}`,`lucide-${m}`,v),...k}));return v.displayName=toPascalCase(m),v}},78134:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},42710:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},2504:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]])},32263:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("calendar",[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]])},35682:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("cat",[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]])},6342:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},84713:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},70522:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},35882:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},31519:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},93227:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},46262:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},38681:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},80534:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},29245:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},66123:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},13057:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);
61let k=(0,x.Z)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},87078:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},68093:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]])},19679:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},12635:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]])},88557:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("dog",[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]])},70391:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},90708:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},59056:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},51279:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},49827:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},41983:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("gift",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8",key:"1sqzm4"}],["path",{d:"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5",key:"kc0143"}],["rect",{x:"3",y:"7",width:"18",height:"4",rx:"1",key:"1hberx"}]])},28416:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]])},37813:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]])},72009:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},69405:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},66477:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])},49759:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},37175:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},85530:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},16573:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]])},32301:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},53244:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},97501:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("refresh-cw",[["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"}]])},51804:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},69494:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},95369:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]])},85913:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);
61let k=(0,x.Z)("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"}]])},79654:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},7313:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},59507:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]])},10371:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]])},4028:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},28115:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]])},48618:function(m,g,v){"use strict";v.d(g,{Z:function(){return k}});var x=v(10763);let k=(0,x.Z)("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]])},68717:function(m,g,v){"use strict";function ensureSynchronous(m,g){if(m instanceof Promise)throw Error(g)}v.d(g,{O:function(){return K}});var x=v(93542),k=v(93542),E=v(53538),T=v(93542);let K=function(m){let g="object"==typeof m.client?m.client:{},v="object"==typeof m.server?m.server:{},E=m.shared,T=m.runtimeEnv?m.runtimeEnv:{...k.env,...m.experimental__runtimeEnv};return function(m){let g=m.runtimeEnvStrict??m.runtimeEnv??x.env;if(m.emptyStringAsUndefined)for(let[m,v]of Object.entries(g))""===v&&delete g[m];if(m.skipValidation){if(m.extends)for(let g of m.extends)g.skipValidation=!0;return g}let v="object"==typeof m.client?m.client:{},k="object"==typeof m.server?m.server:{},E="object"==typeof m.shared?m.shared:{},T=m.isServer??("undefined"==typeof window||"Deno"in window),K=T?{...k,...E,...v}:{...v,...E},et=m.createFinalSchema?.(K,T)?.["~standard"].validate(g)??function(m,g){let v={},x=[];for(let k in m){let E=m[k]["~standard"].validate(g[k]);if(ensureSynchronous(E,`Validation must be synchronous, but ${k} returned a Promise.`),E.issues){x.push(...E.issues.map(m=>({...m,message:m.message,path:[k,...m.path??[]]})));continue}v[k]=E.value}return x.length?{issues:x}:{value:v}}(K,g);ensureSynchronous(et,"Validation must be synchronous");let en=m.onValidationError??(m=>{throw console.error("❌ Invalid environment variables:",m),Error("Invalid environment variables")}),er=m.onInvalidAccess??(()=>{throw Error("❌ Attempted to access a server-side environment variable on the client")});if(et.issues)return en(et.issues);let isServerAccess=g=>!m.clientPrefix||!g.startsWith(m.clientPrefix)&&!(g in E),isValidServerAccess=m=>T||!isServerAccess(m),ignoreProp=m=>"__esModule"===m||"$$typeof"===m,ei=(m.extends??[]).reduce((m,g)=>Object.assign(m,g),{}),es=Object.assign(ei,et.value);return new Proxy(es,{get(m,g){if("string"==typeof g&&!ignoreProp(g))return isValidServerAccess(g)?Reflect.get(m,g):er(g)}})}({...m,shared:E,client:g,server:v,clientPrefix:"NEXT_PUBLIC_",runtimeEnv:T})}({client:{NEXT_PUBLIC_BASE_URL:E.Z_().url(),NEXT_PUBLIC_BYPASS_CAPTCHA:E.Z_().transform(m=>"true"===m).optional(),NEXT_PUBLIC_CURRENT_PRODUCT_ID:E.Z_().pipe(E.oQ.number()),NEXT_PUBLIC_CUSTOMERIO_ANALYTICS_KEY:E.Z_().optional(),NEXT_PUBLIC_ENABLE_WAITLIST:E.Z_().transform(m=>"true"===m).optional(),NEXT_PUBLIC_GA4_MEASUREMENT_ID:E.Z_().regex(/^G-[A-Z0-9]+$/),NEXT_PUBLIC_INTERCOM_ID:E.Z_(),NEXT_PUBLIC_MAINTENANCE_END_DATETIME:E.Z_().datetime(),NEXT_PUBLIC_MAINTENANCE_START_DATETIME:E.Z_().datetime(),NEXT_PUBLIC_MERCADO_PAGO_PUBLIC_KEY:E.Z_(),NEXT_PUBLIC_META_PIXEL_ID:E.Z_().regex(/^\d+$/).optional(),NEXT_PUBLIC_METRICOOL_HASH:E.Z_().optional(),NEXT_PUBLIC_POSTHOG_KEY:E.Z_().optional(),NEXT_PUBLIC_RECAPTCHA_KEY:E.Z_(),NEXT_PUBLIC_S3_BUCKET_URL:E.Z_().url(),NEXT_PUBLIC_SALES_COMMISSION:E.Z_().pipe(E.oQ.number()),NEXT_PUBLIC_SITE_URL:E.Z_().url(),NEXT_PUBLIC_TIKTOK_PIXEL_ID:E.Z_().optional(),NEXT_PUBLIC_TOKU_ACCOUNT_ID:E.Z_(),NEXT_PUBLIC_TOKU_PUBLIC_API_KEY:E.Z_()},runtimeEnv:{LANGGRAPH_API_KEY:T.env.LANGGRAPH_API_KEY,LANGGRAPH_URL:T.env.LANGGRAPH_URL,NEXT_PUBLIC_BASE_URL:"https://api.cacttus.cl",NEXT_PUBLIC_BYPASS_CAPTCHA:T.env.NEXT_PUBLIC_BYPASS_CAPTCHA,NEXT_PUBLIC_CURRENT_PRODUCT_ID:"7",NEXT_PUBLIC_CUSTOMERIO_ANALYTICS_KEY:"8df18c5aefd17371fc03",NEXT_PUBLIC_ENABLE_WAITLIST:T.env.NEXT_PUBLIC_ENABLE_WAITLIST,NEXT_PUBLIC_GA4_MEASUREMENT_ID:"G-BHC7ZYSPBE",NEXT_PUBLIC_INTERCOM_ID:"ux4kq07g",NEXT_PUBLIC_MAINTENANCE_END_DATETIME:"2025-01-09T00:00:00.000Z",NEXT_PUBLIC_MAINTENANCE_START_DATETIME:"2025-01-09T00:00:00.000Z",NEXT_PUBLIC_MERCADO_PAGO_PUBLIC_KEY:"APP_USR-d954f598-4549-41b4-a686-37ae2f6a5990",NEXT_PUBLIC_META_PIXEL_ID:"213280107357740",NEXT_PUBLIC_METRICOOL_HASH:"8148ccfc1535ef5dff4d220383b9f2b2",NEXT_PUBLIC_POSTHOG_KEY:"phc_CkrovvdJ783ZoRnQSHEXHi4gX6ciXhKfymq7p7HW6SPW",NEXT_PUBLIC_RECAPTCHA_KEY:"6LdyFE8qAAAAAAQGGv9etZkGAEsaI9ryK3jcjAeq",NEXT_PUBLIC_S3_BUCKET_URL:"https://cacttus-media-prod.s3.amazonaws.com/",NEXT_PUBLIC_SALES_COMMISSION:"0.35",NEXT_PUBLIC_SITE_URL:"https://cacttus.cl",NEXT_PUBLIC_TIKTOK_PIXEL_ID:"
61CRETUG3C77U0HUGHPTV0",NEXT_PUBLIC_TOKU_ACCOUNT_ID:"acc_kljyuKS1z4lEA04-Apu_xmeJ0d1MtKaB",NEXT_PUBLIC_TOKU_PUBLIC_API_KEY:"-0gzINg7e79vPSZOX6sRvprTYtFUII-wY51da5fB1Eo",NOTION_API_KEY:T.env.NOTION_API_KEY,NOTION_APPLICATIONS_DATABASE_ID:T.env.NOTION_APPLICATIONS_DATABASE_ID,NOTION_JOBS_DATABASE_ID:T.env.NOTION_JOBS_DATABASE_ID},server:{LANGGRAPH_API_KEY:E.Z_().optional(),LANGGRAPH_URL:E.Z_().url().optional(),NOTION_API_KEY:E.Z_().optional(),NOTION_APPLICATIONS_DATABASE_ID:E.Z_().optional(),NOTION_JOBS_DATABASE_ID:E.Z_().optional()}})},63955:function(m,g,v){"use strict";v.d(g,{Gc:function(){return useFormContext},KN:function(){return appendErrors},Qr:function(){return Controller},RV:function(){return FormProvider},U2:function(){return get},bc:function(){return useController},cI:function(){return useForm},cl:function(){return useFormState},t8:function(){return set}});var x=v(2784),isCheckBoxInput=m=>"checkbox"===m.type,isFileInput=m=>"file"===m.type,isDateObject=m=>m instanceof Date,isNullOrUndefined=m=>null==m;let isObjectType=m=>"object"==typeof m;var isObject=m=>!isNullOrUndefined(m)&&!Array.isArray(m)&&isObjectType(m)&&!isDateObject(m),getEventValue=m=>isObject(m)&&m.target?isCheckBoxInput(m.target)?m.target.checked:isFileInput(m.target)?m.target.files:m.target.value:m,isNameInFieldArray=(m,g)=>g.split(".").some((g,v,x)=>!isNaN(Number(g))&&m.has(x.slice(0,v).join("."))),isPlainObject=m=>{let g=m.constructor&&m.constructor.prototype;return isObject(g)&&g.hasOwnProperty("isPrototypeOf")},k="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function cloneObject(m){if(m instanceof Date)return new Date(m);let g="undefined"!=typeof FileList&&m instanceof FileList;if(k&&(m instanceof Blob||g))return m;let v=Array.isArray(m);if(!v&&!(isObject(m)&&isPlainObject(m)))return m;let x=v?[]:Object.create(Object.getPrototypeOf(m));for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(x[g]=cloneObject(m[g]));return x}let E={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},T={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},K={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},et="root",en=["__proto__","constructor","prototype"],er=/^\w*$/;var isKey=m=>er.test(m),isUndefined=m=>void 0===m;let ei=/[.[\]'"]/;var stringToPath=m=>m.split(ei).filter(Boolean),get=(m,g,v)=>{if(!g||!isObject(m))return v;let x=isKey(g)?[g]:stringToPath(g);if(x.some(m=>en.includes(m)))return v;let k=x.reduce((m,g)=>isNullOrUndefined(m)?void 0:m[g],m);return isUndefined(k)||k===m?isUndefined(m[g])?v:m[g]:k},isBoolean=m=>"boolean"==typeof m,isFunction=m=>"function"==typeof m,set=(m,g,v)=>{let x=-1,k=isKey(g)?[g]:stringToPath(g),E=k.length,T=E-1;for(;++x<E;){let g=k[x],E=v;if(x!==T){let v=m[g];E=isObject(v)||Array.isArray(v)?v:isNaN(+k[x+1])?{}:[]}if(en.includes(g))return;m[g]=E,m=m[g]}};let es=x.createContext(null);es.displayName="HookFormControlContext";let useFormControlContext=()=>x.useContext(es);var getProxyFormState=(m,g,v,x=!0)=>{let k={};for(let E in m)Object.defineProperty(k,E,{get:()=>(g._proxyFormState[E]!==T.all&&(g._proxyFormState[E]=!x||T.all),v&&(v[E]=!0),m[E])});return k};let el=k?x.useLayoutEffect:x.useEffect;var isPrimitive=m=>isNullOrUndefined(m)||!isObjectType(m);let isEmptyObjectWithCustomPrototype=(m,g)=>0===g.length&&!Array.isArray(m)&&!isPlainObject(m);function deepEqual(m,g,v=new WeakMap){if(m===g)return!0;if(isPrimitive(m)||isPrimitive(g))return Object.is(m,g);if(isDateObject(m)&&isDateObject(g))return Object.is(m.getTime(),g.getTime());let x=Object.keys(m),k=Object.keys(g);if(x.length!==k.length)return!1;if(isEmptyObjectWithCustomPrototype(m,x)||isEmptyObjectWithCustomPrototype(g,k))return Object.is(m,g);if(!x.length&&Array.isArray(m)!==Array.isArray(g))return!1;let E=v.get(m);if(E&&E.has(g))return!0;if(E)E.add(g);else{let x=new WeakSet;x.add(g),v.set(m,x)}for(let k of x){let x=m[k];if(!(k in g))return!1;if("ref"!==k){let m=g[k];if(isDateObject(x)&&isDateObject(m)||(isObject(x)||Array.isArray(x))&&(isObject(m)||Array.isArray(m))?!deepEqual(x,m,v):!Object.is(x,m))return!1}}return!0}function useResyncOnReconnect(){let m=x.useRef(!1),g=x.useRef(void 0),v=x.useCallback((v,x,k)=>{if(v&&m.current){let m=x();deepEqual(g.current,m)||k(m)}m.current=!0},[]),k=x.useCallback((m,v)=>{m&&(g.current=cloneObject(v()))},[]);return{resyncIfNeeded:v,snapshot:k}}function useFormState(m){let g=useFormControlContext(),{control:v=g,disabled:k,name:E,exact:T}=m||{}
61,[K,et]=x.useState(()=>({...v._formState,defaultValues:v._defaultValues})),en=x.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:er,snapshot:ei}=useResyncOnReconnect();return el(()=>{let getCurrentFormState=()=>({...v._formState,defaultValues:v._defaultValues});er(!k,getCurrentFormState,et);let m=v._subscribe({name:E,formState:en.current,exact:T,callback:m=>{k||et({...v._formState,...m,defaultValues:v._defaultValues})}});return()=>{m(),ei(!k,getCurrentFormState)}},[E,k,T,er,ei]),x.useEffect(()=>{en.current.isValid&&v._setValid(!0)},[v]),x.useMemo(()=>getProxyFormState(K,v,en.current,!1),[K,v])}var isString=m=>"string"==typeof m,generateWatchOutput=(m,g,v,x,k)=>isString(m)?(x&&g.watch.add(m),get(v,m,k)):Array.isArray(m)?m.map(m=>(x&&g.watch.add(m),get(v,m))):(x&&(g.watchAll=!0),v);function useController(m){let g=useFormControlContext(),{name:v,disabled:k,control:T=g,shouldUnregister:K,defaultValue:et,exact:en=!0}=m,er=isNameInFieldArray(T._names.array,v),ei=x.useMemo(()=>get(T._formValues,v,get(T._defaultValues,v,et)),[T,v,et]),es=function(m){let g=useFormControlContext(),{control:v=g,name:k,defaultValue:E,disabled:T,exact:K,compute:et}=m||{},en=x.useRef(E),er=x.useRef(et),ei=x.useRef(void 0),es=x.useRef(v),ec=x.useRef(k);er.current=et;let[eu,ed]=x.useState(()=>{let m=v._getWatch(k,en.current);return er.current?er.current(m):m}),ep=x.useCallback(m=>{let g=generateWatchOutput(k,v._names,m||v._formValues,!1,en.current);return er.current?er.current(g):g},[v._formValues,v._names,k]),em=x.useCallback(m=>{if(!T){let g=generateWatchOutput(k,v._names,m||v._formValues,!1,en.current);if(er.current){let m=er.current(g);deepEqual(m,ei.current)||(ed(m),ei.current=m)}else ed(g)}},[v._formValues,v._names,T,k]),{resyncIfNeeded:ef,snapshot:eh}=useResyncOnReconnect(),eg=x.useRef(em);eg.current=em;let ev=x.useRef(ep);ev.current=ep,el(()=>{es.current===v&&deepEqual(ec.current,k)?ef(!T,()=>ev.current(),m=>{ed(m),ei.current=m}):(es.current=v,ec.current=k,eg.current());let m=v._subscribe({name:k,formState:{values:!0},exact:K,callback:m=>{eg.current(m.values)}});return()=>{m(),eh(!T,()=>ev.current())}},[v,K,k,T,ef,eh]),x.useEffect(()=>v._removeUnmounted());let ey=es.current!==v,eb=ec.current,ex=x.useMemo(()=>{if(T)return null;let m=!ey&&!deepEqual(eb,k),g=ey||m;return g?ep():null},[T,ey,k,eb,ep]);return null!==ex?ex:eu}({control:T,name:v,defaultValue:ei,exact:en}),ec=useFormState({control:T,name:v,exact:en}),eu=x.useRef(m),ed=x.useRef(null),ep=x.useRef(T.register(v,{...m.rules,value:es,...isBoolean(m.disabled)?{disabled:m.disabled}:{}}));eu.current=m;let em=x.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get(ec.errors,v)},isDirty:{enumerable:!0,get:()=>!!get(ec.dirtyFields,v)},isTouched:{enumerable:!0,get:()=>!!get(ec.touchedFields,v)},isValidating:{enumerable:!0,get:()=>!!get(ec.validatingFields,v)},error:{enumerable:!0,get:()=>get(ec.errors,v)}}),[ec,v]),ef=x.useCallback(m=>{let g=getEventValue(m);return get(T._fields,v)||(ep.current=T.register(v,{...eu.current.rules,value:g})),ep.current.onChange({target:{value:getEventValue(m),name:v},type:E.CHANGE})},[v,T]),eh=x.useCallback(()=>ep.current.onBlur({target:{value:get(T._formValues,v),name:v},type:E.BLUR}),[v,T._formValues]),eg=x.useCallback(m=>{m&&(ed.current={focus:()=>isFunction(m.focus)&&m.focus(),select:()=>isFunction(m.select)&&m.select(),setCustomValidity:g=>isFunction(m.setCustomValidity)&&m.setCustomValidity(g),reportValidity:()=>isFunction(m.reportValidity)&&m.reportValidity()});let g=get(T._fields,v);g&&g._f&&m&&(g._f.ref=ed.current)},[T._fields,v]),ev=x.useMemo(()=>({name:v,value:es,...isBoolean(k)||ec.disabled?{disabled:ec.disabled||k}:{},onChange:ef,onBlur:eh,ref:eg}),[v,k,ec.disabled,ef,eh,eg,es]);return x.useEffect(()=>{let m=T._options.shouldUnregister||K;ep.current=T.register(v,{...eu.current.rules,...isBoolean(eu.current.disabled)?{disabled:eu.current.disabled}:{}});let updateMounted=(m,g)=>{let v=get(T._fields,m);v&&v._f&&(v._f.mount=g)};if(updateMounted(v,!0),m){let m=cloneObject(get(K?T._defaultValues:T._options.values||T._defaultValues,v,get(T._options.defaultValues,v,eu.current.defaultValue)));set(T._defaultValues,v,m),isUndefined(get(T._formValues,v))&&set(T._formValues,v,m)}if(er||T.register(v),ed.current){let m=get(T._fields,v);
61m&&m._f&&(m._f.ref=ed.current)}return()=>{(er?m&&!T._state.action:m)?T.unregister(v):updateMounted(v,!1)}},[v,T,er,K]),x.useEffect(()=>{T._setDisabledField({disabled:k,name:v})},[k,v,T]),x.useMemo(()=>({field:ev,formState:ec,fieldState:em}),[ev,ec,em])}let Controller=m=>m.render(useController(m));var getValidationModes=m=>({isOnSubmit:!m||m===T.onSubmit,isOnBlur:m===T.onBlur,isOnChange:m===T.onChange,isOnAll:m===T.all,isOnTouch:m===T.onTouched}),isWatched=(m,g,v)=>{if(v)return!1;if(g.watchAll||g.watch.has(m))return!0;for(let v of g.watch)if(m.startsWith(v)&&"."===m.charAt(v.length))return!0;return!1};let iterateFieldsByAction=(m,g,v,x)=>{for(let k of v||Object.keys(m)){if("_f"===k)continue;let E=v?get(m,k):m[k];if(E){let{_f:m}=E;if(m){if(m.refs&&m.refs[0]&&g(m.refs[0],k)&&!x||m.ref&&g(m.ref,m.name)&&!x)return!0;if(iterateFieldsByAction(E,g))break}else if((isObject(E)||Array.isArray(E))&&iterateFieldsByAction(E,g))break}}};var updateFieldArrayRootError=(m,g,v)=>{let x=get(m,v),k=Array.isArray(x)?x:[];return set(k,et,g[v]),set(m,v,k),m},isEmptyObject=m=>isObject(m)&&!Object.keys(m).length,isHTMLElement=m=>{if(!k)return!1;let g=m?m.ownerDocument:0;return m instanceof(g&&g.defaultView?g.defaultView.HTMLElement:HTMLElement)},isRadioInput=m=>"radio"===m.type,isRegex=m=>m instanceof RegExp,appendErrors=(m,g,v,x,k)=>g?{...v[m],types:{...v[m]&&v[m].types?v[m].types:{},[x]:k||!0}}:{};let ec={value:!1,isValid:!1},eu={value:!0,isValid:!0};var getCheckboxValue=m=>{if(Array.isArray(m)){if(m.length>1){let g=m.filter(m=>m&&m.checked&&!m.disabled).map(m=>m.value);return{value:g,isValid:!!g.length}}return m[0].checked&&!m[0].disabled?m[0].attributes&&!isUndefined(m[0].attributes.value)?isUndefined(m[0].value)||""===m[0].value?eu:{value:m[0].value,isValid:!0}:eu:ec}return ec};let ed={isValid:!1,value:null};var getRadioValue=m=>Array.isArray(m)?m.reduce((m,g)=>g&&g.checked&&!g.disabled?{isValid:!0,value:g.value}:m,ed):ed;function getValidateError(m,g,v="validate"){if(isString(m)||Array.isArray(m)&&m.every(isString)||isBoolean(m)&&!m)return{type:v,message:isString(m)?m:"",ref:g}}var getValueAndMessage=m=>isObject(m)&&!isRegex(m)?m:{value:m,message:""},validateField=async(m,g,v,x,k,E)=>{let{ref:T,refs:et,required:en,maxLength:er,minLength:ei,min:es,max:el,pattern:ec,validate:eu,name:ed,valueAsNumber:ep,mount:em}=m._f,ef=get(v,ed);if(!em||g.has(ed))return{};let eh=et?et[0]:T,setCustomValidity=m=>{if(k&&eh.reportValidity){let g=isBoolean(m)?"":m||"";et?et.forEach(m=>m.setCustomValidity(g)):eh.setCustomValidity(g),eh.reportValidity()}},eg={},ev=isRadioInput(T),ey=isCheckBoxInput(T),eb=(ep||isFileInput(T))&&isUndefined(T.value)&&isUndefined(ef)||isHTMLElement(T)&&""===T.value||""===ef||Array.isArray(ef)&&!ef.length,ex=appendErrors.bind(null,ed,x,eg),getMinMaxMessage=(m,g,v,x=K.maxLength,k=K.minLength)=>{let E=m?g:v;eg[ed]={type:m?x:k,message:E,ref:T,...ex(m?x:k,E)}};if(E?!Array.isArray(ef)||!ef.length:en&&(!(ev||ey)&&(eb||isNullOrUndefined(ef))||isBoolean(ef)&&!ef||ey&&!getCheckboxValue(et).isValid||ev&&!getRadioValue(et).isValid)){let{value:m,message:g}=isString(en)?{value:!!en,message:en}:getValueAndMessage(en);if(m&&(eg[ed]={type:K.required,message:g,ref:eh,...ex(K.required,g)},!x))return setCustomValidity(g),eg}if(!eb&&(!isNullOrUndefined(es)||!isNullOrUndefined(el))){let m,g;let v=getValueAndMessage(el),k=getValueAndMessage(es);if(isNullOrUndefined(ef)||isDateObject(ef)||isNaN(ef)){let x=T.valueAsDate||new Date(ef),convertTimeToDate=m=>new Date(new Date().toDateString()+" "+m),E="time"==T.type,K="week"==T.type;isString(v.value)&&ef&&(m=E?convertTimeToDate(ef)>convertTimeToDate(v.value):K?ef>v.value:x>new Date(v.value)),isString(k.value)&&ef&&(g=E?convertTimeToDate(ef)<convertTimeToDate(k.value):K?ef<k.value:x<new Date(k.value))}else{let x=T.valueAsNumber||(ef?+ef:ef);isNullOrUndefined(v.value)||(m=x>v.value),isNullOrUndefined(k.value)||(g=x<k.value)}if((m||g)&&(getMinMaxMessage(!!m,v.message,k.message,K.max,K.min),!x))return setCustomValidity(eg[ed].message),eg}if((er||ei)&&!eb&&(isString(ef)||E&&Array.isArray(ef))){let m=getValueAndMessage(er),g=getValueAndMessage(ei),v=!isNullOrUndefined(m.value)&&ef.length>+m.value,k=!isNullOrUndefined(g.value)&&ef.length<+g.value;if((v||k)&&(getMinMaxMessage(v,m.message,g.message),!x))return setCustomValidity(eg[ed].message),eg}if(ec&&!eb&&isString(ef)){let{value:m,message:g}=getValueAndMessage(ec);if(isRegex(m)&&!ef.match(m)&&(eg[ed]={type:K.pattern,message:g,ref:T,...ex(K.pattern,g)},!x))return setCustomValidity(g),eg}if(eu){if(isFunction(eu)){let m=await eu(ef,v),g=getValidateError(m,eh);if(g&&(eg[ed]={...g,...ex(K.validate,g.message)},!x))return setCustomValidity(g.message),eg}else if(isObject(eu)){let m={};for(let g in eu){if(!isEmptyObject(m)&&!x)break;let k=getValidateError(await eu[g](ef,v),eh,g);k&&(m={...k,...ex(g,k.message)},setCustomValidity(k.message),x&&(eg[ed]=m))}if(!isEmptyObject(m)&&(eg[ed]={ref:eh,...m},!x))return eg}}return setCustomValidity(!0),eg},convertToArrayPayload=m=>Array.isArray(m)?m:[m],compact=m=>Array.isArray(m)?m.filter(Boolean):[];function unset(m,g){if(isString(g)&&Object.prototype.hasOwnProperty.call(m,g))return delete m[g],m;let v=Array.isArray(g)?g:isKey(g)?[g]:stringToPath(g);if(v.some(m=>en.includes(String(m))))return m;let x=1===v.length?m:function(m,g){let v=g.length-1,x=0;for(;x<v;){if(isNullOrUndefined(m)){m=void 0;break}m=m[g[x]],x++}return m}(m,v),k=v.length-1,E=v[k];return x&&delete x[E],0!==k&&(isObject(x)&&isEmptyObject(x)||Array.isArray(x)&&function(m){for(let g in m)if(m.hasOwnProperty(g)&&!isUndefined(m[g]))return!1;return!0}(x))&&unset(m,v.slice(0,-1)),m}let flatten=m=>{let g={};for(let v of Object.keys(m))if(isObjectType(m[v])&&null!==m[v]&&!isDateObject(m[v])){let x=flatten(m[v]);for(let m of Object.keys(x))g[`${v}.${m}`]=x[m]}else g[v]=m[v];return g},ep=x.createContext(null);ep.displayName="HookFormContext";let useFormContext=()=>x.useContext(ep),FormProvider=({children:m,watch:g,getValues:v,getFieldState:k,setError:E,clearErrors:T,setValue:K,setValues:et,trigger:en,formState:er,resetField:ei,reset:el,resetDefaultValues:ec,handleSubmit:eu,unregister:ed,control:em,register:ef,setFocus:eh,subscribe:eg})=>{let ev=x.useMemo(()=>({watch:g,getValues:v,getFieldState:k,setError:E,clearErrors:T,setValue:K,setValues:et,trigger:en,formState:er,resetField:ei,reset:el,resetDefaultValues:ec,handleSubmit:eu,unregister:ed,control:em,register:ef,setFocus:eh,subscribe:eg}),[T,em,er,k,v,eu,ef,el,ec,ei,E,eh,K,et,eg,en,ed,g]);return x.createElement(ep.Provider,{value:ev},x.createElement(es.Provider,{value:ev.control},m))};var createSubject=()=>{let m=[];return{get observers(){return m},next:g=>{for(let v of m)v.next&&v.next(g)},subscribe:g=>(m.push(g),{unsubscribe:()=>{m=m.filter(m=>m!==g)}}),unsubscribe:()=>{m=[]}}},isMultipleSelect=m=>"select-multiple"===m.type,isRadioOrCheckbox=m=>isRadioInput(m)||isCheckBoxInput(m),live=m=>isHTMLElement(m)&&m.isConnected;function isDirtyContainer(m){return Array.isArray(m)||isObject(m)}var objectHasFunction=m=>{for(let g in m)if(isFunction(m[g]))return!0;return!1};function isTraversable(m){return Array.isArray(m)||isObject(m)&&!objectHasFunction(m)}function isRegisteredLeaf(m){return!!(m&&"_f"in m)}function isEmptyDirtyContainer(m){return Array.isArray(m)?!m.some(m=>!isUndefined(m)):!Object.keys(m).length}function clearDirtyField(m,g){Array.isArray(m)?m[g]=void 0:delete m[g]}function markFieldsDirty(m,g={},v){for(let x in m){let k=m[x],E=v&&v[x];!isTraversable(k)||Array.isArray(k)&&isRegisteredLeaf(E)?isUndefined(k)||(g[x]=!0):(g[x]=Array.isArray(k)?[]:{},markFieldsDirty(k,g[x],E),isEmptyDirtyContainer(g[x])&&clearDirtyField(g,x))}return g}function getDirtyFields(m,g,v,x){for(let k in v||(v=markFieldsDirty(g,{},x)),m){let E=m[k],T=x&&x[k];!isTraversable(E)||Array.isArray(E)&&isRegisteredLeaf(T)?deepEqual(E,g[k])?clearDirtyField(v,k):v[k]=!0:(isUndefined(g)||isPrimitive(v[k])?v[k]=markFieldsDirty(E,Array.isArray(E)?[]:{},T):getDirtyFields(E,isNullOrUndefined(g)?{}:g[k],v[k],T),isEmptyDirtyContainer(v[k])&&clearDirtyField(v,k))}return v}var getFieldValueAs=(m,{valueAsNumber:g,valueAsDate:v,setValueAs:x})=>isUndefined(m)?m:g?""===m?NaN:m?+m:m:v&&isString(m)?new Date(m):x?x(m):m;function getFieldValue(m){let g=m.ref;return isFileInput(g)?g.files:isRadioInput(g)?getRadioValue(m.refs).value:isMultipleSelect(g)?[...g.selectedOptions].map(({value:m})=>m):isCheckBoxInput(g)?getCheckboxValue(m.refs).value:getFieldValueAs(g.value,m)}var getResolverOptions=(m,g,v,x)=>{let k={};for(let v of m){let m=get(g,v);m&&set(k,v,m._f)}return{criteriaMode:v,names:[...m],fields:k,shouldUseNativeValidation:x}},getRuleValue=m=>isUndefined(m)?m:isRegex(m)?m.source:isObject(m)?isRegex(m.value)?m.value.source:m.value:m;let em="AsyncFunction";var hasPromiseValidation=m=>{if(!m||!m.validate)return!1;if(isFunction(m.validate))return m.validate.constructor.name===em;if(isObject(m.validate)){for(let g in m.validate)if(m.validate[g].constructor.name===em)return!0}return!1},hasValidation=m=>m.mount&&(m.required||m.min||m.max||m.maxLength||m.minLength||m.pattern||m.validate);function schemaErrorLookup(m,g,v){let x=get(m,v);if(x||isKey(v))return{error:x,name:v};let k=v.split(".");for(;k.length;){let x=k.join("."),E=get(g,x),T=get(m,x);if(E&&!Array.isArray(E)&&v!==x)break;if(T&&T.type)return{name:x,error:T};if(T&&T.root&&T.root.type)return{name:`${x}.root`,error:T.root};k.pop()}return{name:v}}var shouldRenderFormState=(m,g,v,x)=>{v(m);let k=Object.keys(m).filter(m=>"name"!==m);return!k.length||x&&k.length>=Object.keys(g).length||k.find(m=>g[m]===(!x||T.all))},shouldSubscribeByName=(m,g,v)=>!m||!g||m===g||convertToArrayPayload(m).some(m=>m&&(v?m===g||m.startsWith(g+"."):m.startsWith(g)||g.startsWith(m))),skipValidation=(m,g,v,x,k)=>!k.isOnAll&&(!v&&k.isOnTouch?!(g||m):(v?x.isOnBlur:k.isOnBlur)?!m:(v?!x.isOnChange:!k.isOnChange)||m),unsetEmptyArray=(m,g)=>{let v=get(m,g);compact(v).length||(null==v?void 0:v.root)||unset(m,g)};let ef={mode:T.onSubmit,reValidateMode:T.onChange,shouldFocusError:!0},eh="form",updateDirtyFields=(m,g)=>{for(let v in m)v in g||delete m[v];Object.assign(m,g)},eg={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function useForm(m={}){let g=x.useRef(void 0),v=x.useRef(void 0),en=x.useRef(m.formControl),[er,ei]=x.useState(()=>({...cloneObject(eg),isLoading:isFunction(m.defaultValues),errors:m.errors||{},disabled:m.disabled||!1,defaultValues:isFunction(m.defaultValues)?void 0:m.defaultValues}));if(!g.current||m.formControl&&en.current!==m.formControl){if(en.current=m.formControl,m.formControl)g.current={...m.formControl,formState:er},m.defaultValues&&!isFunction(m.defaultValues)&&m.formControl.reset(m.defaultValues,m.resetOptions);else{let{formControl:v,...x}=function(m={}){let g={...ef,...m},v={...cloneObject(eg),isLoading:isFunction(g.defaultValues),errors:g.errors||{},disabled:g.disabled||!1},x={},en=(isObject(g.defaultValues)||isObject(g.values))&&cloneObject(g.defaultValues||g.values)||{},er=g.shouldUnregister?{}:cloneObject(en),ei={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},es={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},el={},ec={},eu=0,ed=getValidationModes(g.mode),ep=getValidationModes(g.reValidateMode),em={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},ev={...em},ey={...ev},eb={array:createSubject(),state:createSubject()},ex=0,e_=g.criteriaMode===T.all,debounce=(m,g)=>v=>{clearTimeout(ec[m]),ec[m]=setTimeout(g,v)},_setValid=async m=>{if(!ei.keepIsValid&&!g.disabled&&(ev.isValid||ey.isValid||m)){let m;let k=++ex;g.resolver?(m=isEmptyObject((await _runSchema()).errors),k===ex&&_updateIsValidating()):m=await executeBuiltInValidation({fields:x,onlyCheckValid:!0,eventType:E.VALID}),k===ex&&m!==v.isValid&&eb.state.next({isValid:m})}},_updateIsValidating=(m,x)=>{!g.disabled&&(ev.isValidating||ev.validatingFields||ey.isValidating||ey.validatingFields)&&((m||Array.from(es.mount)).forEac
61h(m=>{m&&(x?set(v.validatingFields,m,x):unset(v.validatingFields,m))}),eb.state.next({validatingFields:v.validatingFields,isValidating:!isEmptyObject(v.validatingFields)}))},_updateDirtyFields=()=>{v.dirtyFields=getDirtyFields(en,er,void 0,x)},updateErrors=(m,g)=>{set(v.errors,m,g),v.errors={...v.errors},eb.state.next({errors:v.errors})},hasExplicitNullIntermediate=m=>{let g=isKey(m)?[m]:stringToPath(m),v=er,x=en;for(let m=0;m<g.length-1;m++){let k=g[m];if(v=isNullOrUndefined(v)?v:v[k],x=isNullOrUndefined(x)?x:x[k],null===v&&null!==x)return!0}return!1},isStaleArrayIndex=m=>{if(!ei.actionArrayLengths.size)return!1;let g=isKey(m)?[m]:stringToPath(m),v=er,x="",k=-1,E=0;for(let m=0;m<g.length&&!isNullOrUndefined(v);m++){let T=g[m];if(x=x?`${x}.${T}`:T,Array.isArray(v)&&+T>=v.length)return -1!==k&&(m!==k||+T<E);ei.actionArrayLengths.has(x)&&(k=m+1,E=ei.actionArrayLengths.get(x)),v=v[T]}return!1},updateValidAndValue=(g,k,E,T)=>{let K=get(x,g);if(K){if(hasExplicitNullIntermediate(g)||isStaleArrayIndex(g))return;let x=isUndefined(get(er,g)),et=get(er,g,isUndefined(E)?get(en,g):E);if(isUndefined(et)||T&&T.defaultChecked||k?set(er,g,k?et:getFieldValue(K._f)):setFieldValue(g,et),ei.mount&&!ei.action){if(_setValid(),x&&v.isDirty&&(ev.isDirty||ey.isDirty)){let m=_getDirty();m||(v.isDirty=!1,eb.state.next({...v}))}m.shouldUnregister&&x&&!isUndefined(get(er,g))&&isWatched(g,es)&&(ei.watch=!0)}}},updateTouchAndDirty=(m,k,E,T,K)=>{let et=!1,ei=!1,es={name:m};if(!g.disabled||!0===T){if(!E||T){let g=deepEqual(get(en,m),k);(ev.isDirty||ey.isDirty)&&(ei=v.isDirty,v.isDirty=es.isDirty=!g||_getDirty(),et=ei!==es.isDirty),ei=!!get(v.dirtyFields,m),g!==v.isDirty?updateDirtyFields(v.dirtyFields,getDirtyFields(en,er,void 0,x)):g?unset(v.dirtyFields,m):set(v.dirtyFields,m,!0),es.dirtyFields=v.dirtyFields,et=et||(ev.dirtyFields||ey.dirtyFields)&&!g!==ei}if(E){let g=get(v.touchedFields,m);g||(set(v.touchedFields,m,E),es.touchedFields=v.touchedFields,et=et||(ev.touchedFields||ey.touchedFields)&&g!==E)}et&&K&&eb.state.next(es)}return et?es:{}},shouldRenderByError=(m,x,k,E)=>{let T=get(v.errors,m),K=(ev.isValid||ey.isValid)&&isBoolean(x)&&v.isValid!==x;if(g.delayError&&k?(el[m]=debounce(m,()=>updateErrors(m,k)),el[m](g.delayError)):(clearTimeout(ec[m]),delete el[m],k?set(v.errors,m,k):unset(v.errors,m),v.errors={...v.errors}),(k?!deepEqual(T,k):T)||!isEmptyObject(E)||K){let g={...E,...K&&isBoolean(x)?{isValid:x}:{},errors:v.errors,name:m};v={...v,...g},eb.state.next(g)}},_runSchema=async m=>(_updateIsValidating(m,!0),await g.resolver(er,g.context,getResolverOptions(m||es.mount,x,g.criteriaMode,g.shouldUseNativeValidation))),executeSchemaAndUpdateState=async m=>{let{errors:g}=await _runSchema(m);if(_updateIsValidating(m),m){for(let x of m){let m=get(g,x);m?es.array.has(x)&&isObject(m)&&!Object.keys(m).some(m=>!Number.isNaN(Number(m)))?updateFieldArrayRootError(v.errors,{[x]:m},x):set(v.errors,x,m):unset(v.errors,x)}v.errors={...v.errors}}else v.errors=g;return g},validateForm=async({name:g,eventType:x})=>{if(m.validate){let k=await m.validate({formValues:er,formState:v,name:g,eventType:x});if(isObject(k))for(let m in k){let g=k[m];g&&setError(`${eh}.${m}`,{message:isString(g.message)?g.message:"",type:g.type||K.validate})}else isString(k)||!k?setError(eh,{message:k||"",type:K.validate}):clearErrors(eh);return k}return!0},executeBuiltInValidation=async({fields:x,onlyCheckValid:k,name:E,eventType:T,context:K={valid:!0,runRootValidation:!1}})=>{if(m.validate){K.runRootValidation=!0;let m=await validateForm({name:E,eventType:T});if(!m&&(K.valid=!1,k))return K.valid}for(let E in x){let et=x[E];if(et){let{_f:x,...en}=et;if(x){let E=es.array.has(x.name),T=et._f&&hasPromiseValidation(et._f),en=ev.validatingFields||ev.isValidating||ey.validatingFields||ey.isValidating;T&&en&&_updateIsValidating([x.name],!0);let ei=await validateField(et,es.disabled,er,e_,g.shouldUseNativeValidation&&!k,E);if(T&&en&&_updateIsValidating([x.name]),ei[x.name]&&(K.valid=!1,k)||(k||(get(ei,x.name)?E?updateFieldArrayRootError(v.errors,ei,x.name):set(v.errors,x.name,ei[x.name]):unset(v.errors,x.name)),m.shouldUseNativeValidation&&ei[x.name]))break}isEmptyObject(en)||await executeBuiltInValidation({context:K,onlyCheckValid:k,fields:en,name:E,eventType:T})}}return K.valid},_getDirty=(m,g)=>(m&&g&&set(er,m,g),!deepEqual(ei.mount?er:en,en)),_getWatch=(m,g,v)=>
61generateWatchOutput(m,es,{...ei.mount?er:isUndefined(g)||isString(m)?en:g},v,g),setFieldValue=(m,g,v={},k=!1,E=!1,T=!1)=>{let K=get(x,m),et=g;if(K){let v=K._f;!v||(v.disabled||set(er,m,getFieldValueAs(g,v)),et=isHTMLElement(v.ref)&&isNullOrUndefined(g)?"":g,isMultipleSelect(v.ref)?[...v.ref.options].forEach(m=>m.selected=et.includes(m.value)):v.refs?isCheckBoxInput(v.ref)?v.refs.forEach(m=>{m.defaultChecked&&m.disabled||(Array.isArray(et)?m.checked=!!et.find(g=>g===m.value):m.checked=et===m.value||!!et)}):v.refs.forEach(m=>m.checked=m.value===et):isFileInput(v.ref)?v.ref.value="":(v.ref.value=et,v.ref.type||E||T||eb.state.next({name:m,values:k?er:cloneObject(er)})))}(v.shouldDirty||v.shouldTouch)&&updateTouchAndDirty(m,et,v.shouldTouch,v.shouldDirty,!E),v.shouldValidate&&trigger(m,{delayError:v.delayError})},setFieldValues=(m,g,v,k=!1,E=!1,T=!1)=>{for(let K in es.array.has(m)&&eb.array.next({name:m,values:k?er:cloneObject(er)}),g){if(!g.hasOwnProperty(K))return;let et=g[K],en=m+"."+K,er=get(x,en);(es.array.has(m)||isObject(et)||er&&!er._f)&&!isDateObject(et)?setFieldValues(en,et,v,k,E,T):setFieldValue(en,et,v,k,E,T)}},_setValue=(m,g,k,E,T=!1)=>{let K=get(x,m),et=es.array.has(m),en=E?g:cloneObject(g),el=get(er,m),ec=deepEqual(el,en);if(ec||set(er,m,en),et)eb.array.next({name:m,values:E?er:cloneObject(er)}),(ev.isDirty||ev.dirtyFields||ey.isDirty||ey.dirtyFields)&&k.shouldDirty&&(_updateDirtyFields(),T||eb.state.next({name:m,dirtyFields:v.dirtyFields,isDirty:_getDirty(m,en)}));else{let g=Array.isArray(en)&&!en.length||isEmptyObject(en),v=!ec&&!T;!K||K._f||isNullOrUndefined(en)||g?setFieldValue(m,en,k,E,T,v):setFieldValues(m,en,k,E,T,v)}if(!ec&&!T){let g=isWatched(m,es),x=E?er:cloneObject(er);eb.state.next({...g&&v,name:ei.mount||g?m:void 0,values:x})}},setValue=(m,g,v={})=>_setValue(m,g,v,!1),onChange=async k=>{ei.mount=!0;let T=k.target,K=T.name,et=!0,en=get(x,K),_updateIsFieldValueUpdated=m=>{et=Number.isNaN(m)||isDateObject(m)&&isNaN(m.getTime())||deepEqual(m,get(er,K,m))};if(en){let ei,ec;let em=T.type?getFieldValue(en._f):getEventValue(k),ef=k.type===E.BLUR||k.type===E.FOCUS_OUT,eh=!hasValidation(en._f)&&!m.validate&&!g.resolver&&!get(v.errors,K)&&!en._f.deps,eg=eh||skipValidation(ef,get(v.touchedFields,K),v.isSubmitted,ep,ed),ex=isWatched(K,es,ef);if(set(er,K,em),ef){if(!T||!T.readOnly){en._f.onBlur&&en._f.onBlur(k);let m=el[K];m&&m(0)}}else en._f.onChange&&en._f.onChange(k);let ew=updateTouchAndDirty(K,em,ef),eS=!isEmptyObject(ew)||ex;if(ef||eb.state.next({name:K,type:k.type,...eu?{values:cloneObject(er)}:{}}),eg)return(!eh||!v.isValid)&&(ev.isValid||ey.isValid)&&("onBlur"===g.mode?ef&&_setValid():ef||_setValid()),eS&&eb.state.next({name:K,...ex?{}:ew});if(!g.resolver&&m.validate&&await validateForm({name:K,eventType:k.type}),!ef&&ex&&eb.state.next({...v}),g.resolver){let{errors:m}=await _runSchema([K]);if(_updateIsValidating([K]),_updateIsFieldValueUpdated(em),!et){isEmptyObject(ew)||eb.state.next(ew);return}let g=schemaErrorLookup(v.errors,x,K),k=schemaErrorLookup(m,x,g.name||K);ei=k.error,K=k.name,ec=isEmptyObject(m)}else _updateIsValidating([K],!0),ei=(await validateField(en,es.disabled,er,e_,g.shouldUseNativeValidation))[K],_updateIsValidating([K]),_updateIsFieldValueUpdated(em),et&&(ei?ec=!1:(ev.isValid||ey.isValid)&&(ec=await executeBuiltInValidation({fields:x,onlyCheckValid:!0,name:K,eventType:k.type})));et&&(en._f.deps&&(!Array.isArray(en._f.deps)||en._f.deps.length>0)&&trigger(en._f.deps),shouldRenderByError(K,ec,ei,ew))}},_focusInput=(m,g)=>{if(get(v.errors,g)&&m.focus)return m.focus(),1},trigger=async(m,k={})=>{let T,K;let et=convertToArrayPayload(m);if(g.resolver){let g=await executeSchemaAndUpdateState(isUndefined(m)?m:et);T=isEmptyObject(g),K=m?!et.some(m=>get(g,m)):T}else m?((K=(await Promise.all(et.map(async m=>{let g=get(x,m);return await executeBuiltInValidation({fields:g&&g._f?{[m]:g}:g,eventType:E.TRIGGER})}))).every(Boolean))||v.isValid)&&_setValid():K=T=await executeBuiltInValidation({fields:x,name:m,eventType:E.TRIGGER});if(k.delayError&&g.delayError&&isString(m)){let x=get(v.errors,m);x?(unset(v.errors,m),el[m]=debounce(m,()=>updateErrors(m,x)),el[m](g.delayError)):(clearTimeout(ec[m]),delete el[m])}return eb.state.next({...!isString(m)||(ev.isValid||ey.isValid)&&T!==v.isValid?{}:{name:m},...g.resolver||!m?{isValid:T}:{},errors:v.errors}),k.shouldFocus&&!K&&iterateFieldsByAction(x,_focusInput,m?et:es.mount),K},getFieldState=(m,g)=>({invalid:!!get((g||v).errors,m),isDirty:!!get((g||v).dirtyFields,m),error:get((g||v).errors,m),isValidating:!!get(v.validatingFields,m),isTouched:!!get((g||v).touchedFields,m)}),clearErrors=m=>{let g=m?convertToArrayPayload(m):void 0;null==g||g.forEach(m=>unset(v.errors,m)),g?g.forEach(m=>{eb.state.next({name:m,errors:v.errors})}):(v.errors={},eb.state.next({errors:v.errors}))},setError=(m,g,k)=>{let E=(get(x,m,{_f:{}})._f||{}).ref,T=get(v.errors,m)||{},{ref:K,message:et,type:en,...er}=T;set(v.errors,m,{...er,...g,ref:E}),eb.state.next({name:m,errors:v.errors,isValid:!1}),k&&k.shouldFocus&&E&&E.focus&&E.focus()},_subscribe=m=>{var g;let x=!!(null===(g=m.formState)||void 0===g?void 0:g.values);x&&eu++;let{unsubscribe:k}=eb.state.subscribe({next:g=>
61{if(shouldSubscribeByName(m.name,g.name,m.exact)&&shouldRenderFormState(g,m.formState||ev,_setFormState,m.reRenderRoot)){let x={...er};m.callback({values:x,...v,...g,defaultValues:en})}}});if(!x)return k;let E=!1;return()=>{E||(E=!0,eu--,k())}},unregister=(m,k={})=>{for(let E of m?convertToArrayPayload(m):es.mount)es.mount.delete(E),es.array.delete(E),k.keepValue||(unset(x,E),unset(er,E)),k.keepError||unset(v.errors,E),k.keepDirty||unset(v.dirtyFields,E),k.keepTouched||unset(v.touchedFields,E),k.keepIsValidating||unset(v.validatingFields,E),g.shouldUnregister||k.keepDefaultValue||unset(en,E);eb.state.next({values:cloneObject(er)}),eb.state.next({...v,...k.keepDirty?{isDirty:_getDirty()}:{}}),k.keepIsValid||_setValid()},_setDisabledField=({disabled:m,name:g})=>{if(isBoolean(m)&&ei.mount||m||es.disabled.has(g)){let v=es.disabled.has(g),x=!!m;m?es.disabled.add(g):es.disabled.delete(g),v!==x&&ei.mount&&!ei.action&&_setValid()}},register=(m,v={})=>{let k=get(x,m),E=isBoolean(v.disabled)||isBoolean(g.disabled),T=!es.registerName.has(m)&&k&&k._f&&!k._f.mount;return set(x,m,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:m}},name:m,mount:!0,...v}}),es.mount.add(m),k&&!T?_setDisabledField({disabled:isBoolean(v.disabled)?v.disabled:g.disabled,name:m}):updateValidAndValue(m,!0,v.value),{...E?{disabled:v.disabled||g.disabled}:{},...g.progressive?{required:!!v.required,min:getRuleValue(v.min),max:getRuleValue(v.max),minLength:getRuleValue(v.minLength),maxLength:getRuleValue(v.maxLength),pattern:getRuleValue(v.pattern)}:{},name:m,onChange,onBlur:onChange,ref:E=>{if(E){es.registerName.add(m),register(m,v),es.registerName.delete(m),k=get(x,m);let g=isUndefined(E.value)&&E.querySelectorAll&&E.querySelectorAll("input,select,textarea")[0]||E,T=isRadioOrCheckbox(g),K=k._f.refs||[];if(T?K.find(m=>m===g):g===k._f.ref)return;let et={...k._f};T?(et.refs=[...K.filter(live),g,...Array.isArray(get(en,m))?[{}]:[]],et.ref={type:g.type,name:m}):(et.ref=g,delete et.refs),set(x,m,{_f:et}
61),updateValidAndValue(m,!1,void 0,g)}else(k=get(x,m,{}))._f&&(k._f.mount=!1),(g.shouldUnregister||v.shouldUnregister)&&!(isNameInFieldArray(es.array,m)&&ei.action)&&es.unMount.add(m)}}},_focusError=()=>g.shouldFocusError&&!g.shouldUseNativeValidation&&iterateFieldsByAction(x,_focusInput,es.mount),handleSubmit=(m,k)=>async T=>{let K,en;T&&(T.preventDefault&&T.preventDefault(),T.persist&&T.persist());let ei=cloneObject(er);if(eb.state.next({isSubmitting:!0}),g.resolver){let{errors:m,values:g}=await _runSchema();_updateIsValidating(),v.errors=m,ei=cloneObject(g)}else await executeBuiltInValidation({fields:x,eventType:E.SUBMIT});if(es.disabled.size)for(let m of es.disabled)unset(ei,m);if(unset(v.errors,et),isEmptyObject(v.errors)){eb.state.next({errors:{}});try{K=await m(ei,T)}catch(m){en=m}}else k&&await k({...v.errors},T),_focusError(),setTimeout(_focusError);if(eb.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(v.errors)&&!en,submitCount:v.submitCount+1,errors:v.errors}),en)throw en;return K},_reset=(m,E={})=>{let T=m?cloneObject(m):en,K=cloneObject(T),et=isEmptyObject(m),el=x;if(E.keepDefaultValues||(en=T),!E.keepValues){if(E.keepDirtyValues){let m=new Set([...es.mount,...function collectDirtyFieldNames(m,g,v="",x=[]){for(let k in m){let E=v?`${v}.${k}`:k,T=m[k];isDirtyContainer(T)&&isDirtyContainer(get(g,E))?collectDirtyFieldNames(T,g,E,x):x.push(E)}return x}(getDirtyFields(en,er,void 0,el),v.dirtyFields)]);for(let g of Array.from(m)){let m=get(v.dirtyFields,g),x=get(er,g),k=get(K,g);m&&!isUndefined(x)?set(K,g,x):m||isUndefined(k)||setValue(g,k)}}else{if(k&&isUndefined(m))for(let m of es.mount){let g=get(x,m);if(g&&g._f){let m=Array.isArray(g._f.refs)?g._f.refs[0]:g._f.ref;if(isHTMLElement(m)){let g=m.closest("form");if(g){g.reset();break}}}}if(E.keepFieldsRef)for(let m of es.mount)setValue(m,get(K,m));else x={}}if(g.shouldUnregister){if(er=E.keepDefaultValues?cloneObject(en):{},E.keepFieldsRef)for(let m of es.mount)set(er,m,get(K,m))}else er=cloneObject(K);eb.array.next({values:{...K}}),eb.state.next({name:void 0,type:void 0,values:{...K}})}es={mount:E.keepDirtyValues?es.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},ei.mount=!ev.isValid||!!E.keepIsValid||!!E.keepDirtyValues||!g.shouldUnregister&&!isEmptyObject(K),ei.watch=!!g.shouldUnregister,ei.keepIsValid=!!E.keepIsValid,ei.action=!1,ei.actionArrayLengths.clear(),E.keepErrors||(v.errors={}),eb.state.next({submitCount:E.keepSubmitCount?v.submitCount:0,isDirty:!et&&(E.keepDirty?v.isDirty:E.keepValues?_getDirty():!!(E.keepDefaultValues&&!deepEqual(m,en))),isSubmitted:!!E.keepIsSubmitted&&v.isSubmitted,dirtyFields:et?{}:E.keepDirtyValues?E.keepDefaultValues&&er?getDirtyFields(en,er,void 0,el):v.dirtyFields:E.keepDefaultValues&&m?getDirtyFields(en,m,void 0,el):E.keepDirty?v.dirtyFields:{},touchedFields:E.keepTouched?v.touchedFields:{},errors:E.keepErrors?v.errors:{},isSubmitSuccessful:!!E.keepIsSubmitSuccessful&&v.isSubmitSuccessful,isSubmitting:!1,defaultValues:en})},reset=(m,v)=>_reset(isFunction(m)?m(er):m,{...g.resetOptions,...v}),_setFormState=m=>{let{name:g,type:x,values:k,...E}=m;v={...v,...E}};eb.state.subscribe({next:_setFormState});let ew={control:{register,unregister,getFieldState,handleSubmit,setError,_subscribe,_runSchema,_updateIsValidating,_focusError,_getWatch,_getDirty,_setValid,_setFieldArray:(m,k=[],E,T,K=!0,et=!0)=>{if(T&&E&&!g.disabled){if(ei.action=!0,!ei.actionArrayLengths.has(m)){let g=get(x,m);ei.actionArrayLengths.set(m,Array.isArray(g)?g.length:0)}if(et&&Array.isArray(get(x,m))){let g=E(get(x,m),T.argA,T.argB);K&&set(x,m,g)}if(et&&Array.isArray(get(v.errors,m))){let g=get(v.errors,m),x=g.root,k=E(g,T.argA,T.argB)||g;x&&(k.root=x),K&&set(v.errors,m,k),unsetEmptyArray(v.errors,m)}if((ev.touchedFields||ey.touchedFields)&&et&&Array.isArray(get(v.touchedFields,m))){let g=E(get(v.touchedFields,m),T.argA,T.argB);K&&set(v.touchedFields,m,g)}(ev.dirtyFields||ey.dirtyFields)&&_updateDirtyFields(),eb.state.next({name:m,isDirty:_getDirty(m,k),dirtyFields:v.dirtyFields,errors:v.errors,isValid:v.isValid})}else set(er,m,k)},_setDisabledField,_setErrors:m=>{v.errors=m,eb.state.next({errors:v.errors,isValid:!1})},_getFieldArray:m=>compact(get(ei.mount?er:en,m,g.shouldUnregister?get(en,m,[]):[])),_reset,_resetDefaultValues:()=>isFunction(g.defaultValues)&&g.defaultValues().then(m=>{reset(m,g.resetOptions),eb.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(let m of es.unMount){let g=get(x,m);g&&(g._f.refs?g._f.refs.every(m=>!live(m)):!live(g._f.ref))&&unregister(m)}es.unMount=new Set},_disableForm:m=>{isBoolean(m)&&(eb.state.next({disabled:m}),iterateFieldsByAction(x,(g,v)=>{let k=get(x,v);k&&(g.disabled=k._f.disabled||m,Array.isArray(k._f.refs)&&k._f.refs.forEac
61h(g=>{g.disabled=k._f.disabled||m}))},0,!1))},_subjects:eb,_proxyFormState:ev,get _fields(){return x},get _formValues(){return er},get _state(){return ei},set _state(value){ei=value},get _defaultValues(){return en},get _names(){return es},set _names(value){es=value},get _formState(){return v},get _options(){return g},set _options(value){ed=getValidationModes((g={...g,...value}).mode),ep=getValidationModes(g.reValidateMode)}},subscribe:m=>(ei.mount=!0,ey={...ey,...m.formState},_subscribe({...m,formState:{...em,...m.formState}})),trigger,register,handleSubmit,watch:(m,g)=>{if(isFunction(m)){eu++;let{unsubscribe:v}=eb.state.subscribe({next:v=>"values"in v&&m(v.values||_getWatch(void 0,g),v)}),x=!1;return{unsubscribe:()=>{x||(x=!0,eu--,v())}}}return _getWatch(m,g,!0)},setValue,setValues:(m,g={})=>{let x=isFunction(m)?m(er):m;if(!deepEqual(er,x)){er={...er,...x};let m=flatten(x);for(let v of es.mount)v in m&&_setValue(v,m[v],g,!0,!0);eb.state.next({...v,name:void 0,type:void 0,...eu?{values:er}:{}}),g.shouldValidate&&_setValid()}},getValues:(m,g)=>{let x={...ei.mount?er:en};return g&&(x=function extractFormValues(m,g){let v={};for(let x in m)if(m.hasOwnProperty(x)){let k=m[x],E=g[x];if(k&&isObject(k)&&E){let m=extractFormValues(k,E);isObject(m)&&(v[x]=m)}else m[x]&&(v[x]=E)}return v}(g.dirtyFields?v.dirtyFields:v.touchedFields,x)),isUndefined(m)?x:isString(m)?get(x,m):m.map(m=>get(x,m))},reset,resetField:(m,g={})=>{get(x,m)&&(isUndefined(g.defaultValue)?setValue(m,cloneObject(get(en,m))):(setValue(m,g.defaultValue),set(en,m,cloneObject(g.defaultValue))),g.keepTouched||unset(v.touchedFields,m),g.keepDirty||(unset(v.dirtyFields,m),v.isDirty=g.defaultValue?_getDirty(m,cloneObject(get(en,m))):_getDirty()),!g.keepError&&(unset(v.errors,m),ev.isValid&&_setValid()),eb.state.next({...v}))},resetDefaultValues:(m,g={})=>{if(en=cloneObject(m),!g.keepDirty){let m=getDirtyFields(en,er,void 0,x);v.dirtyFields=m,v.isDirty=!isEmptyObject(m)}g.keepIsValid||_setValid(),eb.state.next({...v,defaultValues:en})},clearErrors,unregister,setError,setFocus:(m,g={})=>{let v=get(x,m),k=v&&v._f;if(k){let m=k.refs?k.refs[0]:k.ref;m.focus&&setTimeout(()=>{m.focus(),g.shouldSelect&&isFunction(m.select)&&m.select()})}},getFieldState};return{...ew,formControl:ew}}(m);g.current={...x,formState:er}}}let es=g.current.control;es._options=m;let{resyncIfNeeded:ec,snapshot:eu}=useResyncOnReconnect();return el(()=>{let getCurrentFormState=()=>({...es._formState,defaultValues:es._defaultValues});ec(!0,getCurrentFormState,ei);let m=es._subscribe({formState:es._proxyFormState,callback:()=>ei({...es._formState,defaultValues:es._defaultValues}),reRenderRoot:!0});return ei(m=>({...m,isReady:!0})),es._formState.isReady=!0,()=>{m(),eu(!0,getCurrentFormState)}},[es,ec,eu]),x.useEffect(()=>es._disableForm(m.disabled),[es,m.disabled]),x.useEffect(()=>{m.mode&&(es._options.mode=m.mode),m.reValidateMode&&(es._options.reValidateMode=m.reValidateMode)},[es,m.mode,m.reValidateMode]),x.useEffect(()=>{m.errors&&(es._setErrors(m.errors),es._focusError())},[es,m.errors]),x.useEffect(()=>{m.shouldUnregister&&es._subjects.state.next({values:es._getWatch()})},[es,m.shouldUnregister]),x.useEffect(()=>{if(es._proxyFormState.isDirty){let m=es._getDirty();m!==er.isDirty&&es._subjects.state.next({isDirty:m})}},[es,er.isDirty]),x.useEffect(()=>{var g;m.values&&!deepEqual(m.values,v.current)?(es._reset(m.values,{keepFieldsRef:!0,...es._options.resetOptions}),(null===(g=es._options.resetOptions)||void 0===g?void 0:g.keepIsValid)||es._setValid(),v.current=m.values,ei(m=>({...m}))):es._resetDefaultValues()},[es,m.values]),x.useEffect(()=>{es._state.mount||(es._setValid(),es._state.mount=!0),es._state.watch&&(es._state.watch=!1,es._subjects.state.next({...es._formState})),es._removeUnmounted()}),g.current.formState=x.useMemo(()=>getProxyFormState(er,es),[es,er]),g.current}},38969:function(m,g,v){"use strict";var x,k;v.d(g,{SK:function(){return ulid}});let E="0123456789ABCDEFGHJKMNPQRSTVWXYZ";(k=x||(x={})).Base32IncorrectEncoding="B32_ENC_INVALID",k.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",k.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",k.EncodeTimeNegative="ENC_TIME_NEG",k.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",k.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",k.PRNGDetectFailure="PRNG_DETECT",k.ULIDInvalid="ULID_INVALID",k.Unexpected="UNEXPECTED",k.UUIDInvalid="UUID_INVALID";
61let ULIDError=class ULIDError extends Error{constructor(m,g){super(`${g} (${m})`),this.name="ULIDError",this.code=m}};function ulid(m,g){let v=g||function(m){let g="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:null,v=g&&(g.crypto||g.msCrypto)||null;if("function"==typeof v?.getRandomValues)return()=>{let m=new Uint8Array(1);return v.getRandomValues(m),m[0]/256};if("function"==typeof v?.randomBytes)return()=>v.randomBytes(1).readUInt8()/256;throw new ULIDError(x.PRNGDetectFailure,"Failed to find a reliable PRNG")}(),k=!m||isNaN(m)?Date.now():m;return function(m,g=10){if(isNaN(m))throw new ULIDError(x.EncodeTimeValueMalformed,`Time must be a number: ${m}`);if(m>0xffffffffffff)throw new ULIDError(x.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${m}`);if(m<0)throw new ULIDError(x.EncodeTimeNegative,`Time must be positive: ${m}`);if(!1===Number.isInteger(m))throw new ULIDError(x.EncodeTimeValueMalformed,`Time must be an integer: ${m}`);let v,k="";for(let x=g;x>0;x--)v=m%32,k=E.charAt(v)+k,m=(m-v)/32;return k}(k,10)+function(m,g){let v="";for(;m>0;m--)v=function(m){let g=Math.floor(32*m())%32;return E.charAt(g)}(g)+v;return v}(16,v)}},84631:function(m,g,v){"use strict";v.d(g,{ZP:function(){return en}});var x={};v.r(x),v.d(x,{BRAND:function(){return K.cg},DIRTY:function(){return E.RC},EMPTY_PATH:function(){return E.h2},INVALID:function(){return E.UI},NEVER:function(){return K.C4},OK:function(){return E.OK},ParseStatus:function(){return E.Q9},Schema:function(){return K.V_},ZodAny:function(){return K.O8},ZodArray:function(){return K.p5},ZodBigInt:function(){return K.EG},ZodBoolean:function(){return K.pZ},ZodBranded:function(){return K.Gd},ZodCatch:function(){return K.ON},ZodDate:function(){return K.$s},ZodDefault:function(){return K.uE},ZodDiscriminatedUnion:function(){return K.Iy},ZodEffects:function(){return K.Xc},ZodEnum:function(){return K.K7},ZodError:function(){return et.jm},ZodFirstPartyTypeKind:function(){return K.pA},ZodFunction:function(){return K.b_},ZodIntersection:function(){return K.f9},ZodIssueCode:function(){return et.NL},ZodLazy:function(){return K.dT},ZodLiteral:function(){return K.SG},ZodMap:function(){return K.Ym},ZodNaN:function(){return K.Hu},ZodNativeEnum:function(){return K.Zl},ZodNever:function(){return K.$n},ZodNull:function(){return K.pV},ZodNullable:function(){return K.ng},ZodNumber:function(){return K.IV},ZodObject:function(){return K.CQ},ZodOptional:function(){return K.ak},ZodParsedType:function(){return T.$k},ZodPipeline:function(){return K.om},ZodPromise:function(){return K.Wx},ZodReadonly:function(){return K.ur},ZodRecord:function(){return K.KX},ZodSchema:function(){return K.I6},ZodSet:function(){return K.qA},ZodString:function(){return K.$T},ZodSymbol:function(){return K.tX},ZodTransformer:function(){return K.z2},ZodTuple:function(){return K._P},ZodType:function(){return K.DI},ZodUndefined:function(){return K.DY},ZodUnion:function(){return K.jp},ZodUnknown:function(){return K.Dy},ZodVoid:function(){return K.XE},addIssueToContext:function(){return E.KD},any:function(){return K.Yj},array:function(){return K.IX},bigint:function(){return K.Kv},boolean:function(){return K.O7},coerce:function(){return K.oQ},custom:function(){return K.PG},date:function(){return K.hT},datetimeRegex:function(){return K.wU},defaultErrorMap:function(){return k.jY},discriminatedUnion:function(){return K.VK},effect:function(){return K.cE},enum:function(){return K.Km},function:function(){return K.ZI},getErrorMap:function(){return k.Pr},getParsedType:function(){return T.FQ},instanceof:function(){return K.Pp},intersection:function(){return K.jV},isAborted:function(){return E.Hc},isAsync:function(){return E.S9},isDirty:function(){return E.eT},isValid:function(){return E.JY},late:function(){return K.wt},lazy:function(){return K.Vo},literal:function(){return K.i0},makeIssue:function(){return E.Xm},map:function(){return K.UI},nan:function(){return K.qn},nativeEnum:function(){return K.jb},never:function(){return K.Fi},null:function(){return K.lB},nullable:function(){return K.AG},number:function(){return K.Rx},object:function(){return K.Ry},objectUtil:function(){return T.Mg},oboolean:function(){return K.Ts},onumber:function(){return K.vs},optional:function(){return K.jt},ostring:function(){return K.Dk},pipeline:function(){return K.EU},preprocess:function(){return K.dj},promise:function(){return K.MC},quotelessJson:function(){return et.Zh},record:function(){return K.IM},set:function(){return K.t8},setErrorMap:function(){return k.DJ},strictObject:function(){return K.cf},string:function(){return K.Z_},symbol:function(){return K.NA},transformer:function(){return K.l4},tuple:function(){return K.bc},undefined:function(){return K.S1},union:function(){return K.G0},unknown:function(){return K._4},util:function(){return T.D5},void:function(){return K.Hc}});var k=v(46904),E=v(14834),T=v(49342),K=v(53538),et=v(82799),en=x},82799:function(m,g,v){"use strict";v.d(g,{NL:function(){return k},Zh:function(){return quotelessJson},jm:function(){return ZodError}});var x=v(49342);
61let k=x.D5.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=m=>{let g=JSON.stringify(m,null,2);return g.replace(/"([^"]+)":/g,"$1:")};let ZodError=class ZodError extends Error{get errors(){return this.issues}constructor(m){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};let g=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,g):this.__proto__=g,this.name="ZodError",this.issues=m}format(m){let g=m||function(m){return m.message},v={_errors:[]},processError=m=>{for(let x of m.issues)if("invalid_union"===x.code)x.unionErrors.map(processError);else if("invalid_return_type"===x.code)processError(x.returnTypeError);else if("invalid_arguments"===x.code)processError(x.argumentsError);else if(0===x.path.length)v._errors.push(g(x));else{let m=v,k=0;for(;k<x.path.length;){let v=x.path[k],E=k===x.path.length-1;E?(m[v]=m[v]||{_errors:[]},m[v]._errors.push(g(x))):m[v]=m[v]||{_errors:[]},m=m[v],k++}}};return processError(this),v}static assert(m){if(!(m instanceof ZodError))throw Error(`Not a ZodError: ${m}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.D5.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(m=m=>m.message){let g={},v=[];for(let x of this.issues)if(x.path.length>0){let v=x.path[0];g[v]=g[v]||[],g[v].push(m(x))}else v.push(m(x));return{formErrors:v,fieldErrors:g}}get formErrors(){return this.flatten()}};ZodError.create=m=>{let g=new ZodError(m);return g}},46904:function(m,g,v){"use strict";v.d(g,{DJ:function(){return setErrorMap},Pr:function(){return getErrorMap},jY:function(){return x.Z}});var x=v(2333);let k=x.Z;function setErrorMap(m){k=m}function getErrorMap(){return k}},14834:function(m,g,v){"use strict";v.d(g,{Hc:function(){return isAborted},JY:function(){return isValid},KD:function(){return addIssueToContext},OK:function(){return OK},Q9:function(){return ParseStatus},RC:function(){return DIRTY},S9:function(){return isAsync},UI:function(){return T},Xm:function(){return makeIssue},eT:function(){return isDirty},h2:function(){return E}});var x=v(46904),k=v(2333);let makeIssue=m=>{let{data:g,path:v,errorMaps:x,issueData:k}=m,E=[...v,...k.path||[]],T={...k,path:E};if(void 0!==k.message)return{...k,path:E,message:k.message};let K="",et=x.filter(m=>!!m).slice().reverse();for(let m of et)K=m(T,{data:g,defaultError:K}).message;return{...k,path:E,message:K}},E=[];function addIssueToContext(m,g){let v=(0,x.Pr)(),E=makeIssue({issueData:g,data:m.data,path:m.path,errorMaps:[m.common.contextualErrorMap,m.schemaErrorMap,v,v===k.Z?void 0:k.Z].filter(m=>!!m)});m.common.issues.push(E)}let ParseStatus=class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(m,g){let v=[];for(let x of g){if("aborted"===x.status)return T;"dirty"===x.status&&m.dirty(),v.push(x.value)}return{status:m.value,value:v}}static async mergeObjectAsync(m,g){let v=[];for(let m of g){let g=await m.key,x=await m.value;v.push({key:g,value:x})}return ParseStatus.mergeObjectSync(m,v)}static mergeObjectSync(m,g){let v={};for(let x of g){let{key:g,value:k}=x;if("aborted"===g.status||"aborted"===k.status)return T;"dirty"===g.status&&m.dirty(),"dirty"===k.status&&m.dirty(),"__proto__"!==g.value&&(void 0!==k.value||x.alwaysSet)&&(v[g.value]=k.value)}return{status:m.value,value:v}}};let T=Object.freeze({status:"aborted"}),DIRTY=m=>({status:"dirty",value:m}),OK=m=>({status:"valid",value:m}),isAborted=m=>"aborted"===m.status,isDirty=m=>"dirty"===m.status,isValid=m=>"valid"===m.status,isAsync=m=>"undefined"!=typeof Promise&&m instanceof Promise},49342:function(m,g,v){"use strict";var x,k,E;v.d(g,{$k:function(){return T},D5:function(){return x},FQ:function(){return getParsedType},Mg:function(){return k}}),(E=x||(x={})).assertEqual=m=>{},E.assertIs=function(m){},E.assertNever=function(m){throw Error()},E.arrayToEnum=m=>{let g={};for(let v of m)g[v]=v;return g},E.getValidEnumValues=m=>{let g=E.objectKeys(m).filter(g=>"number"!=typeof m[m[g]]),v={};for(let x of g)v[x]=m[x];return E.objectValues(v)},E.objectValues=m=>E.objectKeys(m).map(function(g){return m[g]}),E.objectKeys="function"==typeof Object.keys?m=>Object.keys(m):m=>{let g=[];for(let v in m)Object.prototype.hasOwnProperty.call(m,v)&&g.push(v);return g},E.find=(m,g)=>{for(let v of m)if(g(v))return v},E.isInteger="function"==typeof Number.isInteger?m=>Number.isInteger(m):m=>"number"==typeof m&&Number.isFinite(m)&&Math.floor(m)===m,E.joinValues=function(m,g=" | "){return m.map(m=>"string"==typeof m?`'${m}'`:m).join(g)},E.jsonStringifyReplacer=(m,g)=>"bigint"==typeof g?g.toString():g,(k||(k={})).mergeShapes=(m,g)=>({...m,...g});let T=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=m=>{let g=typeof m;switch(g){case"undefined":return T.undefined;
61case"string":return T.string;case"number":return Number.isNaN(m)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":if(Array.isArray(m))return T.array;if(null===m)return T.null;if(m.then&&"function"==typeof m.then&&m.catch&&"function"==typeof m.catch)return T.promise;if("undefined"!=typeof Map&&m instanceof Map)return T.map;if("undefined"!=typeof Set&&m instanceof Set)return T.set;if("undefined"!=typeof Date&&m instanceof Date)return T.date;return T.object;default:return T.unknown}}},2333:function(m,g,v){"use strict";var x=v(82799),k=v(49342);g.Z=(m,g)=>{let v;switch(m.code){case x.NL.invalid_type:v=m.received===k.$k.undefined?"Required":`Expected ${m.expected}, received ${m.received}`;break;case x.NL.invalid_literal:v=`Invalid literal value, expected ${JSON.stringify(m.expected,k.D5.jsonStringifyReplacer)}`;break;case x.NL.unrecognized_keys:v=`Unrecognized key(s) in object: ${k.D5.joinValues(m.keys,", ")}`;break;case x.NL.invalid_union:v="Invalid input";break;case x.NL.invalid_union_discriminator:v=`Invalid discriminator value. Expected ${k.D5.joinValues(m.options)}`;break;case x.NL.invalid_enum_value:v=`Invalid enum value. Expected ${k.D5.joinValues(m.options)}, received '${m.received}'`;break;case x.NL.invalid_arguments:v="Invalid function arguments";break;case x.NL.invalid_return_type:v="Invalid function return type";break;case x.NL.invalid_date:v="Invalid date";break;case x.NL.invalid_string:"object"==typeof m.validation?"includes"in m.validation?(v=`Invalid input: must include "${m.validation.includes}"`,"number"==typeof m.validation.position&&(v=`${v} at one or more positions greater than or equal to ${m.validation.position}`)):"startsWith"in m.validation?v=`Invalid input: must start with "${m.validation.startsWith}"`:"endsWith"in m.validation?v=`Invalid input: must end with "${m.validation.endsWith}"`:k.D5.assertNever(m.validation):v="regex"!==m.validation?`Invalid ${m.validation}`:"Invalid";break;case x.NL.too_small:v="array"===m.type?`Array must contain ${m.exact?"exactly":m.inclusive?"at least":"more than"} ${m.minimum} element(s)`:"string"===m.type?`String must contain ${m.exact?"exactly":m.inclusive?"at least":"over"} ${m.minimum} character(s)`:"number"===m.type?`Number must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${m.minimum}`:"bigint"===m.type?`Number must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${m.minimum}`:"date"===m.type?`Date must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(m.minimum))}`:"Invalid input";break;case x.NL.too_big:v="array"===m.type?`Array must contain ${m.exact?"exactly":m.inclusive?"at most":"less than"} ${m.maximum} element(s)`:"string"===m.type?`String must contain ${m.exact?"exactly":m.inclusive?"at most":"under"} ${m.maximum} character(s)`:"number"===m.type?`Number must be ${m.exact?"exactly":m.inclusive?"less than or equal to":"less than"} ${m.maximum}`:"bigint"===m.type?`BigInt must be ${m.exact?"exactly":m.inclusive?"less than or equal to":"less than"} ${m.maximum}`:"date"===m.type?`Date must be ${m.exact?"exactly":m.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(m.maximum))}`:"Invalid input";break;case x.NL.custom:v="Invalid input";break;case x.NL.invalid_intersection_types:v="Intersection results could not be merged";break;case x.NL.not_multiple_of:v=`Number must be a multiple of ${m.multipleOf}`;break;case x.NL.not_finite:v="Number must be finite";break;default:v=g.defaultError,k.D5.assertNever(m)}return{message:v}}},53538:function(m,g,v){"use strict";let x;v.d(g,{cg:function(){return eC},C4:function(){return e7},V_:function(){return ZodType},O8:function(){return ZodAny},p5:function(){return ZodArray},EG:function(){return ZodBigInt},pZ:function(){return ZodBoolean},Gd:function(){return ZodBranded},ON:function(){return ZodCatch},$s:function(){return ZodDate},uE:function(){return ZodDefault},Iy:function(){return ZodDiscriminatedUnion},Xc:function(){return ZodEffects},K7:function(){return ZodEnum},pA:function(){return K},b_:function(){return ZodFunction},f9:function(){return ZodIntersection},dT:function(){return ZodLazy},SG:function(){return ZodLiteral},Ym:function(){return ZodMap},Hu:function(){return ZodNaN},Zl:function(){return ZodNativeEnum},$n:function(){return ZodNever},pV:function(){return ZodNull},ng:function(){return ZodNullable},IV:function(){return ZodNumber},CQ:function(){return ZodObject},ak:function(){return ZodOptional},om:function(){return ZodPipeline},Wx:function(){return ZodPromise},ur:function(){return ZodReadonly},KX:function(){return ZodRecord},I6:function(){return ZodType},qA:function(){return ZodSet},$T:function(){return ZodString},tX:function(){return ZodSymbol}
61,z2:function(){return ZodEffects},_P:function(){return ZodTuple},DI:function(){return ZodType},DY:function(){return ZodUndefined},jp:function(){return ZodUnion},Dy:function(){return ZodUnknown},XE:function(){return ZodVoid},Yj:function(){return eM},IX:function(){return eZ},Kv:function(){return eR},O7:function(){return eI},oQ:function(){return e6},PG:function(){return custom},hT:function(){return eP},wU:function(){return datetimeRegex},VK:function(){return ez},cE:function(){return e1},Km:function(){return eX},ZI:function(){return eG},Pp:function(){return instanceOfType},jV:function(){return eV},wt:function(){return ek},Vo:function(){return eQ},i0:function(){return eY},UI:function(){return eW},qn:function(){return eN},jb:function(){return eJ},Fi:function(){return eL},lB:function(){return eA},AG:function(){return e3},Rx:function(){return ej},Ry:function(){return eB},Ts:function(){return oboolean},vs:function(){return onumber},jt:function(){return e2},Dk:function(){return ostring},EU:function(){return e4},dj:function(){return e5},MC:function(){return e0},IM:function(){return eH},t8:function(){return eK},cf:function(){return e$},Z_:function(){return eE},NA:function(){return eT},l4:function(){return e1},bc:function(){return eq},S1:function(){return eO},G0:function(){return eU},_4:function(){return eD},Hc:function(){return eF}});var k,E,T,K,et=v(82799),en=v(46904),er=v(2333);(k=T||(T={})).errToObj=m=>"string"==typeof m?{message:m}:m||{},k.toString=m=>"string"==typeof m?m:m?.message;var ei=v(14834),es=v(49342);let ParseInputLazyPath=class ParseInputLazyPath{constructor(m,g,v,x){this._cachedPath=[],this.parent=m,this.data=g,this._path=v,this._key=x}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};let handleResult=(m,g)=>{if((0,ei.JY)(g))return{success:!0,data:g.value};if(!m.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let g=new et.jm(m.common.issues);return this._error=g,this._error}}};function processCreateParams(m){if(!m)return{};let{errorMap:g,invalid_type_error:v,required_error:x,description:k}=m;if(g&&(v||x))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return g?{errorMap:g,description:k}:{errorMap:(g,k)=>{let{message:E}=m;return"invalid_enum_value"===g.code?{message:E??k.defaultError}:void 0===k.data?{message:E??x??k.defaultError}:"invalid_type"!==g.code?{message:k.defaultError}:{message:E??v??k.defaultError}},description:k}}let ZodType=class ZodType{get description(){return this._def.description}_getType(m){return(0,es.FQ)(m.data)}_getOrReturnCtx(m,g){return g||{common:m.parent.common,data:m.data,parsedType:(0,es.FQ)(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}_processInputParams(m){return{status:new ei.Q9,ctx:{common:m.parent.common,data:m.data,parsedType:(0,es.FQ)(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}}_parseSync(m){let g=this._parse(m);if((0,ei.S9)(g))throw Error("Synchronous parse encountered promise.");return g}_parseAsync(m){let g=this._parse(m);return Promise.resolve(g)}parse(m,g){let v=this.safeParse(m,g);if(v.success)return v.data;throw v.error}safeParse(m,g){let v={common:{issues:[],async:g?.async??!1,contextualErrorMap:g?.errorMap},path:g?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:(0,es.FQ)(m)},x=this._parseSync({data:m,path:v.path,parent:v});return handleResult(v,x)}"~validate"(m){let g={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:(0,es.FQ)(m)};if(!this["~standard"].async)try{let v=this._parseSync({data:m,path:[],parent:g});return(0,ei.JY)(v)?{value:v.value}:{issues:g.common.issues}}catch(m){m?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),g.common={issues:[],async:!0}}return this._parseAsync({data:m,path:[],parent:g}).then(m=>(0,ei.JY)(m)?{value:m.value}:{issues:g.common.issues})}async parseAsync(m,g){let v=await this.safeParseAsync(m,g);if(v.success)return v.data;throw v.error}async safeParseAsync(m,g){let v={common:{issues:[],contextualErrorMap:g?.errorMap,async:!0},path:g?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:(0,es.FQ)(m)},x=this._parse({data:m,path:v.path,parent:v}),k=await ((0,ei.S9)(x)?x:Promise.resolve(x));return handleResult(v,k)}refine(m,g){let getIssueProperties=m=>"string"==typeof g||void 0===g?{message:g}:"function"==typeof g?g(m):g;return this._refinement((g,v)=>{let x=m(g),setError=()=>v.addIssue({code:et.NL.custom,...getIssueProperties(g)});return"undefined"!=typeof Promise&&x instanceof Promise?x.then(m=>!!m||(setError(),!1)):!!x||(setError(),!1)})}refinement(m,g){return this._refinement((v,x)=>!!m(v)||(x.addIssue("function"==typeof g?g(v,x):g),!1))}_refinement(m){return new ZodEffects({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:m}})}superRefine(m){return this._refinement(m)}constructor(m){this.spa=this.safeParseAsync,this._def=m,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:m=>this["~validate"](m)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(m){return ZodUnion.create([this,m],this._def)}and(m){return ZodIntersection.create(this,m,this._def)}transform(m){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:m}})}default(m){return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:"function"==typeof m?m:()=>m,typeName:K.ZodDefault})}brand(){return new ZodBranded({typeName:K.ZodBranded,type:this,...processCreateParams(this._def)})}catch(m){return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:"function"==typeof m?m:()=>m,typeName:K.ZodCatch})}describe(m){let g=this.constructor;return new g({...this._def,description:m})}pipe(m){return ZodPipeline.create(this,m)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};let el=/^c[^\s-]{8,}
61$/i,ec=/^[0-9a-z]+$/,eu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ed=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ep=/^[a-z0-9_-]{21}$/i,em=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ef=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ev=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ey=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,e_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ew="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eS=RegExp(`^${ew}$`);function timeRegexSource(m){let g="[0-5]\\d";m.precision?g=`${g}\\.\\d{${m.precision}}`:null==m.precision&&(g=`${g}(\\.\\d+)?`);let v=m.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${g})${v}`}function datetimeRegex(m){let g=`${ew}T${timeRegexSource(m)}`,v=[];return v.push(m.local?"Z?":"Z"),m.offset&&v.push("([+-]\\d{2}:?\\d{2})"),g=`${g}(${v.join("|")})`,RegExp(`^${g}$`)}let ZodString=class ZodString extends ZodType{_parse(m){var g,v,k,E;let T;this._def.coerce&&(m.data=String(m.data));let K=this._getType(m);if(K!==es.$k.string){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.string,received:g.parsedType}),ei.UI}let en=new ei.Q9;for(let K of this._def.checks)if("min"===K.kind)m.data.length<K.value&&(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.too_small,minimum:K.value,type:"string",inclusive:!0,exact:!1,message:K.message}),en.dirty());else if("max"===K.kind)m.data.length>K.value&&(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.too_big,maximum:K.value,type:"string",inclusive:!0,exact:!1,message:K.message}),en.dirty());else if("length"===K.kind){let g=m.data.length>K.value,v=m.data.length<K.value;(g||v)&&(T=this._getOrReturnCtx(m,T),g?(0,ei.KD)(T,{code:et.NL.too_big,maximum:K.value,type:"string",inclusive:!0,exact:!0,message:K.message}):v&&(0,ei.KD)(T,{code:et.NL.too_small,minimum:K.value,type:"string",inclusive:!0,exact:!0,message:K.message}),en.dirty())}else if("email"===K.kind)eh.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"email",code:et.NL.invalid_string,message:K.message}),en.dirty());
61else if("emoji"===K.kind)x||(x=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),x.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"emoji",code:et.NL.invalid_string,message:K.message}),en.dirty());else if("uuid"===K.kind)ed.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"uuid",code:et.NL.invalid_string,message:K.message}),en.dirty());else if("nanoid"===K.kind)ep.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"nanoid",code:et.NL.invalid_string,message:K.message}),en.dirty());else if("cuid"===K.kind)el.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"cuid",code:et.NL.invalid_string,message:K.message}),en.dirty());else if("cuid2"===K.kind)ec.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"cuid2",code:et.NL.invalid_string,message:K.message}),en.dirty());else if("ulid"===K.kind)eu.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"ulid",code:et.NL.invalid_string,message:K.message}),en.dirty());else if("url"===K.kind)try{new URL(m.data)}catch{T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"url",code:et.NL.invalid_string,message:K.message}),en.dirty()}else if("regex"===K.kind){K.regex.lastIndex=0;let g=K.regex.test(m.data);g||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"regex",code:et.NL.invalid_string,message:K.message}),en.dirty())}else if("trim"===K.kind)m.data=m.data.trim();else if("includes"===K.kind)m.data.includes(K.value,K.position)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.invalid_string,validation:{includes:K.value,position:K.position},message:K.message}),en.dirty());else if("toLowerCase"===K.kind)m.data=m.data.toLowerCase();else if("toUpperCase"===K.kind)m.data=m.data.toUpperCase();else if("startsWith"===K.kind)m.data.startsWith(K.value)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.invalid_string,validation:{startsWith:K.value},message:K.message}),en.dirty());else if("endsWith"===K.kind)m.data.endsWith(K.value)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.invalid_string,validation:{endsWith:K.value},message:K.message}),en.dirty());else if("datetime"===K.kind){let g=datetimeRegex(K);g.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.invalid_string,validation:"datetime",message:K.message}),en.dirty())}else if("date"===K.kind)eS.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.invalid_string,validation:"date",message:K.message}),en.dirty());else if("time"===K.kind){let g=RegExp(`^${timeRegexSource(K)}$`);g.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{code:et.NL.invalid_string,validation:"time",message:K.message}),en.dirty())}else"duration"===K.kind?ef.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"duration",code:et.NL.invalid_string,message:K.message}),en.dirty()):"ip"===K.kind?(g=m.data,("v4"===(v=K.version)||!v)&&eg.test(g)||("v6"===v||!v)&&ey.test(g)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"ip",code:et.NL.invalid_string,message:K.message}),en.dirty())):"jwt"===K.kind?!function(m,g){if(!em.test(m))return!1;try{let[v]=m.split(".");if(!v)return!1;let x=v.replace(/-/g,"+").replace(/_/g,"/").padEnd(v.length+(4-v.length%4)%4,"="),k=JSON.parse(atob(x));if("object"!=typeof k||null===k||"typ"in k&&k?.typ!=="JWT"||!k.alg||g&&k.alg!==g)return!1;return!0}catch{return!1}}(m.data,K.alg)&&(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"jwt",code:et.NL.invalid_string,message:K.message}),en.dirty()):"cidr"===K.kind?(k=m.data,("v4"===(E=K.version)||!E)&&ev.test(k)||("v6"===E||!E)&&eb.test(k)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"cidr",code:et.NL.invalid_string,message:K.message}),en.dirty())):"base64"===K.kind?ex.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"base64",code:et.NL.invalid_string,message:K.message}),en.dirty()):"base64url"===K.kind?e_.test(m.data)||(T=this._getOrReturnCtx(m,T),(0,ei.KD)(T,{validation:"base64url",code:et.NL.invalid_string,message:K.message}),en.dirty()):es.D5.assertNever(K);return{status:en.value,value:m.data}}_regex(m,g,v){return this.refinement(g=>m.test(g),{validation:g,code:et.NL.invalid_string,...T.errToObj(v)})}_addCheck(m){return new ZodString({...this._def,checks:[...this._def.checks,m]})}email(m){return this._addCheck({kind:"email",...T.errToObj(m)})}url(m){return this._addCheck({kind:"url",...T.errToObj(m)})}emoji(m){return this._addCheck({kind:"emoji",...T.errToObj(m)})}uuid(m){return this._addCheck({kind:"uuid",...T.errToObj(m)})}nanoid(m){return this._addCheck({kind:"nanoid",...T.errToObj(m)})}cuid(m){return this._addCheck({kind:"cuid",...T.errToObj(m)})}cuid2(m){return this._addCheck({kind:"cuid2",...T.errToObj(m)})}ulid(m){return this._addCheck({kind:"ulid",...T.errToObj(m)})}base64(m){return this._addCheck({kind:"base64",...T.errToObj(m)})}base64url(m){return this._addCheck({kind:"base64url",...T.errToObj(m)})}jwt(m){return this._addCheck({kind:"jwt",...T.errToObj(m)})}ip(m){return this._addCheck({kind:"ip",...T.errToObj(m)})}cidr(m){return this._addCheck({kind:"cidr",...T.errToObj(m)})}datetime(m){return"string"==typeof m?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:m}):this._addCheck({kind:"datetime",precision:void 0===m?.precision?null:m?.precision,offset:m?.offset??!1,local:m?.local??!1,...T.errToObj(m?.message)})}date(m){return this._addCheck({kind:"date",message:m})}time(m){return"string"==typeof m?this._addCheck({kind:"time",precision:null,message:m}):this._addCheck({kind:"time",precision:void 0===m?.precision?null:m?.precision,...T.errToObj(m?.message)})}duration(m){return this._addCheck({kind:"duration",...T.errToObj(m)})}regex(m,g){return this._addCheck({kind:"regex",regex:m,...T.errToObj(g)})}includes(m,g){return this._addCheck({kind:"includes",value:m,position:g?.position,...T.errToObj(g?.message)})}startsWith(m,g){return this._addCheck({kind:"startsWith",value:m,...T.errToObj(g)})}endsWith(m,g){return this._addCheck({kind:"endsWith",value:m,...T.errToObj(g)})}min(m,g){return this._addCheck({kind:"min",value:m,...T.errToObj(g)})}max(m,g){return this._addCheck({kind:"max",value:m,...T.errToObj(g)})}length(m,g){return this._addCheck({kind:"length",value:m,...T.errToObj(g)})}nonempty(m){return this.min(1,T.errToObj(m))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(m=>"datetime"===m.kind)}
61get isDate(){return!!this._def.checks.find(m=>"date"===m.kind)}get isTime(){return!!this._def.checks.find(m=>"time"===m.kind)}get isDuration(){return!!this._def.checks.find(m=>"duration"===m.kind)}get isEmail(){return!!this._def.checks.find(m=>"email"===m.kind)}get isURL(){return!!this._def.checks.find(m=>"url"===m.kind)}get isEmoji(){return!!this._def.checks.find(m=>"emoji"===m.kind)}get isUUID(){return!!this._def.checks.find(m=>"uuid"===m.kind)}get isNANOID(){return!!this._def.checks.find(m=>"nanoid"===m.kind)}get isCUID(){return!!this._def.checks.find(m=>"cuid"===m.kind)}get isCUID2(){return!!this._def.checks.find(m=>"cuid2"===m.kind)}get isULID(){return!!this._def.checks.find(m=>"ulid"===m.kind)}get isIP(){return!!this._def.checks.find(m=>"ip"===m.kind)}get isCIDR(){return!!this._def.checks.find(m=>"cidr"===m.kind)}get isBase64(){return!!this._def.checks.find(m=>"base64"===m.kind)}get isBase64url(){return!!this._def.checks.find(m=>"base64url"===m.kind)}get minLength(){let m=null;for(let g of this._def.checks)"min"===g.kind&&(null===m||g.value>m)&&(m=g.value);return m}get maxLength(){let m=null;for(let g of this._def.checks)"max"===g.kind&&(null===m||g.value<m)&&(m=g.value);return m}};ZodString.create=m=>new ZodString({checks:[],typeName:K.ZodString,coerce:m?.coerce??!1,...processCreateParams(m)});let ZodNumber=class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(m){let g;this._def.coerce&&(m.data=Number(m.data));let v=this._getType(m);if(v!==es.$k.number){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.number,received:g.parsedType}),ei.UI}let x=new ei.Q9;for(let v of this._def.checks)if("int"===v.kind)es.D5.isInteger(m.data)||(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.invalid_type,expected:"integer",received:"float",message:v.message}),x.dirty());else if("min"===v.kind){let k=v.inclusive?m.data<v.value:m.data<=v.value;k&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.too_small,minimum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),x.dirty())}else if("max"===v.kind){let k=v.inclusive?m.data>v.value:m.data>=v.value;k&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.too_big,maximum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),x.dirty())}else"multipleOf"===v.kind?0!==function(m,g){let v=(m.toString().split(".")[1]||"").length,x=(g.toString().split(".")[1]||"").length,k=v>x?v:x,E=Number.parseInt(m.toFixed(k).replace(".","")),T=Number.parseInt(g.toFixed(k).replace(".",""));return E%T/10**k}(m.data,v.value)&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.not_multiple_of,multipleOf:v.value,message:v.message}),x.dirty()):"finite"===v.kind?Number.isFinite(m.data)||(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.not_finite,message:v.message}),x.dirty()):es.D5.assertNever(v);return{status:x.value,value:m.data}}gte(m,g){return this.setLimit("min",m,!0,T.toString(g))}gt(m,g){return this.setLimit("min",m,!1,T.toString(g))}lte(m,g){return this.setLimit("max",m,!0,T.toString(g))}lt(m,g){return this.setLimit("max",m,!1,T.toString(g))}setLimit(m,g,v,x){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:m,value:g,inclusive:v,message:T.toString(x)}]})}_addCheck(m){return new ZodNumber({...this._def,checks:[...this._def.checks,m]})}int(m){return this._addCheck({kind:"int",message:T.toString(m)})}positive(m){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(m)})}negative(m){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(m)})}multipleOf(m,g){return this._addCheck({kind:"multipleOf",value:m,message:T.toString(g)})}finite(m){return this._addCheck({kind:"finite",message:T.toString(m)})}safe(m){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(m)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(m)})}get minValue(){let m=null;for(let g of this._def.checks)"min"===g.kind&&(null===m||g.value>m)&&(m=g.value);return m}get maxValue(){let m=null;for(let g of this._def.checks)"max"===g.kind&&(null===m||g.value<m)&&(m=g.value);return m}get isInt(){return!!this._def.checks.find(m=>"int"===m.kind||"multipleOf"===m.kind&&es.D5.isInteger(m.value))}get isFinite(){let m=null,g=null;for(let v of this._def.checks){if("finite"===v.kind||"int"===v.kind||"multipleOf"===v.kind)return!0;"min"===v.kind?(null===g||v.value>g)&&(g=v.value):"max"===v.kind&&(null===m||v.value<m)&&(m=v.value)}return Number.isFinite(g)&&Number.isFinite(m)}};ZodNumber.create=m=>new ZodNumber({checks:[],typeName:K.ZodNumber,coerce:m?.coerce||!1,...processCreateParams(m)});
61let ZodBigInt=class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(m){let g;if(this._def.coerce)try{m.data=BigInt(m.data)}catch{return this._getInvalidInput(m)}let v=this._getType(m);if(v!==es.$k.bigint)return this._getInvalidInput(m);let x=new ei.Q9;for(let v of this._def.checks)if("min"===v.kind){let k=v.inclusive?m.data<v.value:m.data<=v.value;k&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.too_small,type:"bigint",minimum:v.value,inclusive:v.inclusive,message:v.message}),x.dirty())}else if("max"===v.kind){let k=v.inclusive?m.data>v.value:m.data>=v.value;k&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.too_big,type:"bigint",maximum:v.value,inclusive:v.inclusive,message:v.message}),x.dirty())}else"multipleOf"===v.kind?m.data%v.value!==BigInt(0)&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.not_multiple_of,multipleOf:v.value,message:v.message}),x.dirty()):es.D5.assertNever(v);return{status:x.value,value:m.data}}_getInvalidInput(m){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.bigint,received:g.parsedType}),ei.UI}gte(m,g){return this.setLimit("min",m,!0,T.toString(g))}gt(m,g){return this.setLimit("min",m,!1,T.toString(g))}lte(m,g){return this.setLimit("max",m,!0,T.toString(g))}lt(m,g){return this.setLimit("max",m,!1,T.toString(g))}setLimit(m,g,v,x){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:m,value:g,inclusive:v,message:T.toString(x)}]})}_addCheck(m){return new ZodBigInt({...this._def,checks:[...this._def.checks,m]})}positive(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(m)})}negative(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(m)})}multipleOf(m,g){return this._addCheck({kind:"multipleOf",value:m,message:T.toString(g)})}get minValue(){let m=null;for(let g of this._def.checks)"min"===g.kind&&(null===m||g.value>m)&&(m=g.value);return m}get maxValue(){let m=null;for(let g of this._def.checks)"max"===g.kind&&(null===m||g.value<m)&&(m=g.value);return m}};ZodBigInt.create=m=>new ZodBigInt({checks:[],typeName:K.ZodBigInt,coerce:m?.coerce??!1,...processCreateParams(m)});let ZodBoolean=class ZodBoolean extends ZodType{_parse(m){this._def.coerce&&(m.data=!!m.data);let g=this._getType(m);if(g!==es.$k.boolean){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.boolean,received:g.parsedType}),ei.UI}return(0,ei.OK)(m.data)}};ZodBoolean.create=m=>new ZodBoolean({typeName:K.ZodBoolean,coerce:m?.coerce||!1,...processCreateParams(m)});let ZodDate=class ZodDate extends ZodType{_parse(m){let g;this._def.coerce&&(m.data=new Date(m.data));let v=this._getType(m);if(v!==es.$k.date){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.date,received:g.parsedType}),ei.UI}if(Number.isNaN(m.data.getTime())){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_date}),ei.UI}let x=new ei.Q9;for(let v of this._def.checks)"min"===v.kind?m.data.getTime()<v.value&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.too_small,message:v.message,inclusive:!0,exact:!1,minimum:v.value,type:"date"}),x.dirty()):"max"===v.kind?m.data.getTime()>v.value&&(g=this._getOrReturnCtx(m,g),(0,ei.KD)(g,{code:et.NL.too_big,message:v.message,inclusive:!0,exact:!1,maximum:v.value,type:"date"}),x.dirty()):es.D5.assertNever(v);return{status:x.value,value:new Date(m.data.getTime())}}_addCheck(m){return new ZodDate({...this._def,checks:[...this._def.checks,m]})}min(m,g){return this._addCheck({kind:"min",value:m.getTime(),message:T.toString(g)})}max(m,g){return this._addCheck({kind:"max",value:m.getTime(),message:T.toString(g)})}get minDate(){let m=null;for(let g of this._def.checks)"min"===g.kind&&(null===m||g.value>m)&&(m=g.value);return null!=m?new Date(m):null}get maxDate(){let m=null;for(let g of this._def.checks)"max"===g.kind&&(null===m||g.value<m)&&(m=g.value);return null!=m?new Date(m):null}};ZodDate.create=m=>new ZodDate({checks:[],coerce:m?.coerce||!1,typeName:K.ZodDate,...processCreateParams(m)});
61let ZodSymbol=class ZodSymbol extends ZodType{_parse(m){let g=this._getType(m);if(g!==es.$k.symbol){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.symbol,received:g.parsedType}),ei.UI}return(0,ei.OK)(m.data)}};ZodSymbol.create=m=>new ZodSymbol({typeName:K.ZodSymbol,...processCreateParams(m)});let ZodUndefined=class ZodUndefined extends ZodType{_parse(m){let g=this._getType(m);if(g!==es.$k.undefined){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.undefined,received:g.parsedType}),ei.UI}return(0,ei.OK)(m.data)}};ZodUndefined.create=m=>new ZodUndefined({typeName:K.ZodUndefined,...processCreateParams(m)});let ZodNull=class ZodNull extends ZodType{_parse(m){let g=this._getType(m);if(g!==es.$k.null){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.null,received:g.parsedType}),ei.UI}return(0,ei.OK)(m.data)}};ZodNull.create=m=>new ZodNull({typeName:K.ZodNull,...processCreateParams(m)});let ZodAny=class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(m){return(0,ei.OK)(m.data)}};ZodAny.create=m=>new ZodAny({typeName:K.ZodAny,...processCreateParams(m)});let ZodUnknown=class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(m){return(0,ei.OK)(m.data)}};ZodUnknown.create=m=>new ZodUnknown({typeName:K.ZodUnknown,...processCreateParams(m)});let ZodNever=class ZodNever extends ZodType{_parse(m){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.never,received:g.parsedType}),ei.UI}};ZodNever.create=m=>new ZodNever({typeName:K.ZodNever,...processCreateParams(m)});let ZodVoid=class ZodVoid extends ZodType{_parse(m){let g=this._getType(m);if(g!==es.$k.undefined){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.void,received:g.parsedType}),ei.UI}return(0,ei.OK)(m.data)}};ZodVoid.create=m=>new ZodVoid({typeName:K.ZodVoid,...processCreateParams(m)});let ZodArray=class ZodArray extends ZodType{_parse(m){let{ctx:g,status:v}=this._processInputParams(m),x=this._def;if(g.parsedType!==es.$k.array)return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.array,received:g.parsedType}),ei.UI;if(null!==x.exactLength){let m=g.data.length>x.exactLength.value,k=g.data.length<x.exactLength.value;(m||k)&&((0,ei.KD)(g,{code:m?et.NL.too_big:et.NL.too_small,minimum:k?x.exactLength.value:void 0,maximum:m?x.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:x.exactLength.message}),v.dirty())}if(null!==x.minLength&&g.data.length<x.minLength.value&&((0,ei.KD)(g,{code:et.NL.too_small,minimum:x.minLength.value,type:"array",inclusive:!0,exact:!1,message:x.minLength.message}),v.dirty()),null!==x.maxLength&&g.data.length>x.maxLength.value&&((0,ei.KD)(g,{code:et.NL.too_big,maximum:x.maxLength.value,type:"array",inclusive:!0,exact:!1,message:x.maxLength.message}),v.dirty()),g.common.async)return Promise.all([...g.data].map((m,v)=>x.type._parseAsync(new ParseInputLazyPath(g,m,g.path,v)))).then(m=>ei.Q9.mergeArray(v,m));let k=[...g.data].map((m,v)=>x.type._parseSync(new ParseInputLazyPath(g,m,g.path,v)));return ei.Q9.mergeArray(v,k)}get element(){return this._def.type}min(m,g){return new ZodArray({...this._def,minLength:{value:m,message:T.toString(g)}})}max(m,g){return new ZodArray({...this._def,maxLength:{value:m,message:T.toString(g)}})}length(m,g){return new ZodArray({...this._def,exactLength:{value:m,message:T.toString(g)}})}nonempty(m){return this.min(1,m)}};ZodArray.create=(m,g)=>new ZodArray({type:m,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...processCreateParams(g)});let ZodObject=class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let m=this._def.shape(),g=es.D5.objectKeys(m);return this._cached={shape:m,keys:g},this._cached}_parse(m){let g=this._getType(m);if(g!==es.$k.object){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.object,received:g.parsedType}),ei.UI}let{status:v,ctx:x}=this._processInputParams(m),{shape:k,keys:E}=this._getCached(),T=[];
61if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(let m in x.data)E.includes(m)||T.push(m);let K=[];for(let m of E){let g=k[m],v=x.data[m];K.push({key:{status:"valid",value:m},value:g._parse(new ParseInputLazyPath(x,v,x.path,m)),alwaysSet:m in x.data})}if(this._def.catchall instanceof ZodNever){let m=this._def.unknownKeys;if("passthrough"===m)for(let m of T)K.push({key:{status:"valid",value:m},value:{status:"valid",value:x.data[m]}});else if("strict"===m)T.length>0&&((0,ei.KD)(x,{code:et.NL.unrecognized_keys,keys:T}),v.dirty());else if("strip"===m);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of T){let v=x.data[g];K.push({key:{status:"valid",value:g},value:m._parse(new ParseInputLazyPath(x,v,x.path,g)),alwaysSet:g in x.data})}}return x.common.async?Promise.resolve().then(async()=>{let m=[];for(let g of K){let v=await g.key,x=await g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m}).then(m=>ei.Q9.mergeObjectSync(v,m)):ei.Q9.mergeObjectSync(v,K)}get shape(){return this._def.shape()}strict(m){return T.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==m?{errorMap:(g,v)=>{let x=this._def.errorMap?.(g,v).message??v.defaultError;return"unrecognized_keys"===g.code?{message:T.errToObj(m).message??x}:{message:x}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(m){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...m})})}merge(m){let g=new ZodObject({unknownKeys:m._def.unknownKeys,catchall:m._def.catchall,shape:()=>({...this._def.shape(),...m._def.shape()}),typeName:K.ZodObject});return g}setKey(m,g){return this.augment({[m]:g})}catchall(m){return new ZodObject({...this._def,catchall:m})}pick(m){let g={};for(let v of es.D5.objectKeys(m))m[v]&&this.shape[v]&&(g[v]=this.shape[v]);return new ZodObject({...this._def,shape:()=>g})}omit(m){let g={};for(let v of es.D5.objectKeys(this.shape))m[v]||(g[v]=this.shape[v]);return new ZodObject({...this._def,shape:()=>g})}deepPartial(){return function deepPartialify(m){if(m instanceof ZodObject){let g={};for(let v in m.shape){let x=m.shape[v];g[v]=ZodOptional.create(deepPartialify(x))}return new ZodObject({...m._def,shape:()=>g})}return m instanceof ZodArray?new ZodArray({...m._def,type:deepPartialify(m.element)}):m instanceof ZodOptional?ZodOptional.create(deepPartialify(m.unwrap())):m instanceof ZodNullable?ZodNullable.create(deepPartialify(m.unwrap())):m instanceof ZodTuple?ZodTuple.create(m.items.map(m=>deepPartialify(m))):m}(this)}partial(m){let g={};for(let v of es.D5.objectKeys(this.shape)){let x=this.shape[v];m&&!m[v]?g[v]=x:g[v]=x.optional()}return new ZodObject({...this._def,shape:()=>g})}required(m){let g={};for(let v of es.D5.objectKeys(this.shape))if(m&&!m[v])g[v]=this.shape[v];else{let m=this.shape[v],x=m;for(;x instanceof ZodOptional;)x=x._def.innerType;g[v]=x}return new ZodObject({...this._def,shape:()=>g})}keyof(){return createZodEnum(es.D5.objectKeys(this.shape))}};ZodObject.create=(m,g)=>new ZodObject({shape:()=>m,unknownKeys:"strip",catchall:ZodNever.create(),typeName:K.ZodObject,...processCreateParams(g)}),ZodObject.strictCreate=(m,g)=>new ZodObject({shape:()=>m,unknownKeys:"strict",catchall:ZodNever.create(),typeName:K.ZodObject,...processCreateParams(g)}),ZodObject.lazycreate=(m,g)=>new ZodObject({shape:m,unknownKeys:"strip",catchall:ZodNever.create(),typeName:K.ZodObject,...processCreateParams(g)});let ZodUnion=class ZodUnion extends ZodType{_parse(m){let{ctx:g}=this._processInputParams(m),v=this._def.options;if(g.common.async)return Promise.all(v.map(async m=>{let v={...g,common:{...g.common,issues:[]},parent:null};return{result:await m._parseAsync({data:g.data,path:g.path,parent:v}),ctx:v}})).then(function(m){for(let g of m)if("valid"===g.result.status)return g.result;for(let v of m)if("dirty"===v.result.status)return g.common.issues.push(...v.ctx.common.issues),v.result;let v=m.map(m=>new et.jm(m.ctx.common.issues));return(0,ei.KD)(g,{code:et.NL.invalid_union,unionErrors:v}),ei.UI});{let m;let x=[];for(let k of v){let v={...g,common:{...g.common,issues:[]},parent:null},E=k._parseSync({data:g.data,path:g.path,parent:v});if("valid"===E.status)return E;"dirty"!==E.status||m||(m={result:E,ctx:v}),v.common.issues.length&&x.push(v.common.issues)}if(m)return g.common.issues.push(...m.ctx.common.issues),m.result;let k=x.map(m=>new et.jm(m));return(0,ei.KD)(g,{code:et.NL.invalid_union,unionErrors:k}),ei.UI}}get options(){return this._def.options}};ZodUnion.create=(m,g)=>new ZodUnion({options:m,typeName:K.ZodUnion,...processCreateParams(g)});let getDiscriminator=m=>{if(m instanceof ZodLazy)return getDiscriminator(m.schema);if(m instanceof ZodEffects)return getDiscriminator(m.innerType());if(m instanceof ZodLiteral)return[m.value];if(m instanceof ZodEnum)return m.options;if(m instanceof ZodNativeEnum)return es.D5.objectValues(m.enum);if(m instanceof ZodDefault)return getDiscriminator(m._def.innerType);if(m instanceof ZodUndefined)return[void 0];else if(m instanceof ZodNull)return[null];else if(m instanceof ZodOptional)return[void 0,...getDiscriminator(m.unwrap())];else if(m instanceof ZodNullable)return[null,...getDiscriminator(m.unwrap())];else if(m instanceof ZodBranded)return getDiscriminator(m.unwrap());else if(m instanceof ZodReadonly)return getDiscriminator(m.unwrap());else if(m instanceof ZodCatch)return getDiscriminator(m._def.innerType);else return[]};let ZodDiscriminatedUnion=class ZodDiscriminatedUnion extends ZodT
61ype{_parse(m){let{ctx:g}=this._processInputParams(m);if(g.parsedType!==es.$k.object)return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.object,received:g.parsedType}),ei.UI;let v=this.discriminator,x=g.data[v],k=this.optionsMap.get(x);return k?g.common.async?k._parseAsync({data:g.data,path:g.path,parent:g}):k._parseSync({data:g.data,path:g.path,parent:g}):((0,ei.KD)(g,{code:et.NL.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[v]}),ei.UI)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(m,g,v){let x=new Map;for(let v of g){let g=getDiscriminator(v.shape[m]);if(!g.length)throw Error(`A discriminator value for key \`${m}\` could not be extracted from all schema options`);for(let k of g){if(x.has(k))throw Error(`Discriminator property ${String(m)} has duplicate value ${String(k)}`);x.set(k,v)}}return new ZodDiscriminatedUnion({typeName:K.ZodDiscriminatedUnion,discriminator:m,options:g,optionsMap:x,...processCreateParams(v)})}};let ZodIntersection=class ZodIntersection extends ZodType{_parse(m){let{status:g,ctx:v}=this._processInputParams(m),handleParsed=(m,x)=>{if((0,ei.Hc)(m)||(0,ei.Hc)(x))return ei.UI;let k=function mergeValues(m,g){let v=(0,es.FQ)(m),x=(0,es.FQ)(g);if(m===g)return{valid:!0,data:m};if(v===es.$k.object&&x===es.$k.object){let v=es.D5.objectKeys(g),x=es.D5.objectKeys(m).filter(m=>-1!==v.indexOf(m)),k={...m,...g};for(let v of x){let x=mergeValues(m[v],g[v]);if(!x.valid)return{valid:!1};k[v]=x.data}return{valid:!0,data:k}}if(v===es.$k.array&&x===es.$k.array){if(m.length!==g.length)return{valid:!1};let v=[];for(let x=0;x<m.length;x++){let k=m[x],E=g[x],T=mergeValues(k,E);if(!T.valid)return{valid:!1};v.push(T.data)}return{valid:!0,data:v}}return v===es.$k.date&&x===es.$k.date&&+m==+g?{valid:!0,data:m}:{valid:!1}}(m.value,x.value);return k.valid?(((0,ei.eT)(m)||(0,ei.eT)(x))&&g.dirty(),{status:g.value,value:k.data}):((0,ei.KD)(v,{code:et.NL.invalid_intersection_types}),ei.UI)};return v.common.async?Promise.all([this._def.left._parseAsync({data:v.data,path:v.path,parent:v}),this._def.right._parseAsync({data:v.data,path:v.path,parent:v})]).then(([m,g])=>handleParsed(m,g)):handleParsed(this._def.left._parseSync({data:v.data,path:v.path,parent:v}),this._def.right._parseSync({data:v.data,path:v.path,parent:v}))}};ZodIntersection.create=(m,g,v)=>new ZodIntersection({left:m,right:g,typeName:K.ZodIntersection,...processCreateParams(v)});let ZodTuple=class ZodTuple extends ZodType{_parse(m){let{status:g,ctx:v}=this._processInputParams(m);if(v.parsedType!==es.$k.array)return(0,ei.KD)(v,{code:et.NL.invalid_type,expected:es.$k.array,received:v.parsedType}),ei.UI;if(v.data.length<this._def.items.length)return(0,ei.KD)(v,{code:et.NL.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ei.UI;let x=this._def.rest;!x&&v.data.length>this._def.items.length&&((0,ei.KD)(v,{code:et.NL.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g.dirty());let k=[...v.data].map((m,g)=>{let x=this._def.items[g]||this._def.rest;return x?x._parse(new ParseInputLazyPath(v,m,v.path,g)):null}).filter(m=>!!m);return v.common.async?Promise.all(k).then(m=>ei.Q9.mergeArray(g,m)):ei.Q9.mergeArray(g,k)}get items(){return this._def.items}rest(m){return new ZodTuple({...this._def,rest:m})}};ZodTuple.create=(m,g)=>{if(!Array.isArray(m))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:m,typeName:K.ZodTuple,rest:null,...processCreateParams(g)})};let ZodRecord=class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){let{status:g,ctx:v}=this._processInputParams(m);if(v.parsedType!==es.$k.object)return(0,ei.KD)(v,{code:et.NL.invalid_type,expected:es.$k.object,received:v.parsedType}),ei.UI;let x=[],k=this._def.keyType,E=this._def.valueType;for(let m in v.data)x.push({key:k._parse(new ParseInputLazyPath(v,m,v.path,m)),value:E._parse(new ParseInputLazyPath(v,v.data[m],v.path,m)),alwaysSet:m in v.data});return v.common.async?ei.Q9.mergeObjectAsync(g,x):ei.Q9.mergeObjectSync(g,x)}
61get element(){return this._def.valueType}static create(m,g,v){return new ZodRecord(g instanceof ZodType?{keyType:m,valueType:g,typeName:K.ZodRecord,...processCreateParams(v)}:{keyType:ZodString.create(),valueType:m,typeName:K.ZodRecord,...processCreateParams(g)})}};let ZodMap=class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){let{status:g,ctx:v}=this._processInputParams(m);if(v.parsedType!==es.$k.map)return(0,ei.KD)(v,{code:et.NL.invalid_type,expected:es.$k.map,received:v.parsedType}),ei.UI;let x=this._def.keyType,k=this._def.valueType,E=[...v.data.entries()].map(([m,g],E)=>({key:x._parse(new ParseInputLazyPath(v,m,v.path,[E,"key"])),value:k._parse(new ParseInputLazyPath(v,g,v.path,[E,"value"]))}));if(v.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let v of E){let x=await v.key,k=await v.value;if("aborted"===x.status||"aborted"===k.status)return ei.UI;("dirty"===x.status||"dirty"===k.status)&&g.dirty(),m.set(x.value,k.value)}return{status:g.value,value:m}})}{let m=new Map;for(let v of E){let x=v.key,k=v.value;if("aborted"===x.status||"aborted"===k.status)return ei.UI;("dirty"===x.status||"dirty"===k.status)&&g.dirty(),m.set(x.value,k.value)}return{status:g.value,value:m}}}};ZodMap.create=(m,g,v)=>new ZodMap({valueType:g,keyType:m,typeName:K.ZodMap,...processCreateParams(v)});let ZodSet=class ZodSet extends ZodType{_parse(m){let{status:g,ctx:v}=this._processInputParams(m);if(v.parsedType!==es.$k.set)return(0,ei.KD)(v,{code:et.NL.invalid_type,expected:es.$k.set,received:v.parsedType}),ei.UI;let x=this._def;null!==x.minSize&&v.data.size<x.minSize.value&&((0,ei.KD)(v,{code:et.NL.too_small,minimum:x.minSize.value,type:"set",inclusive:!0,exact:!1,message:x.minSize.message}),g.dirty()),null!==x.maxSize&&v.data.size>x.maxSize.value&&((0,ei.KD)(v,{code:et.NL.too_big,maximum:x.maxSize.value,type:"set",inclusive:!0,exact:!1,message:x.maxSize.message}),g.dirty());let k=this._def.valueType;function finalizeSet(m){let v=new Set;for(let x of m){if("aborted"===x.status)return ei.UI;"dirty"===x.status&&g.dirty(),v.add(x.value)}return{status:g.value,value:v}}let E=[...v.data.values()].map((m,g)=>k._parse(new ParseInputLazyPath(v,m,v.path,g)));return v.common.async?Promise.all(E).then(m=>finalizeSet(m)):finalizeSet(E)}min(m,g){return new ZodSet({...this._def,minSize:{value:m,message:T.toString(g)}})}max(m,g){return new ZodSet({...this._def,maxSize:{value:m,message:T.toString(g)}})}size(m,g){return this.min(m,g).max(m,g)}nonempty(m){return this.min(1,m)}};ZodSet.create=(m,g)=>new ZodSet({valueType:m,minSize:null,maxSize:null,typeName:K.ZodSet,...processCreateParams(g)});let ZodFunction=class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(m){let{ctx:g}=this._processInputParams(m);if(g.parsedType!==es.$k.function)return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.function,received:g.parsedType}),ei.UI;function makeArgsIssue(m,v){return(0,ei.Xm)({data:m,path:g.path,errorMaps:[g.common.contextualErrorMap,g.schemaErrorMap,(0,en.Pr)(),er.Z].filter(m=>!!m),issueData:{code:et.NL.invalid_arguments,argumentsError:v}})}function makeReturnsIssue(m,v){return(0,ei.Xm)({data:m,path:g.path,errorMaps:[g.common.contextualErrorMap,g.schemaErrorMap,(0,en.Pr)(),er.Z].filter(m=>!!m),issueData:{code:et.NL.invalid_return_type,returnTypeError:v}})}let v={errorMap:g.common.contextualErrorMap},x=g.data;if(this._def.returns instanceof ZodPromise){let m=this;return(0,ei.OK)(async function(...g){let k=new et.jm([]),E=await m._def.args.parseAsync(g,v).catch(m=>{throw k.addIssue(makeArgsIssue(g,m)),k}),T=await Reflect.apply(x,this,E),K=await m._def.returns._def.type.parseAsync(T,v).catch(m=>{throw k.addIssue(makeReturnsIssue(T,m)),k});return K})}{let m=this;return(0,ei.OK)(function(...g){let k=m._def.args.safeParse(g,v);if(!k.success)throw new et.jm([makeArgsIssue(g,k.error)]);let E=Reflect.apply(x,this,k.data),T=m._def.returns.safeParse(E,v);if(!T.success)throw new et.jm([makeReturnsIssue(E,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...m){return new ZodFunction({...this._def,args:ZodTuple.create(m).rest(ZodUnknown.create())})}returns(m){return new ZodFunction({...this._def,returns:m})}implement(m){let g=this.parse(m);return g}strictImplement(m){let g=this.parse(m);return g}static create(m,g,v){return new ZodFunction({args:m||ZodTuple.create([]).rest(ZodUnknown.create()),returns:g||ZodUnknown.create(),typeName:K.ZodFunction,...processCreateParams(v)})}};
61let ZodLazy=class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(m){let{ctx:g}=this._processInputParams(m),v=this._def.getter();return v._parse({data:g.data,path:g.path,parent:g})}};ZodLazy.create=(m,g)=>new ZodLazy({getter:m,typeName:K.ZodLazy,...processCreateParams(g)});let ZodLiteral=class ZodLiteral extends ZodType{_parse(m){if(m.data!==this._def.value){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{received:g.data,code:et.NL.invalid_literal,expected:this._def.value}),ei.UI}return{status:"valid",value:m.data}}get value(){return this._def.value}};function createZodEnum(m,g){return new ZodEnum({values:m,typeName:K.ZodEnum,...processCreateParams(g)})}ZodLiteral.create=(m,g)=>new ZodLiteral({value:m,typeName:K.ZodLiteral,...processCreateParams(g)});let ZodEnum=class ZodEnum extends ZodType{_parse(m){if("string"!=typeof m.data){let g=this._getOrReturnCtx(m),v=this._def.values;return(0,ei.KD)(g,{expected:es.D5.joinValues(v),received:g.parsedType,code:et.NL.invalid_type}),ei.UI}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(m.data)){let g=this._getOrReturnCtx(m),v=this._def.values;return(0,ei.KD)(g,{received:g.data,code:et.NL.invalid_enum_value,options:v}),ei.UI}return(0,ei.OK)(m.data)}get options(){return this._def.values}get enum(){let m={};for(let g of this._def.values)m[g]=g;return m}get Values(){let m={};for(let g of this._def.values)m[g]=g;return m}get Enum(){let m={};for(let g of this._def.values)m[g]=g;return m}extract(m,g=this._def){return ZodEnum.create(m,{...this._def,...g})}exclude(m,g=this._def){return ZodEnum.create(this.options.filter(g=>!m.includes(g)),{...this._def,...g})}};ZodEnum.create=createZodEnum;let ZodNativeEnum=class ZodNativeEnum extends ZodType{_parse(m){let g=es.D5.getValidEnumValues(this._def.values),v=this._getOrReturnCtx(m);if(v.parsedType!==es.$k.string&&v.parsedType!==es.$k.number){let m=es.D5.objectValues(g);return(0,ei.KD)(v,{expected:es.D5.joinValues(m),received:v.parsedType,code:et.NL.invalid_type}),ei.UI}if(this._cache||(this._cache=new Set(es.D5.getValidEnumValues(this._def.values))),!this._cache.has(m.data)){let m=es.D5.objectValues(g);return(0,ei.KD)(v,{received:v.data,code:et.NL.invalid_enum_value,options:m}),ei.UI}return(0,ei.OK)(m.data)}get enum(){return this._def.values}};ZodNativeEnum.create=(m,g)=>new ZodNativeEnum({values:m,typeName:K.ZodNativeEnum,...processCreateParams(g)});let ZodPromise=class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(m){let{ctx:g}=this._processInputParams(m);if(g.parsedType!==es.$k.promise&&!1===g.common.async)return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.promise,received:g.parsedType}),ei.UI;let v=g.parsedType===es.$k.promise?g.data:Promise.resolve(g.data);return(0,ei.OK)(v.then(m=>this._def.type.parseAsync(m,{path:g.path,errorMap:g.common.contextualErrorMap})))}};ZodPromise.create=(m,g)=>new ZodPromise({type:m,typeName:K.ZodPromise,...processCreateParams(g)});let ZodEffects=class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(m){let{status:g,ctx:v}=this._processInputParams(m),x=this._def.effect||null,k={addIssue:m=>{(0,ei.KD)(v,m),m.fatal?g.abort():g.dirty()},get path(){return v.path}};if(k.addIssue=k.addIssue.bind(k),"preprocess"===x.type){let m=x.transform(v.data,k);if(v.common.async)return Promise.resolve(m).then(async m=>{if("aborted"===g.value)return ei.UI;let x=await this._def.schema._parseAsync({data:m,path:v.path,parent:v});return"aborted"===x.status?ei.UI:"dirty"===x.status||"dirty"===g.value?(0,ei.RC)(x.value):x});{if("aborted"===g.value)return ei.UI;let x=this._def.schema._parseSync({data:m,path:v.path,parent:v});return"aborted"===x.status?ei.UI:"dirty"===x.status||"dirty"===g.value?(0,ei.RC)(x.value):x}}if("refinement"===x.type){let executeRefinement=m=>{let g=x.refinement(m,k);if(v.common.async)return Promise.resolve(g);if(g instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(!1!==v.common.async)return this._def.schema._parseAsync({data:v.data,path:v.path,parent:v}).then(m=>"aborted"===m.status?ei.UI:("dirty"===m.status&&g.dirty(),executeRefinement(m.value).then(()=>({status:g.value,value:m.value}))));{let m=this._def.schema._parseSync({data:v.data,path:v.path,parent:v});return"aborted"===m.status?ei.UI:("dirty"===m.status&&g.dirty(),executeRefinement(m.value),{status:g.value,value:m.value})}}if("transform"===x.type){if(!1!==v.common.async)return this._def.schema._parseAsync({data:v.data,path:v.path,parent:v}).then(m=>(0,ei.JY)(m)?Promise.resolve(x.transform(m.value,k)).then(m=>({status:g.value,value:m})):ei.UI);{let m=this._def.schema._parseSync({data:v.data,path:v.path,parent:v});if(!(0,ei.JY)(m))return ei.UI;let E=x.transform(m.value,k);if(E instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:g.value,value:E}}}es.D5.assertNever(x)}};ZodEffects.create=(m,g,v)=>new ZodEffects({schema:m,typeName:K.ZodEffects,effect:g,...processCreateParams(v)}),ZodEffects.createWithPreprocess=(m,g,v)=>new ZodEffects({schema:g,effect:{type:"preprocess",transform:m},typeName:K.ZodEffects,...processCreateParams(v)});
61let ZodOptional=class ZodOptional extends ZodType{_parse(m){let g=this._getType(m);return g===es.$k.undefined?(0,ei.OK)(void 0):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}};ZodOptional.create=(m,g)=>new ZodOptional({innerType:m,typeName:K.ZodOptional,...processCreateParams(g)});let ZodNullable=class ZodNullable extends ZodType{_parse(m){let g=this._getType(m);return g===es.$k.null?(0,ei.OK)(null):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}};ZodNullable.create=(m,g)=>new ZodNullable({innerType:m,typeName:K.ZodNullable,...processCreateParams(g)});let ZodDefault=class ZodDefault extends ZodType{_parse(m){let{ctx:g}=this._processInputParams(m),v=g.data;return g.parsedType===es.$k.undefined&&(v=this._def.defaultValue()),this._def.innerType._parse({data:v,path:g.path,parent:g})}removeDefault(){return this._def.innerType}};ZodDefault.create=(m,g)=>new ZodDefault({innerType:m,typeName:K.ZodDefault,defaultValue:"function"==typeof g.default?g.default:()=>g.default,...processCreateParams(g)});let ZodCatch=class ZodCatch extends ZodType{_parse(m){let{ctx:g}=this._processInputParams(m),v={...g,common:{...g.common,issues:[]}},x=this._def.innerType._parse({data:v.data,path:v.path,parent:{...v}});return(0,ei.S9)(x)?x.then(m=>({status:"valid",value:"valid"===m.status?m.value:this._def.catchValue({get error(){return new et.jm(v.common.issues)},input:v.data})})):{status:"valid",value:"valid"===x.status?x.value:this._def.catchValue({get error(){return new et.jm(v.common.issues)},input:v.data})}}removeCatch(){return this._def.innerType}};ZodCatch.create=(m,g)=>new ZodCatch({innerType:m,typeName:K.ZodCatch,catchValue:"function"==typeof g.catch?g.catch:()=>g.catch,...processCreateParams(g)});let ZodNaN=class ZodNaN extends ZodType{_parse(m){let g=this._getType(m);if(g!==es.$k.nan){let g=this._getOrReturnCtx(m);return(0,ei.KD)(g,{code:et.NL.invalid_type,expected:es.$k.nan,received:g.parsedType}),ei.UI}return{status:"valid",value:m.data}}};ZodNaN.create=m=>new ZodNaN({typeName:K.ZodNaN,...processCreateParams(m)});let eC=Symbol("zod_brand");let ZodBranded=class ZodBranded extends ZodType{_parse(m){let{ctx:g}=this._processInputParams(m),v=g.data;return this._def.type._parse({data:v,path:g.path,parent:g})}unwrap(){return this._def.type}};let ZodPipeline=class ZodPipeline extends ZodType{_parse(m){let{status:g,ctx:v}=this._processInputParams(m);if(v.common.async){let handleAsync=async()=>{let m=await this._def.in._parseAsync({data:v.data,path:v.path,parent:v});return"aborted"===m.status?ei.UI:"dirty"===m.status?(g.dirty(),(0,ei.RC)(m.value)):this._def.out._parseAsync({data:m.value,path:v.path,parent:v})};return handleAsync()}{let m=this._def.in._parseSync({data:v.data,path:v.path,parent:v});return"aborted"===m.status?ei.UI:"dirty"===m.status?(g.dirty(),{status:"dirty",value:m.value}):this._def.out._parseSync({data:m.value,path:v.path,parent:v})}}static create(m,g){return new ZodPipeline({in:m,out:g,typeName:K.ZodPipeline})}};let ZodReadonly=class ZodReadonly extends ZodType{_parse(m){let g=this._def.innerType._parse(m),freeze=m=>((0,ei.JY)(m)&&(m.value=Object.freeze(m.value)),m);return(0,ei.S9)(g)?g.then(m=>freeze(m)):freeze(g)}unwrap(){return this._def.innerType}};function cleanParams(m,g){let v="function"==typeof m?m(g):"string"==typeof m?{message:m}:m;return"string"==typeof v?{message:v}:v}function custom(m,g={},v){return m?ZodAny.create().superRefine((x,k)=>{let E=m(x);if(E instanceof Promise)return E.then(m=>{if(!m){let m=cleanParams(g,x),E=m.fatal??v??!0;k.addIssue({code:"custom",...m,fatal:E})}});if(!E){let m=cleanParams(g,x),E=m.fatal??v??!0;k.addIssue({code:"custom",...m,fatal:E})}}):ZodAny.create()}ZodReadonly.create=(m,g)=>new ZodReadonly({innerType:m,typeName:K.ZodReadonly,...processCreateParams(g)});let ek={object:ZodObject.lazycreate};(E=K||(K={})).ZodString="ZodString",E.ZodNumber="ZodNumber",E.ZodNaN="ZodNaN",E.ZodBigInt="ZodBigInt",E.ZodBoolean="ZodBoolean",E.ZodDate="ZodDate",E.ZodSymbol="ZodSymbol",E.ZodUndefined="ZodUndefined",E.ZodNull="ZodNull",E.ZodAny="ZodAny",E.ZodUnknown="ZodUnknown",E.ZodNever="ZodNever",E.ZodVoid="ZodVoid",E.ZodArray="ZodArray",E.ZodObject="ZodObject",E.ZodUnion="ZodUnion",E.ZodDiscriminatedUnion="ZodDiscriminatedUnion",E.ZodIntersection="ZodIntersection",E.ZodTuple="ZodTuple",E.ZodRecord="ZodRecord",E.ZodMap="ZodMap",E.ZodSet="ZodSet",E.ZodFunction="ZodFunction",E.ZodLazy="ZodLazy",E.ZodLiteral="ZodLiteral",E.ZodEnum="ZodEnum",E.ZodEffects="ZodEffects",E.ZodNativeEnum="ZodNativeEnum",E.ZodOptional="ZodOptional",E.ZodNullable="ZodNullable",E.ZodDefault="ZodDefault",E.ZodCatch="ZodCatch",
61E.ZodPromise="ZodPromise",E.ZodBranded="ZodBranded",E.ZodPipeline="ZodPipeline",E.ZodReadonly="ZodReadonly";let instanceOfType=(m,g={message:`Input not instance of ${m.name}`})=>custom(g=>g instanceof m,g),eE=ZodString.create,ej=ZodNumber.create,eN=ZodNaN.create,eR=ZodBigInt.create,eI=ZodBoolean.create,eP=ZodDate.create,eT=ZodSymbol.create,eO=ZodUndefined.create,eA=ZodNull.create,eM=ZodAny.create,eD=ZodUnknown.create,eL=ZodNever.create,eF=ZodVoid.create,eZ=ZodArray.create,eB=ZodObject.create,e$=ZodObject.strictCreate,eU=ZodUnion.create,ez=ZodDiscriminatedUnion.create,eV=ZodIntersection.create,eq=ZodTuple.create,eH=ZodRecord.create,eW=ZodMap.create,eK=ZodSet.create,eG=ZodFunction.create,eQ=ZodLazy.create,eY=ZodLiteral.create,eX=ZodEnum.create,eJ=ZodNativeEnum.create,e0=ZodPromise.create,e1=ZodEffects.create,e2=ZodOptional.create,e3=ZodNullable.create,e5=ZodEffects.createWithPreprocess,e4=ZodPipeline.create,ostring=()=>eE().optional(),onumber=()=>ej().optional(),oboolean=()=>eI().optional(),e6={string:m=>ZodString.create({...m,coerce:!0}),number:m=>ZodNumber.create({...m,coerce:!0}),boolean:m=>ZodBoolean.create({...m,coerce:!0}),bigint:m=>ZodBigInt.create({...m,coerce:!0}),date:m=>ZodDate.create({...m,coerce:!0})},e7=ei.UI}},function(m){var __webpack_exec__=function(g){return m(m.s=g)};m.O(0,[9774,179],function(){return __webpack_exec__(13329),__webpack_exec__(86570),__webpack_exec__(65123)}),_N_E=m.O()}]);

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.