Presupuestador_web/dist/client/assets/index-BVZyG6kc.js

255 lines
281 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var L_=Object.defineProperty;var T_=(n,o,r)=>o in n?L_(n,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[o]=r;var Se=(n,o,r)=>T_(n,typeof o!="symbol"?o+"":o,r);import{u as Ec,a as Jt,b as en,c as Mn,d as Ne,j as i,P as O_,e as P_,f as ge,g as k_,N as Wi,R as Pe,J as Rt,h as ke,i as er,D as tr,l as La,M as Lt,V as q_,r as T,k as Ac,m as Fc,n as ir,o as Ic,B as U,C as $_,p as sr,q as ar,s as or,S as ao,t as lr,v as Bi,w,x as oo,y as Yi,z as Qi,A as Xi,E as Or,F as lo,G as Zi,H as Ji,I as es,K as ts,L as z_,O as Dn,Q as V_,T as B_,U as U_,W as Te,X as ct,Y as Ve,Z as He,_ as Oe,$ as hn,a0 as uo,a1 as G_,a2 as co,a3 as pn,a4 as fo,a5 as go,a6 as qr,a7 as Nt,a8 as Dc,a9 as H_,aa as Ui,ab as ur,ac as mo,ad as ho,ae as po,af as xo,ag as Mc,ah as vo,ai as _o,aj as bo,ak as ns,al as K_,am as Fn,an as rs,ao as fc,ap as W_,aq as Y_,ar as Q_,as as wo,at as zt,au as _n,av as is,aw as Lc,ax as In,ay as X_,az as Tc,aA as Z_,aB as se,aC as ss,aD as gc,aE as Oc,aF as Pc,aG as kc,aH as Ln,aI as qc,aJ as as,aK as zr,aL as Vr,aM as Br,aN as $r,aO as J_,aP as $c,aQ as Ke,aR as We,aS as Wa,aT as Ye,aU as nr,aV as cr,aW as rr,aX as e0,aY as t0,aZ as n0,a_ as Ya,a$ as r0,b0 as i0,b1 as Zn,b2 as zc,b3 as Qa,b4 as Vc,b5 as qt,b6 as s0,b7 as mc,b8 as os,b9 as dr,ba as Bc,bb as a0,bc as So,bd as o0,be as Uc,bf as Gc,bg as Hc,bh as Kc,bi as Wc,bj as Yc,bk as Qc,bl as Xc,bm as Zc,bn as l0,bo as Pi,bp as u0,bq as c0,br as d0,bs as f0,bt as g0,bu as m0,bv as h0,bw as p0,bx as x0,by as v0,bz as _0,bA as hc,bB as Jc,bC as ed,bD as td,bE as nd,bF as rd,bG as id,bH as sd,bI as b0,bJ as Ta,bK as w0,bL as S0,bM as j0,bN as ad,bO as od,bP as Xa,bQ as Za,bR as C0,bS as Oa,bT as y0,bU as N0,bV as pc}from"./index-QDyDWtz5.js";const R0=n=>{const{onSuccess:o,...r}=n||{},a=Mn(),{login:l}=Ec(),c=Jt();return en({mutationKey:a().auth().action("login").get(),mutationFn:l,onSuccess:async(d,h,p)=>{d.success&&c.removeQueries({queryKey:a().auth().get()}),await(o==null?void 0:o(d,h,p))},...r})};/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ld=Ne("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const E0=Ne("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xc=Ne("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vc=Ne("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const A0=Ne("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const F0=Ne("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ud=Ne("CircleAlert",[["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"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const I0=Ne("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const D0=Ne("CircleX",[["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"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M0=Ne("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["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"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jo=Ne("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"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cd=Ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const L0=Ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dd=Ne("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const T0=Ne("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"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const O0=Ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fd=Ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const P0=Ne("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Co=Ne("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yo=Ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const k0=Ne("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const q0=Ne("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $0=Ne("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gd=Ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const md=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),z0=({className:n,...o})=>i.jsx(P_,{className:ge("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),...o}),_c=O_,V0=({withHandle:n,className:o,...r})=>i.jsx(k_,{className:ge("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",o),...r,children:n&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(fd,{className:"h-2.5 w-2.5"})})});function ut({className:n,...o}){return i.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",n),...o})}const B0=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("total_items");let ki;const U0=new Uint8Array(16);function G0(){if(!ki&&(ki=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ki))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ki(U0)}const Ge=[];for(let n=0;n<256;++n)Ge.push((n+256).toString(16).slice(1));function H0(n,o=0){return Ge[n[o+0]]+Ge[n[o+1]]+Ge[n[o+2]]+Ge[n[o+3]]+"-"+Ge[n[o+4]]+Ge[n[o+5]]+"-"+Ge[n[o+6]]+Ge[n[o+7]]+"-"+Ge[n[o+8]]+Ge[n[o+9]]+"-"+Ge[n[o+10]]+Ge[n[o+11]]+Ge[n[o+12]]+Ge[n[o+13]]+Ge[n[o+14]]+Ge[n[o+15]]}const K0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),bc={randomUUID:K0};function W0(n,o,r){if(bc.randomUUID&&!n)return bc.randomUUID();n=n||{};const a=n.random||(n.rng||G0)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,H0(a)}class dn extends Wi{static validate(o,r){const a=Pe.RULE_ALLOW_EMPTY.default(""),l=Rt.string().guid({version:["uuidv4"]}).label(r.label?r.label:"id"),c=Rt.alternatives(a,l);return Pe.validate(c,o)}static sanitize(o){return o.trim()}static create(o,r={}){const a={label:"id",generateOnEmpty:!1,...r};if(!o&&!a.generateOnEmpty)return ke.fail(er(tr.INVALID_INPUT_DATA,"ID is null or empty"));if(o){const l=dn.validate(o,a);return l.isFailure?ke.fail(er(tr.INVALID_INPUT_DATA,l.error.message,a)):ke.ok(new dn(dn.sanitize(l.object)))}return a.generateOnEmpty?dn.generateNewID():ke.ok(new dn(null))}static generateNewID(){return ke.ok(new dn(W0()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}const Pa={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},fn=class fn extends Wi{constructor(){super(...arguments);Se(this,"toString",()=>this.code)}static validate(r,a){const l=Rt.alternatives(Pe.RULE_ALLOW_EMPTY.default(""),Rt.string().lowercase().valid(...Object.keys(Pa)).label(String(a.label)));return Pe.validate(l,r)}static sanitize(r){return r?String(r).toLowerCase():void 0}static createFromCode(r,a={}){const l={...a,label:a.label?a.label:"lang_code"},c=fn.validate(r,l);if(c.isFailure)return ke.fail(er(tr.INVALID_INPUT_DATA,c.error.message,l));const d=fn.sanitize(c.object),h=d?{...Pa[c.object],code:d}:void 0;return ke.ok(new fn(h))}static createDefaultCode(){return fn.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Se(fn,"DEFAULT_LANGUAGE_CODE","es"),Se(fn,"LANGUAGES",Pa);let Pr=fn;class hd{constructor(o){Se(this,"_collection",[]);this._collection=o??[]}add(o){this._collection.push(o)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(o=>o.isFailure)}getFirstFaultyResult(){return this._collection.find(o=>o.isFailure)}getAllFaultyResults(){return this._collection.filter(o=>o.isFailure)}get objects(){return this._collection.filter(o=>o.isSuccess).map(o=>o.object)}get errors(){return this._collection.filter(o=>o.isFailure).map(o=>o.error)}}const pd=2,ka={amount:0,scale:pd},xe=class xe extends Wi{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,h=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Rt.number().min(xe.MIN_SCALE).max(xe.MAX_SCALE).label(l.label?l.label:"scale"),v=new hd([Pe.validate(Rt.alternatives(c,d,h,p),r),Pe.validate(Rt.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);if(v.hasSomeFaultyResult())return v.getFirstFaultyResult();let R=typeof r=="string"?parseInt(r,10):Number(r),N=La.isNull(a)?xe.DEFAULT_SCALE:Number(a);const b=R/Math.pow(10,N);return b<xe.MIN_VALUE||b>xe.MAX_VALUE?ke.fail(new Error(`Value with scale is out of range: ${b}`)):ke.ok()}static create(r=ka,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=ka.amount,scale:c=ka.scale}=r,d={label:"percentage",...a},h=xe.validate(l,c,d);if(h.isFailure)return ke.fail(er(tr.INVALID_INPUT_DATA,h.error.message,d));let p=xe._sanitize(l);const x={amount:La.isNull(p)?0:p,scale:c};return ke.ok(new this(x,La.isNull(p),a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return xe.create({amount:null,scale:xe.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let h=c,p=2;return d===void 0?p=0:(d===""&&(h=c+d.padEnd(1,"0"),p=1),d.length===1?(h=c+d.padEnd(1,"0"),p=1):d.length===2&&(h=c+d.padEnd(2,"0"),p=2)),xe.create({amount:h,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}static _isWithinRange(r,a){const l=Number(xe._toString(r,a));return l>=xe.MIN_VALUE&&l<=xe.MAX_VALUE}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return xe._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==xe.DEFAULT_SCALE?this.convertScale(xe.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(r<xe.MIN_SCALE||r>xe.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new xe({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);if(!xe._isWithinRange(d,r))throw new Error(`Value out of range after conversion: ${d} ${r}`);return new xe({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}isWithinRange(){return xe._isWithinRange(this.amount,this.scale)}};Se(xe,"DEFAULT_SCALE",pd),Se(xe,"MIN_VALUE",0),Se(xe,"MAX_VALUE",100),Se(xe,"MIN_SCALE",0),Se(xe,"MAX_SCALE",2);let $t=xe;const xd=2,qa={amount:0,scale:xd},ve=class ve extends Wi{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l={}){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,h=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Rt.number().min(ve.MIN_SCALE).max(ve.MAX_SCALE).label(l.label?l.label:"scale"),v=new hd([Pe.validate(Rt.alternatives(c,d,h,p),r),Pe.validate(Rt.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);return v.hasSomeFaultyResult()?v.getFirstFaultyResult():ke.ok()}static create(r=qa,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=qa.amount,scale:c=qa.scale}=r,d={label:"quantity",...a},h=ve.validate(l,c,d);if(h.isFailure)return ke.fail(er(tr.INVALID_INPUT_DATA,h.error.message,d));let p=ve._sanitize(l);const x={amount:p===null?0:p,scale:c};return ke.ok(new ve(x,p===null,a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return ve.create({amount:null,scale:ve.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let h=c,p=2;return d===void 0?p=0:(d===""&&(h=c+d.padEnd(1,"0"),p=1),d.length===1?(h=c+d.padEnd(1,"0"),p=1):d.length===2&&(h=c+d.padEnd(2,"0"),p=2)),ve.create({amount:h,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return ve._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==ve.DEFAULT_SCALE?this.convertScale(ve.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(r<ve.MIN_SCALE||r>ve.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new ve({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);return new ve({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}increment(r){return this.isNull()?r?ve.create(r.toObject()):ve.create():r?this.hasSameScale(r)?ve.create({amount:Number(this.amount)+Number(r.amount),scale:this.scale},this._options):ke.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):ve.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(r){return this.isNull()?r?ve.create(r.toObject()):ve.create():r?this.hasSameScale(r)?ve.create({amount:Number(this.amount)-Number(r.amount),scale:this.scale},this._options):ke.fail(Error("No se pueden restar cantidades con diferentes escalas.")):ve.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Se(ve,"DEFAULT_SCALE",xd),Se(ve,"MIN_SCALE",0),Se(ve,"MAX_SCALE",2);let xn=ve;const wc=2;class Y0 extends Lt{static create(o){const{amount:r,currencyCode:a,scale:l=wc}=o,c=Lt.create({amount:r,currencyCode:a,scale:l});if(c.isFailure)return c;const d=c.object.convertScale(wc);return ke.ok(d)}}class Jn extends q_{constructor(){super(...arguments);Se(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Se(this,"isEmpty",()=>!this.isValid());Se(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Se(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Se(this,"toLocaleDateString",(r,a)=>this.isValid()?this.props.toLocaleDateString(r,a):"");Se(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(r,a){const l=Pe.RULE_ALLOW_EMPTY.default(0),c=Rt.date().label(String(a.label)),d=Rt.alternatives(l,c);return Pe.validate(d,r)}static createCurrentDate(){return ke.ok(new Jn(new Date))}static create(r,a={}){const l={...a,dateFormat:a.dateFormat?a.dateFormat:"YYYY-MM-DD",label:a.label?a.label:"date"},c=Jn.validate(r,l);return c.isFailure?ke.fail(er(tr.INVALID_INPUT_DATA,c.error.message,l)):ke.ok(new Jn(new Date(c.object)))}toString(){if(!this.isEmpty()){const r=this.props.getFullYear(),a=String(this.props.getMonth()+1).padStart(2,"0"),l=String(this.props.getDate()).padStart(2,"0");return`${r}-${a}-${l}`}return""}toPrimitive(){return this.toISO8601()}}const Q0=({isPending:n,interval:o=1e3,onInterval:r})=>{const[a,l]=T.useState(void 0);return T.useEffect(()=>{let c;return n&&(c=setInterval(()=>{l(d=>d===void 0?o:d+o)},o)),()=>{clearInterval(c),l(void 0)}},[n,o]),T.useEffect(()=>{r&&a&&r(a)},[a]),{elapsedTime:a}},X0=2*60*1e3,Z0=60*1e3,No=({queryKey:n,queryFn:o,enabled:r,select:a,queryOptions:l={},overtimeOptions:c})=>{const[d,h]=T.useState(!1),p=Ac({queryKey:n,queryFn:o,placeholderData:Fc,staleTime:Z0,refetchInterval:X0,refetchOnWindowFocus:!0,enabled:r&&!!o,select:a,...l});T.useEffect(()=>{p.isSuccess&&B0(p.data)&&h(p.data.total_items===0)},[p]);const{elapsedTime:x}=Q0({isPending:p.isFetching,interval:c==null?void 0:c.interval,onInterval:c==null?void 0:c.onInterval});return{...p,overtime:{elapsedTime:x},isEmpty:d}},vd=n=>Ac({placeholderData:Fc,...n});function J0(n){return en({...n})}/**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function eb(){return{accessor:(n,o)=>typeof n=="function"?{...o,accessorFn:n}:{...o,accessorKey:n},display:n=>n,group:n=>n}}function gn(n,o){return typeof n=="function"?n(o):n}function xt(n,o){return r=>{o.setState(a=>({...a,[n]:gn(r,a[n])}))}}function ls(n){return n instanceof Function}function tb(n){return Array.isArray(n)&&n.every(o=>typeof o=="number")}function nb(n,o){const r=[],a=l=>{l.forEach(c=>{r.push(c);const d=o(c);d!=null&&d.length&&a(d)})};return a(n),r}function X(n,o,r){let a=[],l;return c=>{let d;r.key&&r.debug&&(d=Date.now());const h=n(c);if(!(h.length!==a.length||h.some((v,R)=>a[R]!==v)))return l;a=h;let x;if(r.key&&r.debug&&(x=Date.now()),l=o(...h),r==null||r.onChange==null||r.onChange(l),r.key&&r.debug&&r!=null&&r.debug()){const v=Math.round((Date.now()-d)*100)/100,R=Math.round((Date.now()-x)*100)/100,N=R/16,b=(E,C)=>{for(E=String(E);E.length<C;)E=" "+E;return E};console.info(`%c⏱ ${b(R,5)} /${b(v,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*N,120))}deg 100% 31%);`,r==null?void 0:r.key)}return l}}function Z(n,o,r,a){return{debug:()=>{var l;return(l=n==null?void 0:n.debugAll)!=null?l:n[o]},key:!1,onChange:a}}function rb(n,o,r,a){const l=()=>{var d;return(d=c.getValue())!=null?d:n.options.renderFallbackValue},c={id:`${o.id}_${r.id}`,row:o,column:r,getValue:()=>o.getValue(a),renderValue:l,getContext:X(()=>[n,r,o,c],(d,h,p,x)=>({table:d,column:h,row:p,cell:x,getValue:x.getValue,renderValue:x.renderValue}),Z(n.options,"debugCells"))};return n._features.forEach(d=>{d.createCell==null||d.createCell(c,r,o,n)},{}),c}function ib(n,o,r,a){var l,c;const h={...n._getDefaultColumnDef(),...o},p=h.accessorKey;let x=(l=(c=h.id)!=null?c:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?l:typeof h.header=="string"?h.header:void 0,v;if(h.accessorFn?v=h.accessorFn:p&&(p.includes(".")?v=N=>{let b=N;for(const C of p.split(".")){var E;b=(E=b)==null?void 0:E[C]}return b}:v=N=>N[h.accessorKey]),!x)throw new Error;let R={id:`${String(x)}`,accessorFn:v,parent:a,depth:r,columnDef:h,columns:[],getFlatColumns:X(()=>[!0],()=>{var N;return[R,...(N=R.columns)==null?void 0:N.flatMap(b=>b.getFlatColumns())]},Z(n.options,"debugColumns")),getLeafColumns:X(()=>[n._getOrderColumnsFn()],N=>{var b;if((b=R.columns)!=null&&b.length){let E=R.columns.flatMap(C=>C.getLeafColumns());return N(E)}return[R]},Z(n.options,"debugColumns"))};for(const N of n._features)N.createColumn==null||N.createColumn(R,n);return R}const Ze="debugHeaders";function Sc(n,o,r){var a;let c={id:(a=r.id)!=null?a:o.id,column:o,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const d=[],h=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(h),d.push(p)};return h(c),d},getContext:()=>({table:n,header:c,column:o})};return n._features.forEach(d=>{d.createHeader==null||d.createHeader(c,n)}),c}const sb={createTable:n=>{n.getHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>{var c,d;const h=(c=a==null?void 0:a.map(R=>r.find(N=>N.id===R)).filter(Boolean))!=null?c:[],p=(d=l==null?void 0:l.map(R=>r.find(N=>N.id===R)).filter(Boolean))!=null?d:[],x=r.filter(R=>!(a!=null&&a.includes(R.id))&&!(l!=null&&l.includes(R.id)));return qi(o,[...h,...x,...p],n)},Z(n.options,Ze)),n.getCenterHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>(r=r.filter(c=>!(a!=null&&a.includes(c.id))&&!(l!=null&&l.includes(c.id))),qi(o,r,n,"center")),Z(n.options,Ze)),n.getLeftHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(o,c,n,"left")},Z(n.options,Ze)),n.getRightHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(o,c,n,"right")},Z(n.options,Ze)),n.getFooterGroups=X(()=>[n.getHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getLeftFooterGroups=X(()=>[n.getLeftHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getCenterFooterGroups=X(()=>[n.getCenterHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getRightFooterGroups=X(()=>[n.getRightHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getFlatHeaders=X(()=>[n.getHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getLeftFlatHeaders=X(()=>[n.getLeftHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getCenterFlatHeaders=X(()=>[n.getCenterHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getRightFlatHeaders=X(()=>[n.getRightHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getCenterLeafHeaders=X(()=>[n.getCenterFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,Ze)),n.getLeftLeafHeaders=X(()=>[n.getLeftFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,Ze)),n.getRightLeafHeaders=X(()=>[n.getRightFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,Ze)),n.getLeafHeaders=X(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(o,r,a)=>{var l,c,d,h,p,x;return[...(l=(c=o[0])==null?void 0:c.headers)!=null?l:[],...(d=(h=r[0])==null?void 0:h.headers)!=null?d:[],...(p=(x=a[0])==null?void 0:x.headers)!=null?p:[]].map(v=>v.getLeafHeaders()).flat()},Z(n.options,Ze))}};function qi(n,o,r,a){var l,c;let d=0;const h=function(N,b){b===void 0&&(b=1),d=Math.max(d,b),N.filter(E=>E.getIsVisible()).forEach(E=>{var C;(C=E.columns)!=null&&C.length&&h(E.columns,b+1)},0)};h(n);let p=[];const x=(N,b)=>{const E={depth:b,id:[a,`${b}`].filter(Boolean).join("_"),headers:[]},C=[];N.forEach(L=>{const I=[...C].reverse()[0],q=L.column.depth===E.depth;let $,te=!1;if(q&&L.column.parent?$=L.column.parent:($=L.column,te=!0),I&&(I==null?void 0:I.column)===$)I.subHeaders.push(L);else{const O=Sc(r,$,{id:[a,b,$.id,L==null?void 0:L.id].filter(Boolean).join("_"),isPlaceholder:te,placeholderId:te?`${C.filter(k=>k.column===$).length}`:void 0,depth:b,index:C.length});O.subHeaders.push(L),C.push(O)}E.headers.push(L),L.headerGroup=E}),p.push(E),b>0&&x(C,b-1)},v=o.map((N,b)=>Sc(r,N,{depth:d,index:b}));x(v,d-1),p.reverse();const R=N=>N.filter(E=>E.column.getIsVisible()).map(E=>{let C=0,L=0,I=[0];E.subHeaders&&E.subHeaders.length?(I=[],R(E.subHeaders).forEach($=>{let{colSpan:te,rowSpan:O}=$;C+=te,I.push(O)})):C=1;const q=Math.min(...I);return L=L+q,E.colSpan=C,E.rowSpan=L,{colSpan:C,rowSpan:L}});return R((l=(c=p[0])==null?void 0:c.headers)!=null?l:[]),p}const Ro=(n,o,r,a,l,c,d)=>{let h={id:o,index:a,original:r,depth:l,parentId:d,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(h._valuesCache.hasOwnProperty(p))return h._valuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return h._valuesCache[p]=x.accessorFn(h.original,a),h._valuesCache[p]},getUniqueValues:p=>{if(h._uniqueValuesCache.hasOwnProperty(p))return h._uniqueValuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return x.columnDef.getUniqueValues?(h._uniqueValuesCache[p]=x.columnDef.getUniqueValues(h.original,a),h._uniqueValuesCache[p]):(h._uniqueValuesCache[p]=[h.getValue(p)],h._uniqueValuesCache[p])},renderValue:p=>{var x;return(x=h.getValue(p))!=null?x:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>nb(h.subRows,p=>p.subRows),getParentRow:()=>h.parentId?n.getRow(h.parentId,!0):void 0,getParentRows:()=>{let p=[],x=h;for(;;){const v=x.getParentRow();if(!v)break;p.push(v),x=v}return p.reverse()},getAllCells:X(()=>[n.getAllLeafColumns()],p=>p.map(x=>rb(n,h,x,x.id)),Z(n.options,"debugRows")),_getAllCellsByColumnId:X(()=>[h.getAllCells()],p=>p.reduce((x,v)=>(x[v.column.id]=v,x),{}),Z(n.options,"debugRows"))};for(let p=0;p<n._features.length;p++){const x=n._features[p];x==null||x.createRow==null||x.createRow(h,n)}return h},ab={createColumn:(n,o)=>{n._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():o.getPreFilteredRowModel(),n._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},_d=(n,o,r)=>{var a,l;const c=r==null||(a=r.toString())==null?void 0:a.toLowerCase();return!!(!((l=n.getValue(o))==null||(l=l.toString())==null||(l=l.toLowerCase())==null)&&l.includes(c))};_d.autoRemove=n=>Tt(n);const bd=(n,o,r)=>{var a;return!!(!((a=n.getValue(o))==null||(a=a.toString())==null)&&a.includes(r))};bd.autoRemove=n=>Tt(n);const wd=(n,o,r)=>{var a;return((a=n.getValue(o))==null||(a=a.toString())==null?void 0:a.toLowerCase())===(r==null?void 0:r.toLowerCase())};wd.autoRemove=n=>Tt(n);const Sd=(n,o,r)=>{var a;return(a=n.getValue(o))==null?void 0:a.includes(r)};Sd.autoRemove=n=>Tt(n);const jd=(n,o,r)=>!r.some(a=>{var l;return!((l=n.getValue(o))!=null&&l.includes(a))});jd.autoRemove=n=>Tt(n)||!(n!=null&&n.length);const Cd=(n,o,r)=>r.some(a=>{var l;return(l=n.getValue(o))==null?void 0:l.includes(a)});Cd.autoRemove=n=>Tt(n)||!(n!=null&&n.length);const yd=(n,o,r)=>n.getValue(o)===r;yd.autoRemove=n=>Tt(n);const Nd=(n,o,r)=>n.getValue(o)==r;Nd.autoRemove=n=>Tt(n);const Eo=(n,o,r)=>{let[a,l]=r;const c=n.getValue(o);return c>=a&&c<=l};Eo.resolveFilterValue=n=>{let[o,r]=n,a=typeof o!="number"?parseFloat(o):o,l=typeof r!="number"?parseFloat(r):r,c=o===null||Number.isNaN(a)?-1/0:a,d=r===null||Number.isNaN(l)?1/0:l;if(c>d){const h=c;c=d,d=h}return[c,d]};Eo.autoRemove=n=>Tt(n)||Tt(n[0])&&Tt(n[1]);const Zt={includesString:_d,includesStringSensitive:bd,equalsString:wd,arrIncludes:Sd,arrIncludesAll:jd,arrIncludesSome:Cd,equals:yd,weakEquals:Nd,inNumberRange:Eo};function Tt(n){return n==null||n===""}const ob={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:xt("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,o)=>{n.getAutoFilterFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);return typeof a=="string"?Zt.includesString:typeof a=="number"?Zt.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?Zt.equals:Array.isArray(a)?Zt.arrIncludes:Zt.weakEquals},n.getFilterFn=()=>{var r,a;return ls(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(r=(a=o.options.filterFns)==null?void 0:a[n.columnDef.filterFn])!=null?r:Zt[n.columnDef.filterFn]},n.getCanFilter=()=>{var r,a,l;return((r=n.columnDef.enableColumnFilter)!=null?r:!0)&&((a=o.options.enableColumnFilters)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var r;return(r=o.getState().columnFilters)==null||(r=r.find(a=>a.id===n.id))==null?void 0:r.value},n.getFilterIndex=()=>{var r,a;return(r=(a=o.getState().columnFilters)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.setFilterValue=r=>{o.setColumnFilters(a=>{const l=n.getFilterFn(),c=a==null?void 0:a.find(v=>v.id===n.id),d=gn(r,c?c.value:void 0);if(jc(l,d,n)){var h;return(h=a==null?void 0:a.filter(v=>v.id!==n.id))!=null?h:[]}const p={id:n.id,value:d};if(c){var x;return(x=a==null?void 0:a.map(v=>v.id===n.id?p:v))!=null?x:[]}return a!=null&&a.length?[...a,p]:[p]})}},createRow:(n,o)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=o=>{const r=n.getAllLeafColumns(),a=l=>{var c;return(c=gn(o,l))==null?void 0:c.filter(d=>{const h=r.find(p=>p.id===d.id);if(h){const p=h.getFilterFn();if(jc(p,d.value,h))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(a)},n.resetColumnFilters=o=>{var r,a;n.setColumnFilters(o?[]:(r=(a=n.initialState)==null?void 0:a.columnFilters)!=null?r:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function jc(n,o,r){return(n&&n.autoRemove?n.autoRemove(o,r):!1)||typeof o>"u"||typeof o=="string"&&!o}const lb=(n,o,r)=>r.reduce((a,l)=>{const c=l.getValue(n);return a+(typeof c=="number"?c:0)},0),ub=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a>c||a===void 0&&c>=c)&&(a=c)}),a},cb=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a<c||a===void 0&&c>=c)&&(a=c)}),a},db=(n,o,r)=>{let a,l;return r.forEach(c=>{const d=c.getValue(n);d!=null&&(a===void 0?d>=d&&(a=l=d):(a>d&&(a=d),l<d&&(l=d)))}),[a,l]},fb=(n,o)=>{let r=0,a=0;if(o.forEach(l=>{let c=l.getValue(n);c!=null&&(c=+c)>=c&&(++r,a+=c)}),r)return a/r},gb=(n,o)=>{if(!o.length)return;const r=o.map(c=>c.getValue(n));if(!tb(r))return;if(r.length===1)return r[0];const a=Math.floor(r.length/2),l=r.sort((c,d)=>c-d);return r.length%2!==0?l[a]:(l[a-1]+l[a])/2},mb=(n,o)=>Array.from(new Set(o.map(r=>r.getValue(n))).values()),hb=(n,o)=>new Set(o.map(r=>r.getValue(n))).size,pb=(n,o)=>o.length,$a={sum:lb,min:ub,max:cb,extent:db,mean:fb,median:gb,unique:mb,uniqueCount:hb,count:pb},xb={getDefaultColumnDef:()=>({aggregatedCell:n=>{var o,r;return(o=(r=n.getValue())==null||r.toString==null?void 0:r.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:xt("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,o)=>{n.toggleGrouping=()=>{o.setGrouping(r=>r!=null&&r.includes(n.id)?r.filter(a=>a!==n.id):[...r??[],n.id])},n.getCanGroup=()=>{var r,a;return((r=n.columnDef.enableGrouping)!=null?r:!0)&&((a=o.options.enableGrouping)!=null?a:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.includes(n.id)},n.getGroupedIndex=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const r=n.getCanGroup();return()=>{r&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);if(typeof a=="number")return $a.sum;if(Object.prototype.toString.call(a)==="[object Date]")return $a.extent},n.getAggregationFn=()=>{var r,a;if(!n)throw new Error;return ls(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(r=(a=o.options.aggregationFns)==null?void 0:a[n.columnDef.aggregationFn])!=null?r:$a[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=o=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(o),n.resetGrouping=o=>{var r,a;n.setGrouping(o?[]:(r=(a=n.initialState)==null?void 0:a.grouping)!=null?r:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,o)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=r=>{if(n._groupingValuesCache.hasOwnProperty(r))return n._groupingValuesCache[r];const a=o.getColumn(r);return a!=null&&a.columnDef.getGroupingValue?(n._groupingValuesCache[r]=a.columnDef.getGroupingValue(n.original),n._groupingValuesCache[r]):n.getValue(r)},n._groupingValuesCache={}},createCell:(n,o,r,a)=>{n.getIsGrouped=()=>o.getIsGrouped()&&o.id===r.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&o.getIsGrouped(),n.getIsAggregated=()=>{var l;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((l=r.subRows)!=null&&l.length)}}};function vb(n,o,r){if(!(o!=null&&o.length)||!r)return n;const a=n.filter(c=>!o.includes(c.id));return r==="remove"?a:[...o.map(c=>n.find(d=>d.id===c)).filter(Boolean),...a]}const _b={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:xt("columnOrder",n)}),createColumn:(n,o)=>{n.getIndex=X(r=>[kr(o,r)],r=>r.findIndex(a=>a.id===n.id),Z(o.options,"debugColumns")),n.getIsFirstColumn=r=>{var a;return((a=kr(o,r)[0])==null?void 0:a.id)===n.id},n.getIsLastColumn=r=>{var a;const l=kr(o,r);return((a=l[l.length-1])==null?void 0:a.id)===n.id}},createTable:n=>{n.setColumnOrder=o=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(o),n.resetColumnOrder=o=>{var r;n.setColumnOrder(o?[]:(r=n.initialState.columnOrder)!=null?r:[])},n._getOrderColumnsFn=X(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(o,r,a)=>l=>{let c=[];if(!(o!=null&&o.length))c=l;else{const d=[...o],h=[...l];for(;h.length&&d.length;){const p=d.shift(),x=h.findIndex(v=>v.id===p);x>-1&&c.push(h.splice(x,1)[0])}c=[...c,...h]}return vb(c,r,a)},Z(n.options,"debugTable"))}},za=()=>({left:[],right:[]}),bb={getInitialState:n=>({columnPinning:za(),...n}),getDefaultOptions:n=>({onColumnPinningChange:xt("columnPinning",n)}),createColumn:(n,o)=>{n.pin=r=>{const a=n.getLeafColumns().map(l=>l.id).filter(Boolean);o.setColumnPinning(l=>{var c,d;if(r==="right"){var h,p;return{left:((h=l==null?void 0:l.left)!=null?h:[]).filter(R=>!(a!=null&&a.includes(R))),right:[...((p=l==null?void 0:l.right)!=null?p:[]).filter(R=>!(a!=null&&a.includes(R))),...a]}}if(r==="left"){var x,v;return{left:[...((x=l==null?void 0:l.left)!=null?x:[]).filter(R=>!(a!=null&&a.includes(R))),...a],right:((v=l==null?void 0:l.right)!=null?v:[]).filter(R=>!(a!=null&&a.includes(R)))}}return{left:((c=l==null?void 0:l.left)!=null?c:[]).filter(R=>!(a!=null&&a.includes(R))),right:((d=l==null?void 0:l.right)!=null?d:[]).filter(R=>!(a!=null&&a.includes(R)))}})},n.getCanPin=()=>n.getLeafColumns().some(a=>{var l,c,d;return((l=a.columnDef.enablePinning)!=null?l:!0)&&((c=(d=o.options.enableColumnPinning)!=null?d:o.options.enablePinning)!=null?c:!0)}),n.getIsPinned=()=>{const r=n.getLeafColumns().map(h=>h.id),{left:a,right:l}=o.getState().columnPinning,c=r.some(h=>a==null?void 0:a.includes(h)),d=r.some(h=>l==null?void 0:l.includes(h));return c?"left":d?"right":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();return l?(r=(a=o.getState().columnPinning)==null||(a=a[l])==null?void 0:a.indexOf(n.id))!=null?r:-1:0}},createRow:(n,o)=>{n.getCenterVisibleCells=X(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(r,a,l)=>{const c=[...a??[],...l??[]];return r.filter(d=>!c.includes(d.column.id))},Z(o.options,"debugRows")),n.getLeftVisibleCells=X(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"left"})),Z(o.options,"debugRows")),n.getRightVisibleCells=X(()=>[n._getAllVisibleCells(),o.getState().columnPinning.right],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"right"})),Z(o.options,"debugRows"))},createTable:n=>{n.setColumnPinning=o=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(o),n.resetColumnPinning=o=>{var r,a;return n.setColumnPinning(o?za():(r=(a=n.initialState)==null?void 0:a.columnPinning)!=null?r:za())},n.getIsSomeColumnsPinned=o=>{var r;const a=n.getState().columnPinning;if(!o){var l,c;return!!((l=a.left)!=null&&l.length||(c=a.right)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n.getLeftLeafColumns=X(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),Z(n.options,"debugColumns")),n.getRightLeafColumns=X(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),Z(n.options,"debugColumns")),n.getCenterLeafColumns=X(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a)=>{const l=[...r??[],...a??[]];return o.filter(c=>!l.includes(c.id))},Z(n.options,"debugColumns"))}},$i={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Va=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),wb={getDefaultColumnDef:()=>$i,getInitialState:n=>({columnSizing:{},columnSizingInfo:Va(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:xt("columnSizing",n),onColumnSizingInfoChange:xt("columnSizingInfo",n)}),createColumn:(n,o)=>{n.getSize=()=>{var r,a,l;const c=o.getState().columnSizing[n.id];return Math.min(Math.max((r=n.columnDef.minSize)!=null?r:$i.minSize,(a=c??n.columnDef.size)!=null?a:$i.size),(l=n.columnDef.maxSize)!=null?l:$i.maxSize)},n.getStart=X(r=>[r,kr(o,r),o.getState().columnSizing],(r,a)=>a.slice(0,n.getIndex(r)).reduce((l,c)=>l+c.getSize(),0),Z(o.options,"debugColumns")),n.getAfter=X(r=>[r,kr(o,r),o.getState().columnSizing],(r,a)=>a.slice(n.getIndex(r)+1).reduce((l,c)=>l+c.getSize(),0),Z(o.options,"debugColumns")),n.resetSize=()=>{o.setColumnSizing(r=>{let{[n.id]:a,...l}=r;return l})},n.getCanResize=()=>{var r,a;return((r=n.columnDef.enableResizing)!=null?r:!0)&&((a=o.options.enableColumnResizing)!=null?a:!0)},n.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,o)=>{n.getSize=()=>{let r=0;const a=l=>{if(l.subHeaders.length)l.subHeaders.forEach(a);else{var c;r+=(c=l.column.getSize())!=null?c:0}};return a(n),r},n.getStart=()=>{if(n.index>0){const r=n.headerGroup.headers[n.index-1];return r.getStart()+r.getSize()}return 0},n.getResizeHandler=r=>{const a=o.getColumn(n.column.id),l=a==null?void 0:a.getCanResize();return c=>{if(!a||!l||(c.persist==null||c.persist(),Ba(c)&&c.touches&&c.touches.length>1))return;const d=n.getSize(),h=n?n.getLeafHeaders().map(I=>[I.column.id,I.column.getSize()]):[[a.id,a.getSize()]],p=Ba(c)?Math.round(c.touches[0].clientX):c.clientX,x={},v=(I,q)=>{typeof q=="number"&&(o.setColumnSizingInfo($=>{var te,O;const k=o.options.columnResizeDirection==="rtl"?-1:1,K=(q-((te=$==null?void 0:$.startOffset)!=null?te:0))*k,ne=Math.max(K/((O=$==null?void 0:$.startSize)!=null?O:0),-.999999);return $.columnSizingStart.forEach(B=>{let[me,_e]=B;x[me]=Math.round(Math.max(_e+_e*ne,0)*100)/100}),{...$,deltaOffset:K,deltaPercentage:ne}}),(o.options.columnResizeMode==="onChange"||I==="end")&&o.setColumnSizing($=>({...$,...x})))},R=I=>v("move",I),N=I=>{v("end",I),o.setColumnSizingInfo(q=>({...q,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=r||typeof document<"u"?document:null,E={moveHandler:I=>R(I.clientX),upHandler:I=>{b==null||b.removeEventListener("mousemove",E.moveHandler),b==null||b.removeEventListener("mouseup",E.upHandler),N(I.clientX)}},C={moveHandler:I=>(I.cancelable&&(I.preventDefault(),I.stopPropagation()),R(I.touches[0].clientX),!1),upHandler:I=>{var q;b==null||b.removeEventListener("touchmove",C.moveHandler),b==null||b.removeEventListener("touchend",C.upHandler),I.cancelable&&(I.preventDefault(),I.stopPropagation()),N((q=I.touches[0])==null?void 0:q.clientX)}},L=Sb()?{passive:!1}:!1;Ba(c)?(b==null||b.addEventListener("touchmove",C.moveHandler,L),b==null||b.addEventListener("touchend",C.upHandler,L)):(b==null||b.addEventListener("mousemove",E.moveHandler,L),b==null||b.addEventListener("mouseup",E.upHandler,L)),o.setColumnSizingInfo(I=>({...I,startOffset:p,startSize:d,deltaOffset:0,deltaPercentage:0,columnSizingStart:h,isResizingColumn:a.id}))}}},createTable:n=>{n.setColumnSizing=o=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(o),n.setColumnSizingInfo=o=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(o),n.resetColumnSizing=o=>{var r;n.setColumnSizing(o?{}:(r=n.initialState.columnSizing)!=null?r:{})},n.resetHeaderSizeInfo=o=>{var r;n.setColumnSizingInfo(o?Va():(r=n.initialState.columnSizingInfo)!=null?r:Va())},n.getTotalSize=()=>{var o,r;return(o=(r=n.getHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getLeftTotalSize=()=>{var o,r;return(o=(r=n.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getCenterTotalSize=()=>{var o,r;return(o=(r=n.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getRightTotalSize=()=>{var o,r;return(o=(r=n.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0}}};let zi=null;function Sb(){if(typeof zi=="boolean")return zi;let n=!1;try{const o={get passive(){return n=!0,!1}},r=()=>{};window.addEventListener("test",r,o),window.removeEventListener("test",r)}catch{n=!1}return zi=n,zi}function Ba(n){return n.type==="touchstart"}const jb={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:xt("columnVisibility",n)}),createColumn:(n,o)=>{n.toggleVisibility=r=>{n.getCanHide()&&o.setColumnVisibility(a=>({...a,[n.id]:r??!n.getIsVisible()}))},n.getIsVisible=()=>{var r,a;const l=n.columns;return(r=l.length?l.some(c=>c.getIsVisible()):(a=o.getState().columnVisibility)==null?void 0:a[n.id])!=null?r:!0},n.getCanHide=()=>{var r,a;return((r=n.columnDef.enableHiding)!=null?r:!0)&&((a=o.options.enableHiding)!=null?a:!0)},n.getToggleVisibilityHandler=()=>r=>{n.toggleVisibility==null||n.toggleVisibility(r.target.checked)}},createRow:(n,o)=>{n._getAllVisibleCells=X(()=>[n.getAllCells(),o.getState().columnVisibility],r=>r.filter(a=>a.column.getIsVisible()),Z(o.options,"debugRows")),n.getVisibleCells=X(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(r,a,l)=>[...r,...a,...l],Z(o.options,"debugRows"))},createTable:n=>{const o=(r,a)=>X(()=>[a(),a().filter(l=>l.getIsVisible()).map(l=>l.id).join("_")],l=>l.filter(c=>c.getIsVisible==null?void 0:c.getIsVisible()),Z(n.options,"debugColumns"));n.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=r=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(r),n.resetColumnVisibility=r=>{var a;n.setColumnVisibility(r?{}:(a=n.initialState.columnVisibility)!=null?a:{})},n.toggleAllColumnsVisible=r=>{var a;r=(a=r)!=null?a:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((l,c)=>({...l,[c.id]:r||!(c.getCanHide!=null&&c.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>r=>{var a;n.toggleAllColumnsVisible((a=r.target)==null?void 0:a.checked)}}};function kr(n,o){return o?o==="center"?n.getCenterVisibleLeafColumns():o==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const Cb={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},yb={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:xt("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var r;const a=(r=n.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[o.id])==null?void 0:r.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(n,o)=>{n.getCanGlobalFilter=()=>{var r,a,l,c;return((r=n.columnDef.enableGlobalFilter)!=null?r:!0)&&((a=o.options.enableGlobalFilter)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&((c=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(n))!=null?c:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>Zt.includesString,n.getGlobalFilterFn=()=>{var o,r;const{globalFilterFn:a}=n.options;return ls(a)?a:a==="auto"?n.getGlobalAutoFilterFn():(o=(r=n.options.filterFns)==null?void 0:r[a])!=null?o:Zt[a]},n.setGlobalFilter=o=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(o)},n.resetGlobalFilter=o=>{n.setGlobalFilter(o?void 0:n.initialState.globalFilter)}}},Nb={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:xt("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let o=!1,r=!1;n._autoResetExpanded=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetExpanded)!=null?a:!n.options.manualExpanding){if(r)return;r=!0,n._queue(()=>{n.resetExpanded(),r=!1})}},n.setExpanded=a=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(a),n.toggleAllRowsExpanded=a=>{a??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=a=>{var l,c;n.setExpanded(a?{}:(l=(c=n.initialState)==null?void 0:c.expanded)!=null?l:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const a=n.getState().expanded;return a===!0||Object.values(a).some(Boolean)},n.getIsAllRowsExpanded=()=>{const a=n.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||n.getRowModel().flatRows.some(l=>!l.getIsExpanded()))},n.getExpandedDepth=()=>{let a=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(c=>{const d=c.split(".");a=Math.max(a,d.length)}),a},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,o)=>{n.toggleExpanded=r=>{o.setExpanded(a=>{var l;const c=a===!0?!0:!!(a!=null&&a[n.id]);let d={};if(a===!0?Object.keys(o.getRowModel().rowsById).forEach(h=>{d[h]=!0}):d=a,r=(l=r)!=null?l:!c,!c&&r)return{...d,[n.id]:!0};if(c&&!r){const{[n.id]:h,...p}=d;return p}return a})},n.getIsExpanded=()=>{var r;const a=o.getState().expanded;return!!((r=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(n))!=null?r:a===!0||a!=null&&a[n.id])},n.getCanExpand=()=>{var r,a,l;return(r=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(n))!=null?r:((a=o.options.enableExpanding)!=null?a:!0)&&!!((l=n.subRows)!=null&&l.length)},n.getIsAllParentsExpanded=()=>{let r=!0,a=n;for(;r&&a.parentId;)a=o.getRow(a.parentId,!0),r=a.getIsExpanded();return r},n.getToggleExpandedHandler=()=>{const r=n.getCanExpand();return()=>{r&&n.toggleExpanded()}}}},Ja=0,eo=10,Ua=()=>({pageIndex:Ja,pageSize:eo}),Rb={getInitialState:n=>({...n,pagination:{...Ua(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:xt("pagination",n)}),createTable:n=>{let o=!1,r=!1;n._autoResetPageIndex=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetPageIndex)!=null?a:!n.options.manualPagination){if(r)return;r=!0,n._queue(()=>{n.resetPageIndex(),r=!1})}},n.setPagination=a=>{const l=c=>gn(a,c);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(l)},n.resetPagination=a=>{var l;n.setPagination(a?Ua():(l=n.initialState.pagination)!=null?l:Ua())},n.setPageIndex=a=>{n.setPagination(l=>{let c=gn(a,l.pageIndex);const d=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return c=Math.max(0,Math.min(c,d)),{...l,pageIndex:c}})},n.resetPageIndex=a=>{var l,c;n.setPageIndex(a?Ja:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageIndex)!=null?l:Ja)},n.resetPageSize=a=>{var l,c;n.setPageSize(a?eo:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageSize)!=null?l:eo)},n.setPageSize=a=>{n.setPagination(l=>{const c=Math.max(1,gn(a,l.pageSize)),d=l.pageSize*l.pageIndex,h=Math.floor(d/c);return{...l,pageIndex:h,pageSize:c}})},n.setPageCount=a=>n.setPagination(l=>{var c;let d=gn(a,(c=n.options.pageCount)!=null?c:-1);return typeof d=="number"&&(d=Math.max(-1,d)),{...l,pageCount:d}}),n.getPageOptions=X(()=>[n.getPageCount()],a=>{let l=[];return a&&a>0&&(l=[...new Array(a)].fill(null).map((c,d)=>d)),l},Z(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:a}=n.getState().pagination,l=n.getPageCount();return l===-1?!0:l===0?!1:a<l-1},n.previousPage=()=>n.setPageIndex(a=>a-1),n.nextPage=()=>n.setPageIndex(a=>a+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var a;return(a=n.options.pageCount)!=null?a:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var a;return(a=n.options.rowCount)!=null?a:n.getPrePaginationRowModel().rows.length}}},Ga=()=>({top:[],bottom:[]}),Eb={getInitialState:n=>({rowPinning:Ga(),...n}),getDefaultOptions:n=>({onRowPinningChange:xt("rowPinning",n)}),createRow:(n,o)=>{n.pin=(r,a,l)=>{const c=a?n.getLeafRows().map(p=>{let{id:x}=p;return x}):[],d=l?n.getParentRows().map(p=>{let{id:x}=p;return x}):[],h=new Set([...d,n.id,...c]);o.setRowPinning(p=>{var x,v;if(r==="bottom"){var R,N;return{top:((R=p==null?void 0:p.top)!=null?R:[]).filter(C=>!(h!=null&&h.has(C))),bottom:[...((N=p==null?void 0:p.bottom)!=null?N:[]).filter(C=>!(h!=null&&h.has(C))),...Array.from(h)]}}if(r==="top"){var b,E;return{top:[...((b=p==null?void 0:p.top)!=null?b:[]).filter(C=>!(h!=null&&h.has(C))),...Array.from(h)],bottom:((E=p==null?void 0:p.bottom)!=null?E:[]).filter(C=>!(h!=null&&h.has(C)))}}return{top:((x=p==null?void 0:p.top)!=null?x:[]).filter(C=>!(h!=null&&h.has(C))),bottom:((v=p==null?void 0:p.bottom)!=null?v:[]).filter(C=>!(h!=null&&h.has(C)))}})},n.getCanPin=()=>{var r;const{enableRowPinning:a,enablePinning:l}=o.options;return typeof a=="function"?a(n):(r=a??l)!=null?r:!0},n.getIsPinned=()=>{const r=[n.id],{top:a,bottom:l}=o.getState().rowPinning,c=r.some(h=>a==null?void 0:a.includes(h)),d=r.some(h=>l==null?void 0:l.includes(h));return c?"top":d?"bottom":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();if(!l)return-1;const c=(r=l==="top"?o.getTopRows():o.getBottomRows())==null?void 0:r.map(d=>{let{id:h}=d;return h});return(a=c==null?void 0:c.indexOf(n.id))!=null?a:-1}},createTable:n=>{n.setRowPinning=o=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(o),n.resetRowPinning=o=>{var r,a;return n.setRowPinning(o?Ga():(r=(a=n.initialState)==null?void 0:a.rowPinning)!=null?r:Ga())},n.getIsSomeRowsPinned=o=>{var r;const a=n.getState().rowPinning;if(!o){var l,c;return!!((l=a.top)!=null&&l.length||(c=a.bottom)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n._getPinnedRows=(o,r,a)=>{var l;return((l=n.options.keepPinnedRows)==null||l?(r??[]).map(d=>{const h=n.getRow(d,!0);return h.getIsAllParentsExpanded()?h:null}):(r??[]).map(d=>o.find(h=>h.id===d))).filter(Boolean).map(d=>({...d,position:a}))},n.getTopRows=X(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(o,r)=>n._getPinnedRows(o,r,"top"),Z(n.options,"debugRows")),n.getBottomRows=X(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(o,r)=>n._getPinnedRows(o,r,"bottom"),Z(n.options,"debugRows")),n.getCenterRows=X(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(o,r,a)=>{const l=new Set([...r??[],...a??[]]);return o.filter(c=>!l.has(c.id))},Z(n.options,"debugRows"))}},Ab={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:xt("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=o=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(o),n.resetRowSelection=o=>{var r;return n.setRowSelection(o?{}:(r=n.initialState.rowSelection)!=null?r:{})},n.toggleAllRowsSelected=o=>{n.setRowSelection(r=>{o=typeof o<"u"?o:!n.getIsAllRowsSelected();const a={...r},l=n.getPreGroupedRowModel().flatRows;return o?l.forEach(c=>{c.getCanSelect()&&(a[c.id]=!0)}):l.forEach(c=>{delete a[c.id]}),a})},n.toggleAllPageRowsSelected=o=>n.setRowSelection(r=>{const a=typeof o<"u"?o:!n.getIsAllPageRowsSelected(),l={...r};return n.getRowModel().rows.forEach(c=>{to(l,c.id,a,!0,n)}),l}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=X(()=>[n.getState().rowSelection,n.getCoreRowModel()],(o,r)=>Object.keys(o).length?Ha(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getFilteredSelectedRowModel=X(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(o,r)=>Object.keys(o).length?Ha(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getGroupedSelectedRowModel=X(()=>[n.getState().rowSelection,n.getSortedRowModel()],(o,r)=>Object.keys(o).length?Ha(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const o=n.getFilteredRowModel().flatRows,{rowSelection:r}=n.getState();let a=!!(o.length&&Object.keys(r).length);return a&&o.some(l=>l.getCanSelect()&&!r[l.id])&&(a=!1),a},n.getIsAllPageRowsSelected=()=>{const o=n.getPaginationRowModel().flatRows.filter(l=>l.getCanSelect()),{rowSelection:r}=n.getState();let a=!!o.length;return a&&o.some(l=>!r[l.id])&&(a=!1),a},n.getIsSomeRowsSelected=()=>{var o;const r=Object.keys((o=n.getState().rowSelection)!=null?o:{}).length;return r>0&&r<n.getFilteredRowModel().flatRows.length},n.getIsSomePageRowsSelected=()=>{const o=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:o.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>o=>{n.toggleAllRowsSelected(o.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>o=>{n.toggleAllPageRowsSelected(o.target.checked)}},createRow:(n,o)=>{n.toggleSelected=(r,a)=>{const l=n.getIsSelected();o.setRowSelection(c=>{var d;if(r=typeof r<"u"?r:!l,n.getCanSelect()&&l===r)return c;const h={...c};return to(h,n.id,r,(d=a==null?void 0:a.selectChildren)!=null?d:!0,o),h})},n.getIsSelected=()=>{const{rowSelection:r}=o.getState();return Ao(n,r)},n.getIsSomeSelected=()=>{const{rowSelection:r}=o.getState();return no(n,r)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=o.getState();return no(n,r)==="all"},n.getCanSelect=()=>{var r;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(n):(r=o.options.enableRowSelection)!=null?r:!0},n.getCanSelectSubRows=()=>{var r;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(n):(r=o.options.enableSubRowSelection)!=null?r:!0},n.getCanMultiSelect=()=>{var r;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(n):(r=o.options.enableMultiRowSelection)!=null?r:!0},n.getToggleSelectedHandler=()=>{const r=n.getCanSelect();return a=>{var l;r&&n.toggleSelected((l=a.target)==null?void 0:l.checked)}}}},to=(n,o,r,a,l)=>{var c;const d=l.getRow(o,!0);r?(d.getCanMultiSelect()||Object.keys(n).forEach(h=>delete n[h]),d.getCanSelect()&&(n[o]=!0)):delete n[o],a&&(c=d.subRows)!=null&&c.length&&d.getCanSelectSubRows()&&d.subRows.forEach(h=>to(n,h.id,r,a,l))};function Ha(n,o){const r=n.getState().rowSelection,a=[],l={},c=function(d,h){return d.map(p=>{var x;const v=Ao(p,r);if(v&&(a.push(p),l[p.id]=p),(x=p.subRows)!=null&&x.length&&(p={...p,subRows:c(p.subRows)}),v)return p}).filter(Boolean)};return{rows:c(o.rows),flatRows:a,rowsById:l}}function Ao(n,o){var r;return(r=o[n.id])!=null?r:!1}function no(n,o,r){var a;if(!((a=n.subRows)!=null&&a.length))return!1;let l=!0,c=!1;return n.subRows.forEach(d=>{if(!(c&&!l)&&(d.getCanSelect()&&(Ao(d,o)?c=!0:l=!1),d.subRows&&d.subRows.length)){const h=no(d,o);h==="all"?c=!0:(h==="some"&&(c=!0),l=!1)}}),l?"all":c?"some":!1}const ro=/([0-9]+)/gm,Fb=(n,o,r)=>Rd(vn(n.getValue(r)).toLowerCase(),vn(o.getValue(r)).toLowerCase()),Ib=(n,o,r)=>Rd(vn(n.getValue(r)),vn(o.getValue(r))),Db=(n,o,r)=>Fo(vn(n.getValue(r)).toLowerCase(),vn(o.getValue(r)).toLowerCase()),Mb=(n,o,r)=>Fo(vn(n.getValue(r)),vn(o.getValue(r))),Lb=(n,o,r)=>{const a=n.getValue(r),l=o.getValue(r);return a>l?1:a<l?-1:0},Tb=(n,o,r)=>Fo(n.getValue(r),o.getValue(r));function Fo(n,o){return n===o?0:n>o?1:-1}function vn(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function Rd(n,o){const r=n.split(ro).filter(Boolean),a=o.split(ro).filter(Boolean);for(;r.length&&a.length;){const l=r.shift(),c=a.shift(),d=parseInt(l,10),h=parseInt(c,10),p=[d,h].sort();if(isNaN(p[0])){if(l>c)return 1;if(c>l)return-1;continue}if(isNaN(p[1]))return isNaN(d)?-1:1;if(d>h)return 1;if(h>d)return-1}return r.length-a.length}const Lr={alphanumeric:Fb,alphanumericCaseSensitive:Ib,text:Db,textCaseSensitive:Mb,datetime:Lb,basic:Tb},Ob={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:xt("sorting",n),isMultiSortEvent:o=>o.shiftKey}),createColumn:(n,o)=>{n.getAutoSortingFn=()=>{const r=o.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const l of r){const c=l==null?void 0:l.getValue(n.id);if(Object.prototype.toString.call(c)==="[object Date]")return Lr.datetime;if(typeof c=="string"&&(a=!0,c.split(ro).length>1))return Lr.alphanumeric}return a?Lr.text:Lr.basic},n.getAutoSortDir=()=>{const r=o.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var r,a;if(!n)throw new Error;return ls(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(r=(a=o.options.sortingFns)==null?void 0:a[n.columnDef.sortingFn])!=null?r:Lr[n.columnDef.sortingFn]},n.toggleSorting=(r,a)=>{const l=n.getNextSortingOrder(),c=typeof r<"u"&&r!==null;o.setSorting(d=>{const h=d==null?void 0:d.find(b=>b.id===n.id),p=d==null?void 0:d.findIndex(b=>b.id===n.id);let x=[],v,R=c?r:l==="desc";if(d!=null&&d.length&&n.getCanMultiSort()&&a?h?v="toggle":v="add":d!=null&&d.length&&p!==d.length-1?v="replace":h?v="toggle":v="replace",v==="toggle"&&(c||l||(v="remove")),v==="add"){var N;x=[...d,{id:n.id,desc:R}],x.splice(0,x.length-((N=o.options.maxMultiSortColCount)!=null?N:Number.MAX_SAFE_INTEGER))}else v==="toggle"?x=d.map(b=>b.id===n.id?{...b,desc:R}:b):v==="remove"?x=d.filter(b=>b.id!==n.id):x=[{id:n.id,desc:R}];return x})},n.getFirstSortDir=()=>{var r,a;return((r=(a=n.columnDef.sortDescFirst)!=null?a:o.options.sortDescFirst)!=null?r:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=r=>{var a,l;const c=n.getFirstSortDir(),d=n.getIsSorted();return d?d!==c&&((a=o.options.enableSortingRemoval)==null||a)&&(!(r&&(l=o.options.enableMultiRemove)!=null)||l)?!1:d==="desc"?"asc":"desc":c},n.getCanSort=()=>{var r,a;return((r=n.columnDef.enableSorting)!=null?r:!0)&&((a=o.options.enableSorting)!=null?a:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var r,a;return(r=(a=n.columnDef.enableMultiSort)!=null?a:o.options.enableMultiSort)!=null?r:!!n.accessorFn},n.getIsSorted=()=>{var r;const a=(r=o.getState().sorting)==null?void 0:r.find(l=>l.id===n.id);return a?a.desc?"desc":"asc":!1},n.getSortIndex=()=>{var r,a;return(r=(a=o.getState().sorting)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.clearSorting=()=>{o.setSorting(r=>r!=null&&r.length?r.filter(a=>a.id!==n.id):[])},n.getToggleSortingHandler=()=>{const r=n.getCanSort();return a=>{r&&(a.persist==null||a.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(a):!1))}}},createTable:n=>{n.setSorting=o=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(o),n.resetSorting=o=>{var r,a;n.setSorting(o?[]:(r=(a=n.initialState)==null?void 0:a.sorting)!=null?r:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},Pb=[sb,jb,_b,bb,ab,ob,Cb,yb,Ob,xb,Nb,Rb,Eb,Ab,wb];function kb(n){var o,r;const a=[...Pb,...(o=n._features)!=null?o:[]];let l={_features:a};const c=l._features.reduce((N,b)=>Object.assign(N,b.getDefaultOptions==null?void 0:b.getDefaultOptions(l)),{}),d=N=>l.options.mergeOptions?l.options.mergeOptions(c,N):{...c,...N};let p={...{},...(r=n.initialState)!=null?r:{}};l._features.forEach(N=>{var b;p=(b=N.getInitialState==null?void 0:N.getInitialState(p))!=null?b:p});const x=[];let v=!1;const R={_features:a,options:{...c,...n},initialState:p,_queue:N=>{x.push(N),v||(v=!0,Promise.resolve().then(()=>{for(;x.length;)x.shift()();v=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{l.setState(l.initialState)},setOptions:N=>{const b=gn(N,l.options);l.options=d(b)},getState:()=>l.options.state,setState:N=>{l.options.onStateChange==null||l.options.onStateChange(N)},_getRowId:(N,b,E)=>{var C;return(C=l.options.getRowId==null?void 0:l.options.getRowId(N,b,E))!=null?C:`${E?[E.id,b].join("."):b}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(N,b)=>{let E=(b?l.getPrePaginationRowModel():l.getRowModel()).rowsById[N];if(!E&&(E=l.getCoreRowModel().rowsById[N],!E))throw new Error;return E},_getDefaultColumnDef:X(()=>[l.options.defaultColumn],N=>{var b;return N=(b=N)!=null?b:{},{header:E=>{const C=E.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:E=>{var C,L;return(C=(L=E.renderValue())==null||L.toString==null?void 0:L.toString())!=null?C:null},...l._features.reduce((E,C)=>Object.assign(E,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...N}},Z(n,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:X(()=>[l._getColumnDefs()],N=>{const b=function(E,C,L){return L===void 0&&(L=0),E.map(I=>{const q=ib(l,I,L,C),$=I;return q.columns=$.columns?b($.columns,q,L+1):[],q})};return b(N)},Z(n,"debugColumns")),getAllFlatColumns:X(()=>[l.getAllColumns()],N=>N.flatMap(b=>b.getFlatColumns()),Z(n,"debugColumns")),_getAllFlatColumnsById:X(()=>[l.getAllFlatColumns()],N=>N.reduce((b,E)=>(b[E.id]=E,b),{}),Z(n,"debugColumns")),getAllLeafColumns:X(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(N,b)=>{let E=N.flatMap(C=>C.getLeafColumns());return b(E)},Z(n,"debugColumns")),getColumn:N=>l._getAllFlatColumnsById()[N]};Object.assign(l,R);for(let N=0;N<l._features.length;N++){const b=l._features[N];b==null||b.createTable==null||b.createTable(l)}return l}function Ed(){return n=>X(()=>[n.options.data],o=>{const r={rows:[],flatRows:[],rowsById:{}},a=function(l,c,d){c===void 0&&(c=0);const h=[];for(let x=0;x<l.length;x++){const v=Ro(n,n._getRowId(l[x],x,d),l[x],x,c,void 0,d==null?void 0:d.id);if(r.flatRows.push(v),r.rowsById[v.id]=v,h.push(v),n.options.getSubRows){var p;v.originalSubRows=n.options.getSubRows(l[x],x),(p=v.originalSubRows)!=null&&p.length&&(v.subRows=a(v.originalSubRows,c+1,v))}}return h};return r.rows=a(o),r},Z(n.options,"debugTable","getRowModel",()=>n._autoResetPageIndex()))}function Ad(n,o,r){return r.options.filterFromLeafRows?qb(n,o,r):$b(n,o,r)}function qb(n,o,r){var a;const l=[],c={},d=(a=r.options.maxLeafRowFilterDepth)!=null?a:100,h=function(p,x){x===void 0&&(x=0);const v=[];for(let N=0;N<p.length;N++){var R;let b=p[N];const E=Ro(r,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(E.columnFilters=b.columnFilters,(R=b.subRows)!=null&&R.length&&x<d){if(E.subRows=h(b.subRows,x+1),b=E,o(b)&&!E.subRows.length){v.push(b),c[b.id]=b,l.push(b);continue}if(o(b)||E.subRows.length){v.push(b),c[b.id]=b,l.push(b);continue}}else b=E,o(b)&&(v.push(b),c[b.id]=b,l.push(b))}return v};return{rows:h(n),flatRows:l,rowsById:c}}function $b(n,o,r){var a;const l=[],c={},d=(a=r.options.maxLeafRowFilterDepth)!=null?a:100,h=function(p,x){x===void 0&&(x=0);const v=[];for(let N=0;N<p.length;N++){let b=p[N];if(o(b)){var R;if((R=b.subRows)!=null&&R.length&&x<d){const C=Ro(r,b.id,b.original,b.index,b.depth,void 0,b.parentId);C.subRows=h(b.subRows,x+1),b=C}v.push(b),l.push(b),c[b.id]=b}}return v};return{rows:h(n),flatRows:l,rowsById:c}}function zb(){return(n,o)=>X(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter,n.getFilteredRowModel()],(r,a,l)=>{if(!r.rows.length||!(a!=null&&a.length)&&!l)return r;const c=[...a.map(h=>h.id).filter(h=>h!==o),l?"__global__":void 0].filter(Boolean),d=h=>{for(let p=0;p<c.length;p++)if(h.columnFilters[c[p]]===!1)return!1;return!0};return Ad(r.rows,d,n)},Z(n.options,"debugTable"))}function Vb(){return(n,o)=>X(()=>{var r;return[(r=n.getColumn(o))==null?void 0:r.getFacetedRowModel()]},r=>{if(!r)return new Map;let a=new Map;for(let c=0;c<r.flatRows.length;c++){const d=r.flatRows[c].getUniqueValues(o);for(let h=0;h<d.length;h++){const p=d[h];if(a.has(p)){var l;a.set(p,((l=a.get(p))!=null?l:0)+1)}else a.set(p,1)}}return a},Z(n.options,"debugTable"))}function Bb(){return n=>X(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter],(o,r,a)=>{if(!o.rows.length||!(r!=null&&r.length)&&!a){for(let N=0;N<o.flatRows.length;N++)o.flatRows[N].columnFilters={},o.flatRows[N].columnFiltersMeta={};return o}const l=[],c=[];(r??[]).forEach(N=>{var b;const E=n.getColumn(N.id);if(!E)return;const C=E.getFilterFn();C&&l.push({id:N.id,filterFn:C,resolvedValue:(b=C.resolveFilterValue==null?void 0:C.resolveFilterValue(N.value))!=null?b:N.value})});const d=(r??[]).map(N=>N.id),h=n.getGlobalFilterFn(),p=n.getAllLeafColumns().filter(N=>N.getCanGlobalFilter());a&&h&&p.length&&(d.push("__global__"),p.forEach(N=>{var b;c.push({id:N.id,filterFn:h,resolvedValue:(b=h.resolveFilterValue==null?void 0:h.resolveFilterValue(a))!=null?b:a})}));let x,v;for(let N=0;N<o.flatRows.length;N++){const b=o.flatRows[N];if(b.columnFilters={},l.length)for(let E=0;E<l.length;E++){x=l[E];const C=x.id;b.columnFilters[C]=x.filterFn(b,C,x.resolvedValue,L=>{b.columnFiltersMeta[C]=L})}if(c.length){for(let E=0;E<c.length;E++){v=c[E];const C=v.id;if(v.filterFn(b,C,v.resolvedValue,L=>{b.columnFiltersMeta[C]=L})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const R=N=>{for(let b=0;b<d.length;b++)if(N.columnFilters[d[b]]===!1)return!1;return!0};return Ad(o.rows,R,n)},Z(n.options,"debugTable","getFilteredRowModel",()=>n._autoResetPageIndex()))}function Ub(){return n=>X(()=>[n.getState().sorting,n.getPreSortedRowModel()],(o,r)=>{if(!r.rows.length||!(o!=null&&o.length))return r;const a=n.getState().sorting,l=[],c=a.filter(p=>{var x;return(x=n.getColumn(p.id))==null?void 0:x.getCanSort()}),d={};c.forEach(p=>{const x=n.getColumn(p.id);x&&(d[p.id]={sortUndefined:x.columnDef.sortUndefined,invertSorting:x.columnDef.invertSorting,sortingFn:x.getSortingFn()})});const h=p=>{const x=p.map(v=>({...v}));return x.sort((v,R)=>{for(let b=0;b<c.length;b+=1){var N;const E=c[b],C=d[E.id],L=C.sortUndefined,I=(N=E==null?void 0:E.desc)!=null?N:!1;let q=0;if(L){const $=v.getValue(E.id),te=R.getValue(E.id),O=$===void 0,k=te===void 0;if(O||k){if(L==="first")return O?-1:1;if(L==="last")return O?1:-1;q=O&&k?0:O?L:-L}}if(q===0&&(q=C.sortingFn(v,R,E.id)),q!==0)return I&&(q*=-1),C.invertSorting&&(q*=-1),q}return v.index-R.index}),x.forEach(v=>{var R;l.push(v),(R=v.subRows)!=null&&R.length&&(v.subRows=h(v.subRows))}),x};return{rows:h(r.rows),flatRows:l,rowsById:r.rowsById}},Z(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/**
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Gi(n,o){return n?Gb(n)?T.createElement(n,o):n:null}function Gb(n){return Hb(n)||typeof n=="function"||Kb(n)}function Hb(n){return typeof n=="function"&&(()=>{const o=Object.getPrototypeOf(n);return o.prototype&&o.prototype.isReactComponent})()}function Kb(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Fd(n){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=T.useState(()=>({current:kb(o)})),[a,l]=T.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...a,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const Wb=({buttonText:n,title:o="",content:r,className:a=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${a}`,children:i.jsxs(ir,{children:[i.jsx(Ic,{asChild:!0,children:i.jsxs(U,{variant:"link",className:"inline-flex items-center font-medium group",children:[i.jsx("span",{className:"underline-offset-4 group-hover:underline",children:n}),i.jsx($_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(sr,{className:"sm:max-w-[425px]",children:[i.jsx(ar,{children:i.jsx(or,{children:o})}),i.jsxs(ao,{className:"grid gap-4 py-2",children:[r,i.jsx(lr,{children:i.jsx(Bi,{asChild:!0,children:i.jsx(U,{type:"button",children:w("common.close")})})})]})]})]})});function Yb(n){let a=0;for(let v=0;v<n.length;v++)a=n.charCodeAt(v)+((a<<5)-a);let l="#";for(let v=0;v<3;v++){const R=a>>v*8&255;l+=("00"+R.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),h=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(h*.7|0).toString(16).padStart(2,"0")}`,x=`#${Math.min(255,Math.floor(c+(255-c)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(d+(255-d)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(h+(255-h)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Id=({label:n,className:o})=>{const[r,a]=Yb(n);return i.jsx(oo,{className:o,style:o?{}:{backgroundColor:a,color:r},children:n})};function Dd({table:n,header:o,className:r}){return o.column.getCanSort()?i.jsx("div",{className:ge("flex items-center space-x-2",r),children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{"aria-label":o.column.getIsSorted()==="desc"?w("common.sort_desc_description"):o.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Gi(o.column.columnDef.header,o.getContext()),o.column.getIsSorted()==="desc"?i.jsx(xc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):o.column.getIsSorted()==="asc"?i.jsx(vc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(E0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(Xi,{align:"start",children:[o.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Or,{onClick:()=>o.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(vc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Or,{onClick:()=>o.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(xc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),o.column.getCanSort()&&o.column.getCanHide()&&i.jsx(lo,{}),o.column.getCanHide()&&i.jsxs(Or,{onClick:()=>o.column.toggleVisibility(!1),"aria-label":w("Hide"),children:[i.jsx(dd,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("Hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:ge("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:o.isPlaceholder?null:Gi(o.column.columnDef.header,o.getContext())}),!1]})}function Qb({table:n,className:o,enablePageSizeSelector:r=!0,visible:a="auto"}){const l=T.useMemo(()=>a===!0,[a]),c=T.useMemo(()=>a==="auto",[a]);return!l||c&&n.getPageCount()<1?null:i.jsxs("div",{className:o,children:[i.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:n.getSelectedRowModel().rows.length>0&&i.jsx(i.Fragment,{children:w("common.rows_selected_of_total",{count:n.getFilteredSelectedRowModel().rows.length,total:n.getFilteredRowModel().rows.length})})}),i.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[r&&i.jsxs("div",{className:"flex items-center space-x-2 grow",children:[i.jsx("p",{className:"text-sm font-medium",children:w("common.rows_per_page")}),i.jsxs(Zi,{value:`${n.getState().pagination.pageSize}`,onValueChange:d=>{n.setPageSize(Number(d))},children:[i.jsx(Ji,{className:"h-8 w-[70px]",children:i.jsx(es,{placeholder:n.getState().pagination.pageSize})}),i.jsx(ts,{side:"top",children:z_.map(d=>i.jsx(Dn,{value:`${d}`,children:d},d))})]})]}),i.jsxs("div",{className:ge("flex space-x-2 flex-1",r?"justify-end":"justify-between"),children:[i.jsx("div",{className:"flex w-[150px] items-center justify-start",children:i.jsx("p",{className:"text-sm font-medium ",children:w("common.num_page_of_total",{count:n.getState().pagination.pageIndex+1,total:n.getPageCount()})})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs(U,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(V_),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_first_page")}),i.jsx(A0,{className:"w-4 h-4"})]}),i.jsxs(U,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.previousPage(),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_prev_page")}),i.jsx(B_,{className:"w-4 h-4"})]}),i.jsxs(U,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.nextPage(),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_next_page")}),i.jsx(U_,{className:"w-4 h-4"})]}),i.jsxs(U,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(n.getPageCount()+1),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_last_page")}),i.jsx(F0,{className:"w-4 h-4"})]})]})]})]})]})}function us({table:n,title:o,description:r,caption:a,paginationOptions:l,headerOptions:c={visible:!0},children:d,className:h,contentClassName:p,footerClassName:x,rowClassName:v,cellClassName:R,onRowClick:N,activeRowIndex:b}){var C;const E=c==null?void 0:c.visible;return i.jsxs(Te,{className:h,children:[(o||r)&&i.jsxs(ct,{className:"pb-0",children:[i.jsx(Ve,{children:o}),i.jsx(He,{children:r})]}),i.jsxs(Oe,{className:ge("pt-6",p),children:[d&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex space-x-2",children:d}),i.jsx(hn,{className:"my-4"})]}),i.jsxs(uo,{children:[typeof a<"u"&&i.jsx(G_,{children:a}),E&&n.getHeaderGroups().length&&i.jsx(co,{children:n.getHeaderGroups().map(L=>i.jsx(pn,{className:v,children:L.headers.map(I=>i.jsx(fo,{colSpan:I.colSpan,style:{width:I.getSize()===Number.MAX_SAFE_INTEGER?"auto":I.getSize()},children:i.jsx(Dd,{table:n,header:I})},I.id))},L.id))}),i.jsx(go,{children:(C=n.getRowModel().rows)!=null&&C.length?n.getRowModel().rows.map(L=>i.jsx(pn,{onClick:()=>{N&&N(L)},tabIndex:0,"data-state":L.getIsSelected()&&"selected",className:ge(L.getIsSelected()||b===L.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",v),children:L.getVisibleCells().map(I=>i.jsx(qr,{className:R,style:{width:I.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":I.column.getSize()},children:Gi(I.column.columnDef.cell,I.getContext())},I.id))},L.id)):i.jsx(pn,{className:v,children:i.jsx(qr,{className:ge("h-24 text-center",R),colSpan:n.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),i.jsx(Nt,{className:x,children:i.jsx(Qb,{className:"flex-1",table:n,...l})})]})}function Xb({actions:n,rowContext:o}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{size:"icon",variant:"outline",className:"w-8 h-8",children:[i.jsx(L0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only",children:w("common.open_menu")})]})}),i.jsxs(Xi,{align:"end",children:[i.jsxs(Dc,{children:[w("common.actions")," "]}),n&&n(o).map((r,a)=>r.label==="-"?i.jsx(lo,{},a):i.jsxs(Or,{onClick:l=>r.onClick?r.onClick(o,l):null,children:[r.icon&&i.jsx(i.Fragment,{children:r.icon}),r.label,r.shortcut&&i.jsx(H_,{children:r.shortcut})]},a))]})]})}function Zb(){return{id:"select",header:({table:n})=>i.jsx(Ui,{id:"select-all",checked:n.getIsAllPageRowsSelected()||n.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:o=>n.toggleAllPageRowsSelected(!!o),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:n})=>i.jsx(Ui,{id:`select-row-${n.id}`,checked:n.getIsSelected(),onCheckedChange:o=>{n.toggleSelected(!!o)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function cs({columnCount:n,rowCount:o=10,searchableColumnCount:r=0,filterableColumnCount:a=0,showViewOptions:l=!0,cellWidths:c=["auto"],withPagination:d=!0,shrinkZero:h=!1,className:p,...x}){return i.jsxs("div",{className:ge("w-full space-y-2.5 overflow-auto",p),...x,children:[i.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[r>0?Array.from({length:r}).map((v,R)=>i.jsx(ut,{className:"w-40 h-7 lg:w-60"},R)):null,a>0?Array.from({length:a}).map((v,R)=>i.jsx(ut,{className:"h-7 w-[4.5rem] border-dashed"},R)):null]}),l?i.jsx(ut,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),i.jsx("div",{className:"border rounded-md",children:i.jsxs(uo,{children:[i.jsx(co,{children:Array.from({length:1}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((N,b)=>i.jsx(fo,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))}),i.jsx(go,{children:Array.from({length:o}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((N,b)=>i.jsx(qr,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))})]})}),d?i.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[i.jsx(ut,{className:"w-40 h-7 shrink-0"}),i.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"w-24 h-7"}),i.jsx(ut,{className:"h-7 w-[4.5rem]"})]}),i.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:i.jsx(ut,{className:"w-20 h-7"})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"hidden size-7 lg:block"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const ds=({title:n="Esto está muy vacío",subtitle:o="Empieza solicitando la carga del catálogo",buttonText:r="Solicitar carga del catálogo",onButtonClick:a=()=>{},actions:l=()=>i.jsx(i.Fragment,{})})=>i.jsxs("div",{className:"text-center",children:[i.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),i.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:n}),i.jsx("p",{className:"mt-1 text-base text-slate-500",children:o}),i.jsxs("div",{className:"items-center mt-6",children:[l&&i.jsx(i.Fragment,{children:l}),!l&&i.jsxs(U,{className:"my-4",onClick:a,children:[i.jsx(yo,{}),r]})]})]}),Jb=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),Hi=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:N}=n,{control:b}=ur(),[E,C]=T.useState(""),L={input:I=>{if(typeof I!="object")return I;const q=$t.create(I);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(I,q,$)=>{const{value:te}=$??{value:null};C(te??"");const O=$t.createFromFormattedValue(te);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:o,disabled:h,rules:{max:100,min:0,...x},render:({field:I})=>{const q=L.input(I.value),$=h||I.disabled,te=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:ge(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:a,required:te}),i.jsx(xo,{children:i.jsx(Mc,{name:I.name,ref:I.ref,onBlur:I.onBlur,disabled:$,readOnly:v,className:ge(Jb({variant:N,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,K)=>I.onChange(L.output(O,k,K))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},ew=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),tw=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:N}=n,{control:b}=ur(),[E,C]=T.useState(""),L={input:I=>{if(typeof I!="object")return I;const q=xn.create(I);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(I,q,$)=>{const{value:te}=$??{value:null};C(te??"");const O=xn.createFromFormattedValue(te);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:o,disabled:h,rules:x,render:({field:I})=>{const q=L.input(I.value),$=h||I.disabled,te=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:ge(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:a,required:te}),i.jsx(xo,{children:i.jsx(Mc,{name:I.name,ref:I.ref,onBlur:I.onBlur,disabled:$,readOnly:v,className:ge(ew({variant:N,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,K)=>I.onChange(L.output(O,k,K))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},nw=vo("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),mn=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:h,rules:p,required:x,type:v,variant:R}=n,{control:N}=ur();return i.jsx(mo,{control:N,name:o,disabled:h,rules:{required:x,...p},render:({field:b,fieldState:E})=>{const C=!!((p==null?void 0:p.required)??x);return i.jsxs(ho,{className:ge(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:a,required:C}),i.jsx(xo,{className:"block",children:i.jsx(ns,{type:v,placeholder:c,className:ge(E.error?"border-destructive focus-visible:ring-destructive":"",nw({variant:R,className:d})),...b})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})};function rw(n=!1){const[o,r]=T.useState(n);return[o,()=>r(l=>!l)]}const Tn=()=>{const n=T.useContext(K_);if(n===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return n};function fs({data:n,columns:o,pageCount:r,enableSorting:a=!1,enableHiding:l=!1,enableRowSelection:c=!1,initialState:d,onPaginationChange:h,meta:p}){const{pagination:x,setPagination:v,sorting:R}=Tn(),[N,b]=Fn.useState({}),[E,C]=Fn.useState((d==null?void 0:d.columnVisibility)||{}),L=te=>{if(typeof te=="function"){const O=te(x);v(O)}h&&h(te)},I=te=>{},q=T.useCallback(()=>{const te=o;return c&&te.unshift(Zb()),te},[o,c]);return{table:Fd({data:n,columns:q(),pageCount:r??-1,meta:p,getCoreRowModel:Ed(),initialState:d,state:{pagination:x,sorting:R,columnVisibility:E,rowSelection:N},enableRowSelection:c,onRowSelectionChange:b,manualSorting:!0,enableSorting:a,getSortedRowModel:Ub(),onSortingChange:I,enableHiding:l,onColumnVisibilityChange:C,manualPagination:!0,onPaginationChange:L,manualFiltering:!0,getFilteredRowModel:Bb(),getFacetedRowModel:zb(),getFacetedUniqueValues:Vb(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const iw=({setSize:n,setControllerCallback:o,setPercentageCallback:r,setErrorCallback:a})=>l=>{if(!l.ok)throw Error(`${l.status} ${l.type} ${l.statusText}`);if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.body,d=l.headers.get("content-encoding"),h=l.headers.get(d?"x-file-size":"content-length"),p=parseInt(h||"0",10);n(()=>p);let x=0;const v=new ReadableStream({start(R){o(R);const N=c.getReader();async function b(){return N.read().then(({done:E,value:C})=>E?R.close():(x+=(C==null?void 0:C.byteLength)||0,C&&R.enqueue(C),r({loaded:x,total:p}),b())).catch(E=>(a(E),N.cancel("Cancelled"),R.error(E)))}return b()}});return new Response(v)},Cc=(n,o,r)=>{const a=[n],l=new Blob(a,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(l,o);const c=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(l):window.webkitURL.createObjectURL(l),d=document.createElement("a");return d.style.display="none",d.href=c,d.setAttribute("download",o),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d),window.URL.revokeObjectURL(c)},200)};function yc({customHandleDownload:n,...o}={}){var te;let r=!1;try{r=process?!!((te=process==null?void 0:process.env)!=null&&te.REACT_APP_DEBUG_MODE):!1}catch{r=!1}const[a,l]=T.useState(0),[c,d]=T.useState(0),[h,p]=T.useState(0),[x,v]=T.useState(null),[R,N]=T.useState(!1),b=T.useRef(null),E=T.useCallback(({loaded:O,total:k})=>{const K=Math.round(O/k*100);d(()=>K)},[]),C=T.useCallback(O=>{const k={"Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into an errored readable stream":"Download canceled","The user aborted a request.":"Download timed out"};v(()=>({errorMessage:k[O.message]?k[O.message]:O.message}))},[]),L=T.useCallback(O=>{b.current=O},[]),I=T.useCallback(()=>{b.current&&b.current.error()},[]),q=T.useCallback(()=>{L(null),l(()=>0),d(()=>0),p(()=>0),N(()=>!1)},[L]),$=T.useCallback(async(O,k,K=0,ne={})=>{if(R)return null;q(),v(()=>null),N(()=>!0);const B=setInterval(()=>l(Je=>Je+1),r?1:1e3),me=iw({setSize:p,setControllerCallback:L,setPercentageCallback:E,setErrorCallback:C}),_e=new AbortController,W=setTimeout(()=>{K>0&&_e.abort()},K),Re=n||Cc;try{const Je=await fetch(O,{method:"GET",...o,...ne,signal:_e.signal}),je=await me(Je).blob();Re(je,k),q()}catch(Je){q(),v(Y=>{const{message:je}=Je;return je!=="Failed to fetch"?{errorMessage:je}:Y}),clearTimeout(W)}finally{clearInterval(B)}},[R,q,r,L,E,C,o,n]);return T.useMemo(()=>({elapsed:a,percentage:c,size:h,download:$,cancel:I,error:x,isInProgress:R,jsDownload:Cc}),[a,c,h,$,I,x,R])}const sw=()=>{const{i18n:n}=rs();return Md({locale:n.language})},Md=n=>{const{locale:o}=n,r=T.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h,currency_code:p}=c;return new Intl.NumberFormat(o??"ES",{style:"currency",currency:p,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:h}).format(d===null?0:fc({amount:d,scale:h}))},[o]),a=T.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat("es",{minimumFractionDigits:h,useGrouping:!0}).format(d===null?0:fc({amount:d,scale:h}))},[o]),l=T.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat(o,{style:"decimal",minimumFractionDigits:h}).format(d===null?0:d)},[o]);return{formatCurrency:r,formatNumber:a,formatPercentage:l}};function Ld(n){const[o,r]=T.useState(!1);return T.useEffect(()=>{function a(c){r(c.matches)}const l=matchMedia(n);return l.addEventListener("change",a),r(l.matches),()=>l.removeEventListener("change",a)},[n]),o}const aw=()=>{const n=T.useContext(W_);if(n===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return n},Io=({isDirty:n=!1,title:o=w("hooks.use_unsaved_changes_notifier.title"),subtitle:r=w("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:a=w("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:l=w("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:c,onCancel:d,type:h="warning"})=>{const p=Y_(n),{show:x}=aw(),v=T.useCallback(()=>n?new Promise(R=>{x({title:o,subtitle:r,confirmText:a,cancelText:l,type:h,onConfirm:()=>{R(!0),c==null||c()},onCancel:()=>{R(!1),d==null||d()}})}):Promise.resolve(!0),[l,a,n,d,c,x,r,o,h]);return T.useEffect(()=>{p.state==="blocked"&&v().then(R=>{R?p.proceed():p.reset()})},[p,v]),T.useEffect(()=>(n&&(window.onbeforeunload=()=>r),()=>{window.onbeforeunload=null}),[n,r]),{confirm:v}},Td=n=>{const{isSubmitting:o,isLoading:r,isValidating:a}=Q_();return i.jsx(wo,{disabled:o||r||a,...n})};Td.displayName="FormSubmitButton";const Od={"any.unknown":"{{#label}}: no está permitido","any.invalid":"{{#label}}: contiene un valor invalido","any.empty":"{{#label}}: no está permitido que sea vacío","any.required":"{{#label}}: es un campo requerido","any.allowOnly":"{{#label}}: debería ser uno de las siguientes variantes: {{valids}}","any.default":"emitió un error cuando se ejecutó el metodo default","alternatives.base":"{{#label}}: no coincide con ninguna de las alternativas permitidas","array.base":"{{#label}}: debe ser un array","array.includes":"{{#label}}: en la posición {{pos}} no coincide con ninguno de los tipos permitidos","array.includesSingle":'{{#label}}: el valor de "{{!key}}" no coincide con ninguno de los tipos permitidos',"array.includesOne":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.includesOneSingle":'{{#label}}: el valor "{{!key}}" falló porque {{reason}}',"array.includesRequiredUnknowns":"{{#label}}: no contiene valor/es requerido/s: {{unknownMisses}} ","array.includesRequiredKnowns":"{{#label}}: no contiene: {{knownMisses}}","array.includesRequiredBoth":"{{#label}}: no contiene {{knownMisses}} y {{unknownMisses}} otros valores requeridos","array.excludes":"{{#label}}: en la posición {{pos}} contiene un valor excluído","array.excludesSingle":'{{#label}}: el valor "{{!key}}" contiene un valor excluído',"array.min":"{{#label}}: debe contener al menos {{limit}} items","array.max":"{{#label}}: debe contener máximo {{limit}} items","array.length":"{{#label}}: debe contener exactamente {{limit}} items","array.ordered":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.orderedLength":"{{#label}}: en la posición {{pos}} falló porque el array debre contener como máximo {{limit}} items","array.sparse":"{{#label}}: no debe ser un array esparcido","array.unique":"{{#label}}: posición {{pos}} contiene un valor duplicado","boolean.base":"{{#label}}: debe ser un valor verdadero/falso o si/no","binary.base":"{{#label}}: debe ser un buffer o un string","binary.min":"{{#label}}: debe ser como mínimo de {{limit}} bytes","binary.max":"{{#label}}: debe ser como máximo de {{limit}} bytes","binary.length":"{{#label}}: debe tener exactamente {{limit}} bytes","date.base":"{{#label}}: debe ser una cantidad de milisegundos o una fecha en cadena de texto válida","date.min":'{{#label}}: debe ser mayor o igual a "{{limit}}"',"date.max":'{{#label}}: debe ser menor o igual que "{{limit}}"',"date.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601","date.ref":'referencia a "{{ref}}", que no es una fecha válida',"function.base":"{{#label}}: debe ser una función","object.base":"{{#label}}: debe ser un objeto","object.child":'hijo "{{!key}}" falló porque {{reason}}',"object.min":"{{#label}}: debe tener como mínimo {{limit}} hijo","object.max":"{{#label}}: debe tener menos o a lo sumo {{limit}} hijo","object.length":"{{#label}}: debe tener máximo {{limit}} hijo/s","object.allowUnknown":"no está permitido","object.with":'peer faltante: "{{peer}}"',"object.without":'conflicto con peer prohibido: "{{peer}}"',"object.missing":"{{#label}}: debe contener al menos uno de: {{peers}}","object.xor":"{{#label}}: contiene un conflicto con alguno de: {{peers}}","object.or":"{{#label}}: debe contener al menos uno de: {{peers}}","object.and":"contiene {{present}} sin el requerido: {{missing}}","object.nand":'!!"{{main}}" no debe existir simultáneamente con {{peers}}',"object.assert":'!!"{{ref}}" falló validacion porque "{{ref}}" falló a {{message}}',"object.rename.multiple":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque múltiples re-nombramientos estan deshabilitados y otra clave fue renombrada a "{{to}}"',"object.rename.override":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque la sobre escritura esta deshabilitada y el target "{{to}}" existe',"object.type":'{{#label}}: debe ser una instancia de "{{type}}"',"number.base":"{{#label}}: debe ser un número","number.min":"{{#label}}: debe ser mayor o igual que {{limit}}","number.max":"{{#label}}: debe ser menor o igual que {{limit}}","number.less":"{{#label}}: debe ser menor a {{limit}}","number.greater":"{{#label}}: debe ser mayor a {{limit}}","number.float":"{{#label}}: debe ser un numero flotante","number.integer":"{{#label}}: debe ser un número entero","number.negative":"{{#label}}: debe ser un número negativo","number.positive":"{{#label}}: debe ser un número positivo","number.precision":"{{#label}}: no debe tener mas de {{limit}} decimales","number.ref":'{{#label}}: referencia a "{{ref}}" que no es un número',"number.multiple":"{{#label}}: debe ser un múltiplo de {{multiple}}","string.base":"{{#label}}: debe ser una cadena de texto","string.empty":"{{#label}}: no está permitido que sea vacío","string.min":"{{#label}}: debe ser mínimo de {{limit}} caracteres de largo","string.max":"{{#label}}: debe ser de máximo {{limit}} caracteres de largo","string.length":"{{#label}}: debe ser exactamente de {{limit}} caracteres de largo","string.alphanum":"{{#label}}: debe contener solo letras y números","string.token":"{{#label}}: debe contener solo letras, números y guines bajos","string.regex.base":'{{#label}}: el valor "{{!value}}" no coincide con el pattern requerido: {{pattern}}',"string.regex.name":'{{#label}}: el valor "{{!value}}" no coincide con el nombre de pattern {{name}}',"string.email":"{{#label}}: debe ser un email válido","string.uri":"{{#label}}: debe sre una uri válida","string.uriCustomScheme":"{{#label}}: debe ser una uri válida con el esquema concidiente con el patrón {{scheme}}","string.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601 válida","string.guid":"{{#label}}: debe ser un GUID valido","string.hex":"{{#label}}: debe contener solo caracteres hexadecimales","string.hostname":"{{#label}}: deber ser un hostname válido","string.lowercase":"{{#label}}: solo debe contener minúsculas","string.uppercase":"{{#label}}: solo debe contener mayúsculas","string.trim":"{{#label}}: no debe tener espacios en blanco delante o atrás","string.creditCard":"{{#label}}: debe ser una tarjeta de crédito","string.ref":'Referencia "{{ref}}" que no es un número',"string.ip":"{{#label}}: debe ser una dirección ip válida con un CDIR {{cidr}}","string.ipVersion":"{{#label}}: debe ser una dirección ip válida de una de las siguientes versiones {{version}} con un CDIR {{cidr}}","object.unknown":"{{#label}}: es un campo no es permitido","luxon.lt":"{{#label}}: must be before {{#date}}","luxon.gt":"{{#label}}: must be after {{#date}}","luxon.lte":"{{#label}}: must be same as or before {{#date}}","luxon.gte":"{{#label}}: must be same as or after {{#date}}"},Vi=[{code:"en",name:"English",flag:()=>i.jsx("span",{className:"fi fi-gb"})},{code:"es",name:"Español",flag:()=>i.jsx("span",{className:"fi fi-es"})}],Ww=()=>{var R,N,b,E;const{t:n,i18n:o}=rs(),[r,a]=T.useState(o.language),l=zt(),{toast:c}=_n();T.useEffect(()=>{const C=navigator.language.split("-")[0],L=Vi.find(I=>I.code===C);L&&d(L.code)},[]);const d=C=>{o.changeLanguage(C),a(C)},{mutate:h,status:p}=R0({onSuccess:C=>{const{success:L,error:I}=C;!L&&I&&x.setError("root",I),L&&l("/quotes",{replace:!0})},onError:C=>{const{message:L}=C;c({description:L,title:"Error"}),console.log(C)}}),x=is({mode:"onBlur",defaultValues:{email:"",password:""},resolver:Lc(In.object({email:In.string().email({tlds:{allow:!1}}).required(),password:In.string().min(4).alphanum().required()}),{messages:Od})}),v=async C=>{h({email:C.email,password:C.password},{})};return i.jsxs(X_,{variant:"full",className:"p-0 lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px] h-screen ",children:[i.jsx("div",{className:"flex items-center justify-center py-12 ",children:i.jsxs("div",{className:"mx-auto grid w-[650px] gap-6 relative ",children:[i.jsx("div",{className:"absolute flex space-x-2 top-4 right-4 ",children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{variant:"outline",className:"w-[140px] justify-start",children:[i.jsx("span",{className:"mr-2",children:(R=Vi.find(C=>C.code===r))==null?void 0:R.flag()}),(N=Vi.find(C=>C.code===r))==null?void 0:N.name,i.jsx(Tc,{className:"w-4 h-4 ml-auto opacity-50"})]})}),i.jsx(Xi,{className:"w-[140px]",children:Vi.map(C=>i.jsxs(Or,{onSelect:()=>d(C.code),children:[i.jsx("span",{className:"mr-2",children:C.flag()}),C.name]},C.code))})]})}),i.jsxs(Te,{className:"px-12 py-6 bg-muted/50",children:[i.jsxs(ct,{children:[i.jsx(Z_,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),i.jsx(Ve,{children:i.jsx(se,{i18nKey:"login_page.title"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"login_page.description"})})]}),i.jsx(Oe,{children:i.jsx(ss,{...x,children:i.jsx("form",{onSubmit:x.handleSubmit(v),children:i.jsxs("div",{className:"grid items-start gap-6",children:[i.jsx("div",{className:"grid gap-6",children:i.jsx(mn,{required:!0,disabled:p==="pending",name:"email",label:n("login_page.email_label"),type:"email",placeholder:n("login_page.email_placeholder")})}),i.jsxs("div",{className:"grid gap-6",children:[i.jsx(mn,{required:!0,disabled:p==="pending",name:"password",label:n("login_page.password_label"),type:"password"}),i.jsxs("div",{className:"mb-4 -mt-2 text-sm",children:[i.jsx(se,{i18nKey:"login_page.forgotten_password"}),i.jsx("br",{}),i.jsx(gc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{i18nKey:"login_page.contact_us"})})]})]}),((b=x.formState.errors.root)==null?void 0:b.message)&&i.jsxs(Oc,{variant:"destructive",children:[i.jsx(ud,{className:"w-4 h-4"}),i.jsx(Pc,{children:i.jsx(se,{i18nKey:"common.error"})}),i.jsx(kc,{children:(E=x.formState.errors.root)==null?void 0:E.message})]}),i.jsx(Td,{className:"w-full",disabled:p==="pending"}),i.jsxs("div",{className:"mt-4 text-sm text-center",children:[i.jsx(se,{i18nKey:"login_page.become_dealer"}),i.jsx("br",{}),i.jsx(gc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{i18nKey:"login_page.contact_us"})}),i.jsx("br",{}),i.jsxs("p",{className:"mx-auto mt-4 -mb-6 text-xs text-muted-foreground/50",children:["v.","1.1.8"]})]})]})})})})]}),i.jsx("img",{className:"block w-11/12 mx-auto aspect-auto",src:"/img/uecko-footer_logos.jpg"})]})}),i.jsx("div",{className:"hidden bg-muted lg:block",children:i.jsx("img",{src:"/img/nara2.jpg",alt:"Image",width:"1920",height:"1080",className:"h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"})})]})},ow=n=>{const{onSuccess:o,onError:r,...a}=n||{},l=Jt(),c=Mn(),{logout:d}=Ec(),h=zt(),{toast:p}=_n();return en({mutationKey:c().auth().action("logout").get(),mutationFn:d,onSuccess:async(x,v,R)=>{l.clear();const{success:N,redirectTo:b}=x;N&&b&&h(b||"/"),o&&o(x,v,R)},onError:(x,v,R)=>{const{message:N}=x;p({title:"Error",description:N,variant:"destructive"}),r&&r(x,v,R)},...a})},Yw=()=>{const{mutate:n}=ow({});return T.useEffect(()=>n(),[n]),i.jsx(Ln,{})},lw=T.createContext(null),uw=({children:n})=>{const[o,r]=qc();return i.jsx(lw.Provider,{value:{pagination:o,setPagination:r},children:n})},Qw=({children:n})=>i.jsx(as,{children:i.jsx(uw,{children:i.jsxs(zr,{className:"catalog-layout",children:[i.jsx(Vr,{}),i.jsx(Br,{children:n})]})})}),Pd=n=>{const o=$r(),r=Mn(),{pagination:a,searchTerm:l=[],enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("catalog").action("list").params(n).get(),queryFn:()=>o.getList({resource:"catalog",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})};function kd({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=Fn.useRef(null),[x,v]=Fn.useState(""),R=Fn.useCallback(E=>{E.key==="Enter"&&x.trim()&&(E.preventDefault(),d(C=>[...C,x.trim()]),v("")),E.key==="Backspace"&&!x&&l.length>0&&(E.preventDefault(),d(C=>C.slice(0,-1)))},[l,x]),N=Fn.useCallback(E=>{d(C=>C.filter(L=>L!==E))},[]),b=Fn.useCallback(()=>{var E;x.trim()&&(d(C=>[...C,x.trim()]),v(""),(E=p.current)==null||E.focus())},[x]);return i.jsx(J_,{children:i.jsxs("div",{className:"w-full space-y-2",...a,children:[i.jsxs("div",{className:ge("relative flex items-center flex-1 p-2 space-x-2 border rounded-md",c?"border-primary":"border-input"),children:[i.jsx($c,{className:ge("w-4 h-4 text-gray-500")}),i.jsxs("div",{className:"flex flex-wrap items-center flex-1 gap-2",children:[l&&l.map(E=>i.jsxs(oo,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[E,i.jsxs(U,{variant:"ghost",onClick:()=>N(E),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Wa,{className:"w-4 h-4"})}),i.jsx(Ye,{children:i.jsx("p",{children:w("catalog.filter.badget_remove_tooltip")})})]}),i.jsx("span",{className:"sr-only",children:w("catalog.filter.badget_remove_tooltip")})]})]},E)),i.jsxs("div",{className:"flex-1 flex items-center min-w-[300px]",children:[i.jsx("input",{ref:p,value:x,onChange:E=>v(E.target.value),onKeyDown:R,placeholder:w("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),i.jsxs(nr,{children:[c&&i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[i.jsx(Wa,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})}),i.jsx(Ye,{children:i.jsx("p",{children:w("common.filter.reset_filter")})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"default",size:"icon",disabled:!x,onClick:b,className:"w-8 h-8 p-0 transition-all",children:[i.jsx(yo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.filter.button_add_term")})]})}),i.jsx(Ye,{children:i.jsx("p",{children:w("common.filter.button_add_term_tooltip")})})]})]})]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:w("common.filter.help_text")})]})})}const cw=()=>{const n=zt(),{pagination:o,globalFilter:r,isFiltered:a}=Tn(),{data:l,isPending:c,isError:d,error:h}=Pd({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=T.useMemo(()=>[{id:"id",accessorKey:"id"},{id:"id_article",accessorKey:"id_article"},{id:"catalog_name",accessorKey:"catalog_name"},{id:"description",accessorKey:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})},{id:"points",accessorKey:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:v})=>i.jsx("div",{className:"text-right",children:v()})},{id:"retail_price",accessorKey:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:v})=>{const R=Lt.create(v.original.retail_price).object;return i.jsx("div",{className:"text-right",children:R.toFormat()})}}],[]),{table:x}=fs({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1,initialState:{columnVisibility:{id:!1,id_article:!1,catalog_name:!1}}});return d?i.jsx(cr,{subtitle:h.message}):c?i.jsx(Te,{children:i.jsx(Oe,{children:i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ds,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(us,{table:x,paginationOptions:{visible:!0},children:i.jsx(kd,{table:x})})},Xw=()=>i.jsxs(rr,{children:[i.jsx("div",{className:"flex items-center justify-between space-y-2",children:i.jsx("div",{children:i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(se,{i18nKey:"catalog.list.title"})})})}),i.jsx(cw,{})]}),Zw=()=>{const{data:n,status:o}=e0();return i.jsxs(zr,{children:[i.jsx(Vr,{}),i.jsx(Br,{children:o==="success"?i.jsx("div",{className:"flex items-center",children:i.jsx("h1",{className:"text-lg font-semibold md:text-2xl",children:`${w("dashboard.welcome")}, ${n==null?void 0:n.name}`})}):i.jsx(ut,{className:"w-[100px] h-[20px] rounded-full"})})]})},Jw=({children:n})=>i.jsx(as,{children:i.jsxs(zr,{className:"dealers-layout",children:[i.jsx(Vr,{}),i.jsx(Br,{children:n})]})});function dw({table:n}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[i.jsx($0,{className:"w-4 h-4 mr-2"}),"Columnas"]})}),i.jsxs(Xi,{align:"end",className:"w-[150px]",children:[i.jsx(Dc,{children:"Columnas"}),i.jsx(lo,{}),n.getAllColumns().filter(o=>typeof o.accessorFn<"u"&&o.getCanHide()).map(o=>i.jsx(t0,{className:"capitalize",checked:o.getIsVisible(),onCheckedChange:r=>o.toggleVisibility(!!r),children:i.jsx(i.Fragment,{children:o.columnDef.header})},o.id))]})]})}function qd({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=x=>{const v=String(x.target.value);v===""?h():d([v])};return i.jsxs("div",{className:ge("flex w-full items-center justify-between space-x-2 overflow-auto p-1",o),...a,children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[i.jsx($c,{className:"w-4 h-4 text-gray-500"}),i.jsx(ns,{placeholder:w("common.filter.input_placeholder"),value:l,onChange:p,className:ge("h-8 w-full transition-all")},"global-filter"),c&&i.jsxs(U,{variant:"outline",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3",children:[i.jsx(Wa,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[r,n.options.enableHiding&&i.jsx(dw,{table:n})]})]})}const fw=n=>{const o=$r(),r=Mn(),{pagination:a,searchTerm:l=void 0,enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("dealer").action("list").params(n).get(),queryFn:()=>o.getList({resource:"dealers",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})},gw=()=>{const n=zt(),{pagination:o,globalFilter:r,isFiltered:a}=Tn(),{data:l,isPending:c,isError:d,error:h}=fw({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=T.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:x}=fs({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1});return d?i.jsx(cr,{subtitle:h.message}):c?i.jsx(Te,{children:i.jsx(Oe,{children:i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ds,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(i.Fragment,{children:i.jsx(us,{table:x,paginationOptions:{visible:!0},children:i.jsx(qd,{table:x})})})},eS=()=>i.jsx(rr,{children:i.jsx(gw,{})}),tS=()=>i.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"max-w-md mx-auto text-center",children:[i.jsx("div",{className:"w-12 h-12 mx-auto text-primary"}),i.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Oops, page not found!"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),i.jsx("div",{className:"mt-6",children:i.jsx(U,{className:"inline-flex items-center px-4 py-2 text-sm font-medium transition-colors rounded-md shadow-sm bg-primary text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:"Go to Homepage"})})]})}),$d=T.createContext({attributes:{role:"button",tabIndex:0,"aria-disabled":!1,"aria-pressed":void 0,"aria-roledescription":"sortable","aria-describedby":""},listeners:void 0,ref(){},isDragging:!1});function mw(n){return n.isSorting||n.wasDragging?r0(n):!0}function hw({id:n,children:o,isActive:r=!1,onActivate:a}){const{attributes:l,isDragging:c,listeners:d,setNodeRef:h,setActivatorNodeRef:p,transform:x,transition:v}=n0({animateLayoutChanges:mw,id:n}),R={transform:Ya.Translate.toString(x),transition:v},N=T.useMemo(()=>({attributes:l,listeners:d,ref:p,isDragging:c}),[l,c,d,p]);return i.jsx($d.Provider,{value:N,children:i.jsx(pn,{id:String(n),className:ge(c?"opacity-60":"opacity-100",r?"border border-destructive/30 border-b-0 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5 focus-within:bg-destructive/5":"hover:bg-muted hover:focus-within:bg-accent focus-within:bg-accent","m-0"),ref:h,style:R,onClick:a,onFocusCapture:a,children:o},n)})}const pw=({className:n})=>{const{attributes:o,isDragging:r,listeners:a,ref:l}=T.useContext($d);return i.jsxs(U,{ref:l,onClick:c=>{c.preventDefault()},size:"icon",variant:"link",className:ge(r?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",n),...o,...a,children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.move_row")})]})};function xw(n,o={}){const{enableDragHandleColumn:r=!1,enableSelectionColumn:a=!1,enableActionsColumn:l=!1,rowActionFn:c=void 0}=o;return T.useMemo(()=>(r&&n.unshift({id:"row_drag_handle",header:()=>null,cell:()=>i.jsx(pw,{}),enableSorting:!1,enableHiding:!1,size:40}),a&&n.unshift({id:"select",header:({table:d})=>i.jsx(Ui,{id:"select-all",checked:d.getIsAllPageRowsSelected()||d.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:h=>d.toggleAllPageRowsSelected(!!h),"aria-label":"Seleccionar todo",className:"translate-y-[0px]"}),cell:({row:d})=>i.jsx(Ui,{id:`select-row-${d.id}`,checked:d.getIsSelected(),disabled:!d.getCanSelect(),onCheckedChange:d.getToggleSelectedHandler(),"aria-label":"Seleccionar fila",className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),l&&n.push({id:"row_actions",cell:d=>i.jsx(Xb,{rowContext:d,actions:c}),enableSorting:!1,enableHiding:!1,size:48}),n),[l,r,a])}var zd={exports:{}};(function(n,o){(function(r,a,l){n.exports=l(),n.exports.default=l()})("slugify",Zn,function(){var r=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),a=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function l(c,d){if(typeof c!="string")throw new Error("slugify: string argument expected");d=typeof d=="string"?{replacement:d}:d||{};var h=a[d.locale]||{},p=d.replacement===void 0?"-":d.replacement,x=d.trim===void 0?!0:d.trim,v=c.normalize().split("").reduce(function(R,N){var b=h[N];return b===void 0&&(b=r[N]),b===void 0&&(b=N),b===p&&(b=" "),R+b.replace(d.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return d.strict&&(v=v.replace(/[^A-Za-z0-9\s]/g,"")),x&&(v=v.trim()),v=v.replace(/\s+/g,p),d.lower&&(v=v.toLowerCase()),v}return l.extend=function(c){Object.assign(r,c)},l})})(zd);var vw=zd.exports;const _w=i0(vw),Ur=()=>{const n=$r(),o=Mn(),r=T.useCallback(c=>`${n.getApiUrl()}/quotes/${c}/report`,[n]),a=T.useCallback(c=>`quote-${_w(c.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),l={useList:c=>{const d=$r(),h=Mn(),{pagination:p,status:x="draft",quickSearchTerm:v=void 0,enabled:R=!0,queryOptions:N}=c;return No({queryKey:h().data().resource("quotes").action("list").params(c).get(),queryFn:()=>d.getList({resource:"quotes",quickSearchTerm:v,filters:x!=="all"?[{field:"status",operator:"eq",value:x}]:[{field:"status",operator:"ne",value:"archived"}],pagination:p}),enabled:R,queryOptions:N})},useCreate:()=>{const c=Jt();return J0({mutationFn:d=>{const{date:h}=d,p=dn.generateNewID().object.toString();return n.createOne({resource:"quotes",data:{...d,date:new Date(h).toISOString().slice(0,10),status:"draft",id:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:c=>{const d=Jt();return en({mutationKey:o().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>n.updateOne({resource:"quotes",id:c,data:h}),onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h,newStatus:p}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/setStatus`,method:"put",data:{newStatus:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/duplicate`,method:"post"})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:c=>{const d=Jt();return en({mutationKey:o().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>{const{sent_date:p}=h;return n.custom({url:`${n.getApiUrl()}/quotes/${c}/send`,method:"put",data:{sent_date:p}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(c,d)=>vd({queryKey:o().data().resource("quotes").action("one").id(c).params().get(),queryFn:()=>n.getOne({resource:"quotes",id:String(c)}),enabled:!!c,...d}),getQuotePDFDownloadURL:r,getQuotePDFFilename:a,useReport:()=>{const c=n.getApiAuthorization(),[d,h]=T.useState(void 0),{download:p,...x}=yc({headers:{Authorization:c},customHandleDownload:T.useCallback(R=>{const N=[R],b=new Blob(N,{type:"application/octet-stream"});return h(b),!0},[h])}),v=T.useCallback(R=>p(l.getQuotePDFDownloadURL(R),""),[p]);return{...x,preview:v,report:d}},useDownloader:()=>{const c=n.getApiAuthorization(),d=yc({headers:{Authorization:c}});return{...d,download:(p,x)=>{const v=l.getQuotePDFDownloadURL(p);return d.download(v,x)}}}};return l},nS=()=>{const n=zt(),{toast:o}=_n(),{useCreate:r}=Ur(),{mutate:a,isPending:l}=r(),c=T.useMemo(()=>({date:new Date(Date.now()).toUTCString(),customer_reference:"",customer_information:""}),[]),d=is({mode:"onBlur",defaultValues:c,resolver:Lc(In.object({customer_reference:In.string(),date:In.date().required(),customer_information:In.string().required()}),{messages:{es:Od}})}),{formState:h,reset:p,getValues:x,handleSubmit:v}=d,{isSubmitting:R,isDirty:N}=h;Io({isDirty:N});const b=async E=>{try{a(E,{onError:C=>{console.debug(C),o({title:"Error",description:C.message,variant:"destructive"})},onSuccess:C=>{p(x()),o({title:"Cotización creada",variant:"default"}),n(`/quotes/edit/${C.id}`,{relative:"path"})}})}finally{}};return R?i.jsx(Ln,{title:"Guardando ajustes"}):l?i.jsx(Ln,{}):i.jsx(ss,{...d,children:i.jsx("form",{onSubmit:v(b),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(zc,{}),i.jsx("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:w("quotes.create.title")})]}),i.jsx("div",{className:"grid w-6/12 gap-6 mx-auto",children:i.jsxs(Qa,{className:"md:col-span-4",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),footerActions:i.jsxs("div",{className:"flex items-stretch justify-between flex-1",children:[i.jsx(U,{size:"sm",variant:"outline",onClick:()=>n("/quotes"),children:w("common.discard")}),i.jsx(wo,{size:"sm",label:w("common.continue")})]}),children:[i.jsx(mn,{required:!0,name:"customer_reference",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),placeholder:w("quotes.form_fields.customer_reference.placeholder")}),i.jsx(Vc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(hn,{}),i.jsx(qt,{rows:4,className:"row-span-2",name:"customer_information",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),placeholder:w("quotes.form_fields.customer_information.placeholder")})]})})]})})})},Ka=(n,o=!1)=>{const{discount:r,tax:a,subtotal_price:l}=n||{},c=$t.create(r||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=$t.create(a||{amount:null,scale:2});if(h.isFailure)throw h.error;const p=h.object,x=Lt.create(l||{amount:null,scale:2});if(x.isFailure)throw x.error;const v=o?bw(n.items).convertScale(2):x.object,R=v.percentage(d.toNumber()).convertScale(2),N=v.subtract(R).convertScale(2),b=N.percentage(p.toNumber()).convertScale(2),E=N.add(b).convertScale(2);return{subtotal_price:v,discount:n.discount,discount_price:R,before_tax_price:N,tax:p,tax_price:b,total_price:E}},bw=n=>{let o=Lt.create({amount:0,scale:2}).object;return n&&n.map(r=>{const a=io(r);o=o.add(a.total_price)}),o},io=n=>{const{quantity:o,unit_price:r,discount:a}=n||{};if((!o||o&&o.amount===null)&&(!r||r&&r.amount===null)&&(!a||a&&a.amount===null))return{quantity:xn.create({amount:null,scale:0}).object,unit_price:Lt.create({amount:null,scale:2}).object,subtotal_price:Lt.create({amount:null,scale:2}).object,discount:$t.create({amount:null,scale:2}).object,total_price:Lt.create({amount:null,scale:2}).object};const l=xn.create(o);if(l.isFailure)throw l.error;const c=l.object,d=Lt.create(r);if(d.isFailure)throw d.error;const h=d.object,p=$t.create(a);if(p.isFailure)throw p.error;const x=p.object,v=h.multiply(c.toNumber()),R=v.subtract(v.percentage(x.toNumber()));return{quantity:c,unit_price:h,subtotal_price:v,discount:x,total_price:R}},ww=()=>{const{id:n}=s0();return n};var Ki={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/Ki.exports;(function(n,o){(function(){var r,a="4.17.21",l=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",h="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",x=500,v="__lodash_placeholder__",R=1,N=2,b=4,E=1,C=2,L=1,I=2,q=4,$=8,te=16,O=32,k=64,K=128,ne=256,B=512,me=30,_e="...",W=800,Re=16,Je=1,Y=2,je=3,De=1/0,G=9007199254740991,be=17976931348623157e292,et=NaN,it=4294967295,bn=it-1,Hd=it>>>1,Kd=[["ary",K],["bind",L],["bindKey",I],["curry",$],["curryRight",te],["flip",B],["partial",O],["partialRight",k],["rearg",ne]],On="[object Arguments]",Gr="[object Array]",Wd="[object AsyncFunction]",fr="[object Boolean]",gr="[object Date]",Yd="[object DOMException]",Hr="[object Error]",Kr="[object Function]",To="[object GeneratorFunction]",Et="[object Map]",mr="[object Number]",Qd="[object Null]",Vt="[object Object]",Oo="[object Promise]",Xd="[object Proxy]",hr="[object RegExp]",At="[object Set]",pr="[object String]",Wr="[object Symbol]",Zd="[object Undefined]",xr="[object WeakMap]",Jd="[object WeakSet]",vr="[object ArrayBuffer]",Pn="[object DataView]",gs="[object Float32Array]",ms="[object Float64Array]",hs="[object Int8Array]",ps="[object Int16Array]",xs="[object Int32Array]",vs="[object Uint8Array]",_s="[object Uint8ClampedArray]",bs="[object Uint16Array]",ws="[object Uint32Array]",ef=/\b__p \+= '';/g,tf=/\b(__p \+=) '' \+/g,nf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Po=/&(?:amp|lt|gt|quot|#39);/g,ko=/[&<>"']/g,rf=RegExp(Po.source),sf=RegExp(ko.source),af=/<%-([\s\S]+?)%>/g,of=/<%([\s\S]+?)%>/g,qo=/<%=([\s\S]+?)%>/g,lf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uf=/^\w*$/,cf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ss=/[\\^$.*+?()[\]{}|]/g,df=RegExp(Ss.source),js=/^\s+/,ff=/\s/,gf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mf=/\{\n\/\* \[wrapped with (.+)\] \*/,hf=/,? & /,pf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xf=/[()=,{}\[\]\/\s]/,vf=/\\(\\)?/g,_f=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$o=/\w*$/,bf=/^[-+]0x[0-9a-f]+$/i,wf=/^0b[01]+$/i,Sf=/^\[object .+?Constructor\]$/,jf=/^0o[0-7]+$/i,Cf=/^(?:0|[1-9]\d*)$/,yf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yr=/($^)/,Nf=/['\n\r\u2028\u2029\\]/g,Qr="\\ud800-\\udfff",Rf="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",Af="\\u20d0-\\u20ff",zo=Rf+Ef+Af,Vo="\\u2700-\\u27bf",Bo="a-z\\xdf-\\xf6\\xf8-\\xff",Ff="\\xac\\xb1\\xd7\\xf7",If="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Df="\\u2000-\\u206f",Mf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Uo="A-Z\\xc0-\\xd6\\xd8-\\xde",Go="\\ufe0e\\ufe0f",Ho=Ff+If+Df+Mf,Cs="['’]",Lf="["+Qr+"]",Ko="["+Ho+"]",Xr="["+zo+"]",Wo="\\d+",Tf="["+Vo+"]",Yo="["+Bo+"]",Qo="[^"+Qr+Ho+Wo+Vo+Bo+Uo+"]",ys="\\ud83c[\\udffb-\\udfff]",Of="(?:"+Xr+"|"+ys+")",Xo="[^"+Qr+"]",Ns="(?:\\ud83c[\\udde6-\\uddff]){2}",Rs="[\\ud800-\\udbff][\\udc00-\\udfff]",kn="["+Uo+"]",Zo="\\u200d",Jo="(?:"+Yo+"|"+Qo+")",Pf="(?:"+kn+"|"+Qo+")",el="(?:"+Cs+"(?:d|ll|m|re|s|t|ve))?",tl="(?:"+Cs+"(?:D|LL|M|RE|S|T|VE))?",nl=Of+"?",rl="["+Go+"]?",kf="(?:"+Zo+"(?:"+[Xo,Ns,Rs].join("|")+")"+rl+nl+")*",qf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$f="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",il=rl+nl+kf,zf="(?:"+[Tf,Ns,Rs].join("|")+")"+il,Vf="(?:"+[Xo+Xr+"?",Xr,Ns,Rs,Lf].join("|")+")",Bf=RegExp(Cs,"g"),Uf=RegExp(Xr,"g"),Es=RegExp(ys+"(?="+ys+")|"+Vf+il,"g"),Gf=RegExp([kn+"?"+Yo+"+"+el+"(?="+[Ko,kn,"$"].join("|")+")",Pf+"+"+tl+"(?="+[Ko,kn+Jo,"$"].join("|")+")",kn+"?"+Jo+"+"+el,kn+"+"+tl,$f,qf,Wo,zf].join("|"),"g"),Hf=RegExp("["+Zo+Qr+zo+Go+"]"),Kf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yf=-1,ye={};ye[gs]=ye[ms]=ye[hs]=ye[ps]=ye[xs]=ye[vs]=ye[_s]=ye[bs]=ye[ws]=!0,ye[On]=ye[Gr]=ye[vr]=ye[fr]=ye[Pn]=ye[gr]=ye[Hr]=ye[Kr]=ye[Et]=ye[mr]=ye[Vt]=ye[hr]=ye[At]=ye[pr]=ye[xr]=!1;var Ce={};Ce[On]=Ce[Gr]=Ce[vr]=Ce[Pn]=Ce[fr]=Ce[gr]=Ce[gs]=Ce[ms]=Ce[hs]=Ce[ps]=Ce[xs]=Ce[Et]=Ce[mr]=Ce[Vt]=Ce[hr]=Ce[At]=Ce[pr]=Ce[Wr]=Ce[vs]=Ce[_s]=Ce[bs]=Ce[ws]=!0,Ce[Hr]=Ce[Kr]=Ce[xr]=!1;var Qf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Xf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Jf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eg=parseFloat,tg=parseInt,sl=typeof Zn=="object"&&Zn&&Zn.Object===Object&&Zn,ng=typeof self=="object"&&self&&self.Object===Object&&self,Be=sl||ng||Function("return this")(),As=o&&!o.nodeType&&o,wn=As&&!0&&n&&!n.nodeType&&n,al=wn&&wn.exports===As,Fs=al&&sl.process,vt=function(){try{var j=wn&&wn.require&&wn.require("util").types;return j||Fs&&Fs.binding&&Fs.binding("util")}catch{}}(),ol=vt&&vt.isArrayBuffer,ll=vt&&vt.isDate,ul=vt&&vt.isMap,cl=vt&&vt.isRegExp,dl=vt&&vt.isSet,fl=vt&&vt.isTypedArray;function dt(j,F,A){switch(A.length){case 0:return j.call(F);case 1:return j.call(F,A[0]);case 2:return j.call(F,A[0],A[1]);case 3:return j.call(F,A[0],A[1],A[2])}return j.apply(F,A)}function rg(j,F,A,V){for(var re=-1,fe=j==null?0:j.length;++re<fe;){var qe=j[re];F(V,qe,A(qe),j)}return V}function _t(j,F){for(var A=-1,V=j==null?0:j.length;++A<V&&F(j[A],A,j)!==!1;);return j}function ig(j,F){for(var A=j==null?0:j.length;A--&&F(j[A],A,j)!==!1;);return j}function gl(j,F){for(var A=-1,V=j==null?0:j.length;++A<V;)if(!F(j[A],A,j))return!1;return!0}function tn(j,F){for(var A=-1,V=j==null?0:j.length,re=0,fe=[];++A<V;){var qe=j[A];F(qe,A,j)&&(fe[re++]=qe)}return fe}function Zr(j,F){var A=j==null?0:j.length;return!!A&&qn(j,F,0)>-1}function Is(j,F,A){for(var V=-1,re=j==null?0:j.length;++V<re;)if(A(F,j[V]))return!0;return!1}function Ee(j,F){for(var A=-1,V=j==null?0:j.length,re=Array(V);++A<V;)re[A]=F(j[A],A,j);return re}function nn(j,F){for(var A=-1,V=F.length,re=j.length;++A<V;)j[re+A]=F[A];return j}function Ds(j,F,A,V){var re=-1,fe=j==null?0:j.length;for(V&&fe&&(A=j[++re]);++re<fe;)A=F(A,j[re],re,j);return A}function sg(j,F,A,V){var re=j==null?0:j.length;for(V&&re&&(A=j[--re]);re--;)A=F(A,j[re],re,j);return A}function Ms(j,F){for(var A=-1,V=j==null?0:j.length;++A<V;)if(F(j[A],A,j))return!0;return!1}var ag=Ls("length");function og(j){return j.split("")}function lg(j){return j.match(pf)||[]}function ml(j,F,A){var V;return A(j,function(re,fe,qe){if(F(re,fe,qe))return V=fe,!1}),V}function Jr(j,F,A,V){for(var re=j.length,fe=A+(V?1:-1);V?fe--:++fe<re;)if(F(j[fe],fe,j))return fe;return-1}function qn(j,F,A){return F===F?bg(j,F,A):Jr(j,hl,A)}function ug(j,F,A,V){for(var re=A-1,fe=j.length;++re<fe;)if(V(j[re],F))return re;return-1}function hl(j){return j!==j}function pl(j,F){var A=j==null?0:j.length;return A?Os(j,F)/A:et}function Ls(j){return function(F){return F==null?r:F[j]}}function Ts(j){return function(F){return j==null?r:j[F]}}function xl(j,F,A,V,re){return re(j,function(fe,qe,we){A=V?(V=!1,fe):F(A,fe,qe,we)}),A}function cg(j,F){var A=j.length;for(j.sort(F);A--;)j[A]=j[A].value;return j}function Os(j,F){for(var A,V=-1,re=j.length;++V<re;){var fe=F(j[V]);fe!==r&&(A=A===r?fe:A+fe)}return A}function Ps(j,F){for(var A=-1,V=Array(j);++A<j;)V[A]=F(A);return V}function dg(j,F){return Ee(F,function(A){return[A,j[A]]})}function vl(j){return j&&j.slice(0,Sl(j)+1).replace(js,"")}function ft(j){return function(F){return j(F)}}function ks(j,F){return Ee(F,function(A){return j[A]})}function _r(j,F){return j.has(F)}function _l(j,F){for(var A=-1,V=j.length;++A<V&&qn(F,j[A],0)>-1;);return A}function bl(j,F){for(var A=j.length;A--&&qn(F,j[A],0)>-1;);return A}function fg(j,F){for(var A=j.length,V=0;A--;)j[A]===F&&++V;return V}var gg=Ts(Qf),mg=Ts(Xf);function hg(j){return"\\"+Jf[j]}function pg(j,F){return j==null?r:j[F]}function $n(j){return Hf.test(j)}function xg(j){return Kf.test(j)}function vg(j){for(var F,A=[];!(F=j.next()).done;)A.push(F.value);return A}function qs(j){var F=-1,A=Array(j.size);return j.forEach(function(V,re){A[++F]=[re,V]}),A}function wl(j,F){return function(A){return j(F(A))}}function rn(j,F){for(var A=-1,V=j.length,re=0,fe=[];++A<V;){var qe=j[A];(qe===F||qe===v)&&(j[A]=v,fe[re++]=A)}return fe}function ei(j){var F=-1,A=Array(j.size);return j.forEach(function(V){A[++F]=V}),A}function _g(j){var F=-1,A=Array(j.size);return j.forEach(function(V){A[++F]=[V,V]}),A}function bg(j,F,A){for(var V=A-1,re=j.length;++V<re;)if(j[V]===F)return V;return-1}function wg(j,F,A){for(var V=A+1;V--;)if(j[V]===F)return V;return V}function zn(j){return $n(j)?jg(j):ag(j)}function Ft(j){return $n(j)?Cg(j):og(j)}function Sl(j){for(var F=j.length;F--&&ff.test(j.charAt(F)););return F}var Sg=Ts(Zf);function jg(j){for(var F=Es.lastIndex=0;Es.test(j);)++F;return F}function Cg(j){return j.match(Es)||[]}function yg(j){return j.match(Gf)||[]}var Ng=function j(F){F=F==null?Be:Vn.defaults(Be.Object(),F,Vn.pick(Be,Wf));var A=F.Array,V=F.Date,re=F.Error,fe=F.Function,qe=F.Math,we=F.Object,$s=F.RegExp,Rg=F.String,bt=F.TypeError,ti=A.prototype,Eg=fe.prototype,Bn=we.prototype,ni=F["__core-js_shared__"],ri=Eg.toString,pe=Bn.hasOwnProperty,Ag=0,jl=function(){var e=/[^.]+$/.exec(ni&&ni.keys&&ni.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ii=Bn.toString,Fg=ri.call(we),Ig=Be._,Dg=$s("^"+ri.call(pe).replace(Ss,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),si=al?F.Buffer:r,sn=F.Symbol,ai=F.Uint8Array,Cl=si?si.allocUnsafe:r,oi=wl(we.getPrototypeOf,we),yl=we.create,Nl=Bn.propertyIsEnumerable,li=ti.splice,Rl=sn?sn.isConcatSpreadable:r,br=sn?sn.iterator:r,Sn=sn?sn.toStringTag:r,ui=function(){try{var e=Rn(we,"defineProperty");return e({},"",{}),e}catch{}}(),Mg=F.clearTimeout!==Be.clearTimeout&&F.clearTimeout,Lg=V&&V.now!==Be.Date.now&&V.now,Tg=F.setTimeout!==Be.setTimeout&&F.setTimeout,ci=qe.ceil,di=qe.floor,zs=we.getOwnPropertySymbols,Og=si?si.isBuffer:r,El=F.isFinite,Pg=ti.join,kg=wl(we.keys,we),$e=qe.max,Qe=qe.min,qg=V.now,$g=F.parseInt,Al=qe.random,zg=ti.reverse,Vs=Rn(F,"DataView"),wr=Rn(F,"Map"),Bs=Rn(F,"Promise"),Un=Rn(F,"Set"),Sr=Rn(F,"WeakMap"),jr=Rn(we,"create"),fi=Sr&&new Sr,Gn={},Vg=En(Vs),Bg=En(wr),Ug=En(Bs),Gg=En(Un),Hg=En(Sr),gi=sn?sn.prototype:r,Cr=gi?gi.valueOf:r,Fl=gi?gi.toString:r;function g(e){if(Fe(e)&&!ie(e)&&!(e instanceof ce)){if(e instanceof wt)return e;if(pe.call(e,"__wrapped__"))return Iu(e)}return new wt(e)}var Hn=function(){function e(){}return function(t){if(!Ae(t))return{};if(yl)return yl(t);e.prototype=t;var s=new e;return e.prototype=r,s}}();function mi(){}function wt(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}g.templateSettings={escape:af,evaluate:of,interpolate:qo,variable:"",imports:{_:g}},g.prototype=mi.prototype,g.prototype.constructor=g,wt.prototype=Hn(mi.prototype),wt.prototype.constructor=wt;function ce(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=it,this.__views__=[]}function Kg(){var e=new ce(this.__wrapped__);return e.__actions__=st(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=st(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=st(this.__views__),e}function Wg(){if(this.__filtered__){var e=new ce(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Yg(){var e=this.__wrapped__.value(),t=this.__dir__,s=ie(e),u=t<0,f=s?e.length:0,m=oh(0,f,this.__views__),_=m.start,S=m.end,y=S-_,D=u?S:_-1,M=this.__iteratees__,P=M.length,z=0,H=Qe(y,this.__takeCount__);if(!s||!u&&f==y&&H==y)return eu(e,this.__actions__);var J=[];e:for(;y--&&z<H;){D+=t;for(var oe=-1,ee=e[D];++oe<P;){var ue=M[oe],de=ue.iteratee,ht=ue.type,rt=de(ee);if(ht==Y)ee=rt;else if(!rt){if(ht==Je)continue e;break e}}J[z++]=ee}return J}ce.prototype=Hn(mi.prototype),ce.prototype.constructor=ce;function jn(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var u=e[t];this.set(u[0],u[1])}}function Qg(){this.__data__=jr?jr(null):{},this.size=0}function Xg(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Zg(e){var t=this.__data__;if(jr){var s=t[e];return s===p?r:s}return pe.call(t,e)?t[e]:r}function Jg(e){var t=this.__data__;return jr?t[e]!==r:pe.call(t,e)}function em(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=jr&&t===r?p:t,this}jn.prototype.clear=Qg,jn.prototype.delete=Xg,jn.prototype.get=Zg,jn.prototype.has=Jg,jn.prototype.set=em;function Bt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var u=e[t];this.set(u[0],u[1])}}function tm(){this.__data__=[],this.size=0}function nm(e){var t=this.__data__,s=hi(t,e);if(s<0)return!1;var u=t.length-1;return s==u?t.pop():li.call(t,s,1),--this.size,!0}function rm(e){var t=this.__data__,s=hi(t,e);return s<0?r:t[s][1]}function im(e){return hi(this.__data__,e)>-1}function sm(e,t){var s=this.__data__,u=hi(s,e);return u<0?(++this.size,s.push([e,t])):s[u][1]=t,this}Bt.prototype.clear=tm,Bt.prototype.delete=nm,Bt.prototype.get=rm,Bt.prototype.has=im,Bt.prototype.set=sm;function Ut(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var u=e[t];this.set(u[0],u[1])}}function am(){this.size=0,this.__data__={hash:new jn,map:new(wr||Bt),string:new jn}}function om(e){var t=Ri(this,e).delete(e);return this.size-=t?1:0,t}function lm(e){return Ri(this,e).get(e)}function um(e){return Ri(this,e).has(e)}function cm(e,t){var s=Ri(this,e),u=s.size;return s.set(e,t),this.size+=s.size==u?0:1,this}Ut.prototype.clear=am,Ut.prototype.delete=om,Ut.prototype.get=lm,Ut.prototype.has=um,Ut.prototype.set=cm;function Cn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Ut;++t<s;)this.add(e[t])}function dm(e){return this.__data__.set(e,p),this}function fm(e){return this.__data__.has(e)}Cn.prototype.add=Cn.prototype.push=dm,Cn.prototype.has=fm;function It(e){var t=this.__data__=new Bt(e);this.size=t.size}function gm(){this.__data__=new Bt,this.size=0}function mm(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function hm(e){return this.__data__.get(e)}function pm(e){return this.__data__.has(e)}function xm(e,t){var s=this.__data__;if(s instanceof Bt){var u=s.__data__;if(!wr||u.length<l-1)return u.push([e,t]),this.size=++s.size,this;s=this.__data__=new Ut(u)}return s.set(e,t),this.size=s.size,this}It.prototype.clear=gm,It.prototype.delete=mm,It.prototype.get=hm,It.prototype.has=pm,It.prototype.set=xm;function Il(e,t){var s=ie(e),u=!s&&An(e),f=!s&&!u&&cn(e),m=!s&&!u&&!f&&Qn(e),_=s||u||f||m,S=_?Ps(e.length,Rg):[],y=S.length;for(var D in e)(t||pe.call(e,D))&&!(_&&(D=="length"||f&&(D=="offset"||D=="parent")||m&&(D=="buffer"||D=="byteLength"||D=="byteOffset")||Wt(D,y)))&&S.push(D);return S}function Dl(e){var t=e.length;return t?e[ea(0,t-1)]:r}function vm(e,t){return Ei(st(e),yn(t,0,e.length))}function _m(e){return Ei(st(e))}function Us(e,t,s){(s!==r&&!Dt(e[t],s)||s===r&&!(t in e))&&Gt(e,t,s)}function yr(e,t,s){var u=e[t];(!(pe.call(e,t)&&Dt(u,s))||s===r&&!(t in e))&&Gt(e,t,s)}function hi(e,t){for(var s=e.length;s--;)if(Dt(e[s][0],t))return s;return-1}function bm(e,t,s,u){return an(e,function(f,m,_){t(u,f,s(f),_)}),u}function Ml(e,t){return e&&Pt(t,ze(t),e)}function wm(e,t){return e&&Pt(t,ot(t),e)}function Gt(e,t,s){t=="__proto__"&&ui?ui(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function Gs(e,t){for(var s=-1,u=t.length,f=A(u),m=e==null;++s<u;)f[s]=m?r:ya(e,t[s]);return f}function yn(e,t,s){return e===e&&(s!==r&&(e=e<=s?e:s),t!==r&&(e=e>=t?e:t)),e}function St(e,t,s,u,f,m){var _,S=t&R,y=t&N,D=t&b;if(s&&(_=f?s(e,u,f,m):s(e)),_!==r)return _;if(!Ae(e))return e;var M=ie(e);if(M){if(_=uh(e),!S)return st(e,_)}else{var P=Xe(e),z=P==Kr||P==To;if(cn(e))return ru(e,S);if(P==Vt||P==On||z&&!f){if(_=y||z?{}:Su(e),!S)return y?Zm(e,wm(_,e)):Xm(e,Ml(_,e))}else{if(!Ce[P])return f?e:{};_=ch(e,P,S)}}m||(m=new It);var H=m.get(e);if(H)return H;m.set(e,_),Xu(e)?e.forEach(function(ee){_.add(St(ee,t,s,ee,e,m))}):Yu(e)&&e.forEach(function(ee,ue){_.set(ue,St(ee,t,s,ue,e,m))});var J=D?y?da:ca:y?ot:ze,oe=M?r:J(e);return _t(oe||e,function(ee,ue){oe&&(ue=ee,ee=e[ue]),yr(_,ue,St(ee,t,s,ue,e,m))}),_}function Sm(e){var t=ze(e);return function(s){return Ll(s,e,t)}}function Ll(e,t,s){var u=s.length;if(e==null)return!u;for(e=we(e);u--;){var f=s[u],m=t[f],_=e[f];if(_===r&&!(f in e)||!m(_))return!1}return!0}function Tl(e,t,s){if(typeof e!="function")throw new bt(d);return Dr(function(){e.apply(r,s)},t)}function Nr(e,t,s,u){var f=-1,m=Zr,_=!0,S=e.length,y=[],D=t.length;if(!S)return y;s&&(t=Ee(t,ft(s))),u?(m=Is,_=!1):t.length>=l&&(m=_r,_=!1,t=new Cn(t));e:for(;++f<S;){var M=e[f],P=s==null?M:s(M);if(M=u||M!==0?M:0,_&&P===P){for(var z=D;z--;)if(t[z]===P)continue e;y.push(M)}else m(t,P,u)||y.push(M)}return y}var an=lu(Ot),Ol=lu(Ks,!0);function jm(e,t){var s=!0;return an(e,function(u,f,m){return s=!!t(u,f,m),s}),s}function pi(e,t,s){for(var u=-1,f=e.length;++u<f;){var m=e[u],_=t(m);if(_!=null&&(S===r?_===_&&!mt(_):s(_,S)))var S=_,y=m}return y}function Cm(e,t,s,u){var f=e.length;for(s=ae(s),s<0&&(s=-s>f?0:f+s),u=u===r||u>f?f:ae(u),u<0&&(u+=f),u=s>u?0:Ju(u);s<u;)e[s++]=t;return e}function Pl(e,t){var s=[];return an(e,function(u,f,m){t(u,f,m)&&s.push(u)}),s}function Ue(e,t,s,u,f){var m=-1,_=e.length;for(s||(s=fh),f||(f=[]);++m<_;){var S=e[m];t>0&&s(S)?t>1?Ue(S,t-1,s,u,f):nn(f,S):u||(f[f.length]=S)}return f}var Hs=uu(),kl=uu(!0);function Ot(e,t){return e&&Hs(e,t,ze)}function Ks(e,t){return e&&kl(e,t,ze)}function xi(e,t){return tn(t,function(s){return Yt(e[s])})}function Nn(e,t){t=ln(t,e);for(var s=0,u=t.length;e!=null&&s<u;)e=e[kt(t[s++])];return s&&s==u?e:r}function ql(e,t,s){var u=t(e);return ie(e)?u:nn(u,s(e))}function tt(e){return e==null?e===r?Zd:Qd:Sn&&Sn in we(e)?ah(e):_h(e)}function Ws(e,t){return e>t}function ym(e,t){return e!=null&&pe.call(e,t)}function Nm(e,t){return e!=null&&t in we(e)}function Rm(e,t,s){return e>=Qe(t,s)&&e<$e(t,s)}function Ys(e,t,s){for(var u=s?Is:Zr,f=e[0].length,m=e.length,_=m,S=A(m),y=1/0,D=[];_--;){var M=e[_];_&&t&&(M=Ee(M,ft(t))),y=Qe(M.length,y),S[_]=!s&&(t||f>=120&&M.length>=120)?new Cn(_&&M):r}M=e[0];var P=-1,z=S[0];e:for(;++P<f&&D.length<y;){var H=M[P],J=t?t(H):H;if(H=s||H!==0?H:0,!(z?_r(z,J):u(D,J,s))){for(_=m;--_;){var oe=S[_];if(!(oe?_r(oe,J):u(e[_],J,s)))continue e}z&&z.push(J),D.push(H)}}return D}function Em(e,t,s,u){return Ot(e,function(f,m,_){t(u,s(f),m,_)}),u}function Rr(e,t,s){t=ln(t,e),e=Nu(e,t);var u=e==null?e:e[kt(Ct(t))];return u==null?r:dt(u,e,s)}function $l(e){return Fe(e)&&tt(e)==On}function Am(e){return Fe(e)&&tt(e)==vr}function Fm(e){return Fe(e)&&tt(e)==gr}function Er(e,t,s,u,f){return e===t?!0:e==null||t==null||!Fe(e)&&!Fe(t)?e!==e&&t!==t:Im(e,t,s,u,Er,f)}function Im(e,t,s,u,f,m){var _=ie(e),S=ie(t),y=_?Gr:Xe(e),D=S?Gr:Xe(t);y=y==On?Vt:y,D=D==On?Vt:D;var M=y==Vt,P=D==Vt,z=y==D;if(z&&cn(e)){if(!cn(t))return!1;_=!0,M=!1}if(z&&!M)return m||(m=new It),_||Qn(e)?_u(e,t,s,u,f,m):ih(e,t,y,s,u,f,m);if(!(s&E)){var H=M&&pe.call(e,"__wrapped__"),J=P&&pe.call(t,"__wrapped__");if(H||J){var oe=H?e.value():e,ee=J?t.value():t;return m||(m=new It),f(oe,ee,s,u,m)}}return z?(m||(m=new It),sh(e,t,s,u,f,m)):!1}function Dm(e){return Fe(e)&&Xe(e)==Et}function Qs(e,t,s,u){var f=s.length,m=f,_=!u;if(e==null)return!m;for(e=we(e);f--;){var S=s[f];if(_&&S[2]?S[1]!==e[S[0]]:!(S[0]in e))return!1}for(;++f<m;){S=s[f];var y=S[0],D=e[y],M=S[1];if(_&&S[2]){if(D===r&&!(y in e))return!1}else{var P=new It;if(u)var z=u(D,M,y,e,t,P);if(!(z===r?Er(M,D,E|C,u,P):z))return!1}}return!0}function zl(e){if(!Ae(e)||mh(e))return!1;var t=Yt(e)?Dg:Sf;return t.test(En(e))}function Mm(e){return Fe(e)&&tt(e)==hr}function Lm(e){return Fe(e)&&Xe(e)==At}function Tm(e){return Fe(e)&&Li(e.length)&&!!ye[tt(e)]}function Vl(e){return typeof e=="function"?e:e==null?lt:typeof e=="object"?ie(e)?Gl(e[0],e[1]):Ul(e):cc(e)}function Xs(e){if(!Ir(e))return kg(e);var t=[];for(var s in we(e))pe.call(e,s)&&s!="constructor"&&t.push(s);return t}function Om(e){if(!Ae(e))return vh(e);var t=Ir(e),s=[];for(var u in e)u=="constructor"&&(t||!pe.call(e,u))||s.push(u);return s}function Zs(e,t){return e<t}function Bl(e,t){var s=-1,u=at(e)?A(e.length):[];return an(e,function(f,m,_){u[++s]=t(f,m,_)}),u}function Ul(e){var t=ga(e);return t.length==1&&t[0][2]?Cu(t[0][0],t[0][1]):function(s){return s===e||Qs(s,e,t)}}function Gl(e,t){return ha(e)&&ju(t)?Cu(kt(e),t):function(s){var u=ya(s,e);return u===r&&u===t?Na(s,e):Er(t,u,E|C)}}function vi(e,t,s,u,f){e!==t&&Hs(t,function(m,_){if(f||(f=new It),Ae(m))Pm(e,t,_,s,vi,u,f);else{var S=u?u(xa(e,_),m,_+"",e,t,f):r;S===r&&(S=m),Us(e,_,S)}},ot)}function Pm(e,t,s,u,f,m,_){var S=xa(e,s),y=xa(t,s),D=_.get(y);if(D){Us(e,s,D);return}var M=m?m(S,y,s+"",e,t,_):r,P=M===r;if(P){var z=ie(y),H=!z&&cn(y),J=!z&&!H&&Qn(y);M=y,z||H||J?ie(S)?M=S:Me(S)?M=st(S):H?(P=!1,M=ru(y,!0)):J?(P=!1,M=iu(y,!0)):M=[]:Mr(y)||An(y)?(M=S,An(S)?M=ec(S):(!Ae(S)||Yt(S))&&(M=Su(y))):P=!1}P&&(_.set(y,M),f(M,y,u,m,_),_.delete(y)),Us(e,s,M)}function Hl(e,t){var s=e.length;if(s)return t+=t<0?s:0,Wt(t,s)?e[t]:r}function Kl(e,t,s){t.length?t=Ee(t,function(m){return ie(m)?function(_){return Nn(_,m.length===1?m[0]:m)}:m}):t=[lt];var u=-1;t=Ee(t,ft(Q()));var f=Bl(e,function(m,_,S){var y=Ee(t,function(D){return D(m)});return{criteria:y,index:++u,value:m}});return cg(f,function(m,_){return Qm(m,_,s)})}function km(e,t){return Wl(e,t,function(s,u){return Na(e,u)})}function Wl(e,t,s){for(var u=-1,f=t.length,m={};++u<f;){var _=t[u],S=Nn(e,_);s(S,_)&&Ar(m,ln(_,e),S)}return m}function qm(e){return function(t){return Nn(t,e)}}function Js(e,t,s,u){var f=u?ug:qn,m=-1,_=t.length,S=e;for(e===t&&(t=st(t)),s&&(S=Ee(e,ft(s)));++m<_;)for(var y=0,D=t[m],M=s?s(D):D;(y=f(S,M,y,u))>-1;)S!==e&&li.call(S,y,1),li.call(e,y,1);return e}function Yl(e,t){for(var s=e?t.length:0,u=s-1;s--;){var f=t[s];if(s==u||f!==m){var m=f;Wt(f)?li.call(e,f,1):ra(e,f)}}return e}function ea(e,t){return e+di(Al()*(t-e+1))}function $m(e,t,s,u){for(var f=-1,m=$e(ci((t-e)/(s||1)),0),_=A(m);m--;)_[u?m:++f]=e,e+=s;return _}function ta(e,t){var s="";if(!e||t<1||t>G)return s;do t%2&&(s+=e),t=di(t/2),t&&(e+=e);while(t);return s}function le(e,t){return va(yu(e,t,lt),e+"")}function zm(e){return Dl(Xn(e))}function Vm(e,t){var s=Xn(e);return Ei(s,yn(t,0,s.length))}function Ar(e,t,s,u){if(!Ae(e))return e;t=ln(t,e);for(var f=-1,m=t.length,_=m-1,S=e;S!=null&&++f<m;){var y=kt(t[f]),D=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(f!=_){var M=S[y];D=u?u(M,y,S):r,D===r&&(D=Ae(M)?M:Wt(t[f+1])?[]:{})}yr(S,y,D),S=S[y]}return e}var Ql=fi?function(e,t){return fi.set(e,t),e}:lt,Bm=ui?function(e,t){return ui(e,"toString",{configurable:!0,enumerable:!1,value:Ea(t),writable:!0})}:lt;function Um(e){return Ei(Xn(e))}function jt(e,t,s){var u=-1,f=e.length;t<0&&(t=-t>f?0:f+t),s=s>f?f:s,s<0&&(s+=f),f=t>s?0:s-t>>>0,t>>>=0;for(var m=A(f);++u<f;)m[u]=e[u+t];return m}function Gm(e,t){var s;return an(e,function(u,f,m){return s=t(u,f,m),!s}),!!s}function _i(e,t,s){var u=0,f=e==null?u:e.length;if(typeof t=="number"&&t===t&&f<=Hd){for(;u<f;){var m=u+f>>>1,_=e[m];_!==null&&!mt(_)&&(s?_<=t:_<t)?u=m+1:f=m}return f}return na(e,t,lt,s)}function na(e,t,s,u){var f=0,m=e==null?0:e.length;if(m===0)return 0;t=s(t);for(var _=t!==t,S=t===null,y=mt(t),D=t===r;f<m;){var M=di((f+m)/2),P=s(e[M]),z=P!==r,H=P===null,J=P===P,oe=mt(P);if(_)var ee=u||J;else D?ee=J&&(u||z):S?ee=J&&z&&(u||!H):y?ee=J&&z&&!H&&(u||!oe):H||oe?ee=!1:ee=u?P<=t:P<t;ee?f=M+1:m=M}return Qe(m,bn)}function Xl(e,t){for(var s=-1,u=e.length,f=0,m=[];++s<u;){var _=e[s],S=t?t(_):_;if(!s||!Dt(S,y)){var y=S;m[f++]=_===0?0:_}}return m}function Zl(e){return typeof e=="number"?e:mt(e)?et:+e}function gt(e){if(typeof e=="string")return e;if(ie(e))return Ee(e,gt)+"";if(mt(e))return Fl?Fl.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function on(e,t,s){var u=-1,f=Zr,m=e.length,_=!0,S=[],y=S;if(s)_=!1,f=Is;else if(m>=l){var D=t?null:nh(e);if(D)return ei(D);_=!1,f=_r,y=new Cn}else y=t?[]:S;e:for(;++u<m;){var M=e[u],P=t?t(M):M;if(M=s||M!==0?M:0,_&&P===P){for(var z=y.length;z--;)if(y[z]===P)continue e;t&&y.push(P),S.push(M)}else f(y,P,s)||(y!==S&&y.push(P),S.push(M))}return S}function ra(e,t){return t=ln(t,e),e=Nu(e,t),e==null||delete e[kt(Ct(t))]}function Jl(e,t,s,u){return Ar(e,t,s(Nn(e,t)),u)}function bi(e,t,s,u){for(var f=e.length,m=u?f:-1;(u?m--:++m<f)&&t(e[m],m,e););return s?jt(e,u?0:m,u?m+1:f):jt(e,u?m+1:0,u?f:m)}function eu(e,t){var s=e;return s instanceof ce&&(s=s.value()),Ds(t,function(u,f){return f.func.apply(f.thisArg,nn([u],f.args))},s)}function ia(e,t,s){var u=e.length;if(u<2)return u?on(e[0]):[];for(var f=-1,m=A(u);++f<u;)for(var _=e[f],S=-1;++S<u;)S!=f&&(m[f]=Nr(m[f]||_,e[S],t,s));return on(Ue(m,1),t,s)}function tu(e,t,s){for(var u=-1,f=e.length,m=t.length,_={};++u<f;){var S=u<m?t[u]:r;s(_,e[u],S)}return _}function sa(e){return Me(e)?e:[]}function aa(e){return typeof e=="function"?e:lt}function ln(e,t){return ie(e)?e:ha(e,t)?[e]:Fu(he(e))}var Hm=le;function un(e,t,s){var u=e.length;return s=s===r?u:s,!t&&s>=u?e:jt(e,t,s)}var nu=Mg||function(e){return Be.clearTimeout(e)};function ru(e,t){if(t)return e.slice();var s=e.length,u=Cl?Cl(s):new e.constructor(s);return e.copy(u),u}function oa(e){var t=new e.constructor(e.byteLength);return new ai(t).set(new ai(e)),t}function Km(e,t){var s=t?oa(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Wm(e){var t=new e.constructor(e.source,$o.exec(e));return t.lastIndex=e.lastIndex,t}function Ym(e){return Cr?we(Cr.call(e)):{}}function iu(e,t){var s=t?oa(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function su(e,t){if(e!==t){var s=e!==r,u=e===null,f=e===e,m=mt(e),_=t!==r,S=t===null,y=t===t,D=mt(t);if(!S&&!D&&!m&&e>t||m&&_&&y&&!S&&!D||u&&_&&y||!s&&y||!f)return 1;if(!u&&!m&&!D&&e<t||D&&s&&f&&!u&&!m||S&&s&&f||!_&&f||!y)return-1}return 0}function Qm(e,t,s){for(var u=-1,f=e.criteria,m=t.criteria,_=f.length,S=s.length;++u<_;){var y=su(f[u],m[u]);if(y){if(u>=S)return y;var D=s[u];return y*(D=="desc"?-1:1)}}return e.index-t.index}function au(e,t,s,u){for(var f=-1,m=e.length,_=s.length,S=-1,y=t.length,D=$e(m-_,0),M=A(y+D),P=!u;++S<y;)M[S]=t[S];for(;++f<_;)(P||f<m)&&(M[s[f]]=e[f]);for(;D--;)M[S++]=e[f++];return M}function ou(e,t,s,u){for(var f=-1,m=e.length,_=-1,S=s.length,y=-1,D=t.length,M=$e(m-S,0),P=A(M+D),z=!u;++f<M;)P[f]=e[f];for(var H=f;++y<D;)P[H+y]=t[y];for(;++_<S;)(z||f<m)&&(P[H+s[_]]=e[f++]);return P}function st(e,t){var s=-1,u=e.length;for(t||(t=A(u));++s<u;)t[s]=e[s];return t}function Pt(e,t,s,u){var f=!s;s||(s={});for(var m=-1,_=t.length;++m<_;){var S=t[m],y=u?u(s[S],e[S],S,s,e):r;y===r&&(y=e[S]),f?Gt(s,S,y):yr(s,S,y)}return s}function Xm(e,t){return Pt(e,ma(e),t)}function Zm(e,t){return Pt(e,bu(e),t)}function wi(e,t){return function(s,u){var f=ie(s)?rg:bm,m=t?t():{};return f(s,e,Q(u,2),m)}}function Kn(e){return le(function(t,s){var u=-1,f=s.length,m=f>1?s[f-1]:r,_=f>2?s[2]:r;for(m=e.length>3&&typeof m=="function"?(f--,m):r,_&&nt(s[0],s[1],_)&&(m=f<3?r:m,f=1),t=we(t);++u<f;){var S=s[u];S&&e(t,S,u,m)}return t})}function lu(e,t){return function(s,u){if(s==null)return s;if(!at(s))return e(s,u);for(var f=s.length,m=t?f:-1,_=we(s);(t?m--:++m<f)&&u(_[m],m,_)!==!1;);return s}}function uu(e){return function(t,s,u){for(var f=-1,m=we(t),_=u(t),S=_.length;S--;){var y=_[e?S:++f];if(s(m[y],y,m)===!1)break}return t}}function Jm(e,t,s){var u=t&L,f=Fr(e);function m(){var _=this&&this!==Be&&this instanceof m?f:e;return _.apply(u?s:this,arguments)}return m}function cu(e){return function(t){t=he(t);var s=$n(t)?Ft(t):r,u=s?s[0]:t.charAt(0),f=s?un(s,1).join(""):t.slice(1);return u[e]()+f}}function Wn(e){return function(t){return Ds(lc(oc(t).replace(Bf,"")),e,"")}}function Fr(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var s=Hn(e.prototype),u=e.apply(s,t);return Ae(u)?u:s}}function eh(e,t,s){var u=Fr(e);function f(){for(var m=arguments.length,_=A(m),S=m,y=Yn(f);S--;)_[S]=arguments[S];var D=m<3&&_[0]!==y&&_[m-1]!==y?[]:rn(_,y);if(m-=D.length,m<s)return hu(e,t,Si,f.placeholder,r,_,D,r,r,s-m);var M=this&&this!==Be&&this instanceof f?u:e;return dt(M,this,_)}return f}function du(e){return function(t,s,u){var f=we(t);if(!at(t)){var m=Q(s,3);t=ze(t),s=function(S){return m(f[S],S,f)}}var _=e(t,s,u);return _>-1?f[m?t[_]:_]:r}}function fu(e){return Kt(function(t){var s=t.length,u=s,f=wt.prototype.thru;for(e&&t.reverse();u--;){var m=t[u];if(typeof m!="function")throw new bt(d);if(f&&!_&&Ni(m)=="wrapper")var _=new wt([],!0)}for(u=_?u:s;++u<s;){m=t[u];var S=Ni(m),y=S=="wrapper"?fa(m):r;y&&pa(y[0])&&y[1]==(K|$|O|ne)&&!y[4].length&&y[9]==1?_=_[Ni(y[0])].apply(_,y[3]):_=m.length==1&&pa(m)?_[S]():_.thru(m)}return function(){var D=arguments,M=D[0];if(_&&D.length==1&&ie(M))return _.plant(M).value();for(var P=0,z=s?t[P].apply(this,D):M;++P<s;)z=t[P].call(this,z);return z}})}function Si(e,t,s,u,f,m,_,S,y,D){var M=t&K,P=t&L,z=t&I,H=t&($|te),J=t&B,oe=z?r:Fr(e);function ee(){for(var ue=arguments.length,de=A(ue),ht=ue;ht--;)de[ht]=arguments[ht];if(H)var rt=Yn(ee),pt=fg(de,rt);if(u&&(de=au(de,u,f,H)),m&&(de=ou(de,m,_,H)),ue-=pt,H&&ue<D){var Le=rn(de,rt);return hu(e,t,Si,ee.placeholder,s,de,Le,S,y,D-ue)}var Mt=P?s:this,Xt=z?Mt[e]:e;return ue=de.length,S?de=bh(de,S):J&&ue>1&&de.reverse(),M&&y<ue&&(de.length=y),this&&this!==Be&&this instanceof ee&&(Xt=oe||Fr(Xt)),Xt.apply(Mt,de)}return ee}function gu(e,t){return function(s,u){return Em(s,e,t(u),{})}}function ji(e,t){return function(s,u){var f;if(s===r&&u===r)return t;if(s!==r&&(f=s),u!==r){if(f===r)return u;typeof s=="string"||typeof u=="string"?(s=gt(s),u=gt(u)):(s=Zl(s),u=Zl(u)),f=e(s,u)}return f}}function la(e){return Kt(function(t){return t=Ee(t,ft(Q())),le(function(s){var u=this;return e(t,function(f){return dt(f,u,s)})})})}function Ci(e,t){t=t===r?" ":gt(t);var s=t.length;if(s<2)return s?ta(t,e):t;var u=ta(t,ci(e/zn(t)));return $n(t)?un(Ft(u),0,e).join(""):u.slice(0,e)}function th(e,t,s,u){var f=t&L,m=Fr(e);function _(){for(var S=-1,y=arguments.length,D=-1,M=u.length,P=A(M+y),z=this&&this!==Be&&this instanceof _?m:e;++D<M;)P[D]=u[D];for(;y--;)P[D++]=arguments[++S];return dt(z,f?s:this,P)}return _}function mu(e){return function(t,s,u){return u&&typeof u!="number"&&nt(t,s,u)&&(s=u=r),t=Qt(t),s===r?(s=t,t=0):s=Qt(s),u=u===r?t<s?1:-1:Qt(u),$m(t,s,u,e)}}function yi(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=yt(t),s=yt(s)),e(t,s)}}function hu(e,t,s,u,f,m,_,S,y,D){var M=t&$,P=M?_:r,z=M?r:_,H=M?m:r,J=M?r:m;t|=M?O:k,t&=~(M?k:O),t&q||(t&=-4);var oe=[e,t,f,H,P,J,z,S,y,D],ee=s.apply(r,oe);return pa(e)&&Ru(ee,oe),ee.placeholder=u,Eu(ee,e,t)}function ua(e){var t=qe[e];return function(s,u){if(s=yt(s),u=u==null?0:Qe(ae(u),292),u&&El(s)){var f=(he(s)+"e").split("e"),m=t(f[0]+"e"+(+f[1]+u));return f=(he(m)+"e").split("e"),+(f[0]+"e"+(+f[1]-u))}return t(s)}}var nh=Un&&1/ei(new Un([,-0]))[1]==De?function(e){return new Un(e)}:Ia;function pu(e){return function(t){var s=Xe(t);return s==Et?qs(t):s==At?_g(t):dg(t,e(t))}}function Ht(e,t,s,u,f,m,_,S){var y=t&I;if(!y&&typeof e!="function")throw new bt(d);var D=u?u.length:0;if(D||(t&=-97,u=f=r),_=_===r?_:$e(ae(_),0),S=S===r?S:ae(S),D-=f?f.length:0,t&k){var M=u,P=f;u=f=r}var z=y?r:fa(e),H=[e,t,s,u,f,M,P,m,_,S];if(z&&xh(H,z),e=H[0],t=H[1],s=H[2],u=H[3],f=H[4],S=H[9]=H[9]===r?y?0:e.length:$e(H[9]-D,0),!S&&t&($|te)&&(t&=-25),!t||t==L)var J=Jm(e,t,s);else t==$||t==te?J=eh(e,t,S):(t==O||t==(L|O))&&!f.length?J=th(e,t,s,u):J=Si.apply(r,H);var oe=z?Ql:Ru;return Eu(oe(J,H),e,t)}function xu(e,t,s,u){return e===r||Dt(e,Bn[s])&&!pe.call(u,s)?t:e}function vu(e,t,s,u,f,m){return Ae(e)&&Ae(t)&&(m.set(t,e),vi(e,t,r,vu,m),m.delete(t)),e}function rh(e){return Mr(e)?r:e}function _u(e,t,s,u,f,m){var _=s&E,S=e.length,y=t.length;if(S!=y&&!(_&&y>S))return!1;var D=m.get(e),M=m.get(t);if(D&&M)return D==t&&M==e;var P=-1,z=!0,H=s&C?new Cn:r;for(m.set(e,t),m.set(t,e);++P<S;){var J=e[P],oe=t[P];if(u)var ee=_?u(oe,J,P,t,e,m):u(J,oe,P,e,t,m);if(ee!==r){if(ee)continue;z=!1;break}if(H){if(!Ms(t,function(ue,de){if(!_r(H,de)&&(J===ue||f(J,ue,s,u,m)))return H.push(de)})){z=!1;break}}else if(!(J===oe||f(J,oe,s,u,m))){z=!1;break}}return m.delete(e),m.delete(t),z}function ih(e,t,s,u,f,m,_){switch(s){case Pn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case vr:return!(e.byteLength!=t.byteLength||!m(new ai(e),new ai(t)));case fr:case gr:case mr:return Dt(+e,+t);case Hr:return e.name==t.name&&e.message==t.message;case hr:case pr:return e==t+"";case Et:var S=qs;case At:var y=u&E;if(S||(S=ei),e.size!=t.size&&!y)return!1;var D=_.get(e);if(D)return D==t;u|=C,_.set(e,t);var M=_u(S(e),S(t),u,f,m,_);return _.delete(e),M;case Wr:if(Cr)return Cr.call(e)==Cr.call(t)}return!1}function sh(e,t,s,u,f,m){var _=s&E,S=ca(e),y=S.length,D=ca(t),M=D.length;if(y!=M&&!_)return!1;for(var P=y;P--;){var z=S[P];if(!(_?z in t:pe.call(t,z)))return!1}var H=m.get(e),J=m.get(t);if(H&&J)return H==t&&J==e;var oe=!0;m.set(e,t),m.set(t,e);for(var ee=_;++P<y;){z=S[P];var ue=e[z],de=t[z];if(u)var ht=_?u(de,ue,z,t,e,m):u(ue,de,z,e,t,m);if(!(ht===r?ue===de||f(ue,de,s,u,m):ht)){oe=!1;break}ee||(ee=z=="constructor")}if(oe&&!ee){var rt=e.constructor,pt=t.constructor;rt!=pt&&"constructor"in e&&"constructor"in t&&!(typeof rt=="function"&&rt instanceof rt&&typeof pt=="function"&&pt instanceof pt)&&(oe=!1)}return m.delete(e),m.delete(t),oe}function Kt(e){return va(yu(e,r,Lu),e+"")}function ca(e){return ql(e,ze,ma)}function da(e){return ql(e,ot,bu)}var fa=fi?function(e){return fi.get(e)}:Ia;function Ni(e){for(var t=e.name+"",s=Gn[t],u=pe.call(Gn,t)?s.length:0;u--;){var f=s[u],m=f.func;if(m==null||m==e)return f.name}return t}function Yn(e){var t=pe.call(g,"placeholder")?g:e;return t.placeholder}function Q(){var e=g.iteratee||Aa;return e=e===Aa?Vl:e,arguments.length?e(arguments[0],arguments[1]):e}function Ri(e,t){var s=e.__data__;return gh(t)?s[typeof t=="string"?"string":"hash"]:s.map}function ga(e){for(var t=ze(e),s=t.length;s--;){var u=t[s],f=e[u];t[s]=[u,f,ju(f)]}return t}function Rn(e,t){var s=pg(e,t);return zl(s)?s:r}function ah(e){var t=pe.call(e,Sn),s=e[Sn];try{e[Sn]=r;var u=!0}catch{}var f=ii.call(e);return u&&(t?e[Sn]=s:delete e[Sn]),f}var ma=zs?function(e){return e==null?[]:(e=we(e),tn(zs(e),function(t){return Nl.call(e,t)}))}:Da,bu=zs?function(e){for(var t=[];e;)nn(t,ma(e)),e=oi(e);return t}:Da,Xe=tt;(Vs&&Xe(new Vs(new ArrayBuffer(1)))!=Pn||wr&&Xe(new wr)!=Et||Bs&&Xe(Bs.resolve())!=Oo||Un&&Xe(new Un)!=At||Sr&&Xe(new Sr)!=xr)&&(Xe=function(e){var t=tt(e),s=t==Vt?e.constructor:r,u=s?En(s):"";if(u)switch(u){case Vg:return Pn;case Bg:return Et;case Ug:return Oo;case Gg:return At;case Hg:return xr}return t});function oh(e,t,s){for(var u=-1,f=s.length;++u<f;){var m=s[u],_=m.size;switch(m.type){case"drop":e+=_;break;case"dropRight":t-=_;break;case"take":t=Qe(t,e+_);break;case"takeRight":e=$e(e,t-_);break}}return{start:e,end:t}}function lh(e){var t=e.match(mf);return t?t[1].split(hf):[]}function wu(e,t,s){t=ln(t,e);for(var u=-1,f=t.length,m=!1;++u<f;){var _=kt(t[u]);if(!(m=e!=null&&s(e,_)))break;e=e[_]}return m||++u!=f?m:(f=e==null?0:e.length,!!f&&Li(f)&&Wt(_,f)&&(ie(e)||An(e)))}function uh(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function Su(e){return typeof e.constructor=="function"&&!Ir(e)?Hn(oi(e)):{}}function ch(e,t,s){var u=e.constructor;switch(t){case vr:return oa(e);case fr:case gr:return new u(+e);case Pn:return Km(e,s);case gs:case ms:case hs:case ps:case xs:case vs:case _s:case bs:case ws:return iu(e,s);case Et:return new u;case mr:case pr:return new u(e);case hr:return Wm(e);case At:return new u;case Wr:return Ym(e)}}function dh(e,t){var s=t.length;if(!s)return e;var u=s-1;return t[u]=(s>1?"& ":"")+t[u],t=t.join(s>2?", ":" "),e.replace(gf,`{
/* [wrapped with `+t+`] */
`)}function fh(e){return ie(e)||An(e)||!!(Rl&&e&&e[Rl])}function Wt(e,t){var s=typeof e;return t=t??G,!!t&&(s=="number"||s!="symbol"&&Cf.test(e))&&e>-1&&e%1==0&&e<t}function nt(e,t,s){if(!Ae(s))return!1;var u=typeof t;return(u=="number"?at(s)&&Wt(t,s.length):u=="string"&&t in s)?Dt(s[t],e):!1}function ha(e,t){if(ie(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||mt(e)?!0:uf.test(e)||!lf.test(e)||t!=null&&e in we(t)}function gh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function pa(e){var t=Ni(e),s=g[t];if(typeof s!="function"||!(t in ce.prototype))return!1;if(e===s)return!0;var u=fa(s);return!!u&&e===u[0]}function mh(e){return!!jl&&jl in e}var hh=ni?Yt:Ma;function Ir(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Bn;return e===s}function ju(e){return e===e&&!Ae(e)}function Cu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==r||e in we(s))}}function ph(e){var t=Di(e,function(u){return s.size===x&&s.clear(),u}),s=t.cache;return t}function xh(e,t){var s=e[1],u=t[1],f=s|u,m=f<(L|I|K),_=u==K&&s==$||u==K&&s==ne&&e[7].length<=t[8]||u==(K|ne)&&t[7].length<=t[8]&&s==$;if(!(m||_))return e;u&L&&(e[2]=t[2],f|=s&L?0:q);var S=t[3];if(S){var y=e[3];e[3]=y?au(y,S,t[4]):S,e[4]=y?rn(e[3],v):t[4]}return S=t[5],S&&(y=e[5],e[5]=y?ou(y,S,t[6]):S,e[6]=y?rn(e[5],v):t[6]),S=t[7],S&&(e[7]=S),u&K&&(e[8]=e[8]==null?t[8]:Qe(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=f,e}function vh(e){var t=[];if(e!=null)for(var s in we(e))t.push(s);return t}function _h(e){return ii.call(e)}function yu(e,t,s){return t=$e(t===r?e.length-1:t,0),function(){for(var u=arguments,f=-1,m=$e(u.length-t,0),_=A(m);++f<m;)_[f]=u[t+f];f=-1;for(var S=A(t+1);++f<t;)S[f]=u[f];return S[t]=s(_),dt(e,this,S)}}function Nu(e,t){return t.length<2?e:Nn(e,jt(t,0,-1))}function bh(e,t){for(var s=e.length,u=Qe(t.length,s),f=st(e);u--;){var m=t[u];e[u]=Wt(m,s)?f[m]:r}return e}function xa(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ru=Au(Ql),Dr=Tg||function(e,t){return Be.setTimeout(e,t)},va=Au(Bm);function Eu(e,t,s){var u=t+"";return va(e,dh(u,wh(lh(u),s)))}function Au(e){var t=0,s=0;return function(){var u=qg(),f=Re-(u-s);if(s=u,f>0){if(++t>=W)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ei(e,t){var s=-1,u=e.length,f=u-1;for(t=t===r?u:t;++s<t;){var m=ea(s,f),_=e[m];e[m]=e[s],e[s]=_}return e.length=t,e}var Fu=ph(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(cf,function(s,u,f,m){t.push(f?m.replace(vf,"$1"):u||s)}),t});function kt(e){if(typeof e=="string"||mt(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function En(e){if(e!=null){try{return ri.call(e)}catch{}try{return e+""}catch{}}return""}function wh(e,t){return _t(Kd,function(s){var u="_."+s[0];t&s[1]&&!Zr(e,u)&&e.push(u)}),e.sort()}function Iu(e){if(e instanceof ce)return e.clone();var t=new wt(e.__wrapped__,e.__chain__);return t.__actions__=st(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Sh(e,t,s){(s?nt(e,t,s):t===r)?t=1:t=$e(ae(t),0);var u=e==null?0:e.length;if(!u||t<1)return[];for(var f=0,m=0,_=A(ci(u/t));f<u;)_[m++]=jt(e,f,f+=t);return _}function jh(e){for(var t=-1,s=e==null?0:e.length,u=0,f=[];++t<s;){var m=e[t];m&&(f[u++]=m)}return f}function Ch(){var e=arguments.length;if(!e)return[];for(var t=A(e-1),s=arguments[0],u=e;u--;)t[u-1]=arguments[u];return nn(ie(s)?st(s):[s],Ue(t,1))}var yh=le(function(e,t){return Me(e)?Nr(e,Ue(t,1,Me,!0)):[]}),Nh=le(function(e,t){var s=Ct(t);return Me(s)&&(s=r),Me(e)?Nr(e,Ue(t,1,Me,!0),Q(s,2)):[]}),Rh=le(function(e,t){var s=Ct(t);return Me(s)&&(s=r),Me(e)?Nr(e,Ue(t,1,Me,!0),r,s):[]});function Eh(e,t,s){var u=e==null?0:e.length;return u?(t=s||t===r?1:ae(t),jt(e,t<0?0:t,u)):[]}function Ah(e,t,s){var u=e==null?0:e.length;return u?(t=s||t===r?1:ae(t),t=u-t,jt(e,0,t<0?0:t)):[]}function Fh(e,t){return e&&e.length?bi(e,Q(t,3),!0,!0):[]}function Ih(e,t){return e&&e.length?bi(e,Q(t,3),!0):[]}function Dh(e,t,s,u){var f=e==null?0:e.length;return f?(s&&typeof s!="number"&&nt(e,t,s)&&(s=0,u=f),Cm(e,t,s,u)):[]}function Du(e,t,s){var u=e==null?0:e.length;if(!u)return-1;var f=s==null?0:ae(s);return f<0&&(f=$e(u+f,0)),Jr(e,Q(t,3),f)}function Mu(e,t,s){var u=e==null?0:e.length;if(!u)return-1;var f=u-1;return s!==r&&(f=ae(s),f=s<0?$e(u+f,0):Qe(f,u-1)),Jr(e,Q(t,3),f,!0)}function Lu(e){var t=e==null?0:e.length;return t?Ue(e,1):[]}function Mh(e){var t=e==null?0:e.length;return t?Ue(e,De):[]}function Lh(e,t){var s=e==null?0:e.length;return s?(t=t===r?1:ae(t),Ue(e,t)):[]}function Th(e){for(var t=-1,s=e==null?0:e.length,u={};++t<s;){var f=e[t];u[f[0]]=f[1]}return u}function Tu(e){return e&&e.length?e[0]:r}function Oh(e,t,s){var u=e==null?0:e.length;if(!u)return-1;var f=s==null?0:ae(s);return f<0&&(f=$e(u+f,0)),qn(e,t,f)}function Ph(e){var t=e==null?0:e.length;return t?jt(e,0,-1):[]}var kh=le(function(e){var t=Ee(e,sa);return t.length&&t[0]===e[0]?Ys(t):[]}),qh=le(function(e){var t=Ct(e),s=Ee(e,sa);return t===Ct(s)?t=r:s.pop(),s.length&&s[0]===e[0]?Ys(s,Q(t,2)):[]}),$h=le(function(e){var t=Ct(e),s=Ee(e,sa);return t=typeof t=="function"?t:r,t&&s.pop(),s.length&&s[0]===e[0]?Ys(s,r,t):[]});function zh(e,t){return e==null?"":Pg.call(e,t)}function Ct(e){var t=e==null?0:e.length;return t?e[t-1]:r}function Vh(e,t,s){var u=e==null?0:e.length;if(!u)return-1;var f=u;return s!==r&&(f=ae(s),f=f<0?$e(u+f,0):Qe(f,u-1)),t===t?wg(e,t,f):Jr(e,hl,f,!0)}function Bh(e,t){return e&&e.length?Hl(e,ae(t)):r}var Uh=le(Ou);function Ou(e,t){return e&&e.length&&t&&t.length?Js(e,t):e}function Gh(e,t,s){return e&&e.length&&t&&t.length?Js(e,t,Q(s,2)):e}function Hh(e,t,s){return e&&e.length&&t&&t.length?Js(e,t,r,s):e}var Kh=Kt(function(e,t){var s=e==null?0:e.length,u=Gs(e,t);return Yl(e,Ee(t,function(f){return Wt(f,s)?+f:f}).sort(su)),u});function Wh(e,t){var s=[];if(!(e&&e.length))return s;var u=-1,f=[],m=e.length;for(t=Q(t,3);++u<m;){var _=e[u];t(_,u,e)&&(s.push(_),f.push(u))}return Yl(e,f),s}function _a(e){return e==null?e:zg.call(e)}function Yh(e,t,s){var u=e==null?0:e.length;return u?(s&&typeof s!="number"&&nt(e,t,s)?(t=0,s=u):(t=t==null?0:ae(t),s=s===r?u:ae(s)),jt(e,t,s)):[]}function Qh(e,t){return _i(e,t)}function Xh(e,t,s){return na(e,t,Q(s,2))}function Zh(e,t){var s=e==null?0:e.length;if(s){var u=_i(e,t);if(u<s&&Dt(e[u],t))return u}return-1}function Jh(e,t){return _i(e,t,!0)}function ep(e,t,s){return na(e,t,Q(s,2),!0)}function tp(e,t){var s=e==null?0:e.length;if(s){var u=_i(e,t,!0)-1;if(Dt(e[u],t))return u}return-1}function np(e){return e&&e.length?Xl(e):[]}function rp(e,t){return e&&e.length?Xl(e,Q(t,2)):[]}function ip(e){var t=e==null?0:e.length;return t?jt(e,1,t):[]}function sp(e,t,s){return e&&e.length?(t=s||t===r?1:ae(t),jt(e,0,t<0?0:t)):[]}function ap(e,t,s){var u=e==null?0:e.length;return u?(t=s||t===r?1:ae(t),t=u-t,jt(e,t<0?0:t,u)):[]}function op(e,t){return e&&e.length?bi(e,Q(t,3),!1,!0):[]}function lp(e,t){return e&&e.length?bi(e,Q(t,3)):[]}var up=le(function(e){return on(Ue(e,1,Me,!0))}),cp=le(function(e){var t=Ct(e);return Me(t)&&(t=r),on(Ue(e,1,Me,!0),Q(t,2))}),dp=le(function(e){var t=Ct(e);return t=typeof t=="function"?t:r,on(Ue(e,1,Me,!0),r,t)});function fp(e){return e&&e.length?on(e):[]}function gp(e,t){return e&&e.length?on(e,Q(t,2)):[]}function mp(e,t){return t=typeof t=="function"?t:r,e&&e.length?on(e,r,t):[]}function ba(e){if(!(e&&e.length))return[];var t=0;return e=tn(e,function(s){if(Me(s))return t=$e(s.length,t),!0}),Ps(t,function(s){return Ee(e,Ls(s))})}function Pu(e,t){if(!(e&&e.length))return[];var s=ba(e);return t==null?s:Ee(s,function(u){return dt(t,r,u)})}var hp=le(function(e,t){return Me(e)?Nr(e,t):[]}),pp=le(function(e){return ia(tn(e,Me))}),xp=le(function(e){var t=Ct(e);return Me(t)&&(t=r),ia(tn(e,Me),Q(t,2))}),vp=le(function(e){var t=Ct(e);return t=typeof t=="function"?t:r,ia(tn(e,Me),r,t)}),_p=le(ba);function bp(e,t){return tu(e||[],t||[],yr)}function wp(e,t){return tu(e||[],t||[],Ar)}var Sp=le(function(e){var t=e.length,s=t>1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,Pu(e,s)});function ku(e){var t=g(e);return t.__chain__=!0,t}function jp(e,t){return t(e),e}function Ai(e,t){return t(e)}var Cp=Kt(function(e){var t=e.length,s=t?e[0]:0,u=this.__wrapped__,f=function(m){return Gs(m,e)};return t>1||this.__actions__.length||!(u instanceof ce)||!Wt(s)?this.thru(f):(u=u.slice(s,+s+(t?1:0)),u.__actions__.push({func:Ai,args:[f],thisArg:r}),new wt(u,this.__chain__).thru(function(m){return t&&!m.length&&m.push(r),m}))});function yp(){return ku(this)}function Np(){return new wt(this.value(),this.__chain__)}function Rp(){this.__values__===r&&(this.__values__=Zu(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Ep(){return this}function Ap(e){for(var t,s=this;s instanceof mi;){var u=Iu(s);u.__index__=0,u.__values__=r,t?f.__wrapped__=u:t=u;var f=u;s=s.__wrapped__}return f.__wrapped__=e,t}function Fp(){var e=this.__wrapped__;if(e instanceof ce){var t=e;return this.__actions__.length&&(t=new ce(this)),t=t.reverse(),t.__actions__.push({func:Ai,args:[_a],thisArg:r}),new wt(t,this.__chain__)}return this.thru(_a)}function Ip(){return eu(this.__wrapped__,this.__actions__)}var Dp=wi(function(e,t,s){pe.call(e,s)?++e[s]:Gt(e,s,1)});function Mp(e,t,s){var u=ie(e)?gl:jm;return s&&nt(e,t,s)&&(t=r),u(e,Q(t,3))}function Lp(e,t){var s=ie(e)?tn:Pl;return s(e,Q(t,3))}var Tp=du(Du),Op=du(Mu);function Pp(e,t){return Ue(Fi(e,t),1)}function kp(e,t){return Ue(Fi(e,t),De)}function qp(e,t,s){return s=s===r?1:ae(s),Ue(Fi(e,t),s)}function qu(e,t){var s=ie(e)?_t:an;return s(e,Q(t,3))}function $u(e,t){var s=ie(e)?ig:Ol;return s(e,Q(t,3))}var $p=wi(function(e,t,s){pe.call(e,s)?e[s].push(t):Gt(e,s,[t])});function zp(e,t,s,u){e=at(e)?e:Xn(e),s=s&&!u?ae(s):0;var f=e.length;return s<0&&(s=$e(f+s,0)),Ti(e)?s<=f&&e.indexOf(t,s)>-1:!!f&&qn(e,t,s)>-1}var Vp=le(function(e,t,s){var u=-1,f=typeof t=="function",m=at(e)?A(e.length):[];return an(e,function(_){m[++u]=f?dt(t,_,s):Rr(_,t,s)}),m}),Bp=wi(function(e,t,s){Gt(e,s,t)});function Fi(e,t){var s=ie(e)?Ee:Bl;return s(e,Q(t,3))}function Up(e,t,s,u){return e==null?[]:(ie(t)||(t=t==null?[]:[t]),s=u?r:s,ie(s)||(s=s==null?[]:[s]),Kl(e,t,s))}var Gp=wi(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Hp(e,t,s){var u=ie(e)?Ds:xl,f=arguments.length<3;return u(e,Q(t,4),s,f,an)}function Kp(e,t,s){var u=ie(e)?sg:xl,f=arguments.length<3;return u(e,Q(t,4),s,f,Ol)}function Wp(e,t){var s=ie(e)?tn:Pl;return s(e,Mi(Q(t,3)))}function Yp(e){var t=ie(e)?Dl:zm;return t(e)}function Qp(e,t,s){(s?nt(e,t,s):t===r)?t=1:t=ae(t);var u=ie(e)?vm:Vm;return u(e,t)}function Xp(e){var t=ie(e)?_m:Um;return t(e)}function Zp(e){if(e==null)return 0;if(at(e))return Ti(e)?zn(e):e.length;var t=Xe(e);return t==Et||t==At?e.size:Xs(e).length}function Jp(e,t,s){var u=ie(e)?Ms:Gm;return s&&nt(e,t,s)&&(t=r),u(e,Q(t,3))}var ex=le(function(e,t){if(e==null)return[];var s=t.length;return s>1&&nt(e,t[0],t[1])?t=[]:s>2&&nt(t[0],t[1],t[2])&&(t=[t[0]]),Kl(e,Ue(t,1),[])}),Ii=Lg||function(){return Be.Date.now()};function tx(e,t){if(typeof t!="function")throw new bt(d);return e=ae(e),function(){if(--e<1)return t.apply(this,arguments)}}function zu(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Ht(e,K,r,r,r,r,t)}function Vu(e,t){var s;if(typeof t!="function")throw new bt(d);return e=ae(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var wa=le(function(e,t,s){var u=L;if(s.length){var f=rn(s,Yn(wa));u|=O}return Ht(e,u,t,s,f)}),Bu=le(function(e,t,s){var u=L|I;if(s.length){var f=rn(s,Yn(Bu));u|=O}return Ht(t,u,e,s,f)});function Uu(e,t,s){t=s?r:t;var u=Ht(e,$,r,r,r,r,r,t);return u.placeholder=Uu.placeholder,u}function Gu(e,t,s){t=s?r:t;var u=Ht(e,te,r,r,r,r,r,t);return u.placeholder=Gu.placeholder,u}function Hu(e,t,s){var u,f,m,_,S,y,D=0,M=!1,P=!1,z=!0;if(typeof e!="function")throw new bt(d);t=yt(t)||0,Ae(s)&&(M=!!s.leading,P="maxWait"in s,m=P?$e(yt(s.maxWait)||0,t):m,z="trailing"in s?!!s.trailing:z);function H(Le){var Mt=u,Xt=f;return u=f=r,D=Le,_=e.apply(Xt,Mt),_}function J(Le){return D=Le,S=Dr(ue,t),M?H(Le):_}function oe(Le){var Mt=Le-y,Xt=Le-D,dc=t-Mt;return P?Qe(dc,m-Xt):dc}function ee(Le){var Mt=Le-y,Xt=Le-D;return y===r||Mt>=t||Mt<0||P&&Xt>=m}function ue(){var Le=Ii();if(ee(Le))return de(Le);S=Dr(ue,oe(Le))}function de(Le){return S=r,z&&u?H(Le):(u=f=r,_)}function ht(){S!==r&&nu(S),D=0,u=y=f=S=r}function rt(){return S===r?_:de(Ii())}function pt(){var Le=Ii(),Mt=ee(Le);if(u=arguments,f=this,y=Le,Mt){if(S===r)return J(y);if(P)return nu(S),S=Dr(ue,t),H(y)}return S===r&&(S=Dr(ue,t)),_}return pt.cancel=ht,pt.flush=rt,pt}var nx=le(function(e,t){return Tl(e,1,t)}),rx=le(function(e,t,s){return Tl(e,yt(t)||0,s)});function ix(e){return Ht(e,B)}function Di(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new bt(d);var s=function(){var u=arguments,f=t?t.apply(this,u):u[0],m=s.cache;if(m.has(f))return m.get(f);var _=e.apply(this,u);return s.cache=m.set(f,_)||m,_};return s.cache=new(Di.Cache||Ut),s}Di.Cache=Ut;function Mi(e){if(typeof e!="function")throw new bt(d);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function sx(e){return Vu(2,e)}var ax=Hm(function(e,t){t=t.length==1&&ie(t[0])?Ee(t[0],ft(Q())):Ee(Ue(t,1),ft(Q()));var s=t.length;return le(function(u){for(var f=-1,m=Qe(u.length,s);++f<m;)u[f]=t[f].call(this,u[f]);return dt(e,this,u)})}),Sa=le(function(e,t){var s=rn(t,Yn(Sa));return Ht(e,O,r,t,s)}),Ku=le(function(e,t){var s=rn(t,Yn(Ku));return Ht(e,k,r,t,s)}),ox=Kt(function(e,t){return Ht(e,ne,r,r,r,t)});function lx(e,t){if(typeof e!="function")throw new bt(d);return t=t===r?t:ae(t),le(e,t)}function ux(e,t){if(typeof e!="function")throw new bt(d);return t=t==null?0:$e(ae(t),0),le(function(s){var u=s[t],f=un(s,0,t);return u&&nn(f,u),dt(e,this,f)})}function cx(e,t,s){var u=!0,f=!0;if(typeof e!="function")throw new bt(d);return Ae(s)&&(u="leading"in s?!!s.leading:u,f="trailing"in s?!!s.trailing:f),Hu(e,t,{leading:u,maxWait:t,trailing:f})}function dx(e){return zu(e,1)}function fx(e,t){return Sa(aa(t),e)}function gx(){if(!arguments.length)return[];var e=arguments[0];return ie(e)?e:[e]}function mx(e){return St(e,b)}function hx(e,t){return t=typeof t=="function"?t:r,St(e,b,t)}function px(e){return St(e,R|b)}function xx(e,t){return t=typeof t=="function"?t:r,St(e,R|b,t)}function vx(e,t){return t==null||Ll(e,t,ze(t))}function Dt(e,t){return e===t||e!==e&&t!==t}var _x=yi(Ws),bx=yi(function(e,t){return e>=t}),An=$l(function(){return arguments}())?$l:function(e){return Fe(e)&&pe.call(e,"callee")&&!Nl.call(e,"callee")},ie=A.isArray,wx=ol?ft(ol):Am;function at(e){return e!=null&&Li(e.length)&&!Yt(e)}function Me(e){return Fe(e)&&at(e)}function Sx(e){return e===!0||e===!1||Fe(e)&&tt(e)==fr}var cn=Og||Ma,jx=ll?ft(ll):Fm;function Cx(e){return Fe(e)&&e.nodeType===1&&!Mr(e)}function yx(e){if(e==null)return!0;if(at(e)&&(ie(e)||typeof e=="string"||typeof e.splice=="function"||cn(e)||Qn(e)||An(e)))return!e.length;var t=Xe(e);if(t==Et||t==At)return!e.size;if(Ir(e))return!Xs(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function Nx(e,t){return Er(e,t)}function Rx(e,t,s){s=typeof s=="function"?s:r;var u=s?s(e,t):r;return u===r?Er(e,t,r,s):!!u}function ja(e){if(!Fe(e))return!1;var t=tt(e);return t==Hr||t==Yd||typeof e.message=="string"&&typeof e.name=="string"&&!Mr(e)}function Ex(e){return typeof e=="number"&&El(e)}function Yt(e){if(!Ae(e))return!1;var t=tt(e);return t==Kr||t==To||t==Wd||t==Xd}function Wu(e){return typeof e=="number"&&e==ae(e)}function Li(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=G}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Fe(e){return e!=null&&typeof e=="object"}var Yu=ul?ft(ul):Dm;function Ax(e,t){return e===t||Qs(e,t,ga(t))}function Fx(e,t,s){return s=typeof s=="function"?s:r,Qs(e,t,ga(t),s)}function Ix(e){return Qu(e)&&e!=+e}function Dx(e){if(hh(e))throw new re(c);return zl(e)}function Mx(e){return e===null}function Lx(e){return e==null}function Qu(e){return typeof e=="number"||Fe(e)&&tt(e)==mr}function Mr(e){if(!Fe(e)||tt(e)!=Vt)return!1;var t=oi(e);if(t===null)return!0;var s=pe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&ri.call(s)==Fg}var Ca=cl?ft(cl):Mm;function Tx(e){return Wu(e)&&e>=-9007199254740991&&e<=G}var Xu=dl?ft(dl):Lm;function Ti(e){return typeof e=="string"||!ie(e)&&Fe(e)&&tt(e)==pr}function mt(e){return typeof e=="symbol"||Fe(e)&&tt(e)==Wr}var Qn=fl?ft(fl):Tm;function Ox(e){return e===r}function Px(e){return Fe(e)&&Xe(e)==xr}function kx(e){return Fe(e)&&tt(e)==Jd}var qx=yi(Zs),$x=yi(function(e,t){return e<=t});function Zu(e){if(!e)return[];if(at(e))return Ti(e)?Ft(e):st(e);if(br&&e[br])return vg(e[br]());var t=Xe(e),s=t==Et?qs:t==At?ei:Xn;return s(e)}function Qt(e){if(!e)return e===0?e:0;if(e=yt(e),e===De||e===-1/0){var t=e<0?-1:1;return t*be}return e===e?e:0}function ae(e){var t=Qt(e),s=t%1;return t===t?s?t-s:t:0}function Ju(e){return e?yn(ae(e),0,it):0}function yt(e){if(typeof e=="number")return e;if(mt(e))return et;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=vl(e);var s=wf.test(e);return s||jf.test(e)?tg(e.slice(2),s?2:8):bf.test(e)?et:+e}function ec(e){return Pt(e,ot(e))}function zx(e){return e?yn(ae(e),-9007199254740991,G):e===0?e:0}function he(e){return e==null?"":gt(e)}var Vx=Kn(function(e,t){if(Ir(t)||at(t)){Pt(t,ze(t),e);return}for(var s in t)pe.call(t,s)&&yr(e,s,t[s])}),tc=Kn(function(e,t){Pt(t,ot(t),e)}),Oi=Kn(function(e,t,s,u){Pt(t,ot(t),e,u)}),Bx=Kn(function(e,t,s,u){Pt(t,ze(t),e,u)}),Ux=Kt(Gs);function Gx(e,t){var s=Hn(e);return t==null?s:Ml(s,t)}var Hx=le(function(e,t){e=we(e);var s=-1,u=t.length,f=u>2?t[2]:r;for(f&&nt(t[0],t[1],f)&&(u=1);++s<u;)for(var m=t[s],_=ot(m),S=-1,y=_.length;++S<y;){var D=_[S],M=e[D];(M===r||Dt(M,Bn[D])&&!pe.call(e,D))&&(e[D]=m[D])}return e}),Kx=le(function(e){return e.push(r,vu),dt(nc,r,e)});function Wx(e,t){return ml(e,Q(t,3),Ot)}function Yx(e,t){return ml(e,Q(t,3),Ks)}function Qx(e,t){return e==null?e:Hs(e,Q(t,3),ot)}function Xx(e,t){return e==null?e:kl(e,Q(t,3),ot)}function Zx(e,t){return e&&Ot(e,Q(t,3))}function Jx(e,t){return e&&Ks(e,Q(t,3))}function ev(e){return e==null?[]:xi(e,ze(e))}function tv(e){return e==null?[]:xi(e,ot(e))}function ya(e,t,s){var u=e==null?r:Nn(e,t);return u===r?s:u}function nv(e,t){return e!=null&&wu(e,t,ym)}function Na(e,t){return e!=null&&wu(e,t,Nm)}var rv=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=ii.call(t)),e[t]=s},Ea(lt)),iv=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=ii.call(t)),pe.call(e,t)?e[t].push(s):e[t]=[s]},Q),sv=le(Rr);function ze(e){return at(e)?Il(e):Xs(e)}function ot(e){return at(e)?Il(e,!0):Om(e)}function av(e,t){var s={};return t=Q(t,3),Ot(e,function(u,f,m){Gt(s,t(u,f,m),u)}),s}function ov(e,t){var s={};return t=Q(t,3),Ot(e,function(u,f,m){Gt(s,f,t(u,f,m))}),s}var lv=Kn(function(e,t,s){vi(e,t,s)}),nc=Kn(function(e,t,s,u){vi(e,t,s,u)}),uv=Kt(function(e,t){var s={};if(e==null)return s;var u=!1;t=Ee(t,function(m){return m=ln(m,e),u||(u=m.length>1),m}),Pt(e,da(e),s),u&&(s=St(s,R|N|b,rh));for(var f=t.length;f--;)ra(s,t[f]);return s});function cv(e,t){return rc(e,Mi(Q(t)))}var dv=Kt(function(e,t){return e==null?{}:km(e,t)});function rc(e,t){if(e==null)return{};var s=Ee(da(e),function(u){return[u]});return t=Q(t),Wl(e,s,function(u,f){return t(u,f[0])})}function fv(e,t,s){t=ln(t,e);var u=-1,f=t.length;for(f||(f=1,e=r);++u<f;){var m=e==null?r:e[kt(t[u])];m===r&&(u=f,m=s),e=Yt(m)?m.call(e):m}return e}function gv(e,t,s){return e==null?e:Ar(e,t,s)}function mv(e,t,s,u){return u=typeof u=="function"?u:r,e==null?e:Ar(e,t,s,u)}var ic=pu(ze),sc=pu(ot);function hv(e,t,s){var u=ie(e),f=u||cn(e)||Qn(e);if(t=Q(t,4),s==null){var m=e&&e.constructor;f?s=u?new m:[]:Ae(e)?s=Yt(m)?Hn(oi(e)):{}:s={}}return(f?_t:Ot)(e,function(_,S,y){return t(s,_,S,y)}),s}function pv(e,t){return e==null?!0:ra(e,t)}function xv(e,t,s){return e==null?e:Jl(e,t,aa(s))}function vv(e,t,s,u){return u=typeof u=="function"?u:r,e==null?e:Jl(e,t,aa(s),u)}function Xn(e){return e==null?[]:ks(e,ze(e))}function _v(e){return e==null?[]:ks(e,ot(e))}function bv(e,t,s){return s===r&&(s=t,t=r),s!==r&&(s=yt(s),s=s===s?s:0),t!==r&&(t=yt(t),t=t===t?t:0),yn(yt(e),t,s)}function wv(e,t,s){return t=Qt(t),s===r?(s=t,t=0):s=Qt(s),e=yt(e),Rm(e,t,s)}function Sv(e,t,s){if(s&&typeof s!="boolean"&&nt(e,t,s)&&(t=s=r),s===r&&(typeof t=="boolean"?(s=t,t=r):typeof e=="boolean"&&(s=e,e=r)),e===r&&t===r?(e=0,t=1):(e=Qt(e),t===r?(t=e,e=0):t=Qt(t)),e>t){var u=e;e=t,t=u}if(s||e%1||t%1){var f=Al();return Qe(e+f*(t-e+eg("1e-"+((f+"").length-1))),t)}return ea(e,t)}var jv=Wn(function(e,t,s){return t=t.toLowerCase(),e+(s?ac(t):t)});function ac(e){return Ra(he(e).toLowerCase())}function oc(e){return e=he(e),e&&e.replace(yf,gg).replace(Uf,"")}function Cv(e,t,s){e=he(e),t=gt(t);var u=e.length;s=s===r?u:yn(ae(s),0,u);var f=s;return s-=t.length,s>=0&&e.slice(s,f)==t}function yv(e){return e=he(e),e&&sf.test(e)?e.replace(ko,mg):e}function Nv(e){return e=he(e),e&&df.test(e)?e.replace(Ss,"\\$&"):e}var Rv=Wn(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),Ev=Wn(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Av=cu("toLowerCase");function Fv(e,t,s){e=he(e),t=ae(t);var u=t?zn(e):0;if(!t||u>=t)return e;var f=(t-u)/2;return Ci(di(f),s)+e+Ci(ci(f),s)}function Iv(e,t,s){e=he(e),t=ae(t);var u=t?zn(e):0;return t&&u<t?e+Ci(t-u,s):e}function Dv(e,t,s){e=he(e),t=ae(t);var u=t?zn(e):0;return t&&u<t?Ci(t-u,s)+e:e}function Mv(e,t,s){return s||t==null?t=0:t&&(t=+t),$g(he(e).replace(js,""),t||0)}function Lv(e,t,s){return(s?nt(e,t,s):t===r)?t=1:t=ae(t),ta(he(e),t)}function Tv(){var e=arguments,t=he(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var Ov=Wn(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function Pv(e,t,s){return s&&typeof s!="number"&&nt(e,t,s)&&(t=s=r),s=s===r?it:s>>>0,s?(e=he(e),e&&(typeof t=="string"||t!=null&&!Ca(t))&&(t=gt(t),!t&&$n(e))?un(Ft(e),0,s):e.split(t,s)):[]}var kv=Wn(function(e,t,s){return e+(s?" ":"")+Ra(t)});function qv(e,t,s){return e=he(e),s=s==null?0:yn(ae(s),0,e.length),t=gt(t),e.slice(s,s+t.length)==t}function $v(e,t,s){var u=g.templateSettings;s&&nt(e,t,s)&&(t=r),e=he(e),t=Oi({},t,u,xu);var f=Oi({},t.imports,u.imports,xu),m=ze(f),_=ks(f,m),S,y,D=0,M=t.interpolate||Yr,P="__p += '",z=$s((t.escape||Yr).source+"|"+M.source+"|"+(M===qo?_f:Yr).source+"|"+(t.evaluate||Yr).source+"|$","g"),H="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yf+"]")+`
`;e.replace(z,function(ee,ue,de,ht,rt,pt){return de||(de=ht),P+=e.slice(D,pt).replace(Nf,hg),ue&&(S=!0,P+=`' +
__e(`+ue+`) +
'`),rt&&(y=!0,P+=`';
`+rt+`;
__p += '`),de&&(P+=`' +
((__t = (`+de+`)) == null ? '' : __t) +
'`),D=pt+ee.length,ee}),P+=`';
`;var J=pe.call(t,"variable")&&t.variable;if(!J)P=`with (obj) {
`+P+`
}
`;else if(xf.test(J))throw new re(h);P=(y?P.replace(ef,""):P).replace(tf,"$1").replace(nf,"$1;"),P="function("+(J||"obj")+`) {
`+(J?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(y?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+P+`return __p
}`;var oe=uc(function(){return fe(m,H+"return "+P).apply(r,_)});if(oe.source=P,ja(oe))throw oe;return oe}function zv(e){return he(e).toLowerCase()}function Vv(e){return he(e).toUpperCase()}function Bv(e,t,s){if(e=he(e),e&&(s||t===r))return vl(e);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=Ft(t),m=_l(u,f),_=bl(u,f)+1;return un(u,m,_).join("")}function Uv(e,t,s){if(e=he(e),e&&(s||t===r))return e.slice(0,Sl(e)+1);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=bl(u,Ft(t))+1;return un(u,0,f).join("")}function Gv(e,t,s){if(e=he(e),e&&(s||t===r))return e.replace(js,"");if(!e||!(t=gt(t)))return e;var u=Ft(e),f=_l(u,Ft(t));return un(u,f).join("")}function Hv(e,t){var s=me,u=_e;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?gt(t.omission):u}e=he(e);var m=e.length;if($n(e)){var _=Ft(e);m=_.length}if(s>=m)return e;var S=s-zn(u);if(S<1)return u;var y=_?un(_,0,S).join(""):e.slice(0,S);if(f===r)return y+u;if(_&&(S+=y.length-S),Ca(f)){if(e.slice(S).search(f)){var D,M=y;for(f.global||(f=$s(f.source,he($o.exec(f))+"g")),f.lastIndex=0;D=f.exec(M);)var P=D.index;y=y.slice(0,P===r?S:P)}}else if(e.indexOf(gt(f),S)!=S){var z=y.lastIndexOf(f);z>-1&&(y=y.slice(0,z))}return y+u}function Kv(e){return e=he(e),e&&rf.test(e)?e.replace(Po,Sg):e}var Wv=Wn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Ra=cu("toUpperCase");function lc(e,t,s){return e=he(e),t=s?r:t,t===r?xg(e)?yg(e):lg(e):e.match(t)||[]}var uc=le(function(e,t){try{return dt(e,r,t)}catch(s){return ja(s)?s:new re(s)}}),Yv=Kt(function(e,t){return _t(t,function(s){s=kt(s),Gt(e,s,wa(e[s],e))}),e});function Qv(e){var t=e==null?0:e.length,s=Q();return e=t?Ee(e,function(u){if(typeof u[1]!="function")throw new bt(d);return[s(u[0]),u[1]]}):[],le(function(u){for(var f=-1;++f<t;){var m=e[f];if(dt(m[0],this,u))return dt(m[1],this,u)}})}function Xv(e){return Sm(St(e,R))}function Ea(e){return function(){return e}}function Zv(e,t){return e==null||e!==e?t:e}var Jv=fu(),e_=fu(!0);function lt(e){return e}function Aa(e){return Vl(typeof e=="function"?e:St(e,R))}function t_(e){return Ul(St(e,R))}function n_(e,t){return Gl(e,St(t,R))}var r_=le(function(e,t){return function(s){return Rr(s,e,t)}}),i_=le(function(e,t){return function(s){return Rr(e,s,t)}});function Fa(e,t,s){var u=ze(t),f=xi(t,u);s==null&&!(Ae(t)&&(f.length||!u.length))&&(s=t,t=e,e=this,f=xi(t,ze(t)));var m=!(Ae(s)&&"chain"in s)||!!s.chain,_=Yt(e);return _t(f,function(S){var y=t[S];e[S]=y,_&&(e.prototype[S]=function(){var D=this.__chain__;if(m||D){var M=e(this.__wrapped__),P=M.__actions__=st(this.__actions__);return P.push({func:y,args:arguments,thisArg:e}),M.__chain__=D,M}return y.apply(e,nn([this.value()],arguments))})}),e}function s_(){return Be._===this&&(Be._=Ig),this}function Ia(){}function a_(e){return e=ae(e),le(function(t){return Hl(t,e)})}var o_=la(Ee),l_=la(gl),u_=la(Ms);function cc(e){return ha(e)?Ls(kt(e)):qm(e)}function c_(e){return function(t){return e==null?r:Nn(e,t)}}var d_=mu(),f_=mu(!0);function Da(){return[]}function Ma(){return!1}function g_(){return{}}function m_(){return""}function h_(){return!0}function p_(e,t){if(e=ae(e),e<1||e>G)return[];var s=it,u=Qe(e,it);t=Q(t),e-=it;for(var f=Ps(u,t);++s<e;)t(s);return f}function x_(e){return ie(e)?Ee(e,kt):mt(e)?[e]:st(Fu(he(e)))}function v_(e){var t=++Ag;return he(e)+t}var __=ji(function(e,t){return e+t},0),b_=ua("ceil"),w_=ji(function(e,t){return e/t},1),S_=ua("floor");function j_(e){return e&&e.length?pi(e,lt,Ws):r}function C_(e,t){return e&&e.length?pi(e,Q(t,2),Ws):r}function y_(e){return pl(e,lt)}function N_(e,t){return pl(e,Q(t,2))}function R_(e){return e&&e.length?pi(e,lt,Zs):r}function E_(e,t){return e&&e.length?pi(e,Q(t,2),Zs):r}var A_=ji(function(e,t){return e*t},1),F_=ua("round"),I_=ji(function(e,t){return e-t},0);function D_(e){return e&&e.length?Os(e,lt):0}function M_(e,t){return e&&e.length?Os(e,Q(t,2)):0}return g.after=tx,g.ary=zu,g.assign=Vx,g.assignIn=tc,g.assignInWith=Oi,g.assignWith=Bx,g.at=Ux,g.before=Vu,g.bind=wa,g.bindAll=Yv,g.bindKey=Bu,g.castArray=gx,g.chain=ku,g.chunk=Sh,g.compact=jh,g.concat=Ch,g.cond=Qv,g.conforms=Xv,g.constant=Ea,g.countBy=Dp,g.create=Gx,g.curry=Uu,g.curryRight=Gu,g.debounce=Hu,g.defaults=Hx,g.defaultsDeep=Kx,g.defer=nx,g.delay=rx,g.difference=yh,g.differenceBy=Nh,g.differenceWith=Rh,g.drop=Eh,g.dropRight=Ah,g.dropRightWhile=Fh,g.dropWhile=Ih,g.fill=Dh,g.filter=Lp,g.flatMap=Pp,g.flatMapDeep=kp,g.flatMapDepth=qp,g.flatten=Lu,g.flattenDeep=Mh,g.flattenDepth=Lh,g.flip=ix,g.flow=Jv,g.flowRight=e_,g.fromPairs=Th,g.functions=ev,g.functionsIn=tv,g.groupBy=$p,g.initial=Ph,g.intersection=kh,g.intersectionBy=qh,g.intersectionWith=$h,g.invert=rv,g.invertBy=iv,g.invokeMap=Vp,g.iteratee=Aa,g.keyBy=Bp,g.keys=ze,g.keysIn=ot,g.map=Fi,g.mapKeys=av,g.mapValues=ov,g.matches=t_,g.matchesProperty=n_,g.memoize=Di,g.merge=lv,g.mergeWith=nc,g.method=r_,g.methodOf=i_,g.mixin=Fa,g.negate=Mi,g.nthArg=a_,g.omit=uv,g.omitBy=cv,g.once=sx,g.orderBy=Up,g.over=o_,g.overArgs=ax,g.overEvery=l_,g.overSome=u_,g.partial=Sa,g.partialRight=Ku,g.partition=Gp,g.pick=dv,g.pickBy=rc,g.property=cc,g.propertyOf=c_,g.pull=Uh,g.pullAll=Ou,g.pullAllBy=Gh,g.pullAllWith=Hh,g.pullAt=Kh,g.range=d_,g.rangeRight=f_,g.rearg=ox,g.reject=Wp,g.remove=Wh,g.rest=lx,g.reverse=_a,g.sampleSize=Qp,g.set=gv,g.setWith=mv,g.shuffle=Xp,g.slice=Yh,g.sortBy=ex,g.sortedUniq=np,g.sortedUniqBy=rp,g.split=Pv,g.spread=ux,g.tail=ip,g.take=sp,g.takeRight=ap,g.takeRightWhile=op,g.takeWhile=lp,g.tap=jp,g.throttle=cx,g.thru=Ai,g.toArray=Zu,g.toPairs=ic,g.toPairsIn=sc,g.toPath=x_,g.toPlainObject=ec,g.transform=hv,g.unary=dx,g.union=up,g.unionBy=cp,g.unionWith=dp,g.uniq=fp,g.uniqBy=gp,g.uniqWith=mp,g.unset=pv,g.unzip=ba,g.unzipWith=Pu,g.update=xv,g.updateWith=vv,g.values=Xn,g.valuesIn=_v,g.without=hp,g.words=lc,g.wrap=fx,g.xor=pp,g.xorBy=xp,g.xorWith=vp,g.zip=_p,g.zipObject=bp,g.zipObjectDeep=wp,g.zipWith=Sp,g.entries=ic,g.entriesIn=sc,g.extend=tc,g.extendWith=Oi,Fa(g,g),g.add=__,g.attempt=uc,g.camelCase=jv,g.capitalize=ac,g.ceil=b_,g.clamp=bv,g.clone=mx,g.cloneDeep=px,g.cloneDeepWith=xx,g.cloneWith=hx,g.conformsTo=vx,g.deburr=oc,g.defaultTo=Zv,g.divide=w_,g.endsWith=Cv,g.eq=Dt,g.escape=yv,g.escapeRegExp=Nv,g.every=Mp,g.find=Tp,g.findIndex=Du,g.findKey=Wx,g.findLast=Op,g.findLastIndex=Mu,g.findLastKey=Yx,g.floor=S_,g.forEach=qu,g.forEachRight=$u,g.forIn=Qx,g.forInRight=Xx,g.forOwn=Zx,g.forOwnRight=Jx,g.get=ya,g.gt=_x,g.gte=bx,g.has=nv,g.hasIn=Na,g.head=Tu,g.identity=lt,g.includes=zp,g.indexOf=Oh,g.inRange=wv,g.invoke=sv,g.isArguments=An,g.isArray=ie,g.isArrayBuffer=wx,g.isArrayLike=at,g.isArrayLikeObject=Me,g.isBoolean=Sx,g.isBuffer=cn,g.isDate=jx,g.isElement=Cx,g.isEmpty=yx,g.isEqual=Nx,g.isEqualWith=Rx,g.isError=ja,g.isFinite=Ex,g.isFunction=Yt,g.isInteger=Wu,g.isLength=Li,g.isMap=Yu,g.isMatch=Ax,g.isMatchWith=Fx,g.isNaN=Ix,g.isNative=Dx,g.isNil=Lx,g.isNull=Mx,g.isNumber=Qu,g.isObject=Ae,g.isObjectLike=Fe,g.isPlainObject=Mr,g.isRegExp=Ca,g.isSafeInteger=Tx,g.isSet=Xu,g.isString=Ti,g.isSymbol=mt,g.isTypedArray=Qn,g.isUndefined=Ox,g.isWeakMap=Px,g.isWeakSet=kx,g.join=zh,g.kebabCase=Rv,g.last=Ct,g.lastIndexOf=Vh,g.lowerCase=Ev,g.lowerFirst=Av,g.lt=qx,g.lte=$x,g.max=j_,g.maxBy=C_,g.mean=y_,g.meanBy=N_,g.min=R_,g.minBy=E_,g.stubArray=Da,g.stubFalse=Ma,g.stubObject=g_,g.stubString=m_,g.stubTrue=h_,g.multiply=A_,g.nth=Bh,g.noConflict=s_,g.noop=Ia,g.now=Ii,g.pad=Fv,g.padEnd=Iv,g.padStart=Dv,g.parseInt=Mv,g.random=Sv,g.reduce=Hp,g.reduceRight=Kp,g.repeat=Lv,g.replace=Tv,g.result=fv,g.round=F_,g.runInContext=j,g.sample=Yp,g.size=Zp,g.snakeCase=Ov,g.some=Jp,g.sortedIndex=Qh,g.sortedIndexBy=Xh,g.sortedIndexOf=Zh,g.sortedLastIndex=Jh,g.sortedLastIndexBy=ep,g.sortedLastIndexOf=tp,g.startCase=kv,g.startsWith=qv,g.subtract=I_,g.sum=D_,g.sumBy=M_,g.template=$v,g.times=p_,g.toFinite=Qt,g.toInteger=ae,g.toLength=Ju,g.toLower=zv,g.toNumber=yt,g.toSafeInteger=zx,g.toString=he,g.toUpper=Vv,g.trim=Bv,g.trimEnd=Uv,g.trimStart=Gv,g.truncate=Hv,g.unescape=Kv,g.uniqueId=v_,g.upperCase=Wv,g.upperFirst=Ra,g.each=qu,g.eachRight=$u,g.first=Tu,Fa(g,function(){var e={};return Ot(g,function(t,s){pe.call(g.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),g.VERSION=a,_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){g[e].placeholder=g}),_t(["drop","take"],function(e,t){ce.prototype[e]=function(s){s=s===r?1:$e(ae(s),0);var u=this.__filtered__&&!t?new ce(this):this.clone();return u.__filtered__?u.__takeCount__=Qe(s,u.__takeCount__):u.__views__.push({size:Qe(s,it),type:e+(u.__dir__<0?"Right":"")}),u},ce.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var s=t+1,u=s==Je||s==je;ce.prototype[e]=function(f){var m=this.clone();return m.__iteratees__.push({iteratee:Q(f,3),type:s}),m.__filtered__=m.__filtered__||u,m}}),_t(["head","last"],function(e,t){var s="take"+(t?"Right":"");ce.prototype[e]=function(){return this[s](1).value()[0]}}),_t(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");ce.prototype[e]=function(){return this.__filtered__?new ce(this):this[s](1)}}),ce.prototype.compact=function(){return this.filter(lt)},ce.prototype.find=function(e){return this.filter(e).head()},ce.prototype.findLast=function(e){return this.reverse().find(e)},ce.prototype.invokeMap=le(function(e,t){return typeof e=="function"?new ce(this):this.map(function(s){return Rr(s,e,t)})}),ce.prototype.reject=function(e){return this.filter(Mi(Q(e)))},ce.prototype.slice=function(e,t){e=ae(e);var s=this;return s.__filtered__&&(e>0||t<0)?new ce(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=ae(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},ce.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ce.prototype.toArray=function(){return this.take(it)},Ot(ce.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),f=g[u?"take"+(t=="last"?"Right":""):t],m=u||/^find/.test(t);f&&(g.prototype[t]=function(){var _=this.__wrapped__,S=u?[1]:arguments,y=_ instanceof ce,D=S[0],M=y||ie(_),P=function(ue){var de=f.apply(g,nn([ue],S));return u&&z?de[0]:de};M&&s&&typeof D=="function"&&D.length!=1&&(y=M=!1);var z=this.__chain__,H=!!this.__actions__.length,J=m&&!z,oe=y&&!H;if(!m&&M){_=oe?_:new ce(this);var ee=e.apply(_,S);return ee.__actions__.push({func:Ai,args:[P],thisArg:r}),new wt(ee,z)}return J&&oe?e.apply(this,S):(ee=this.thru(P),J?u?ee.value()[0]:ee.value():ee)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=ti[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);g.prototype[e]=function(){var f=arguments;if(u&&!this.__chain__){var m=this.value();return t.apply(ie(m)?m:[],f)}return this[s](function(_){return t.apply(ie(_)?_:[],f)})}}),Ot(ce.prototype,function(e,t){var s=g[t];if(s){var u=s.name+"";pe.call(Gn,u)||(Gn[u]=[]),Gn[u].push({name:t,func:s})}}),Gn[Si(r,I).name]=[{name:"wrapper",func:r}],ce.prototype.clone=Kg,ce.prototype.reverse=Wg,ce.prototype.value=Yg,g.prototype.at=Cp,g.prototype.chain=yp,g.prototype.commit=Np,g.prototype.next=Rp,g.prototype.plant=Ap,g.prototype.reverse=Fp,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Ip,g.prototype.first=g.prototype.head,br&&(g.prototype[br]=Ep),g},Vn=Ng();wn?((wn.exports=Vn)._=Vn,As._=Vn):Be._=Vn}).call(Zn)})(Ki,Ki.exports);var Ie=Ki.exports;const Sw=n=>{console.debug("calculateQuoteTotals",n);const o=$t.create(n[1]||{amount:null,scale:2});if(o.isFailure)throw o.error;const r=o.object,a=$t.create(n[2]||{amount:null,scale:2});if(a.isFailure)throw a.error;const l=a.object,c=Lt.create(n[0]||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=d.percentage(r.toNumber()).convertScale(2),p=d.subtract(h).convertScale(2),x=p.percentage(l.toNumber()).convertScale(2),v=p.add(x).convertScale(2);return{subtotalPrice:d.toObject(),discount:r.toObject(),discountPrice:h.toObject(),priceBeforeTaxes:p.toObject(),tax:l.toObject(),taxesPrice:x.toObject(),totalPrice:v.toObject()}},jw=({currency:n})=>{const{formState:o,control:r}=ur(),{formatNumber:a}=sw(),l=mc({control:r,name:["subtotal_price","discount","tax"]}),c=mc({control:r,name:"tax_label"})||w("quotes.form_fields.tax.label"),d=Sw(l),h=a(d.subtotalPrice),p=a(d.discountPrice),x=a(d.taxesPrice),v=a(d.totalPrice),R=T.useMemo(()=>n.symbol||"",[n]);return i.jsx(Te,{className:"w-full bg-muted",children:i.jsxs(Oe,{className:"flex flex-row items-end gap-2 p-4 border-t",children:[i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-1 font-semibold text-right text-muted-foreground",children:[i.jsx(He,{className:"text-sm",children:w("quotes.form_fields.subtotal_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[h,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(He,{className:"text-sm",children:w("quotes.form_fields.discount.label")}),i.jsx(Hi,{scale:2,disabled:o.disabled,placeholder:w("quotes.form_fields.discount.placeholder"),name:"discount",onChange:N=>{console.log("discount",N)}})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(He,{className:"text-sm text-right",children:w("quotes.form_fields.discount_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[p,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})]}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(He,{className:"text-sm",children:c}),i.jsx(Hi,{scale:2,disabled:o.disabled,placeholder:w("quotes.form_fields.tax.placeholder"),name:"tax"})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(He,{className:"text-sm text-right",children:w("quotes.form_fields.tax_price.label",{label:""})}),i.jsxs(Ve,{className:"flex items-baseline justify-end gap-1 text-2xl tabular-nums",children:[x,i.jsx("span",{className:"text-base font-medium tracking-normal",children:R})]})]})]})," ",i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-0",children:[i.jsx(He,{className:"text-sm font-semibold text-right text-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end gap-1 text-3xl tabular-nums",children:[v,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})})]})})},Vd=n=>{const{percentage:o,cancel:r,error:a,isInProgress:l,onFinishDownload:c}=n,d=T.useId();return T.useEffect(()=>{l&&!a&&o===100&&c&&c()},[o,l,a,c]),i.jsx(ir,{open:l,children:i.jsxs(sr,{className:"sm:max-w-md",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.downloading_dialog.title")}),i.jsx(os,{children:w("quotes.downloading_dialog.description")})]}),i.jsxs("div",{className:"mb-4 space-y-2",id:d,children:[i.jsx(dr,{children:w("quotes.downloading_dialog.progress.label",{status:w(l?"quotes.downloading_dialog.progress.status_in_progress":"quotes.downloading_dialog.progress.status_stopped")})}),i.jsx(Bc,{value:o,max:100,getValueLabel:()=>w("quotes.downloading_dialog.progress.label",{})}),a&&i.jsxs("p",{children:["Error: ",JSON.stringify(a)]})]}),i.jsx(lr,{className:"sm:justify-end",children:i.jsx(Bi,{asChild:!0,children:i.jsx(U,{type:"button",variant:"secondary",onClick:()=>r(),children:w("quotes.downloading_dialog.cancel_button")})})})]})})},Cw=({isInProgress:n,percentage:o,elapsed:r,cancel:a,error:l,className:c})=>{const[d,h]=T.useState(10);return T.useEffect(()=>{if(n&&o>0){const p=r/o*100;h(Math.max(0,Math.round(p-r)))}},[n,o,r]),!n&&!(l!=null&&l.errorMessage)?null:i.jsxs(Te,{className:ge("overflow-hidden",c),children:[i.jsx(ct,{children:i.jsxs(Ve,{className:"flex items-center justify-between",children:[l!=null&&l.errorMessage?"Error en la generación del PDF":"Generando PDF",n&&i.jsx(P0,{className:"w-4 h-4 animate-spin"}),(l==null?void 0:l.errorMessage)&&i.jsx(D0,{className:"w-4 h-4 text-destructive"})]})}),i.jsx(Oe,{children:l!=null&&l.errorMessage?i.jsx("div",{className:"text-destructive",children:l==null?void 0:l.errorMessage}):i.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[i.jsxs("div",{className:"relative w-32 h-40 overflow-hidden rounded-lg bg-muted",children:[i.jsx("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-1000 ease-out bg-primary",style:{height:`${o}%`}}),i.jsx(O0,{className:"absolute transform -translate-x-1/2 -translate-y-1/2 animate-pulse top-1/2 left-1/2 text-muted-foreground",size:48})]}),i.jsx(Bc,{value:o,className:"w-full"}),i.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[i.jsxs("p",{children:["Progreso: ",o,"%"]}),i.jsxs("div",{className:"hidden",children:[i.jsxs("p",{children:["Tiempo transcurrido: ",r," segundos"]}),d>0&&i.jsxs("p",{children:["Tiempo estimado restante: ",d," segundos"]})]})]}),i.jsx(U,{variant:"destructive",onClick:a,className:"hidden",children:"Cancelar generación"})]})})]})},Bd=({quote:n,className:o})=>{const{useReport:r,getQuotePDFFilename:a,useDownloader:l}=Ur(),{download:c}=l(),{report:d,preview:h,isInProgress:p,...x}=r(),[v,R]=T.useState(void 0),N=T.useCallback(()=>{n&&c(n.id,a(n))},[n]);return T.useEffect(()=>{const b=setTimeout(()=>{n&&n.id&&h(n.id)},200);return()=>clearTimeout(b)},[n]),T.useEffect(()=>{if(!p&&d){const b=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(d):window.webkitURL.createObjectURL(d);return R(b),()=>{R(void 0),window.URL.revokeObjectURL(b)}}},[d,p]),n?p?i.jsx(Cw,{isInProgress:p,...x}):i.jsx(a0,{file:v,className:"object-contain",onThumbnailClick:N}):i.jsx(Te,{className:ge("overflow-hidden",o),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})})};Bd.whyDidYouRender=!0;const Tr=eb();function yw({row:n,table:o}){var l;const r=(l=o.options.meta)==null?void 0:l.catalogPicker;if(!r)return null;const a=r.quantities[n.index]??1;return i.jsx(ns,{type:"number",name:"quantity",min:1,className:"w-24",value:a,onChange:c=>{const d=c.target.value;r.setQuantity(n.index,d===""?"":Number(d))}})}function Nw({row:n,table:o}){var a;const r=(a=o.options.meta)==null?void 0:a.catalogPicker;return i.jsxs(U,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:l=>{l.preventDefault(),r==null||r.selectArticle(n.original,n.index)},children:[i.jsx(Co,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:w("common.add")})]})}const so=({onSelect:n})=>{const o=zt(),{pagination:r,globalFilter:a,isFiltered:l}=Tn(),[c,d]=T.useState([]),h=T.useCallback((L,I)=>{d(q=>{const $=[...q];return $[L]=I,$})},[]),p=()=>{d([])},{data:x,isPending:v,isError:R,error:N}=Pd({pagination:{pageIndex:r.pageIndex,pageSize:r.pageSize},searchTerm:a});T.useEffect(()=>{p()},[r,a,l]);const b=T.useMemo(()=>({catalogPicker:{quantities:c,setQuantity:h,selectArticle:(L,I)=>n(L,c[I]===""?1:c[I]??1)}}),[h,n,c]),E=T.useMemo(()=>[Tr.accessor("description",{id:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})}),Tr.accessor("points",{id:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:L})=>i.jsx("div",{className:"text-right",children:L()})}),Tr.accessor("retail_price",{id:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:L})=>{const I=Lt.create(L.original.retail_price).object;return i.jsx("div",{className:"text-right",children:I.toFormat()})}}),Tr.display({id:"quantity",header:()=>i.jsx("div",{className:"font-medium text-right text-foreground",children:w("catalog.list.columns.quantity")}),cell:yw}),Tr.display({id:"row-actions",header:()=>null,cell:Nw})],[]),{table:C}=fs({data:[...(x==null?void 0:x.items)||[]],columns:E,pageCount:(x==null?void 0:x.total_pages)??-1,meta:b});return R?i.jsx(cr,{subtitle:N.message}):v?i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(x==null?void 0:x.total_items)===0&&!l?i.jsx(ds,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>o("/catalog/add")}):i.jsx(us,{className:"bg-transparent border-0 shadow-none",table:C,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:i.jsx(kd,{table:C})})},Do=T.forwardRef(({label:n=w("common.append_block"),className:o,...r},a)=>i.jsxs(U,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Do.displayName="AppendBlockRowButton";const Mo=T.forwardRef(({label:n=w("common.append_article"),className:o,...r},a)=>i.jsxs(U,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Mo.displayName="AppendCatalogArticleRowButton";const Lo=T.forwardRef(({label:n=w("common.append_empty_row"),className:o,...r},a)=>i.jsxs(U,{type:"button",variant:"outline",ref:a,...r,children:[i.jsx(I0,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Lo.displayName="AppendEmptyRowButton";const Rw=({table:n,showLineDiscountColumn:o,hasLineDiscounts:r,onShowLineDiscountColumnChange:a})=>{const l=n.getSelectedRowModel().rows.length,[c,d]=T.useState(!1),h=x=>{if(!x&&o&&r){d(!0);return}a(x)},p=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsxs("div",{className:"grid gap-0.5",children:[i.jsx(dr,{htmlFor:"show-line-discount-column",className:"text-sm font-medium",children:w("quotes.discount_column.label")}),i.jsx("p",{className:"text-xs font-normal text-muted-foreground",children:w("quotes.discount_column.description")})]}),i.jsx(So,{id:"show-line-discount-column",checked:o,onCheckedChange:h})]}),i.jsx(ir,{open:c,onOpenChange:d,children:i.jsxs(sr,{children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.discount_column.confirmation.title")}),i.jsx(os,{children:w("quotes.discount_column.confirmation.description")})]}),i.jsxs(lr,{children:[i.jsx(U,{type:"button",variant:"secondary",onClick:()=>d(!1),children:w("common.cancel")}),i.jsx(U,{type:"button",onClick:()=>{a(!1),d(!1)},children:w("quotes.discount_column.confirmation.confirm")})]})]})})]});return l?i.jsx("nav",{className:"flex items-center h-12 p-1 rounded-md text-muted-foreground bg-muted ",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.duplicateItems()},children:[i.jsx(M0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.duplicate_selected_rows")})]})}),i.jsx(Ye,{children:w("common.duplicate_selected_rows_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.deleteItems()},children:[i.jsx(md,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.remove_selected_rows")})]})}),i.jsx(Ye,{children:w("common.remove_selected_rows_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>n.resetRowSelection(),children:[i.jsx(k0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.reset_selected_rows")})]})}),i.jsx(Ye,{children:w("common.reset_selected_rows_tooltip")})]}),i.jsx(hn,{orientation:"vertical",className:"h-6 ml-1 mr-4"}),i.jsx("p",{className:"text-sm font-normal",children:w("common.rows_selected",{count:l})}),p]})}):i.jsxs("nav",{className:"flex items-center h-12 p-1 rounded-md bg-accent/75 text-muted-foreground",children:[i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Lo,{variant:"link",onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.appendItem()}})}),i.jsx(Ye,{children:w("common.append_empty_row_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Mo,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickCatalogArticle&&((x=n.options.meta)==null||x.pickCatalogArticle())}})}),i.jsx(Ye,{children:w("common.append_article_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Do,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickBlock&&((x=n.options.meta)==null||x.pickBlock())}})}),i.jsx(Ye,{children:w("common.append_block_tooltip")})]})]}),p]})},Ew=({row:n,table:o,onDelete:r})=>{const a=()=>{var l;(l=o.options.meta)==null||l.deleteItems(n.index),r()};return i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.insertItem(n.index)},children:[i.jsx(o0,{className:"w-4 h-4 mr-2"}),w("common.insert_row_above")]}),i.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.insertItem(n.index+1)},children:[i.jsx(Tc,{className:"w-4 h-4 mr-2"}),w("common.insert_row_below")]}),i.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.duplicateItems(n.index)},children:[i.jsx(jo,{className:"w-4 h-4 mr-2"}),w("common.duplicate_row")]}),i.jsxs(Uc,{children:[i.jsx(Gc,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"destructive",size:"sm",children:[i.jsx(md,{className:"w-4 h-4 mr-2"}),w("common.remove_row")]})}),i.jsxs(Hc,{children:[i.jsxs(Kc,{children:[i.jsx(Wc,{children:w("quotes.inline_row_actions.delete_confirmation.title")}),i.jsx(Yc,{children:w("quotes.inline_row_actions.delete_confirmation.description")})]}),i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("common.cancel")}),i.jsx(Zc,{asChild:!0,children:i.jsx(U,{type:"button",variant:"destructive",onClick:a,children:w("quotes.inline_row_actions.delete_confirmation.confirm")})})]})]})]})]})},Aw={droppable:{strategy:d0.Always}},Fw={keyframes({transform:n}){return[{opacity:1,transform:Ya.Transform.toString(n.initial)},{opacity:0,transform:Ya.Transform.toString({...n.final,x:n.final.x+5,y:n.final.y+5})}]},easing:"ease-out",sideEffects({active:n}){n.node.animate([{opacity:0},{opacity:1}],{duration:hc.duration,easing:hc.easing})}};function Nc({columns:n,data:o,defaultValues:r,initialState:a,actions:l,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h}){const[p,x]=T.useState({}),[v,R]=T.useState(),[N,b]=T.useState(null),E=T.useMemo(()=>o.map(O=>O.id),[o]),C=Fd({data:o,columns:n,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:a,state:{rowSelection:p,columnVisibility:{...a==null?void 0:a.columnVisibility,discount:c}},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:x,getCoreRowModel:Ed(),getRowId:O=>O==null?void 0:O.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(O,k)=>{l.insert(O,k||(r==null?void 0:r.items[0]),{shouldFocus:!0})},appendItem:O=>{l.append(O||(r==null?void 0:r.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{l.pickCatalogArticle&&(l==null||l.pickCatalogArticle())},pickBlock:()=>{l.pickBlock&&(l==null||l.pickBlock())},duplicateItems:O=>{var k;if(O!=null){const K=((k=l.getItem)==null?void 0:k.call(l,O))??C.getRowModel().rows[O].original;l.insert(O+1,{...K,id:void 0},{shouldFocus:!0})}else if(C.getSelectedRowModel().rows.length){const K=C.getSelectedRowModel().rows[C.getSelectedRowModel().rows.length-1].index,ne=C.getSelectedRowModel().rows.map(B=>({...B.original,id:void 0}));C.getRowModel().rows.length<K+1?l.append(ne):l.insert(K+1,ne,{shouldFocus:!0}),C.resetRowSelection()}},deleteItems:O=>{if(O!=null)l.remove(O);else if(C.getSelectedRowModel().rows.length>0){let k=C.getSelectedRowModel().rows.length-1;for(;k>=0;k--){const K=E.indexOf(String(C.getSelectedRowModel().rows[k].id));l.remove(K),E.splice(K,1)}C.resetRowSelection()}else l.remove()},updateItem:(O,k,K,ne)=>{l.update(O,{...k,[`${K}`]:ne})}}}),L=l0(Pi(_0,{}),Pi(v0,{}),Pi(x0,{}),Pi(p0,{}));function I(O){var ne;let k=O.active.id,K=(ne=O.over)==null?void 0:ne.id;if(K!==void 0&&k!==K){let B=E.indexOf(String(K));if(C.getSelectedRowModel().rows.length>1)C.getSelectedRowModel().rows.forEach((me,_e)=>{const W=E.indexOf(String(me.id));_e>0&&(k=me.id,B=E.indexOf(String(K)),B<W&&(B=B+1)),l.move(W,B),E.splice(B,0,E.splice(W,1)[0]),K=me.id});else{const me=E.indexOf(String(k));l.move(me,B)}}R(null)}function q({active:O}){C.getSelectedRowModel().rowsById[O.id]||C.resetRowSelection(),R(O.id)}function $(){R(null)}function te(O){return v?O.filter(k=>{const K=typeof k=="string"?k:k.id;return K===v||!C.getSelectedRowModel().rowsById[K]}):O}return i.jsx(u0,{measuring:Aw,sensors:L,onDragEnd:I,onDragStart:q,onDragCancel:$,collisionDetection:c0,children:i.jsxs(Te,{children:[i.jsx(ct,{className:"sticky z-10 top-16 bg-card/90",children:i.jsx(Ve,{children:i.jsx(Rw,{table:C,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h})})}),i.jsxs(Oe,{children:[i.jsxs(uo,{className:"table-fixed",children:[i.jsx(co,{className:"sticky top-0 z-10 bg-background",children:C.getHeaderGroups().map(O=>i.jsx(pn,{className:"hover:bg-transparent",children:O.headers.map(k=>i.jsx(fo,{className:"px-2 py-1",style:{width:k.getSize()===Number.MAX_SAFE_INTEGER?"auto":k.getSize()},children:k.isPlaceholder?null:i.jsx(Dd,{table:C,header:k})},k.id))},O.id))}),i.jsx(go,{children:i.jsx(g0,{items:te(E),strategy:m0,children:te(C.getRowModel().rows).map(O=>{const k=O,K=k.id===N;return i.jsxs(T.Fragment,{children:[i.jsx(hw,{id:k.id,isActive:K,onActivate:()=>b(k.id),children:k.getVisibleCells().map(ne=>i.jsx(qr,{className:"px-2 py-2 align-top",style:{width:ne.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":ne.column.getSize()},children:Gi(ne.column.columnDef.cell,ne.getContext())},ne.id))}),K&&i.jsx(pn,{className:"border border-t-0 border-destructive/30 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5",children:i.jsx(qr,{colSpan:k.getVisibleCells().length,className:"px-2 py-2",children:i.jsx(Ew,{row:k,table:C,onDelete:()=>b(null)})})})]},k.id)})})})]}),f0.createPortal(i.jsx(h0,{dropAnimation:Fw,className:"z-40 opacity-100",children:v&&i.jsx("div",{className:"relative flex flex-wrap",children:C.getSelectedRowModel().rows.length?i.jsx(oo,{variant:"destructive",className:"absolute z-50 flex items-center justify-center w-2 h-2 p-3 rounded-full top left -left-2 -top-2",children:C.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),i.jsx(Nt,{children:i.jsxs(nr,{children:[i.jsx(Lo,{onClick:()=>{var O;return(O=C.options.meta)==null?void 0:O.appendItem()}}),i.jsx(Mo,{onClick:()=>{var O;C.options.meta&&C.options.meta.pickCatalogArticle&&((O=C.options.meta)==null||O.pickCatalogArticle())}}),i.jsx(Do,{onClick:()=>{var O;C.options.meta&&C.options.meta.pickBlock&&((O=C.options.meta)==null||O.pickBlock())}})]})})]})})}const Iw={en:[{id:2000000098,code:"CAP_CLA_SEMI_SUSPENDIDO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r
Hanging rods: CHROME/ BLACK\r
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
Shoe rack door: YES/NO / Profile finish: BLACK LACQUER / SILVER MATTE\r
Shoe cabinet door glass finish: FLOAT BRONZE C-424\r
Composed of:`},{id:2000000084,code:"CAP_FRE_ARM_ABATIBLE_EN",title:"CHARACTERISTICS OF THE FRONT OF THE HINGED WARDROBE",body:`Size of opening: 2275x1390 mm.\r
Model: ARGO / Finish: LACQUER / Colour: TO BE DETERMINED\r
Door thickness: 22 or 19 mm\r
Door finish: SMOOTH \r
Handle: KNOB TO BE DETERMINED\r
Hardware finish: CHROME OR ANTHRACITE\r
Perimetral doorposts: VISIBLE, REMETED OR COMBI TO BE DETERMINED.\r
Number of doors: 2 \r
Composed of:`},{id:2000000089,code:"CAP_FRE_ARM_CORREDERA_EN",title:"Size of opening: 2440x5180mm. ",body:`Model: PANORAMIC P.O. / Finish: LACQUER / Colour: WHITE\r
No. of listers: NO LISTELS / Panels finish: LACQUERED PANEL \r
Handle: \r
Perimeter frame: \r
Nº of doors: \r
INCORPORATED HYDRAULIC BRAKE (not available in lower doors of 650 mm.) OR INCORPORATED MAGNETIC BRAKE. \r
Composed of:`},{id:2000000092,code:"CAP_INT_ARM_FORRADO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r
Hanging rods: CHROME/ BLACK\r
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
Composed of:`},{id:2000000109,code:"CAP_INT_EST_CRISTAL_EN",title:"Frames finish: BLACK ANODIZED",body:`Side frame panel finish: BRONZE FLOAT BRONZE GLASS C-424\r
Rear panel finish: BRONZE FLOAT GLASS C-424\r
Complements finish: MELAMIN / Colour: DENBER OAK M-242\r
Thickness of accessories: 25 mm.\r
Hanging bars: BLACK\r
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
Composed of:`},{id:2000000095,code:"CAP_SEP_AMBIENTES_EN",title:"CHARACTERISTICS SEPARATION OF ROOMS",body:`Size of opening: 2450x3000 mm.\r
Model: LYN / Finish: ANODISED / Colour: BLACK\r
No. of crosspieces: 2 HORIZONTAL CROSSBARS\r
Panel finish: TRANSPARENT TEMPLARED \r
Handle: DOUBLE PER DOOR\r
Brake: DOUBLE PER DOOR (OPENING AND CLOSING)\r
Guide: VISTA (DOUBLE EMBELLECEDOR)\r
Number of panels: 2 SLIDING + 2 FIXED`}],es:[{id:54,code:"CAP_CLA_SEMI_SUSPENDIDO_ES",title:"Acabado vestidor: MELAMINA / color: A DETERMINAR",body:`Espesor bloque: 25 mm. / Espesor complementos: 25 mm.\r
Barras de colgar: CROMO/ NEGRA/ BRONCE\r
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r
Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r
Baldas deslizantes: X DE 145 MM. A DETERMINAR\r
Compuesto por:`},{id:52,code:"CAP_FRE_ARM_ABATIBLE_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de hueco: 2275x1390 mm.\r
Modelo: ARGO / Acabado: LACADO / Color: A DETERMINAR\r
Grosor hoja: 22 o 19 mm\r
Acabado de hojas: LISAS\r
Tirador: UÑERO A DETERMINAR\r
Acabado herrajes: CROMADO O ANTRACITA\r
Jambas perimetrales: VISTAS, REMETIDAS O COMBI A DETERMINAR.\r
Nº de hojas: 2\r
Compuesto por:`},{id:51,code:"CAP_FRE_ARM_CORREDERA_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO CORREDERA",body:`Medida de Hueco:2440x5180mm.\r
Modelo: PANORAMIC P.O. / Acabado: LACADO / Color: BLANCO\r
Nº de lístelos: SIN LISTELOS / Acabado paneles: PANEL LACADO\r
Tirador:\r
Cerco perimetral: \r
Nº de hojas:\r
FRENO HIDRAULICO INCORPORADO O FRENO MAGNETICO INCORPORADO\r
Compuesto por:`},{id:53,code:"CAP_INT_ARM_FORRADO_ES",title:"CARACTERISTICAS INTERIOR DE ARMARIO",body:`Acabado: MELAMINA / color: A DETERMINAR\r
Espesor bloque: 19 mm. / Espesor complementos: 19 mm.\r
Barras de colgar: CROMO/ NEGRA/ BRONCE\r
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r
Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r
Baldas deslizantes: X DE 145 MM. A DETERMINAR\r
Compuesto por:`},{id:2000000108,code:"CAP_INT_EST_CRISTAL_ES",title:"Acabado bastidores: ANODIZADO NEGRO",body:`Acabado panel bastidores laterales: CRISTAL TEMPLADO FLOAT BRONCE C-424\r
Acabado trasera: CRISTAL TEMPLADO FLOAT BRONCE C-424\r
Acabado complementos: MELAMINA / Color: ROBLE DENBER M-242\r
Espesor complementos: 25 mm.\r
Barras de colgar: NEGRA\r
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424 \r
Tirador cajones: xxxxx / Cajones: 4 DE 180 MM.\r
Compuesto por:`},{id:50,code:"CAP_SEP_AMBIENTES_ES",title:"CARACTERISTICAS SEPARACIÓN DE AMBIENTES",body:`Medida de Hueco: 2450x3000 mm.\r
Modelo: LYN / Acabado: ANODIZADO / Color: NEGRO\r
Nº de travesaños: 2 TRAVESAÑOS HORIZONTALES\r
Acabado paneles: TRANSPARENTE TEMPLADO \r
Tirador: DOBLE POR PUERTA\r
Freno: DOBLE POR PUERTA (APERTURA Y CIERRE)\r
Guía: VISTA (DOBLE EMBELLECEDOR)\r
Nº de hojas: 2 CORREDERAS + 2 FIJOS`}]},Rc=({onSelect:n})=>{const{i18n:o}=rs(),[r]=T.useState(o.resolvedLanguage||"es"),[a]=T.useState(Iw[r.toLowerCase()]);return console.log(r),i.jsx(ao,{className:"h-96",children:i.jsx("div",{className:"flex flex-col gap-2 p-4 pt-0",children:a&&a.sort((l,c)=>l.title.localeCompare(c.title)).map((l,c)=>i.jsx("button",{className:"flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent",onClick:()=>n&&n(l,1),children:i.jsxs("div",{className:"flex flex-col w-full gap-1",children:[i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("div",{className:"font-semibold",children:l.title})})}),i.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:i.jsx("p",{dangerouslySetInnerHTML:{__html:l.body.substring(0,300).replace(`\r
`,"<br>")}})})]})},l.id))})})},Dw=({isOpen:n,onOpenChange:o,onSelect:r})=>Ld("(min-width: 768px)")?i.jsx(ir,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(sr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(os,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Rc,{onSelect:r}),i.jsx(lr,{children:i.jsx(U,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(Jc,{open:n,onOpenChange:o,children:i.jsxs(ed,{children:[i.jsxs(td,{className:"text-left",children:[i.jsx(nd,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(rd,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Rc,{onSelect:r}),i.jsx(id,{className:"pt-2",children:i.jsx(sd,{asChild:!0,children:i.jsx(U,{variant:"outline",children:w("common.close")})})})]})}),Mw=({isOpen:n,onOpenChange:o,onSelect:r})=>Ld("(min-width: 768px)")?i.jsx(ir,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(sr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(os,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(rr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(so,{onSelect:r})}),i.jsx(lr,{children:i.jsx(U,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(Jc,{open:n,onOpenChange:o,children:i.jsxs(ed,{children:[i.jsxs(td,{className:"text-left",children:[i.jsx(nd,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(rd,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(rr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(so,{onSelect:r})}),i.jsx(id,{className:"pt-2",children:i.jsx(sd,{asChild:!0,children:i.jsx(U,{variant:"outline",children:w("common.close")})})})]})}),Lw=({currency:n,language:o,defaultValues:r})=>{var ne;const{toast:a}=_n(),{control:l,getValues:c,setValue:d,watch:h}=ur(),p=h("show_line_discount_column")??!0,x=!!((ne=c("items"))!=null&&ne.some(B=>{var me;return Number((me=B.discount)==null?void 0:me.amount)>0})),[v]=T.useState("dialog"),[R,N]=T.useState(!1),[b,E]=T.useState(!1),{fields:C,...L}=b0({control:l,name:"items"}),I=xw([{id:"description",accessorKey:"description",header:w("quotes.form_fields.items.description.label"),cell:({row:{index:B,original:me}})=>i.jsx(qt,{readOnly:me==null?void 0:me.id_article,autoSize:!0,name:`items.${B}.description`}),minSize:200,size:400},{id:"quantity",accessorKey:"quantity",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.quantity.label")}),cell:({row:{index:B}})=>i.jsx(tw,{scale:0,className:"text-right",name:`items.${B}.quantity`}),size:75},{id:"unit_price",accessorKey:"unit_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{currency:n,language:o,scale:2,className:"text-right",name:`items.${B}.unit_price`}),size:125},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"text-right",name:`items.${B}.subtotal_price`}),size:150},{id:"discount",accessorKey:"discount",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.discount.label")}),cell:({row:{index:B}})=>i.jsx(Hi,{scale:2,className:"text-right",name:`items.${B}.discount`}),size:100},{id:"total_price",accessorKey:"total_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.total_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"font-semibold text-right",name:`items.${B}.total_price`}),size:150}],{enableDragHandleColumn:!0,enableSelectionColumn:!0}),q=T.useCallback((B,me=1)=>{L.append({...B,quantity:{amount:100*me,scale:xn.DEFAULT_SCALE},unit_price:B.retail_price,discount:{amount:null,scale:2}}),a({title:w("quotes.catalog_picker_dialog.toast_article_added"),description:B.description})},[L]),$=T.useCallback(B=>{L.append({description:`${B.title}
${B.body}`,quantity:{amount:null,scale:xn.DEFAULT_SCALE},unit_price:{amount:null,scale:Y0.DEFAULT_SCALE},discount:{amount:null,scale:2}}),a({title:w("quotes.blocks_picker_dialog.toast_article_added"),description:B.title})},[L]),[te,O]=T.useState(!1),k=[265,440,655],K=4;return v==="dialog"?i.jsxs("div",{className:"relative",children:[i.jsx(Nc,{actions:{...L,getItem:B=>c(`items.${B}`),pickCatalogArticle:()=>N(!0),pickBlock:()=>E(!0)},columns:I,data:C,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})}),i.jsx(Mw,{onSelect:q,isOpen:R,onOpenChange:N}),i.jsx(Dw,{onSelect:$,isOpen:b,onOpenChange:E})]}):i.jsxs(z0,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[i.jsx(_c,{defaultSize:k[0],collapsedSize:K,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{O(!0)},onExpand:()=>{O(!1)},className:ge(te&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:i.jsx(Nc,{actions:{...L,getItem:B=>c(`items.${B}`)},columns:I,data:C,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})})}),i.jsx(V0,{withHandle:!0,className:"mx-3"}),i.jsx(_c,{defaultSize:k[1],minSize:10,children:i.jsx(rr,{syncWithLocation:!1,children:i.jsx(so,{onSelect:q})})})]})},Tw=()=>{const{formState:n}=ur();return i.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[i.jsxs(Qa,{className:"md:col-span-6",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),children:[i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(mn,{required:!0,className:"col-span-2",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_reference.placeholder"),name:"customer_reference"}),i.jsx(Vc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(mn,{label:w("quotes.form_fields.validity.label"),description:w("quotes.form_fields.validity.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.validity.placeholder"),name:"validity"}),i.jsx(qt,{className:"col-span-2",label:w("quotes.form_fields.payment_method.label"),description:w("quotes.form_fields.payment_method.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.payment_method.placeholder"),name:"payment_method"})]}),i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(qt,{className:"col-span-3",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_information.placeholder"),name:"customer_information",errors:n.errors}),i.jsx(qt,{className:"col-span-3",label:w("quotes.form_fields.notes.label"),description:w("quotes.form_fields.notes.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.notes.placeholder"),name:"notes"})]})]}),i.jsx(Qa,{className:"hidden md:col-span-2",title:w("quotes.create.form_groups.status.title"),description:w("quotes.create.form_groups.status.desc"),children:i.jsxs("div",{className:"grid gap-6",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx(dr,{htmlFor:"status",children:"Status"}),i.jsxs(Zi,{children:[i.jsx(Ji,{id:"status","aria-label":"Select status",children:i.jsx(es,{placeholder:"Select status"})}),i.jsxs(ts,{children:[i.jsx(Dn,{value:"draft",children:"Draft"}),i.jsx(Dn,{value:"published",children:"Active"}),i.jsx(Dn,{value:"archived",children:"Archived"})]})]})]}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.lang_code.label"),description:w("quotes.form_fields.lang_code.desc"),placeholder:w("quotes.form_fields.lang_code.placeholder"),name:"lang_code"}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.currency_code.label"),description:w("quotes.form_fields.currency_code.desc"),placeholder:w("quotes.form_fields.currency_code.placeholder"),name:"currency_code"})]})})]})},Ud=({id:n,onSentTo:o,disabled:r})=>{const a=()=>{o(n)};return i.jsxs(Uc,{children:[i.jsx(Gc,{asChild:!0,disabled:r,children:i.jsxs(U,{variant:"ghost",className:"h-10 gap-1 text-primary disabled:text-secondary-foreground",children:[i.jsx(q0,{className:"w-4 h-4"}),w("quotes.quote_sent_to_editor.trigger_button")]})}),i.jsxs(Hc,{children:[i.jsxs(Kc,{children:[i.jsx(Wc,{children:w("quotes.quote_sent_to_editor.title")}),i.jsx(Yc,{children:w("quotes.quote_sent_to_editor.description")})]}),i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("common.cancel")}),i.jsx(Zc,{asChild:!0,children:i.jsx(U,{onClick:a,children:w("common.continue")})})]})]})]})},Ow=["draft","ready","delivered","accepted","rejected","archived"],Pw={draft:["draft","ready","archived"],ready:["ready","delivered","archived"],delivered:["delivered","accepted","rejected","archived"],accepted:["accepted","rejected","archived"],rejected:["rejected","accepted","archived"],archived:["archived","draft","ready","delivered","accepted","rejected"]},Gd=({type:n="button",status:o,onChangeStatus:r})=>{const[a,l]=T.useState(o),c=h=>l(h);T.useEffect(()=>{o&&l(o)},[o]);const d=()=>{a!==o&&r(a,o)};return i.jsxs(ir,{children:[i.jsx(Ic,{asChild:!0,children:n==="button"?i.jsxs(U,{size:"sm",variant:"outline",className:"h-8 gap-1",children:[i.jsx(w0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only md:not-sr-only md:whitespace-nowrap",children:w("quotes.quote_status_editor.trigger_button")})]}):i.jsx(S0,{status:o,isEditable:!0})}),i.jsxs(sr,{children:[i.jsx(ar,{children:i.jsx(or,{children:w("quotes.quote_status_editor.title")})}),i.jsx(j0,{}),i.jsx("div",{className:"grid gap-4 py-4",children:Ow.map(h=>{const p=!Pw[o].includes(h);return i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx(So,{id:h,checked:a===h,onCheckedChange:()=>c(h),disabled:p}),i.jsxs("div",{className:"grid gap-1.5 leading-none",children:[i.jsx(dr,{htmlFor:h,className:ge("font-medium",p?"text-input":"text-foreground"),children:w(`quotes.quote_status_editor.status.${h}.title`)}),i.jsx("p",{className:ge("text-sm",p?"text-input":"text-muted-foreground"),children:w(`quotes.quote_status_editor.status.${h}.description`)})]})]},h)})}),i.jsxs(lr,{className:"pt-6 border-t",children:[i.jsx(Bi,{asChild:!0,children:i.jsx(U,{type:"button",variant:"secondary",children:w("common.cancel")})}),i.jsx(Bi,{asChild:!0,children:i.jsx(U,{onClick:d,disabled:a===o,children:w("quotes.quote_status_editor.submit_button")})})]})]})]})},kw=({quoteId:n,className:o})=>{const r=zt(),{toast:a}=_n(),{useOne:l,useSetStatus:c,useSentTo:d,useDownloader:h,useDuplicate:p,getQuotePDFFilename:x}=Ur(),{data:v,status:R}=l(n),{mutate:N}=c(),{mutate:b}=d(n),{mutate:E}=p(),{download:C,...L}=h(),{formatCurrency:I,formatNumber:q}=Md({locale:(v==null?void 0:v.lang_code)||"ES"}),$=T.useMemo(()=>v?{subtotal_price:I(v.subtotal_price),discount:q(v.discount),discount_price:I(v.discount_price),tax:q(v.tax),tax_price:I(v.tax_price),total_price:I(v.total_price)}:{subtotal_price:"0,00 €",discount:"0",discount_price:"0,00 €",tax:"0",tax_price:"0,00 €",total_price:"0,00 €"},[v]),te=T.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!(v!=null&&v.date_sent),[v]),O=T.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!!(v!=null&&v.date_sent),[v]),k=W=>{N({id:v.id,newStatus:W},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed"),variant:"success"})}})},K=W=>{b({sent_date:C0(new Date)},{onSuccess:()=>{a({description:w("quotes.quote_sent_to_editor.toast_status_changed"),variant:"success"})}})},ne=T.useCallback(()=>{a({description:w("quotes.downloading_dialog.toast_success"),variant:"success"})},[a]),B=T.useCallback(()=>{v&&C(v.id,x(v))},[v]);if(R==="error"||R!=="success")return null;if(!v)return i.jsx(Te,{className:ge("overflow-hidden",o),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})});const me=W=>{E({id:W},{onSuccess(Re){a({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${Re.id}`,{relative:"path"})}})},_e=W=>{N({id:W,newStatus:"archived"},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})};return i.jsxs(i.Fragment,{children:[i.jsx(Vd,{...L,onFinishDownload:ne}),i.jsx(ad,{defaultValue:"resume",children:i.jsxs(Te,{className:"w-[390px] overflow-hidden",children:[i.jsxs(ct,{className:"gap-3 border-b bg-accent",children:[i.jsxs(Ve,{className:"flex items-center justify-between text-lg",children:[i.jsx("span",{children:w("quotes.list.resume.title")}),i.jsx(Gd,{status:v.status,onChangeStatus:k,type:"badge"})]}),i.jsx("div",{className:"flex w-full mr-auto text-foreground",children:i.jsxs("div",{className:"flex justify-between w-full",children:[i.jsxs(nr,{className:"gap-0",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",disabled:O,onClick:W=>{W.preventDefault(),r(`/quotes/edit/${v.id}`,{relative:"path"})},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Editar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Editar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",onClick:W=>{W.preventDefault(),me(v.id)},children:[i.jsx(jo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Duplicar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",onClick:B,children:[i.jsx(cd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Descargar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Descargar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",disabled:O,onClick:W=>{W.preventDefault(),_e(v.id)},children:[i.jsx(ld,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Archivar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Archivar"})})]})]}),i.jsx(nr,{children:i.jsx(Ud,{disabled:O||!te,id:v.id,onSentTo:K})})]})})]}),i.jsxs(Oe,{className:"p-6 text-sm",children:[i.jsxs(od,{className:"grid w-full grid-cols-2",children:[i.jsx(Xa,{value:"resume",children:w("quotes.list.resume.tabs.resume")}),i.jsx(Xa,{value:"preview",children:w("quotes.list.resume.tabs.preview")})]}),i.jsx(Za,{value:"resume",className:"pt-4",children:i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.quote_information")}),i.jsxs("dl",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.reference.label")}),i.jsx("dd",{className:"font-medium",children:v.reference})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.date.label")}),i.jsx("dd",{className:"font-medium",children:new Date(v.date).toLocaleDateString()})]}),i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("dt",{className:"text-muted-foreground whitespace-nowrap",children:w("quotes.form_fields.customer_reference.label")}),i.jsx("dd",{className:"font-medium text-right whitespace-break-spaces",children:v.customer_reference})]})]})]}),i.jsx(hn,{className:"my-4"}),i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.customer_information")}),i.jsx("div",{children:v.customer_information})]}),i.jsx(hn,{className:"my-4"}),i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.price_information")}),i.jsxs("ul",{className:"grid gap-3",children:[i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.subtotal_price.label")}),i.jsx("span",{children:$.subtotal_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.discount_value.label",{value:$.discount})}),i.jsx("span",{children:$.discount_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.tax_value.label",{label:v.tax_label,value:$.tax})}),i.jsx("span",{children:$.tax_price})]}),i.jsxs("li",{className:"flex items-center justify-between font-semibold",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsx("span",{children:$.total_price})]})]})]})}),i.jsx(Za,{value:"preview",children:i.jsx(Bd,{quote:v})})]}),i.jsx(Nt,{className:"flex flex-row items-center px-6 py-3 border-t bg-accent",children:i.jsx("div",{className:"text-xs text-muted-foreground"})})]})})]})},qw=({status:n="all",preview:o=!1})=>{const r=zt(),{toast:a}=_n(),l=T.useId(),c=T.useId(),{pagination:d,globalFilter:h,isFiltered:p}=Tn(),[x,v]=T.useState(void 0),{useList:R,useDownloader:N,useSetStatus:b,useDuplicate:E,getQuotePDFFilename:C}=Ur(),{mutate:L}=b(),{mutate:I}=E(),{data:q,isPending:$,isError:te,error:O}=R({pagination:{pageIndex:d.pageIndex,pageSize:d.pageSize},status:n,quickSearchTerm:h}),{download:k,...K}=N(),ne=je=>{v(je)},B=T.useCallback(()=>{a({description:w("quotes.downloading_dialog.toast_success")})},[a]),me=T.useCallback(je=>{r(`/quotes/edit/${je.id}`,{relative:"path"})},[r,a]),_e=je=>{I({id:je},{onSuccess(De){a({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${De.id}`,{relative:"path"})}})},W=je=>{L({id:je,newStatus:"archived"},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})},Re=(je,De)=>{L({id:je,newStatus:De},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w(`quotes.status.${De}`)}),variant:"success"})}})},Je=T.useMemo(()=>{const je=[{id:"reference",accessorKey:"reference",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.reference")}),cell:({row:{original:G},renderValue:be})=>{const et=!!((G==null?void 0:G.status)==="accepted"&&(G!=null&&G.date_sent));return i.jsx(U,{size:"sm",variant:"link",disabled:et,className:"h-8 gap-1 px-0 text-left text-ellipsis",onClick:it=>{it.preventDefault(),me(G)},children:i.jsx("div",{className:"",children:be()})})}},{id:"status",accessorKey:"status",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.status")}),cell:({row:{original:G}})=>i.jsx(Gd,{type:"badge",status:G.status,onChangeStatus:be=>Re(G.id,be)})},{id:"date_sent",accessor:"date_sent",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:w("quotes.list.columns.date_sent")}),cell:({row:{original:G}})=>{const be=Jn.create(G.date_sent),et=be.isSuccess&&!be.object.isEmpty();return i.jsx("div",{className:"text-left text-ellipsis",children:et?i.jsx(Id,{label:be.object.toLocaleDateString("es-ES"),className:"text-green-800 bg-green-100 hover:text-green-800 hover:bg-green-100"}):i.jsx(i.Fragment,{})})}},{id:"date",accessor:"date",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:w("quotes.list.columns.date")}),cell:({row:{original:G}})=>{const be=Jn.create(G.date);return i.jsx("div",{className:"text-left text-ellipsis",children:be.isSuccess?be.object.toLocaleDateString("es-ES"):"-"})}},{id:"customer_reference",accessorKey:"customer_reference",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.customer_reference")}),cell:({renderValue:G})=>i.jsx("div",{className:"text-left text-ellipsis",children:G()})},{id:"customer_information",accessorKey:"customer_information",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.customer_information")}),cell:({row:{original:G}})=>i.jsx("div",{className:"text-left text-ellipsis",children:G.customer_information.split(`
`).map((be,et)=>i.jsxs("span",{className:et===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[be,i.jsx("br",{})]},et))}),size:500}],De=[{id:"row-actions",header:()=>null,cell:({row:{original:G}})=>{const be=(G==null?void 0:G.status)==="accepted"&&!(G!=null&&G.date_sent),et=(G==null?void 0:G.status)==="accepted"&&!!(G!=null&&G.date_sent),it=(G==null?void 0:G.status)==="archived";return i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(nr,{className:"gap-0",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",disabled:et,onClick:bn=>{bn.preventDefault(),me(G)},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Editar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Editar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",onClick:bn=>{bn.preventDefault(),_e(G.id)},children:[i.jsx(jo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Duplicar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",onClick:()=>{k(G.id,C(G))},children:[i.jsx(cd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Descargar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Descargar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",disabled:it||et,onClick:bn=>{bn.preventDefault(),W(G.id)},children:[i.jsx(ld,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Archivar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Archivar"})})]})]}),i.jsx(nr,{children:i.jsx(Ud,{id:G.id,onSentTo:()=>null,disabled:et||!be})})]})}}];return o?je:[...je,...De]},[o]),{table:Y}=fs({data:(q==null?void 0:q.items)??[],columns:Je,pageCount:(q==null?void 0:q.total_pages)??-1});return T.useEffect(()=>{Y&&q&&(q==null?void 0:q.total_pages)>0&&v(Y.getRowModel().rows[0])},[q,Y]),te?i.jsx(cr,{subtitle:O.message}):$?i.jsxs("div",{className:"grid items-start flex-1 gap-4 sm:py-0 md:gap-8 lg:grid-cols-3 xl:grid-cols-3",children:[i.jsx(Te,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:i.jsx(Oe,{children:i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),i.jsx("div",{})]}):(q==null?void 0:q.total_items)===0&&!p?i.jsx(Te,{children:i.jsx(Oe,{children:i.jsx(ds,{subtitle:"Empieza creando alguna cotización",buttonText:w("quotes.create.title"),onButtonClick:()=>r("add",{relative:"path"})})})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[i.jsx("div",{id:l,className:"flex items-stretch flex-1",children:i.jsx(us,{table:Y,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:ne,activeRowIndex:x==null?void 0:x.index,children:i.jsx(qd,{table:Y})})}),o&&i.jsx("div",{id:c,className:"flex items-stretch ",children:i.jsx(kw,{quoteId:x==null?void 0:x.original.id})})]}),i.jsx(Vd,{...K,onFinishDownload:B})]})},rS=()=>{const n=zt(),o=ww(),{toast:r}=_n(),[a,l]=T.useState(Oa.createDefaultCode().object),[c,d]=T.useState(Pr.createDefaultCode().object),h=T.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",show_line_discount_column:!0,subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:0,scale:0},discount_price:{amount:0,scale:0,currency_code:""},before_tax_price:{amount:void 0,scale:2,currency_code:""},tax:{amount:void 0,scale:0},tax_label:"% IVA",tax_price:{amount:void 0,scale:2,currency_code:""},total_price:{amount:void 0,scale:2,currency_code:""},items:[{id_article:"",description:"",quantity:{amount:null,scale:2},unit_price:{amount:null,scale:2,currency_code:a.code},subtotal_price:{amount:null,scale:2,currency_code:a.code},discount:{amount:null,scale:2},total_price:{amount:null,scale:2,currency_code:a.code}}]}),[a.code]),{useOne:p,useUpdate:x}=Ur(),{data:v,status:R,error:N}=p(o),{mutate:b,isPending:E}=x(String(o)),C=is({mode:"onBlur",defaultValues:h}),{getValues:L,reset:I,handleSubmit:q,formState:$,control:te,watch:O,setValue:k}=C,{isSubmitting:K,isDirty:ne}=$;Io({isDirty:ne}),T.useEffect(()=>{if(!ne)return;const{unsubscribe:_e}=O((W,{name:Re,type:Je})=>{if(Re==="items"){W.items&&W.items.map((je,De)=>{if(je){const G=io(je);Ie.isEqual(G.subtotal_price.toObject(),je.subtotal_price)||k(`items.${De}.subtotal_price`,G.subtotal_price.toObject()),Ie.isEqual(G.total_price.toObject(),je.total_price)||k(`items.${De}.total_price`,G.total_price.toObject())}});const Y=Ka(W,!0);Ie.isEqual(Y.subtotal_price.toObject(),W.total_price)||k("subtotal_price",Y.subtotal_price.toObject()),Ie.isEqual(Y.discount_price.toObject(),W.total_price)||k("discount_price",Y.discount_price.toObject()),Ie.isEqual(Y.before_tax_price.toObject(),W.before_tax_price)||k("before_tax_price",Y.before_tax_price.toObject()),Ie.isEqual(Y.tax_price.toObject(),W.tax_price)||k("tax_price",Y.tax_price.toObject()),Ie.isEqual(Y.total_price.toObject(),W.total_price)||k("total_price",Y.total_price.toObject())}else if(Re&&Je==="change"){if(Re==="currency_code"){const Y=Oa.createFromCode(W.currency_code??Oa.DEFAULT_CURRENCY_CODE);if(Y.isFailure)throw console.error(Y.error),Y.error;l(Y.object)}if(Re==="lang_code"){const Y=Pr.createFromCode(W.lang_code??Pr.DEFAULT_LANGUAGE_CODE);if(Y.isFailure)throw console.error(Y.error),Y.error;d(Y.object)}if(["discount","tax"].includes(Re)){const Y=Ka(W,!0);Ie.isEqual(Y.subtotal_price.toObject(),W.total_price)||k("subtotal_price",Y.subtotal_price.toObject()),Ie.isEqual(Y.discount_price.toObject(),W.total_price)||k("discount_price",Y.discount_price.toObject()),Ie.isEqual(Y.before_tax_price.toObject(),W.before_tax_price)||k("before_tax_price",Y.before_tax_price.toObject()),Ie.isEqual(Y.tax_price.toObject(),W.tax_price)||k("tax_price",Y.tax_price.toObject()),Ie.isEqual(Y.total_price.toObject(),W.total_price)||k("total_price",Y.total_price.toObject())}if(Re!=null&&Re.startsWith("items")){const Y=Number(Re.split(".")[1]),je=Re.split(".")[2];if(["quantity","unit_price","discount"].includes(je)&&W.items&&W.items[Y]){const De=W.items[Y],G=io(De);Ie.isEqual(G.quantity.toObject(),De.quantity)||k(`items.${Y}.quantity`,G.quantity.toObject()),Ie.isEqual(G.unit_price.toObject(),De.unit_price)||k(`items.${Y}.unit_price`,G.unit_price.toObject()),Ie.isEqual(G.discount.toObject(),De.discount)||k(`items.${Y}.discount`,G.discount.toObject()),Ie.isEqual(G.subtotal_price.toObject(),De.subtotal_price)||k(`items.${Y}.subtotal_price`,G.subtotal_price.toObject()),Ie.isEqual(G.total_price.toObject(),De.total_price)||k(`items.${Y}.total_price`,G.total_price.toObject());const be=Ka(W,!0);Ie.isEqual(be.subtotal_price.toObject(),W.total_price)||k("subtotal_price",be.subtotal_price.toObject()),Ie.isEqual(be.discount_price.toObject(),W.total_price)||k("discount_price",be.discount_price.toObject()),Ie.isEqual(be.before_tax_price.toObject(),W.before_tax_price)||k("before_tax_price",be.before_tax_price.toObject()),Ie.isEqual(be.tax_price.toObject(),W.tax_price)||k("tax_price",be.tax_price.toObject()),Ie.isEqual(be.total_price.toObject(),W.total_price)||k("total_price",be.total_price.toObject())}}}});return()=>_e()},[O,ne,k]);const B=async(_e,W)=>{b(_e,{onError:Re=>{console.error(Re),r({title:"Error",description:Re.message,variant:"destructive"})},onSuccess:()=>{I(L()),r({title:"Cotización guardada",variant:"success"}),W&&n("/quotes")}})},me=T.useCallback(()=>{n("/quotes",{state:{id:o}})},[n,o]);return T.useEffect(()=>{R==="success"&&v&&I(v)},[R,v,I]),R==="error"?i.jsx(cr,{errorMessage:N.message}):R!=="success"?i.jsx(Ln,{}):i.jsxs(i.Fragment,{children:[(K||E)&&i.jsx(Ln,{title:"Guardando cotización"}),i.jsx(ss,{...C,children:i.jsx("form",{onSubmit:q(_e=>B(_e,!1)),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(zc,{}),i.jsxs("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:[w("quotes.edit.title")," ",v.reference]}),i.jsx(Id,{label:w(`quotes.status.${v.status}`),className:"ml-auto sm:ml-0"}),i.jsxs("div",{className:"items-center hidden gap-2 md:ml-auto md:flex",children:[i.jsx(y0,{label:w("common.close"),variant:"secondary",size:"sm",onClick:me}),i.jsx(wo,{label:w("common.save"),size:"sm",disabled:$.isSubmitting||$.isLoading||$.isValidating}),i.jsx(U,{size:"sm",disabled:$.isSubmitting||$.isLoading||$.isValidating,onClick:q(_e=>B(_e,!0)),children:w("common.save_close")})]})]}),i.jsx(Tw,{}),i.jsx(jw,{currency:a}),i.jsx(Lw,{currency:a,language:c,defaultValues:h}),i.jsxs("div",{className:"flex items-center justify-center gap-2 md:hidden",children:[i.jsx(U,{variant:"outline",size:"sm",children:w("common.discard")}),i.jsx(U,{onClick:q(_e=>B(_e,!1)),size:"sm",children:w("quotes.edit.buttons.save_quote")})]})]})})}),!1]})},$w=T.createContext(null),zw=({children:n})=>{const[o,r]=qc();return i.jsx($w.Provider,{value:{pagination:o,setPagination:r},children:n})},iS=({children:n})=>i.jsx(as,{children:i.jsx(zw,{children:i.jsxs(zr,{className:"quotes-layout",children:[i.jsx(Vr,{}),i.jsx(Br,{children:n})]})})}),sS=()=>{const n=zt(),[o,r]=T.useState("all"),[a,l]=rw(!0),c=[{value:"all",label:w("quotes.list.tabs.all")},{value:"draft",label:w("quotes.list.tabs.draft")},{value:"ready",label:w("quotes.list.tabs.ready")},{value:"delivered",label:w("quotes.list.tabs.delivered")},{value:"accepted",label:w("quotes.list.tabs.accepted")},{value:"rejected",label:w("quotes.list.tabs.rejected")},{value:"archived",label:w("quotes.list.tabs.archived")}];return i.jsxs(rr,{children:[i.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(se,{i18nKey:"quotes.list.title"})}),i.jsx("p",{className:"text-muted-foreground",children:i.jsx(se,{i18nKey:"quotes.list.subtitle"})})]}),i.jsx("div",{className:"flex items-center space-x-2",children:i.jsxs(U,{onClick:()=>n("/quotes/add"),children:[i.jsx(yo,{className:"w-4 h-4 mr-2"}),w("quotes.create.title")]})})]}),i.jsxs(ad,{value:o,onValueChange:r,children:[i.jsxs("div",{className:"flex flex-col items-start justify-between mb-4 sm:flex-row sm:items-center",children:[i.jsxs("div",{className:"w-full mb-4 sm:w-auto sm:mb-0",children:[i.jsx(od,{className:"hidden sm:flex",children:c.map(d=>i.jsx(Xa,{value:d.value,children:d.label},d.value))}),i.jsxs("div",{className:"flex items-center w-full space-x-2 sm:hidden",children:[i.jsx(dr,{children:w("quotes.list.tabs_title")}),i.jsxs(Zi,{value:o,onValueChange:r,children:[i.jsx(Ji,{children:i.jsx(es,{placeholder:"Seleccionar estado"})}),i.jsx(ts,{children:c.map(d=>i.jsx(Dn,{value:d.value,children:d.label},d.value))})]})]})]}),i.jsx("div",{className:"flex items-baseline justify-center mr-4 font-medium",children:i.jsx(Wb,{buttonText:"Ayuda",title:"Ayuda sobre el Estado de Cotizaciones",content:Vw})}),i.jsx("div",{className:"flex items-center gap-2 ml-auto",children:i.jsx(N0,{"aria-label":"Show quote preview",variant:"outline",defaultPressed:!1,pressed:a,onPressedChange:l,children:a?i.jsxs(i.Fragment,{children:[i.jsx(dd,{className:"w-4 h-4 mr-2"}),w("common.disable_preview")]}):i.jsxs(i.Fragment,{children:[i.jsx(T0,{className:"w-4 h-4 mr-2"}),w("common.enable_preview")]})})})]}),c.map(d=>i.jsx(Za,{value:d.value,children:i.jsx(qw,{status:d.value,preview:a})},d.value))]})]})},Vw=i.jsxs(ao,{className:"grid gap-4 py-4",children:[i.jsx("p",{children:"El estado de una cotización indica su posición actual en el proceso de negocio."}),i.jsx("p",{children:"Los estados posibles son:"}),i.jsxs("ul",{className:"pl-6 space-y-2 list-disc",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Borrador:"})," La cotización está en proceso de creación o edición."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Preparado:"})," La cotización está lista para ser enviada al cliente."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Entregado:"})," La cotización ha sido enviada al cliente."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Aceptado:"})," El cliente ha aprobado la cotización."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Rechazado:"})," El cliente no ha aceptado la cotización."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Arcivado:"})," La cotización ha sido guardada para referencia futura y ya no está activa."]})]}),i.jsxs("p",{children:["Utiliza estos estados para hacer un seguimiento eficiente de tus cotizaciones y optimizar tu proceso de ventas. El estado ",i.jsx("strong",{children:"Archivado"})," es útil para mantener un historial de cotizaciones pasadas sin que interfieran con las cotizaciones activas."]})]}),Bw=n=>{const o=$r(),r=Mn(),a=r().data().resource("settings").action("one").id("me").params().get(),l=r().auth().action("profile").get();return{useOne:()=>vd({queryKey:a,queryFn:()=>o.getOne({resource:"profile",id:""}),...n}),useUpdate:()=>{const c=Jt();return en({mutationKey:a,mutationFn:d=>o.updateOne({resource:"profile",data:d,id:""}),onSuccess:(d,h)=>{const p=x=>x&&{...x,lang_code:h.lang_code??x.lang_code,dealer:{...x.dealer,...d}};return c.setQueryData(a,p),c.setQueryData(l,p),Promise.all([c.invalidateQueries({queryKey:a}),c.invalidateQueries({queryKey:l})])}})},useUploadLogo:()=>{const c=Jt(),{mutate:d,mutateAsync:h,...p}=en({mutationKey:["data","default","settings"],mutationFn:x=>o.uploadFile({path:"profile/logo",file:x,key:"logo"}),onError:()=>c.invalidateQueries({queryKey:["data","default","settings"]}),onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","settings"]})}});return{upload:d,uploadAsync:h,...p}}}},aS=()=>{var k,K;const[n,o]=T.useState("profile"),{useOne:r,useUpdate:a,useUploadLogo:l}=Bw(),{toast:c}=_n(),{i18n:d}=rs(),{data:h,status:p,error:x}=r(),v=T.useMemo(()=>({lang_code:"es",contact_information:"",default_payment_method:"",default_notes:"",default_legal_terms:"",default_quote_validity:"",default_show_line_discount_column:!0,default_tax:{amount:void 0,scale:2},default_tax_label:"% IVA"}),[]),{mutate:R}=a(),{upload:N}=l(),b=is({mode:"onBlur",values:h?{...h.dealer,lang_code:h.lang_code}:void 0,defaultValues:v}),{formState:E,reset:C,getValues:L,handleSubmit:I}=b,{isSubmitting:q,isDirty:$}=E,te=ne=>{var me;const B=(me=ne.target.files)==null?void 0:me[0];if(B){if(B.type!=="image/png"&&B.type!=="image/jpeg"){alert(w("settings.form_fields.logo.invalid_format"));return}const _e=new FileReader;_e.onloadend=()=>{const W=new Image;W.onload=()=>{const Re=W.width,Je=W.height,Y=Re/Je===2;Re<200||Je<100||!Y?alert(w("settings.form_fields.logo.invalid_dimensions")):N(B)},W.src=_e.result},_e.readAsDataURL(B)}};Io({isDirty:$});const O=async ne=>{R(ne,{onError:B=>{console.debug(B),c({title:"Error",description:B.message,variant:"destructive"})},onSuccess:()=>{d.language!==ne.lang_code&&d.changeLanguage(ne.lang_code??"es"),C(L()),c({description:"Ajustes guardados",variant:"success"})}})};return q?i.jsx(Ln,{title:"Guardando ajustes"}):p==="error"?i.jsx(cr,{errorMessage:x.message}):p!=="success"?i.jsx(Ln,{}):i.jsx(ss,{...b,children:i.jsx("form",{onSubmit:I(O),children:i.jsxs("div",{className:"mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]",children:[((k=b.formState.errors.root)==null?void 0:k.message)&&i.jsxs(Oc,{variant:"destructive",children:[i.jsx(ud,{className:"w-4 h-4"}),i.jsx(Pc,{children:i.jsx(se,{i18nKey:"common.error"})}),i.jsx(kc,{children:(K=b.formState.errors.root)==null?void 0:K.message})]}),i.jsxs("nav",{className:"grid gap-4 text-sm text-muted-foreground",children:[i.jsx("a",{onClick:()=>o("profile"),className:n==="profile"?"font-semibold text-primary":"cursor-pointer",children:i.jsx(se,{i18nKey:"settings.edit.tabs.profile"})}),i.jsx("a",{onClick:()=>o("quotes"),className:n==="quotes"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.quotes"})}),i.jsx("a",{onClick:()=>o("legal"),className:n==="legal"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.legal"})})]}),i.jsxs("div",{className:ge("grid gap-6",n==="profile"?"visible":"hidden"),children:[i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.desc"})})]}),i.jsx(Oe,{children:i.jsx(pc,{control:b.control,name:"lang_code",render:({field:ne})=>i.jsxs(Zi,{value:ne.value,onValueChange:ne.onChange,children:[i.jsx(Ji,{"aria-label":w("settings.form_fields.language.label"),children:i.jsx(es,{placeholder:w("settings.form_fields.language.placeholder")})}),i.jsxs(ts,{children:[i.jsx(Dn,{value:"es",children:"Español"}),i.jsx(Dn,{value:"en",children:"English"})]})]})})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{rows:8,placeholder:w("settings.form_fields.contact_information.placeholder"),name:"contact_information",required:!0})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.desc"})})]}),i.jsx(Oe,{children:i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:"w-[400px] h-[200px] border border-gray-300 flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:h.dealer.logo?h.dealer.logo:"https://via.placeholder.com/200x100",width:400,height:200,style:{objectFit:"contain"}})}),i.jsx("div",{children:i.jsx("p",{className:"mt-2 text-sm text-gray-500",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.requirements"})})})]})}),i.jsxs(Nt,{className:"px-6 py-4 border-t",children:[i.jsx(dr,{htmlFor:"logo-upload",className:"inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium transition-colors rounded-md cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.upload"})}),i.jsx(ns,{id:"logo-upload",type:"file",accept:".png,.jpg,.jpeg",onChange:te,className:"hidden"})]})]})]}),i.jsxs("div",{className:ge("grid gap-6",n==="quotes"?"visible":"hidden"),children:[i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.desc"})})]}),i.jsx(Oe,{children:i.jsx(pc,{control:b.control,name:"default_show_line_discount_column",render:({field:ne})=>i.jsx(So,{checked:ne.value??!0,onCheckedChange:ne.onChange})})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.desc"})})]}),i.jsxs(Oe,{children:[i.jsx(mn,{maxLength:32,placeholder:w("settings.form_fields.default_tax_label.placeholder"),name:"default_tax_label",required:!0,description:w("settings.form_fields.default_tax_label.desc")}),i.jsx("br",{}),i.jsx(Hi,{scale:2,disabled:E.disabled,placeholder:w("settings.form_fields.default_tax.desc"),name:"default_tax",required:!0,description:w("settings.form_fields.default_tax.desc")})]}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_payment_method.placeholder"),name:"default_payment_method",required:!0,errors:b.formState.errors})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_quote_validity.placeholder"),name:"default_quote_validity",required:!0})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_notes.placeholder"),name:"default_notes"})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]})]}),i.jsx("div",{className:ge("grid gap-6",n==="legal"?"visible":"hidden"),children:i.jsxs(Te,{className:"h-",children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{rows:25,placeholder:w("settings.form_fields.default_legal_terms.placeholder"),name:"default_legal_terms"})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]})})]})})})},Uw=T.createContext(null),Gw=({children:n})=>i.jsx(Uw.Provider,{value:{},children:n}),oS=({children:n})=>i.jsx(as,{children:i.jsx(Gw,{children:i.jsxs(zr,{className:"settings-layout",children:[i.jsx(Vr,{}),i.jsxs(Br,{children:[i.jsx("div",{className:"grid w-full max-w-6xl gap-2 mx-auto",children:i.jsx("h1",{className:"text-2xl font-semibold md:text-3xl",children:i.jsx(se,{i18nKey:"settings.edit.title"})})}),n]})]})})});export{Qw as CatalogLayout,Xw as CatalogList,Zw as DashboardPage,Jw as DealerLayout,eS as DealersList,tS as ErrorPage,Ww as LoginPageWithLanguageSelector,Yw as LogoutPage,nS as QuoteCreate,rS as QuoteEdit,iS as QuotesLayout,sS as QuotesList,aS as SettingsEditor,oS as SettingsLayout};