react-luminus-components 2.0.5-beta.r19-2 → 2.0.5-beta.r19-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -241,7 +241,7 @@ to {
241
241
  *
242
242
  * This source code is licensed under the MIT license found in the
243
243
  * LICENSE file in the root directory of this source tree.
244
- */var $x;function BN(){return $x||($x=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function w(N){return typeof N=="string"||typeof N=="function"||N===r||N===c||N===o||N===i||N===d||N===f||typeof N=="object"&&N!==null&&(N.$$typeof===p||N.$$typeof===h||N.$$typeof===a||N.$$typeof===s||N.$$typeof===u||N.$$typeof===v||N.$$typeof===x||N.$$typeof===_||N.$$typeof===g)}function C(N){if(typeof N=="object"&&N!==null){var Q=N.$$typeof;switch(Q){case t:var X=N.type;switch(X){case l:case c:case r:case o:case i:case d:return X;default:var G=X&&X.$$typeof;switch(G){case s:case u:case p:case h:case a:return G;default:return Q}}case n:return Q}}}var b=l,$=c,T=s,k=a,O=t,j=u,S=r,E=p,A=h,D=n,R=o,M=i,I=d,F=!1;function U(N){return F||(F=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(N)||C(N)===l}function P(N){return C(N)===c}function z(N){return C(N)===s}function V(N){return C(N)===a}function H(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function Y(N){return C(N)===u}function Z(N){return C(N)===r}function J(N){return C(N)===p}function ee(N){return C(N)===h}function W(N){return C(N)===n}function L(N){return C(N)===o}function B(N){return C(N)===i}function q(N){return C(N)===d}It.AsyncMode=b,It.ConcurrentMode=$,It.ContextConsumer=T,It.ContextProvider=k,It.Element=O,It.ForwardRef=j,It.Fragment=S,It.Lazy=E,It.Memo=A,It.Portal=D,It.Profiler=R,It.StrictMode=M,It.Suspense=I,It.isAsyncMode=U,It.isConcurrentMode=P,It.isContextConsumer=z,It.isContextProvider=V,It.isElement=H,It.isForwardRef=Y,It.isFragment=Z,It.isLazy=J,It.isMemo=ee,It.isPortal=W,It.isProfiler=L,It.isStrictMode=B,It.isSuspense=q,It.isValidElementType=w,It.typeOf=C}()),It}var Sx;function zN(){return Sx||(Sx=1,process.env.NODE_ENV==="production"?Vu.exports=FN():Vu.exports=BN()),Vu.exports}var cm,Tx;function WN(){if(Tx)return cm;Tx=1;var e=zN(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=r,o[e.Memo]=i;function a(p){return e.isMemo(p)?i:o[p.$$typeof]||t}var s=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,f=Object.prototype;function h(p,g,v){if(typeof g!="string"){if(f){var x=d(g);x&&x!==f&&h(p,x,v)}var _=l(g);c&&(_=_.concat(c(g)));for(var w=a(p),C=a(g),b=0;b<_.length;++b){var $=_[b];if(!n[$]&&!(v&&v[$])&&!(C&&C[$])&&!(w&&w[$])){var T=u(g,$);try{s(p,$,T)}catch{}}}}return p}return cm=h,cm}WN();function UN(){return typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"}function I0(e,t){const n=m.useContext(O$);if(!n)throw new Error("Missing <CookiesProvider>");const i=Object.assign(Object.assign({},{doNotUpdate:!0}),t),[o,a]=m.useState(()=>n.getAll(i));UN()&&m.useLayoutEffect(()=>{function u(){const d=n.getAll(i);HN(e||null,d,o)&&a(d)}return n.addChangeListener(u),()=>{n.removeChangeListener(u)}},[n,o]);const s=m.useMemo(()=>n.set.bind(n),[n]),l=m.useMemo(()=>n.remove.bind(n),[n]),c=m.useMemo(()=>n.update.bind(n),[n]);return[o,s,l,c]}function HN(e,t,n){if(!e)return!0;for(let r of e)if(t[r]!==n[r])return!0;return!1}const VN=()=>{const e=Re.c(12),{axiosOptions:t,cookieDomain:n}=m.useContext(ln);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=["Authorization"],e[0]=r):r=e[0];const[,i,o]=I0(r);let a;e[1]!==t?(a=Qt.create(t),e[1]=t,e[2]=a):a=e[2];const s=a,l=qN;let c;e[3]!==s||e[4]!==n||e[5]!==i?(c=async(p,g)=>s.post("/user/login",{kid:p,password:g}).then(v=>(localStorage.setItem("token",v.data),i("Authorization",v.data,{path:"/",secure:!0,sameSite:"none",domain:n,expires:H4(new Date(Date.now()),24)}),v.data)).catch(YN),e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6];const u=c;let d;e[7]!==o?(d=()=>{localStorage.removeItem("token"),localStorage.removeItem("user"),o("Authorization")},e[7]=o,e[8]=d):d=e[8];const f=d;let h;return e[9]!==u||e[10]!==f?(h={isAuthenticated:l,login:u,logout:f},e[9]=u,e[10]=f,e[11]=h):h=e[11],h};function qN(){const e=localStorage.getItem("token");return e!==null&&e.length>0}function YN(e){return console.log(e),null}const GN=()=>{const e=Re.c(18);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=["Authorization"],e[0]=t):t=e[0];const[,,n]=I0(t),{msalScopes:r,msalExtraScopes:i}=m.useContext(Jf),{instance:o,inProgress:a}=hy.useMsal(),s=hy.useIsAuthenticated();let l;e[1]!==s?(l=()=>s,e[1]=s,e[2]=l):l=e[2];const c=l;let u;e[3]!==c||e[4]!==a?(u=()=>!c()&&a!==mO.InteractionStatus.None,e[3]=c,e[4]=a,e[5]=u):u=e[5];const d=u;let f;e[6]!==o||e[7]!==i||e[8]!==r?(f=async()=>o.loginRedirect({scopes:r,extraScopesToConsent:i}).then(KN).catch(ZN),e[6]=o,e[7]=i,e[8]=r,e[9]=f):f=e[9];const h=f;let p;e[10]!==o||e[11]!==n?(p=()=>{o.logout(),localStorage.removeItem("user"),n("Authorization")},e[10]=o,e[11]=n,e[12]=p):p=e[12];const g=p;let v;return e[13]!==c||e[14]!==d||e[15]!==h||e[16]!==g?(v={isAuthenticated:c,isAuthenticating:d,login:h,logout:g},e[13]=c,e[14]=d,e[15]=h,e[16]=g,e[17]=v):v=e[17],v};function KN(){return""}function ZN(){return null}const M$=()=>{const e=Re.c(13),{useMsal:t}=m.useContext(Jf),n=gO.useQueryClient(),r=VN(),i=GN();let o;e[0]!==r||e[1]!==i||e[2]!==n||e[3]!==t?(o=(d,f)=>{const h=t?i.login():r.login(d,f);return n.invalidateQueries(),h},e[0]=r,e[1]=i,e[2]=n,e[3]=t,e[4]=o):o=e[4];const a=o,s=t?i.isAuthenticated:r.isAuthenticated;let l;e[5]!==i||e[6]!==t?(l=t?i.isAuthenticating:XN,e[5]=i,e[6]=t,e[7]=l):l=e[7];const c=t?i.logout:r.logout;let u;return e[8]!==s||e[9]!==l||e[10]!==c||e[11]!==a?(u={isAuthenticated:s,isAuthenticating:l,login:a,logout:c},e[8]=s,e[9]=l,e[10]=c,e[11]=a,e[12]=u):u=e[12],u};function XN(){return!1}const QN="_toast_1s57i_1",gl={toast:QN},JN=e=>{switch(e){case"success":return 5e3;case"info":return 5e3;case"danger":return 1e4;case"warning":return 1e4;case"prompt":return 1e4;default:return 5e3}},ah=()=>{const e=Re.c(1),t=eD;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n={addNotification:t},e[0]=n):n=e[0],n};function eD(e,t){const n=ZC(e),r=JN(t),i=y.jsxs(y.Fragment,{children:[n,y.jsx(AC,{onClick:()=>Fa.dismiss(n),type:"button",style:{position:"absolute",fontSize:"12px",top:"calc(50% - 6px)",right:"8px"}})]});e:switch(t){case"success":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(RR,{size:12}),className:ue("luminus-toast-success rounded shadow bg-success",gl.toast)});break e}case"danger":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(_R,{size:12}),className:ue("luminus-toast-danger rounded shadow bg-danger",gl.toast)});break e}case"warning":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(bR,{size:12}),className:ue("luminus-toast-warning rounded shadow bg-warning",gl.toast)});break e}case"info":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(xR,{size:12}),className:ue("luminus-toast-info rounded shadow bg-info",gl.toast)});break e}case"prompt":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(wR,{size:12}),className:ue("luminus-toast-prompt rounded shadow bg-light",gl.toast)});break e}}}const tD=Qt.CancelToken,sh=e=>{const{authenticated:t=!0,differentBaseUrl:n,silent:r=!1,customToken:i,ignoreDelegation:o,noToastOnStatus:a}={...e},{language:s,axiosOptions:l,texts:{axios:c}}=m.useContext(ln),{delegation:u}=m.useContext(VC),{getToken:d}=m.useContext(Jf),f=m.useMemo(()=>(u==null?void 0:u.id)??null,[u==null?void 0:u.id]),{addNotification:h}=ah(),{isAuthenticating:p}=M$(),g=m.useMemo(()=>Qt.create(l),[l]),v=m.useCallback(async b=>{var T,k,O;if(t&&!b.headers.Authorization){if(p())return console.log("Authentication in progress, waiting for token..."),Promise.reject(new Error("Authentication in progress"));const j=i?{token:i,expiresOn:H4(new Date(Date.now()),1)}:await d();if(!j)return console.log("No bearer token"),Promise.reject(new Error("No bearer token"));if(K4(j.expiresOn))return console.log("Token expired"),Promise.reject(new Error("Token expired"));b.headers.Authorization=`Bearer ${j.token}`}f!==null&&!o&&(b.headers.DelegationId=f.toString());const $=localStorage.getItem("search-use-asterisk")!=="false";return b.headers["Search-Use-Asterisk"]=$?"true":"false",(T=b.url)!=null&&T.includes("culture=")?b.url=(k=b.url)==null?void 0:k.replace(/culture=[a-z]{2}/,`culture=${s}`):b.url=`${b.url}${(O=b.url)!=null&&O.includes("?")?"&":"?"}culture=${s}`,b},[t,d,s,i,f,o,p]),x=m.useCallback(b=>{var k,O;if(console.log(b),Qt.isCancel(b)||b.message==="Authentication in progress"||b.message==="No bearer token"||b.message==="Token expired")return Promise.reject(b);const $=k0(b);if($.length>0){const j=$.find(S=>S.name.toLowerCase()==="others");return j?(!r&&h(j.errors,"danger"),Promise.reject(b)):(!r&&h(c.validationError,"warning"),Promise.reject(b))}const T=GC(b);return T!==null?(!r&&h(`${c.permissionError}: ${M0(", ",...T)}`,"danger"),Promise.reject(b)):(a??[]).includes((k=b.response)==null?void 0:k.status)?Promise.reject(b):((O=b.response)==null?void 0:O.status)===403?(!r&&h(c.forbiddenError,"danger"),Promise.reject(b)):b.message&&b.message==="Network Error"?(!r&&h(c.networkError,"danger"),Promise.reject(b)):(Qt.isCancel(b)||(!r&&h(c.unexpectedError,"danger"),(b.response||b.request)&&!r&&h(c.unexpectedError,"danger")),Promise.reject(b))},[h,c.forbiddenError,c.networkError,c.permissionError,c.unexpectedError,c.validationError,r,a]),[_,w]=m.useState(!1);return m.useEffect(()=>{n&&(g.defaults.baseURL=n)},[n,g.defaults]),m.useEffect(()=>{g.interceptors.request.clear();const b=g.interceptors.request.use(v,$=>Promise.reject($));return w(!0),()=>{g.interceptors.request.eject(b),w(!1)}},[g.interceptors.request,v]),m.useEffect(()=>{g.interceptors.response.clear();const b=g.interceptors.response.use($=>$,x);return()=>{g.interceptors.response.eject(b)}},[g.interceptors.response,x]),m.useMemo(()=>({...g,interceptorsUsed:_}),[g,_])};let Il;const P0=()=>{const e=Re.c(15),{show:t,text:n,showConfirm:r,hideConfirm:i,textSm:o}=m.useContext(jC);let a;e[0]!==i?(a=()=>{i()},e[0]=i,e[1]=a):a=e[1];const s=a;let l;e[2]!==s?(l=()=>{s(),Il&&Il(!0)},e[2]=s,e[3]=l):l=e[3];const c=l;let u;e[4]!==s?(u=()=>{s(),Il&&Il(!1)},e[4]=s,e[5]=u):u=e[5];const d=u;let f;e[6]!==r?(f=async(g,v)=>(r(g,v),new Promise(nD)),e[6]=r,e[7]=f):f=e[7];const h=f;let p;return e[8]!==h||e[9]!==d||e[10]!==c||e[11]!==t||e[12]!==n||e[13]!==o?(p={confirm:h,onConfirm:c,onCancel:d,show:t,text:n,textSm:o},e[8]=h,e[9]=d,e[10]=c,e[11]=t,e[12]=n,e[13]=o,e[14]=p):p=e[14],p};function nD(e){Il=e}var xt;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(xt||(xt={}));var zg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(zg||(zg={}));const Ce=xt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=e=>{switch(typeof e){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return Number.isNaN(e)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(e)?Ce.array:e===null?Ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ce.promise:typeof Map<"u"&&e instanceof Map?Ce.map:typeof Set<"u"&&e instanceof Set?Ce.set:typeof Date<"u"&&e instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},he=xt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),rD=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class lr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(this),r}static assert(t){if(!(t instanceof lr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}lr.create=e=>new lr(e);const $s=(e,t)=>{let n;switch(e.code){case he.invalid_type:e.received===Ce.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case he.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,xt.jsonStringifyReplacer)}`;break;case he.unrecognized_keys:n=`Unrecognized key(s) in object: ${xt.joinValues(e.keys,", ")}`;break;case he.invalid_union:n="Invalid input";break;case he.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${xt.joinValues(e.options)}`;break;case he.invalid_enum_value:n=`Invalid enum value. Expected ${xt.joinValues(e.options)}, received '${e.received}'`;break;case he.invalid_arguments:n="Invalid function arguments";break;case he.invalid_return_type:n="Invalid function return type";break;case he.invalid_date:n="Invalid date";break;case he.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:xt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case he.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case he.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case he.custom:n="Invalid input";break;case he.invalid_intersection_types:n="Intersection results could not be merged";break;case he.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case he.not_finite:n="Number must be finite";break;default:n=t.defaultError,xt.assertNever(e)}return{message:n}};let A$=$s;function iD(e){A$=e}function Ud(){return A$}const Hd=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)s=c(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},oD=[];function _e(e,t){const n=Ud(),r=Hd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===$s?void 0:$s].filter(i=>!!i)});e.common.issues.push(r)}class In{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return ze;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return In.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const ze=Object.freeze({status:"aborted"}),es=e=>({status:"dirty",value:e}),Hn=e=>({status:"valid",value:e}),Wg=e=>e.status==="aborted",Ug=e=>e.status==="dirty",la=e=>e.status==="valid",ac=e=>typeof Promise<"u"&&e instanceof Promise;var Oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Oe||(Oe={}));class ei{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ex=(e,t)=>{if(la(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new lr(e.common.issues);return this._error=n,this._error}}};function ot(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{const{message:l}=e;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:i}}class ut{get description(){return this._def.description}_getType(t){return _i(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new In,ctx:{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ac(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},i=this._parseSync({data:t,path:r.path,parent:r});return Ex(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return la(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>la(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(ac(i)?i:Promise.resolve(i));return Ex(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:he.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Dr({schema:this,typeName:Ue.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Kr.create(this,this._def)}nullable(){return bo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this)}promise(){return Ts.create(this,this._def)}or(t){return uc.create([this,t],this._def)}and(t){return dc.create(this,t,this._def)}transform(t){return new Dr({...ot(this._def),schema:this,typeName:Ue.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new gc({...ot(this._def),innerType:this,defaultValue:n,typeName:Ue.ZodDefault})}brand(){return new L0({typeName:Ue.ZodBranded,type:this,...ot(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new vc({...ot(this._def),innerType:this,catchValue:n,typeName:Ue.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return iu.create(this,t)}readonly(){return bc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const aD=/^c[^\s-]{8,}$/i,sD=/^[0-9a-z]+$/,lD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,uD=/^[a-z0-9_-]{21}$/i,dD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fD=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hD=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let um;const mD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,bD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,R$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wD=new RegExp(`^${R$}$`);function j$(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function _D(e){return new RegExp(`^${j$(e)}$`)}function N$(e){let t=`${R$}T${j$(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function CD(e,t){return!!((t==="v4"||!t)&&mD.test(e)||(t==="v6"||!t)&&vD.test(e))}function $D(e,t){if(!dD.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function SD(e,t){return!!((t==="v4"||!t)&&gD.test(e)||(t==="v6"||!t)&&bD.test(e))}class Rr extends ut{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ce.string){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_type,expected:Ce.string,received:o.parsedType}),ze}const r=new In;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?_e(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&_e(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")hD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"email",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")um||(um=new RegExp(pD,"u")),um.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"emoji",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")cD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"uuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")uD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"nanoid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")aD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"cuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")sD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"cuid2",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")lD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"ulid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),_e(i,{validation:"url",code:he.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"regex",code:he.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?N$(o).test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?wD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?_D(o).test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?fD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"duration",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?CD(t.data,o.version)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"ip",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?$D(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"jwt",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?SD(t.data,o.version)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"cidr",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?yD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"base64",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?xD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"base64url",code:he.invalid_string,message:o.message}),r.dirty()):xt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:he.invalid_string,...Oe.errToObj(r)})}_addCheck(t){return new Rr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Oe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Oe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Oe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Oe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Oe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Oe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Oe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Oe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Oe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Oe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Oe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Oe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Oe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Oe.errToObj(n)})}nonempty(t){return this.min(1,Oe.errToObj(t))}trim(){return new Rr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Rr.create=e=>new Rr({checks:[],typeName:Ue.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ot(e)});function TD(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}class mo extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ce.number){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_type,expected:Ce.number,received:o.parsedType}),ze}let r;const i=new In;for(const o of this._def.checks)o.kind==="int"?xt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),_e(r,{code:he.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?TD(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),_e(r,{code:he.not_finite,message:o.message}),i.dirty()):xt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Oe.toString(n))}setLimit(t,n,r,i){return new mo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Oe.toString(i)}]})}_addCheck(t){return new mo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Oe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&xt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}mo.create=e=>new mo({checks:[],typeName:Ue.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ot(e)});class go extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ce.bigint)return this._getInvalidInput(t);let r;const i=new In;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):xt.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return _e(n,{code:he.invalid_type,expected:Ce.bigint,received:n.parsedType}),ze}gte(t,n){return this.setLimit("min",t,!0,Oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Oe.toString(n))}setLimit(t,n,r,i){return new go({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Oe.toString(i)}]})}_addCheck(t){return new go({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}go.create=e=>new go({checks:[],typeName:Ue.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ot(e)});class sc extends ut{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ce.boolean){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.boolean,received:r.parsedType}),ze}return Hn(t.data)}}sc.create=e=>new sc({typeName:Ue.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ot(e)});class ca extends ut{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ce.date){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_type,expected:Ce.date,received:o.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_date}),ze}const r=new In;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):xt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ca({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Oe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Oe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ca.create=e=>new ca({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ue.ZodDate,...ot(e)});class Vd extends ut{_parse(t){if(this._getType(t)!==Ce.symbol){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.symbol,received:r.parsedType}),ze}return Hn(t.data)}}Vd.create=e=>new Vd({typeName:Ue.ZodSymbol,...ot(e)});class lc extends ut{_parse(t){if(this._getType(t)!==Ce.undefined){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.undefined,received:r.parsedType}),ze}return Hn(t.data)}}lc.create=e=>new lc({typeName:Ue.ZodUndefined,...ot(e)});class cc extends ut{_parse(t){if(this._getType(t)!==Ce.null){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.null,received:r.parsedType}),ze}return Hn(t.data)}}cc.create=e=>new cc({typeName:Ue.ZodNull,...ot(e)});class Ss extends ut{constructor(){super(...arguments),this._any=!0}_parse(t){return Hn(t.data)}}Ss.create=e=>new Ss({typeName:Ue.ZodAny,...ot(e)});class ta extends ut{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Hn(t.data)}}ta.create=e=>new ta({typeName:Ue.ZodUnknown,...ot(e)});class Di extends ut{_parse(t){const n=this._getOrReturnCtx(t);return _e(n,{code:he.invalid_type,expected:Ce.never,received:n.parsedType}),ze}}Di.create=e=>new Di({typeName:Ue.ZodNever,...ot(e)});class qd extends ut{_parse(t){if(this._getType(t)!==Ce.undefined){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.void,received:r.parsedType}),ze}return Hn(t.data)}}qd.create=e=>new qd({typeName:Ue.ZodVoid,...ot(e)});class Nr extends ut{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Ce.array)return _e(n,{code:he.invalid_type,expected:Ce.array,received:n.parsedType}),ze;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(_e(n,{code:a?he.too_big:he.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(_e(n,{code:he.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(_e(n,{code:he.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new ei(n,a,n.path,s)))).then(a=>In.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new ei(n,a,n.path,s)));return In.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Nr({...this._def,minLength:{value:t,message:Oe.toString(n)}})}max(t,n){return new Nr({...this._def,maxLength:{value:t,message:Oe.toString(n)}})}length(t,n){return new Nr({...this._def,exactLength:{value:t,message:Oe.toString(n)}})}nonempty(t){return this.min(1,t)}}Nr.create=(e,t)=>new Nr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ue.ZodArray,...ot(t)});function Ja(e){if(e instanceof an){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Kr.create(Ja(r))}return new an({...e._def,shape:()=>t})}else return e instanceof Nr?new Nr({...e._def,type:Ja(e.element)}):e instanceof Kr?Kr.create(Ja(e.unwrap())):e instanceof bo?bo.create(Ja(e.unwrap())):e instanceof ti?ti.create(e.items.map(t=>Ja(t))):e}class an extends ut{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=xt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ce.object){const c=this._getOrReturnCtx(t);return _e(c,{code:he.invalid_type,expected:Ce.object,received:c.parsedType}),ze}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Di&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||s.push(c);const l=[];for(const c of a){const u=o[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ei(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Di){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")s.length>0&&(_e(i,{code:he.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ei(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then(c=>In.mergeObjectSync(r,c)):In.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Oe.errToObj,new an({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,a;const i=((a=(o=this._def).errorMap)==null?void 0:a.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Oe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new an({...this._def,unknownKeys:"strip"})}passthrough(){return new an({...this._def,unknownKeys:"passthrough"})}extend(t){return new an({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new an({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ue.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new an({...this._def,catchall:t})}pick(t){const n={};for(const r of xt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new an({...this._def,shape:()=>n})}omit(t){const n={};for(const r of xt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new an({...this._def,shape:()=>n})}deepPartial(){return Ja(this)}partial(t){const n={};for(const r of xt.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new an({...this._def,shape:()=>n})}required(t){const n={};for(const r of xt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Kr;)o=o._def.innerType;n[r]=o}return new an({...this._def,shape:()=>n})}keyof(){return D$(xt.objectKeys(this.shape))}}an.create=(e,t)=>new an({shape:()=>e,unknownKeys:"strip",catchall:Di.create(),typeName:Ue.ZodObject,...ot(t)});an.strictCreate=(e,t)=>new an({shape:()=>e,unknownKeys:"strict",catchall:Di.create(),typeName:Ue.ZodObject,...ot(t)});an.lazycreate=(e,t)=>new an({shape:e,unknownKeys:"strip",catchall:Di.create(),typeName:Ue.ZodObject,...ot(t)});class uc extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new lr(s.ctx.common.issues));return _e(n,{code:he.invalid_union,unionErrors:a}),ze}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new lr(l));return _e(n,{code:he.invalid_union,unionErrors:s}),ze}}get options(){return this._def.options}}uc.create=(e,t)=>new uc({options:e,typeName:Ue.ZodUnion,...ot(t)});const gi=e=>e instanceof hc?gi(e.schema):e instanceof Dr?gi(e.innerType()):e instanceof pc?[e.value]:e instanceof vo?e.options:e instanceof mc?xt.objectValues(e.enum):e instanceof gc?gi(e._def.innerType):e instanceof lc?[void 0]:e instanceof cc?[null]:e instanceof Kr?[void 0,...gi(e.unwrap())]:e instanceof bo?[null,...gi(e.unwrap())]:e instanceof L0||e instanceof bc?gi(e.unwrap()):e instanceof vc?gi(e._def.innerType):[];class lh extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.object)return _e(n,{code:he.invalid_type,expected:Ce.object,received:n.parsedType}),ze;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(_e(n,{code:he.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=gi(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new lh({typeName:Ue.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ot(r)})}}function Hg(e,t){const n=_i(e),r=_i(t);if(e===t)return{valid:!0,data:e};if(n===Ce.object&&r===Ce.object){const i=xt.objectKeys(t),o=xt.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=Hg(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===Ce.array&&r===Ce.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=Hg(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Ce.date&&r===Ce.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class dc extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(Wg(o)||Wg(a))return ze;const s=Hg(o.value,a.value);return s.valid?((Ug(o)||Ug(a))&&n.dirty(),{status:n.value,value:s.data}):(_e(r,{code:he.invalid_intersection_types}),ze)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}dc.create=(e,t,n)=>new dc({left:e,right:t,typeName:Ue.ZodIntersection,...ot(n)});class ti extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.array)return _e(r,{code:he.invalid_type,expected:Ce.array,received:r.parsedType}),ze;if(r.data.length<this._def.items.length)return _e(r,{code:he.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&r.data.length>this._def.items.length&&(_e(r,{code:he.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new ei(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>In.mergeArray(n,a)):In.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ti({...this._def,rest:t})}}ti.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ti({items:e,typeName:Ue.ZodTuple,rest:null,...ot(t)})};class fc extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.object)return _e(r,{code:he.invalid_type,expected:Ce.object,received:r.parsedType}),ze;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new ei(r,s,r.path,s)),value:a._parse(new ei(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?In.mergeObjectAsync(n,i):In.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ut?new fc({keyType:t,valueType:n,typeName:Ue.ZodRecord,...ot(r)}):new fc({keyType:Rr.create(),valueType:t,typeName:Ue.ZodRecord,...ot(n)})}}class Yd extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.map)return _e(r,{code:he.invalid_type,expected:Ce.map,received:r.parsedType}),ze;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:i._parse(new ei(r,s,r.path,[c,"key"])),value:o._parse(new ei(r,l,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return ze;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return ze;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}}Yd.create=(e,t,n)=>new Yd({valueType:t,keyType:e,typeName:Ue.ZodMap,...ot(n)});class ua extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.set)return _e(r,{code:he.invalid_type,expected:Ce.set,received:r.parsedType}),ze;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(_e(r,{code:he.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(_e(r,{code:he.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return ze;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const s=[...r.data.values()].map((l,c)=>o._parse(new ei(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new ua({...this._def,minSize:{value:t,message:Oe.toString(n)}})}max(t,n){return new ua({...this._def,maxSize:{value:t,message:Oe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ua.create=(e,t)=>new ua({valueType:e,minSize:null,maxSize:null,typeName:Ue.ZodSet,...ot(t)});class as extends ut{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.function)return _e(n,{code:he.invalid_type,expected:Ce.function,received:n.parsedType}),ze;function r(s,l){return Hd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),$s].filter(c=>!!c),issueData:{code:he.invalid_arguments,argumentsError:l}})}function i(s,l){return Hd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),$s].filter(c=>!!c),issueData:{code:he.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Ts){const s=this;return Hn(async function(...l){const c=new lr([]),u=await s._def.args.parseAsync(l,o).catch(h=>{throw c.addIssue(r(l,h)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw c.addIssue(i(d,h)),c})})}else{const s=this;return Hn(function(...l){const c=s._def.args.safeParse(l,o);if(!c.success)throw new lr([r(l,c.error)]);const u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new lr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new as({...this._def,args:ti.create(t).rest(ta.create())})}returns(t){return new as({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new as({args:t||ti.create([]).rest(ta.create()),returns:n||ta.create(),typeName:Ue.ZodFunction,...ot(r)})}}class hc extends ut{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}hc.create=(e,t)=>new hc({getter:e,typeName:Ue.ZodLazy,...ot(t)});class pc extends ut{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return _e(n,{received:n.data,code:he.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}pc.create=(e,t)=>new pc({value:e,typeName:Ue.ZodLiteral,...ot(t)});function D$(e,t){return new vo({values:e,typeName:Ue.ZodEnum,...ot(t)})}class vo extends ut{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return _e(n,{expected:xt.joinValues(r),received:n.parsedType,code:he.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return _e(n,{received:n.data,code:he.invalid_enum_value,options:r}),ze}return Hn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return vo.create(t,{...this._def,...n})}exclude(t,n=this._def){return vo.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}vo.create=D$;class mc extends ut{_parse(t){const n=xt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ce.string&&r.parsedType!==Ce.number){const i=xt.objectValues(n);return _e(r,{expected:xt.joinValues(i),received:r.parsedType,code:he.invalid_type}),ze}if(this._cache||(this._cache=new Set(xt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=xt.objectValues(n);return _e(r,{received:r.data,code:he.invalid_enum_value,options:i}),ze}return Hn(t.data)}get enum(){return this._def.values}}mc.create=(e,t)=>new mc({values:e,typeName:Ue.ZodNativeEnum,...ot(t)});class Ts extends ut{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.promise&&n.common.async===!1)return _e(n,{code:he.invalid_type,expected:Ce.promise,received:n.parsedType}),ze;const r=n.parsedType===Ce.promise?n.data:Promise.resolve(n.data);return Hn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ts.create=(e,t)=>new Ts({type:e,typeName:Ue.ZodPromise,...ot(t)});class Dr extends ut{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{_e(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return ze;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?ze:l.status==="dirty"||n.value==="dirty"?es(l.value):l});{if(n.value==="aborted")return ze;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?ze:s.status==="dirty"||n.value==="dirty"?es(s.value):s}}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ze:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?ze:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!la(a))return ze;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>la(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):ze);xt.assertNever(i)}}Dr.create=(e,t,n)=>new Dr({schema:e,typeName:Ue.ZodEffects,effect:t,...ot(n)});Dr.createWithPreprocess=(e,t,n)=>new Dr({schema:t,effect:{type:"preprocess",transform:e},typeName:Ue.ZodEffects,...ot(n)});class Kr extends ut{_parse(t){return this._getType(t)===Ce.undefined?Hn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Kr.create=(e,t)=>new Kr({innerType:e,typeName:Ue.ZodOptional,...ot(t)});class bo extends ut{_parse(t){return this._getType(t)===Ce.null?Hn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bo.create=(e,t)=>new bo({innerType:e,typeName:Ue.ZodNullable,...ot(t)});class gc extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ce.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}gc.create=(e,t)=>new gc({innerType:e,typeName:Ue.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ot(t)});class vc extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ac(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new lr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}vc.create=(e,t)=>new vc({innerType:e,typeName:Ue.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ot(t)});class Gd extends ut{_parse(t){if(this._getType(t)!==Ce.nan){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.nan,received:r.parsedType}),ze}return{status:"valid",value:t.data}}}Gd.create=e=>new Gd({typeName:Ue.ZodNaN,...ot(e)});const ED=Symbol("zod_brand");class L0 extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class iu extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ze:o.status==="dirty"?(n.dirty(),es(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ze:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new iu({in:t,out:n,typeName:Ue.ZodPipeline})}}class bc extends ut{_parse(t){const n=this._def.innerType._parse(t),r=i=>(la(i)&&(i.value=Object.freeze(i.value)),i);return ac(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}bc.create=(e,t)=>new bc({innerType:e,typeName:Ue.ZodReadonly,...ot(t)});function kx(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function I$(e,t={},n){return e?Ss.create().superRefine((r,i)=>{const o=e(r);if(o instanceof Promise)return o.then(a=>{if(!a){const s=kx(t,r),l=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:l})}});if(!o){const a=kx(t,r),s=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:s})}}):Ss.create()}const kD={object:an.lazycreate};var Ue;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ue||(Ue={}));const OD=(e,t={message:`Input not instance of ${e.name}`})=>I$(n=>n instanceof e,t),F0=Rr.create,P$=mo.create,MD=Gd.create,AD=go.create,L$=sc.create,RD=ca.create,jD=Vd.create,ND=lc.create,DD=cc.create,F$=Ss.create,ID=ta.create,PD=Di.create,LD=qd.create,B$=Nr.create,Si=an.create,FD=an.strictCreate,BD=uc.create,zD=lh.create,WD=dc.create,UD=ti.create,HD=fc.create,VD=Yd.create,qD=ua.create,YD=as.create,GD=hc.create,KD=pc.create,z$=vo.create,ZD=mc.create,XD=Ts.create,Ox=Dr.create,QD=Kr.create,JD=bo.create,eI=Dr.createWithPreprocess,tI=iu.create,nI=()=>F0().optional(),rI=()=>P$().optional(),iI=()=>L$().optional(),Pl={string:e=>Rr.create({...e,coerce:!0}),number:e=>mo.create({...e,coerce:!0}),boolean:e=>sc.create({...e,coerce:!0}),bigint:e=>go.create({...e,coerce:!0}),date:e=>ca.create({...e,coerce:!0})},oI=ze,Ll=Object.freeze(Object.defineProperty({__proto__:null,BRAND:ED,DIRTY:es,EMPTY_PATH:oD,INVALID:ze,NEVER:oI,OK:Hn,ParseStatus:In,Schema:ut,ZodAny:Ss,ZodArray:Nr,ZodBigInt:go,ZodBoolean:sc,ZodBranded:L0,ZodCatch:vc,ZodDate:ca,ZodDefault:gc,ZodDiscriminatedUnion:lh,ZodEffects:Dr,ZodEnum:vo,ZodError:lr,get ZodFirstPartyTypeKind(){return Ue},ZodFunction:as,ZodIntersection:dc,ZodIssueCode:he,ZodLazy:hc,ZodLiteral:pc,ZodMap:Yd,ZodNaN:Gd,ZodNativeEnum:mc,ZodNever:Di,ZodNull:cc,ZodNullable:bo,ZodNumber:mo,ZodObject:an,ZodOptional:Kr,ZodParsedType:Ce,ZodPipeline:iu,ZodPromise:Ts,ZodReadonly:bc,ZodRecord:fc,ZodSchema:ut,ZodSet:ua,ZodString:Rr,ZodSymbol:Vd,ZodTransformer:Dr,ZodTuple:ti,ZodType:ut,ZodUndefined:lc,ZodUnion:uc,ZodUnknown:ta,ZodVoid:qd,addIssueToContext:_e,any:F$,array:B$,bigint:AD,boolean:L$,coerce:Pl,custom:I$,date:RD,datetimeRegex:N$,defaultErrorMap:$s,discriminatedUnion:zD,effect:Ox,enum:z$,function:YD,getErrorMap:Ud,getParsedType:_i,instanceof:OD,intersection:WD,isAborted:Wg,isAsync:ac,isDirty:Ug,isValid:la,late:kD,lazy:GD,literal:KD,makeIssue:Hd,map:VD,nan:MD,nativeEnum:ZD,never:PD,null:DD,nullable:JD,number:P$,object:Si,get objectUtil(){return zg},oboolean:iI,onumber:rI,optional:QD,ostring:nI,pipeline:tI,preprocess:eI,promise:XD,quotelessJson:rD,record:HD,set:qD,setErrorMap:iD,strictObject:FD,string:F0,symbol:jD,transformer:Ox,tuple:UD,undefined:ND,union:BD,unknown:ID,get util(){return xt},void:LD},Symbol.toStringTag,{value:"Module"})),ch=()=>{const e=Re.c(41),{texts:t}=m.useContext(ln),{formValidation:n}=t;let r;e[0]!==n?(r=R=>{let M=(R!=null&&R.useCoerce?Pl:Ll).string({invalid_type_error:n.required,required_error:n.required});return R!=null&&R.email&&(M=M.email(n.invalidEmail)),R!=null&&R.length&&(M=M.min(R.length,n.length(R.length))),R!=null&&R.minLength&&(M=M.min(R.minLength,n.minLength(R.minLength))),R!=null&&R.maxLength&&(M=M.max(R.maxLength,n.maxLength(R.maxLength))),R!=null&&R.numeric&&(M=M.regex(/^\d+$/,n.noCharactersOtherThanNumbers)),R!=null&&R.regex&&(M=M.regex(R.regex,n.invalidFormat)),M.transform(aI)},e[0]=n,e[1]=r):r=e[1];const i=r;let o;e[2]!==i?(o=R=>i(R).nullable().optional().transform(sI),e[2]=i,e[3]=o):o=e[3];const a=o;let s;e[4]!==n?(s=R=>{const M=(R==null?void 0:R.min)??Number.MIN_SAFE_INTEGER,I=(R==null?void 0:R.max)??Number.MAX_SAFE_INTEGER,F=(R!=null&&R.useCoerce?Pl:Ll).number({invalid_type_error:n.required,required_error:n.required}).min(M,n.lessThanMin(M)).max(I,n.moreThanMax(I));return F.transform(lI),F},e[4]=n,e[5]=s):s=e[5];const l=s;let c;e[6]!==l?(c=R=>l(R).nullable().optional().transform(cI),e[6]=l,e[7]=c):c=e[7];const u=c;let d;e[8]!==n.required?(d=R=>(R!=null&&R.useCoerce?Pl:Ll).boolean({invalid_type_error:n.required,required_error:n.required}).transform(uI),e[8]=n.required,e[9]=d):d=e[9];const f=d;let h;e[10]!==n.invalidDate||e[11]!==n.required?(h=R=>(R!=null&&R.useCoerce?Pl:Ll).string({invalid_type_error:n.required,required_error:n.required}).refine(QC,{message:n.invalidDate}).transform(dI),e[10]=n.invalidDate,e[11]=n.required,e[12]=h):h=e[12];const p=h;let g;e[13]!==p?(g=R=>p(R).nullable().transform(fI),e[13]=p,e[14]=g):g=e[14];const v=g;let x;e[15]!==n.required?(x=(R,M)=>z$(R,{invalid_type_error:n.required,required_error:n.required}).transform(hI),e[15]=n.required,e[16]=x):x=e[16];const _=x;let w;e[17]!==_?(w=(R,M)=>_(R,M).nullable().transform(pI),e[17]=_,e[18]=w):w=e[18];const C=w;let b;e[19]!==u?(b=R=>Si({id:u({useCoerce:!0})}).nullable().transform(mI),e[19]=u,e[20]=b):b=e[20];const $=b;let T;e[21]!==l?(T=R=>Si({id:l()}).transform(gI),e[21]=l,e[22]=T):T=e[22];const k=T;let O;e[23]!==a?(O=R=>Si({id:a({useCoerce:!0})}).nullable().transform(vI),e[23]=a,e[24]=O):O=e[24];const j=O;let S;e[25]!==i?(S=R=>Si({id:i()}).transform(bI),e[25]=i,e[26]=S):S=e[26];const E=S,A=xI;let D;return e[27]!==f||e[28]!==v||e[29]!==p||e[30]!==C||e[31]!==_||e[32]!==u||e[33]!==l||e[34]!==$||e[35]!==k||e[36]!==j||e[37]!==E||e[38]!==a||e[39]!==i?(D={zString:a,zStringRequired:i,zNumber:u,zNumberRequired:l,zBool:f,zDate:v,zDateRequired:p,zEnum:C,zEnumRequired:_,zObjectIdInt:$,zObjectIdIntRequired:k,zObjectIdStr:j,zObjectIdStrRequired:E,zFile:A},e[27]=f,e[28]=v,e[29]=p,e[30]=C,e[31]=_,e[32]=u,e[33]=l,e[34]=$,e[35]=k,e[36]=j,e[37]=E,e[38]=a,e[39]=i,e[40]=D):D=e[40],D};function aI(e){return e??null}function sI(e){return e??null}function lI(e){return e??null}function cI(e){return e??null}function uI(e){return e??null}function dI(e){return e??null}function fI(e){return e??null}function hI(e){return e??null}function pI(e){return e??null}function mI(e){return e??null}function gI(e){return e??null}function vI(e){return e??null}function bI(e){return e??null}function yI(e){return Array.from(e??[])}function xI(e){const{required:t,multiple:n,maxFileSize:r}=e;return F$().transform(yI).refine(o=>!t||(o==null?void 0:o.length)>0,"File is required.").refine(o=>n||(o==null?void 0:o.length)<=1,"Multiple files not allowed.").refine(o=>o.every(a=>a.size<=r),`Maximum file size is ${ws(r)}.`).transform(o=>(n?o:o==null?void 0:o[0])??null)}const W$=(e,t)=>{const n=Re.c(4);let r,i;n[0]!==t||n[1]!==e?(r=()=>{const o=a=>{e.some(s=>s.current&&s.current.contains(a.target))||t()};return document.addEventListener("mouseup",o),()=>{document.removeEventListener("mouseup",o)}},i=[e,t],n[0]=t,n[1]=e,n[2]=r,n[3]=i):(r=n[2],i=n[3]),m.useEffect(r,i)},U$=()=>{const e=Re.c(4),{user:t}=m.useContext(HC);let n;e[0]!==(t==null?void 0:t.permissions)?(n=(o,a)=>{const s=a===void 0?"any":a;return o.length===0?!0:s==="any"?o.some(l=>{var c;return(c=t==null?void 0:t.permissions)==null?void 0:c.includes(l)}):o.every(l=>{var c;return(c=t==null?void 0:t.permissions)==null?void 0:c.includes(l)})},e[0]=t==null?void 0:t.permissions,e[1]=n):n=e[1];const r=n;let i;return e[2]!==r?(i={checkUserHasPermissions:r},e[2]=r,e[3]=i):i=e[3],i},H$=(e,t)=>{const n=Re.c(6);let r,i;n[0]!==e?(r=()=>(document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}),i=[e],n[0]=e,n[1]=r,n[2]=i):(r=n[1],i=n[2]),m.useEffect(r,i);let o,a;n[3]!==t?(o=()=>t===void 0?wI:(document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}),a=[t],n[3]=t,n[4]=o,n[5]=a):(o=n[4],a=n[5]),m.useEffect(o,a)};function wI(){}const B0=(e,t,n)=>{let r;e:{if(n){r=e;break e}if(e!=="date"&&e!=="datetime-local"&&e!=="time"){r=e;break e}if(!t){r="text";break e}r=e}return r},V$=()=>{const{addNotification:e}=ah(),{texts:{clipboard:t}}=m.useContext(ln);return{copyToClipboard:m.useCallback(async r=>{var i;try{await((i=navigator.clipboard)==null?void 0:i.writeText(r)),e(t.copySuccess(r),"prompt")}catch(o){console.error(o),e(t.copyError,"danger")}},[e,t])}},ou=()=>{const e=Re.c(7),[t,n]=m.useState(window.innerWidth),[r,i]=m.useState(window.innerHeight);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{n(window.innerWidth),i(window.innerHeight)},e[0]=o):o=e[0];const a=o;let s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=()=>(window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)),l=[],e[1]=s,e[2]=l):(s=e[1],l=e[2]),m.useEffect(s,l);const c=t<992;let u;return e[3]!==r||e[4]!==c||e[5]!==t?(u={width:t,height:r,isMobile:c},e[3]=r,e[4]=c,e[5]=t,e[6]=u):u=e[6],u},q$=m.createContext({addHelmet:e=>{},removeHelmet:()=>{}}),Y$=m.createContext(void 0),Mx={falseIfNotInit:!1},uh=e=>{const{falseIfNotInit:t}=e===void 0?Mx:e,n=t===void 0?Mx.falseIfNotInit:t,r=m.useContext(Y$);if(!n&&r===void 0)throw new Error("FormDisabledProvider not initilized. Probably tried to use useFormDisabledContext outside FormDisabledProvider.");return r??!1},_I="_button_1wjon_1",CI="_filled_1wjon_7",$I="_sm_1wjon_13",SI="_md_1wjon_18",TI="_lg_1wjon_23",Ba={button:_I,filled:CI,sm:$I,md:SI,lg:TI},da=e=>{const t=Re.c(24);let n,r,i,o,a,s;t[0]!==e?({variant:o,color:a,size:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s):(n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6]);const l=o===void 0?"filled":o,c=a===void 0?"primary":a,u=s===void 0?"md":s;if(i.as==="link"){const d=i.href??"/",f=`luminus-primary-button ${c} btn ${l==="outlined"?`btn-outline-${c}`:`btn-${c}`} ${r??""}`,h=Ba[l],p=Ba[u];let g;t[7]!==f||t[8]!==h||t[9]!==p?(g=ue(f,Ba.button,h,p),t[7]=f,t[8]=h,t[9]=p,t[10]=g):g=t[10];let v;return t[11]!==n||t[12]!==i||t[13]!==d||t[14]!==g?(v=y.jsx(Ps.Link,{to:d,className:g,...i,children:n}),t[11]=n,t[12]=i,t[13]=d,t[14]=g,t[15]=v):v=t[15],v}if(i.as==="button"||i.as===void 0){const d=`luminus-primary-button ${c} btn ${l==="outlined"?`btn-outline-${c}`:`btn-${c}`} ${r??""}`,f=Ba[l],h=Ba[u];let p;t[16]!==d||t[17]!==f||t[18]!==h?(p=ue(d,Ba.button,f,h),t[16]=d,t[17]=f,t[18]=h,t[19]=p):p=t[19];let g;return t[20]!==n||t[21]!==i||t[22]!==p?(g=y.jsx("button",{type:"button",className:p,...i,children:n}),t[20]=n,t[21]=i,t[22]=p,t[23]=g):g=t[23],g}return null},EI="_button_1r3i0_1",Vg={button:EI},dh=e=>{const t=Re.c(21);let n,r,i,o,a;t[0]!==e?({color:a,icon:i,className:r,children:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a):(n=t[1],r=t[2],i=t[3],o=t[4],a=t[5]);const s=a===void 0?"primary":a;if(o.as==="link"){const l=o.href??"/",c=`luminus-context-button btn text-${s} ${r??""}`;let u;t[6]!==c?(u=ue(c,Vg.button),t[6]=c,t[7]=u):u=t[7];let d;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==l||t[12]!==u?(d=y.jsxs(Ps.Link,{to:l,className:u,...o,children:[i,n]}),t[8]=n,t[9]=i,t[10]=o,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}if(o.as==="button"||o.as===void 0){const l=`luminus-context-button btn text-${s} ${r??""}`;let c;t[14]!==l?(c=ue(l,Vg.button),t[14]=l,t[15]=c):c=t[15];let u;return t[16]!==n||t[17]!==i||t[18]!==o||t[19]!==c?(u=y.jsxs("button",{type:"button",className:c,...o,children:[i,n]}),t[16]=n,t[17]=i,t[18]=o,t[19]=c,t[20]=u):u=t[20],u}return null},kI="_icon-button_15e26_1",OI="_sm_15e26_14",MI="_md_15e26_23",AI="_lg_15e26_32",qu={"icon-button":"_icon-button_15e26_1",iconButton:kI,sm:OI,md:MI,lg:AI},au=e=>{const t=Re.c(23);let n,r,i,o,a,s;t[0]!==e?({type:o,color:a,size:s,children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s):(n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6]);const l=o===void 0?"button":o,c=a===void 0?"primary":a,u=s===void 0?"md":s;if(i.as==="link"){const d=i.href??"/",f=`luminus-icon-button btn text-${c} ${r??""}`,h=qu[u];let p;t[7]!==f||t[8]!==h?(p=ue(f,qu.iconButton,h),t[7]=f,t[8]=h,t[9]=p):p=t[9];let g;return t[10]!==n||t[11]!==i||t[12]!==d||t[13]!==p?(g=y.jsx(Ps.Link,{to:d,className:p,...i,children:n}),t[10]=n,t[11]=i,t[12]=d,t[13]=p,t[14]=g):g=t[14],g}if(i.as==="button"||i.as===void 0){const d=`luminus-icon-button btn text-${c} ${r??""}`,f=qu[u];let h;t[15]!==d||t[16]!==f?(h=ue(d,qu.iconButton,f),t[15]=d,t[16]=f,t[17]=h):h=t[17];let p;return t[18]!==n||t[19]!==i||t[20]!==h||t[21]!==l?(p=y.jsx("button",{type:l,className:h,...i,children:n}),t[18]=n,t[19]=i,t[20]=h,t[21]=l,t[22]=p):p=t[22],p}return null};var z0={},Kd={exports:{}};Kd.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",g="[object Map]",v="[object Number]",x="[object Null]",_="[object Object]",w="[object Promise]",C="[object Proxy]",b="[object RegExp]",$="[object Set]",T="[object String]",k="[object Symbol]",O="[object Undefined]",j="[object WeakMap]",S="[object ArrayBuffer]",E="[object DataView]",A="[object Float32Array]",D="[object Float64Array]",R="[object Int8Array]",M="[object Int16Array]",I="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",P="[object Uint16Array]",z="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,Z={};Z[A]=Z[D]=Z[R]=Z[M]=Z[I]=Z[F]=Z[U]=Z[P]=Z[z]=!0,Z[s]=Z[l]=Z[S]=Z[u]=Z[E]=Z[d]=Z[f]=Z[h]=Z[g]=Z[v]=Z[_]=Z[b]=Z[$]=Z[T]=Z[j]=!1;var J=typeof Zn=="object"&&Zn&&Zn.Object===Object&&Zn,ee=typeof self=="object"&&self&&self.Object===Object&&self,W=J||ee||Function("return this")(),L=t&&!t.nodeType&&t,B=L&&!0&&e&&!e.nodeType&&e,q=B&&B.exports===L,N=q&&J.process,Q=function(){try{return N&&N.binding&&N.binding("util")}catch{}}(),X=Q&&Q.isTypedArray;function G(K,ne){for(var fe=-1,Se=K==null?0:K.length,Jt=0,st=[];++fe<Se;){var un=K[fe];ne(un,fe,K)&&(st[Jt++]=un)}return st}function se(K,ne){for(var fe=-1,Se=ne.length,Jt=K.length;++fe<Se;)K[Jt+fe]=ne[fe];return K}function te(K,ne){for(var fe=-1,Se=K==null?0:K.length;++fe<Se;)if(ne(K[fe],fe,K))return!0;return!1}function re(K,ne){for(var fe=-1,Se=Array(K);++fe<K;)Se[fe]=ne(fe);return Se}function ae(K){return function(ne){return K(ne)}}function ce(K,ne){return K.has(ne)}function ve(K,ne){return K==null?void 0:K[ne]}function ge(K){var ne=-1,fe=Array(K.size);return K.forEach(function(Se,Jt){fe[++ne]=[Jt,Se]}),fe}function be(K,ne){return function(fe){return K(ne(fe))}}function Te(K){var ne=-1,fe=Array(K.size);return K.forEach(function(Se){fe[++ne]=Se}),fe}var de=Array.prototype,le=Function.prototype,we=Object.prototype,Be=W["__core-js_shared__"],Bt=le.toString,Le=we.hasOwnProperty,gt=function(){var K=/[^.]+$/.exec(Be&&Be.keys&&Be.keys.IE_PROTO||"");return K?"Symbol(src)_1."+K:""}(),_t=we.toString,nn=RegExp("^"+Bt.call(Le).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=q?W.Buffer:void 0,je=W.Symbol,vt=W.Uint8Array,qe=we.propertyIsEnumerable,bt=de.splice,at=je?je.toStringTag:void 0,At=Object.getOwnPropertySymbols,Ke=Ee?Ee.isBuffer:void 0,De=be(Object.keys,Object),We=Da(W,"DataView"),Qe=Da(W,"Map"),Ie=Da(W,"Promise"),Je=Da(W,"Set"),ht=Da(W,"WeakMap"),nt=Da(Object,"create"),Ne=jo(We),ke=jo(Qe),He=jo(Ie),yt=jo(Je),et=jo(ht),pt=je?je.prototype:void 0,tn=pt?pt.valueOf:void 0;function zt(K){var ne=-1,fe=K==null?0:K.length;for(this.clear();++ne<fe;){var Se=K[ne];this.set(Se[0],Se[1])}}function Ht(){this.__data__=nt?nt(null):{},this.size=0}function vn(K){var ne=this.has(K)&&delete this.__data__[K];return this.size-=ne?1:0,ne}function Kt(K){var ne=this.__data__;if(nt){var fe=ne[K];return fe===r?void 0:fe}return Le.call(ne,K)?ne[K]:void 0}function $e(K){var ne=this.__data__;return nt?ne[K]!==void 0:Le.call(ne,K)}function Ze(K,ne){var fe=this.__data__;return this.size+=this.has(K)?0:1,fe[K]=nt&&ne===void 0?r:ne,this}zt.prototype.clear=Ht,zt.prototype.delete=vn,zt.prototype.get=Kt,zt.prototype.has=$e,zt.prototype.set=Ze;function Ct(K){var ne=-1,fe=K==null?0:K.length;for(this.clear();++ne<fe;){var Se=K[ne];this.set(Se[0],Se[1])}}function cn(){this.__data__=[],this.size=0}function Zt(K){var ne=this.__data__,fe=di(ne,K);if(fe<0)return!1;var Se=ne.length-1;return fe==Se?ne.pop():bt.call(ne,fe,1),--this.size,!0}function Pe(K){var ne=this.__data__,fe=di(ne,K);return fe<0?void 0:ne[fe][1]}function Fe(K){return di(this.__data__,K)>-1}function ct(K,ne){var fe=this.__data__,Se=di(fe,K);return Se<0?(++this.size,fe.push([K,ne])):fe[Se][1]=ne,this}Ct.prototype.clear=cn,Ct.prototype.delete=Zt,Ct.prototype.get=Pe,Ct.prototype.has=Fe,Ct.prototype.set=ct;function Rt(K){var ne=-1,fe=K==null?0:K.length;for(this.clear();++ne<fe;){var Se=K[ne];this.set(Se[0],Se[1])}}function $t(){this.size=0,this.__data__={hash:new zt,map:new(Qe||Ct),string:new zt}}function Xe(K){var ne=Hi(this,K).delete(K);return this.size-=ne?1:0,ne}function St(K){return Hi(this,K).get(K)}function kr(K){return Hi(this,K).has(K)}function fn(K,ne){var fe=Hi(this,K),Se=fe.size;return fe.set(K,ne),this.size+=fe.size==Se?0:1,this}Rt.prototype.clear=$t,Rt.prototype.delete=Xe,Rt.prototype.get=St,Rt.prototype.has=kr,Rt.prototype.set=fn;function hn(K){var ne=-1,fe=K==null?0:K.length;for(this.__data__=new Rt;++ne<fe;)this.add(K[ne])}function Pn(K){return this.__data__.set(K,r),this}function ko(K){return this.__data__.has(K)}hn.prototype.add=hn.prototype.push=Pn,hn.prototype.has=ko;function wt(K){var ne=this.__data__=new Ct(K);this.size=ne.size}function Oo(){this.__data__=new Ct,this.size=0}function Me(K){var ne=this.__data__,fe=ne.delete(K);return this.size=ne.size,fe}function Br(K){return this.__data__.get(K)}function Mo(K){return this.__data__.has(K)}function ja(K,ne){var fe=this.__data__;if(fe instanceof Ct){var Se=fe.__data__;if(!Qe||Se.length<n-1)return Se.push([K,ne]),this.size=++fe.size,this;fe=this.__data__=new Rt(Se)}return fe.set(K,ne),this.size=fe.size,this}wt.prototype.clear=Oo,wt.prototype.delete=Me,wt.prototype.get=Br,wt.prototype.has=Mo,wt.prototype.set=ja;function Na(K,ne){var fe=Nu(K),Se=!fe&&cO(K),Jt=!fe&&!Se&&Wp(K),st=!fe&&!Se&&!Jt&&dy(K),un=fe||Se||Jt||st,_n=un?re(K.length,String):[],Tn=_n.length;for(var rn in K)Le.call(K,rn)&&!(un&&(rn=="length"||Jt&&(rn=="offset"||rn=="parent")||st&&(rn=="buffer"||rn=="byteLength"||rn=="byteOffset")||iO(rn,Tn)))&&_n.push(rn);return _n}function di(K,ne){for(var fe=K.length;fe--;)if(sy(K[fe][0],ne))return fe;return-1}function Au(K,ne,fe){var Se=ne(K);return Nu(K)?Se:se(Se,fe(K))}function fi(K){return K==null?K===void 0?O:x:at&&at in Object(K)?nO(K):lO(K)}function ll(K){return ul(K)&&fi(K)==s}function Ao(K,ne,fe,Se,Jt){return K===ne?!0:K==null||ne==null||!ul(K)&&!ul(ne)?K!==K&&ne!==ne:cl(K,ne,fe,Se,Ao,Jt)}function cl(K,ne,fe,Se,Jt,st){var un=Nu(K),_n=Nu(ne),Tn=un?l:Vi(K),rn=_n?l:Vi(ne);Tn=Tn==s?_:Tn,rn=rn==s?_:rn;var ar=Tn==_,Or=rn==_,kn=Tn==rn;if(kn&&Wp(K)){if(!Wp(ne))return!1;un=!0,ar=!1}if(kn&&!ar)return st||(st=new wt),un||dy(K)?Ln(K,ne,fe,Se,Jt,st):Bp(K,ne,Tn,fe,Se,Jt,st);if(!(fe&i)){var fr=ar&&Le.call(K,"__wrapped__"),hr=Or&&Le.call(ne,"__wrapped__");if(fr||hr){var qi=fr?K.value():K,hi=hr?ne.value():ne;return st||(st=new wt),Jt(qi,hi,fe,Se,st)}}return kn?(st||(st=new wt),zp(K,ne,fe,Se,Jt,st)):!1}function Ru(K){if(!uy(K)||aO(K))return!1;var ne=ly(K)?nn:H;return ne.test(jo(K))}function Ro(K){return ul(K)&&cy(K.length)&&!!Z[fi(K)]}function ju(K){if(!sO(K))return De(K);var ne=[];for(var fe in Object(K))Le.call(K,fe)&&fe!="constructor"&&ne.push(fe);return ne}function Ln(K,ne,fe,Se,Jt,st){var un=fe&i,_n=K.length,Tn=ne.length;if(_n!=Tn&&!(un&&Tn>_n))return!1;var rn=st.get(K);if(rn&&st.get(ne))return rn==ne;var ar=-1,Or=!0,kn=fe&o?new hn:void 0;for(st.set(K,ne),st.set(ne,K);++ar<_n;){var fr=K[ar],hr=ne[ar];if(Se)var qi=un?Se(hr,fr,ar,ne,K,st):Se(fr,hr,ar,K,ne,st);if(qi!==void 0){if(qi)continue;Or=!1;break}if(kn){if(!te(ne,function(hi,No){if(!ce(kn,No)&&(fr===hi||Jt(fr,hi,fe,Se,st)))return kn.push(No)})){Or=!1;break}}else if(!(fr===hr||Jt(fr,hr,fe,Se,st))){Or=!1;break}}return st.delete(K),st.delete(ne),Or}function Bp(K,ne,fe,Se,Jt,st,un){switch(fe){case E:if(K.byteLength!=ne.byteLength||K.byteOffset!=ne.byteOffset)return!1;K=K.buffer,ne=ne.buffer;case S:return!(K.byteLength!=ne.byteLength||!st(new vt(K),new vt(ne)));case u:case d:case v:return sy(+K,+ne);case f:return K.name==ne.name&&K.message==ne.message;case b:case T:return K==ne+"";case g:var _n=ge;case $:var Tn=Se&i;if(_n||(_n=Te),K.size!=ne.size&&!Tn)return!1;var rn=un.get(K);if(rn)return rn==ne;Se|=o,un.set(K,ne);var ar=Ln(_n(K),_n(ne),Se,Jt,st,un);return un.delete(K),ar;case k:if(tn)return tn.call(K)==tn.call(ne)}return!1}function zp(K,ne,fe,Se,Jt,st){var un=fe&i,_n=zr(K),Tn=_n.length,rn=zr(ne),ar=rn.length;if(Tn!=ar&&!un)return!1;for(var Or=Tn;Or--;){var kn=_n[Or];if(!(un?kn in ne:Le.call(ne,kn)))return!1}var fr=st.get(K);if(fr&&st.get(ne))return fr==ne;var hr=!0;st.set(K,ne),st.set(ne,K);for(var qi=un;++Or<Tn;){kn=_n[Or];var hi=K[kn],No=ne[kn];if(Se)var fy=un?Se(No,hi,kn,ne,K,st):Se(hi,No,kn,K,ne,st);if(!(fy===void 0?hi===No||Jt(hi,No,fe,Se,st):fy)){hr=!1;break}qi||(qi=kn=="constructor")}if(hr&&!qi){var Du=K.constructor,Iu=ne.constructor;Du!=Iu&&"constructor"in K&&"constructor"in ne&&!(typeof Du=="function"&&Du instanceof Du&&typeof Iu=="function"&&Iu instanceof Iu)&&(hr=!1)}return st.delete(K),st.delete(ne),hr}function zr(K){return Au(K,fO,rO)}function Hi(K,ne){var fe=K.__data__;return oO(ne)?fe[typeof ne=="string"?"string":"hash"]:fe.map}function Da(K,ne){var fe=ve(K,ne);return Ru(fe)?fe:void 0}function nO(K){var ne=Le.call(K,at),fe=K[at];try{K[at]=void 0;var Se=!0}catch{}var Jt=_t.call(K);return Se&&(ne?K[at]=fe:delete K[at]),Jt}var rO=At?function(K){return K==null?[]:(K=Object(K),G(At(K),function(ne){return qe.call(K,ne)}))}:hO,Vi=fi;(We&&Vi(new We(new ArrayBuffer(1)))!=E||Qe&&Vi(new Qe)!=g||Ie&&Vi(Ie.resolve())!=w||Je&&Vi(new Je)!=$||ht&&Vi(new ht)!=j)&&(Vi=function(K){var ne=fi(K),fe=ne==_?K.constructor:void 0,Se=fe?jo(fe):"";if(Se)switch(Se){case Ne:return E;case ke:return g;case He:return w;case yt:return $;case et:return j}return ne});function iO(K,ne){return ne=ne??a,!!ne&&(typeof K=="number"||Y.test(K))&&K>-1&&K%1==0&&K<ne}function oO(K){var ne=typeof K;return ne=="string"||ne=="number"||ne=="symbol"||ne=="boolean"?K!=="__proto__":K===null}function aO(K){return!!gt&&gt in K}function sO(K){var ne=K&&K.constructor,fe=typeof ne=="function"&&ne.prototype||we;return K===fe}function lO(K){return _t.call(K)}function jo(K){if(K!=null){try{return Bt.call(K)}catch{}try{return K+""}catch{}}return""}function sy(K,ne){return K===ne||K!==K&&ne!==ne}var cO=ll(function(){return arguments}())?ll:function(K){return ul(K)&&Le.call(K,"callee")&&!qe.call(K,"callee")},Nu=Array.isArray;function uO(K){return K!=null&&cy(K.length)&&!ly(K)}var Wp=Ke||pO;function dO(K,ne){return Ao(K,ne)}function ly(K){if(!uy(K))return!1;var ne=fi(K);return ne==h||ne==p||ne==c||ne==C}function cy(K){return typeof K=="number"&&K>-1&&K%1==0&&K<=a}function uy(K){var ne=typeof K;return K!=null&&(ne=="object"||ne=="function")}function ul(K){return K!=null&&typeof K=="object"}var dy=X?ae(X):Ro;function fO(K){return uO(K)?Na(K):ju(K)}function hO(){return[]}function pO(){return!1}e.exports=dO})(Kd,Kd.exports);var RI=Kd.exports,G$={exports:{}};(function(e,t){var n=function(){var r=function(b,$){var T=236,k=17,O=b,j=o[$],S=null,E=0,A=null,D=[],R={},M=function(W,L){E=O*4+17,S=function(B){for(var q=new Array(B),N=0;N<B;N+=1){q[N]=new Array(B);for(var Q=0;Q<B;Q+=1)q[N][Q]=null}return q}(E),I(0,0),I(E-7,0),I(0,E-7),P(),U(),V(W,L),O>=7&&z(W),A==null&&(A=Z(O,j,D)),H(A,L)},I=function(W,L){for(var B=-1;B<=7;B+=1)if(!(W+B<=-1||E<=W+B))for(var q=-1;q<=7;q+=1)L+q<=-1||E<=L+q||(0<=B&&B<=6&&(q==0||q==6)||0<=q&&q<=6&&(B==0||B==6)||2<=B&&B<=4&&2<=q&&q<=4?S[W+B][L+q]=!0:S[W+B][L+q]=!1)},F=function(){for(var W=0,L=0,B=0;B<8;B+=1){M(!0,B);var q=s.getLostPoint(R);(B==0||W>q)&&(W=q,L=B)}return L},U=function(){for(var W=8;W<E-8;W+=1)S[W][6]==null&&(S[W][6]=W%2==0);for(var L=8;L<E-8;L+=1)S[6][L]==null&&(S[6][L]=L%2==0)},P=function(){for(var W=s.getPatternPosition(O),L=0;L<W.length;L+=1)for(var B=0;B<W.length;B+=1){var q=W[L],N=W[B];if(S[q][N]==null)for(var Q=-2;Q<=2;Q+=1)for(var X=-2;X<=2;X+=1)Q==-2||Q==2||X==-2||X==2||Q==0&&X==0?S[q+Q][N+X]=!0:S[q+Q][N+X]=!1}},z=function(W){for(var L=s.getBCHTypeNumber(O),B=0;B<18;B+=1){var q=!W&&(L>>B&1)==1;S[Math.floor(B/3)][B%3+E-8-3]=q}for(var B=0;B<18;B+=1){var q=!W&&(L>>B&1)==1;S[B%3+E-8-3][Math.floor(B/3)]=q}},V=function(W,L){for(var B=j<<3|L,q=s.getBCHTypeInfo(B),N=0;N<15;N+=1){var Q=!W&&(q>>N&1)==1;N<6?S[N][8]=Q:N<8?S[N+1][8]=Q:S[E-15+N][8]=Q}for(var N=0;N<15;N+=1){var Q=!W&&(q>>N&1)==1;N<8?S[8][E-N-1]=Q:N<9?S[8][15-N-1+1]=Q:S[8][15-N-1]=Q}S[E-8][8]=!W},H=function(W,L){for(var B=-1,q=E-1,N=7,Q=0,X=s.getMaskFunction(L),G=E-1;G>0;G-=2)for(G==6&&(G-=1);;){for(var se=0;se<2;se+=1)if(S[q][G-se]==null){var te=!1;Q<W.length&&(te=(W[Q]>>>N&1)==1);var re=X(q,G-se);re&&(te=!te),S[q][G-se]=te,N-=1,N==-1&&(Q+=1,N=7)}if(q+=B,q<0||E<=q){q-=B,B=-B;break}}},Y=function(W,L){for(var B=0,q=0,N=0,Q=new Array(L.length),X=new Array(L.length),G=0;G<L.length;G+=1){var se=L[G].dataCount,te=L[G].totalCount-se;q=Math.max(q,se),N=Math.max(N,te),Q[G]=new Array(se);for(var re=0;re<Q[G].length;re+=1)Q[G][re]=255&W.getBuffer()[re+B];B+=se;var ae=s.getErrorCorrectPolynomial(te),ce=c(Q[G],ae.getLength()-1),ve=ce.mod(ae);X[G]=new Array(ae.getLength()-1);for(var re=0;re<X[G].length;re+=1){var ge=re+ve.getLength()-X[G].length;X[G][re]=ge>=0?ve.getAt(ge):0}}for(var be=0,re=0;re<L.length;re+=1)be+=L[re].totalCount;for(var Te=new Array(be),de=0,re=0;re<q;re+=1)for(var G=0;G<L.length;G+=1)re<Q[G].length&&(Te[de]=Q[G][re],de+=1);for(var re=0;re<N;re+=1)for(var G=0;G<L.length;G+=1)re<X[G].length&&(Te[de]=X[G][re],de+=1);return Te},Z=function(W,L,B){for(var q=u.getRSBlocks(W,L),N=d(),Q=0;Q<B.length;Q+=1){var X=B[Q];N.put(X.getMode(),4),N.put(X.getLength(),s.getLengthInBits(X.getMode(),W)),X.write(N)}for(var G=0,Q=0;Q<q.length;Q+=1)G+=q[Q].dataCount;if(N.getLengthInBits()>G*8)throw"code length overflow. ("+N.getLengthInBits()+">"+G*8+")";for(N.getLengthInBits()+4<=G*8&&N.put(0,4);N.getLengthInBits()%8!=0;)N.putBit(!1);for(;!(N.getLengthInBits()>=G*8||(N.put(T,8),N.getLengthInBits()>=G*8));)N.put(k,8);return Y(N,q)};R.addData=function(W,L){L=L||"Byte";var B=null;switch(L){case"Numeric":B=f(W);break;case"Alphanumeric":B=h(W);break;case"Byte":B=p(W);break;case"Kanji":B=g(W);break;default:throw"mode:"+L}D.push(B),A=null},R.isDark=function(W,L){if(W<0||E<=W||L<0||E<=L)throw W+","+L;return S[W][L]},R.getModuleCount=function(){return E},R.make=function(){if(O<1){for(var W=1;W<40;W++){for(var L=u.getRSBlocks(W,j),B=d(),q=0;q<D.length;q++){var N=D[q];B.put(N.getMode(),4),B.put(N.getLength(),s.getLengthInBits(N.getMode(),W)),N.write(B)}for(var Q=0,q=0;q<L.length;q++)Q+=L[q].dataCount;if(B.getLengthInBits()<=Q*8)break}O=W}M(!1,F())},R.createTableTag=function(W,L){W=W||2,L=typeof L>"u"?W*4:L;var B="";B+='<table style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: "+L+"px;",B+='">',B+="<tbody>";for(var q=0;q<R.getModuleCount();q+=1){B+="<tr>";for(var N=0;N<R.getModuleCount();N+=1)B+='<td style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: 0px;",B+=" width: "+W+"px;",B+=" height: "+W+"px;",B+=" background-color: ",B+=R.isDark(q,N)?"#000000":"#ffffff",B+=";",B+='"/>';B+="</tr>"}return B+="</tbody>",B+="</table>",B},R.createSvgTag=function(W,L,B,q){var N={};typeof arguments[0]=="object"&&(N=arguments[0],W=N.cellSize,L=N.margin,B=N.alt,q=N.title),W=W||2,L=typeof L>"u"?W*4:L,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-description":null,q=typeof q=="string"?{text:q}:q||{},q.text=q.text||null,q.id=q.text?q.id||"qrcode-title":null;var Q=R.getModuleCount()*W+L*2,X,G,se,te,re="",ae;for(ae="l"+W+",0 0,"+W+" -"+W+",0 0,-"+W+"z ",re+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',re+=N.scalable?"":' width="'+Q+'px" height="'+Q+'px"',re+=' viewBox="0 0 '+Q+" "+Q+'" ',re+=' preserveAspectRatio="xMinYMin meet"',re+=q.text||B.text?' role="img" aria-labelledby="'+J([q.id,B.id].join(" ").trim())+'"':"",re+=">",re+=q.text?'<title id="'+J(q.id)+'">'+J(q.text)+"</title>":"",re+=B.text?'<description id="'+J(B.id)+'">'+J(B.text)+"</description>":"",re+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',re+='<path d="',se=0;se<R.getModuleCount();se+=1)for(te=se*W+L,X=0;X<R.getModuleCount();X+=1)R.isDark(se,X)&&(G=X*W+L,re+="M"+G+","+te+ae);return re+='" stroke="transparent" fill="black"/>',re+="</svg>",re},R.createDataURL=function(W,L){W=W||2,L=typeof L>"u"?W*4:L;var B=R.getModuleCount()*W+L*2,q=L,N=B-L;return C(B,B,function(Q,X){if(q<=Q&&Q<N&&q<=X&&X<N){var G=Math.floor((Q-q)/W),se=Math.floor((X-q)/W);return R.isDark(se,G)?0:1}else return 1})},R.createImgTag=function(W,L,B){W=W||2,L=typeof L>"u"?W*4:L;var q=R.getModuleCount()*W+L*2,N="";return N+="<img",N+=' src="',N+=R.createDataURL(W,L),N+='"',N+=' width="',N+=q,N+='"',N+=' height="',N+=q,N+='"',B&&(N+=' alt="',N+=J(B),N+='"'),N+="/>",N};var J=function(W){for(var L="",B=0;B<W.length;B+=1){var q=W.charAt(B);switch(q){case"<":L+="&lt;";break;case">":L+="&gt;";break;case"&":L+="&amp;";break;case'"':L+="&quot;";break;default:L+=q;break}}return L},ee=function(W){var L=1;W=typeof W>"u"?L*2:W;var B=R.getModuleCount()*L+W*2,q=W,N=B-W,Q,X,G,se,te,re={"██":"█","█ ":"▀"," █":"▄"," ":" "},ae={"██":"▀","█ ":"▀"," █":" "," ":" "},ce="";for(Q=0;Q<B;Q+=2){for(G=Math.floor((Q-q)/L),se=Math.floor((Q+1-q)/L),X=0;X<B;X+=1)te="█",q<=X&&X<N&&q<=Q&&Q<N&&R.isDark(G,Math.floor((X-q)/L))&&(te=" "),q<=X&&X<N&&q<=Q+1&&Q+1<N&&R.isDark(se,Math.floor((X-q)/L))?te+=" ":te+="█",ce+=W<1&&Q+1>=N?ae[te]:re[te];ce+=`
244
+ */var $x;function BN(){return $x||($x=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function w(N){return typeof N=="string"||typeof N=="function"||N===r||N===c||N===o||N===i||N===d||N===f||typeof N=="object"&&N!==null&&(N.$$typeof===p||N.$$typeof===h||N.$$typeof===a||N.$$typeof===s||N.$$typeof===u||N.$$typeof===v||N.$$typeof===x||N.$$typeof===_||N.$$typeof===g)}function C(N){if(typeof N=="object"&&N!==null){var Q=N.$$typeof;switch(Q){case t:var X=N.type;switch(X){case l:case c:case r:case o:case i:case d:return X;default:var G=X&&X.$$typeof;switch(G){case s:case u:case p:case h:case a:return G;default:return Q}}case n:return Q}}}var b=l,$=c,T=s,k=a,O=t,j=u,S=r,E=p,A=h,D=n,R=o,M=i,I=d,F=!1;function U(N){return F||(F=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(N)||C(N)===l}function P(N){return C(N)===c}function z(N){return C(N)===s}function V(N){return C(N)===a}function H(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function Y(N){return C(N)===u}function Z(N){return C(N)===r}function J(N){return C(N)===p}function ee(N){return C(N)===h}function W(N){return C(N)===n}function L(N){return C(N)===o}function B(N){return C(N)===i}function q(N){return C(N)===d}It.AsyncMode=b,It.ConcurrentMode=$,It.ContextConsumer=T,It.ContextProvider=k,It.Element=O,It.ForwardRef=j,It.Fragment=S,It.Lazy=E,It.Memo=A,It.Portal=D,It.Profiler=R,It.StrictMode=M,It.Suspense=I,It.isAsyncMode=U,It.isConcurrentMode=P,It.isContextConsumer=z,It.isContextProvider=V,It.isElement=H,It.isForwardRef=Y,It.isFragment=Z,It.isLazy=J,It.isMemo=ee,It.isPortal=W,It.isProfiler=L,It.isStrictMode=B,It.isSuspense=q,It.isValidElementType=w,It.typeOf=C}()),It}var Sx;function zN(){return Sx||(Sx=1,process.env.NODE_ENV==="production"?Vu.exports=FN():Vu.exports=BN()),Vu.exports}var cm,Tx;function WN(){if(Tx)return cm;Tx=1;var e=zN(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=r,o[e.Memo]=i;function a(p){return e.isMemo(p)?i:o[p.$$typeof]||t}var s=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,f=Object.prototype;function h(p,g,v){if(typeof g!="string"){if(f){var x=d(g);x&&x!==f&&h(p,x,v)}var _=l(g);c&&(_=_.concat(c(g)));for(var w=a(p),C=a(g),b=0;b<_.length;++b){var $=_[b];if(!n[$]&&!(v&&v[$])&&!(C&&C[$])&&!(w&&w[$])){var T=u(g,$);try{s(p,$,T)}catch{}}}}return p}return cm=h,cm}WN();function UN(){return typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"}function I0(e,t){const n=m.useContext(O$);if(!n)throw new Error("Missing <CookiesProvider>");const i=Object.assign(Object.assign({},{doNotUpdate:!0}),t),[o,a]=m.useState(()=>n.getAll(i));UN()&&m.useLayoutEffect(()=>{function u(){const d=n.getAll(i);HN(e||null,d,o)&&a(d)}return n.addChangeListener(u),()=>{n.removeChangeListener(u)}},[n,o]);const s=m.useMemo(()=>n.set.bind(n),[n]),l=m.useMemo(()=>n.remove.bind(n),[n]),c=m.useMemo(()=>n.update.bind(n),[n]);return[o,s,l,c]}function HN(e,t,n){if(!e)return!0;for(let r of e)if(t[r]!==n[r])return!0;return!1}const VN=()=>{const e=Re.c(12),{axiosOptions:t,cookieDomain:n}=m.useContext(ln);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=["Authorization"],e[0]=r):r=e[0];const[,i,o]=I0(r);let a;e[1]!==t?(a=Qt.create(t),e[1]=t,e[2]=a):a=e[2];const s=a,l=qN;let c;e[3]!==s||e[4]!==n||e[5]!==i?(c=async(p,g)=>s.post("/user/login",{kid:p,password:g}).then(v=>(localStorage.setItem("token",v.data),i("Authorization",v.data,{path:"/",secure:!0,sameSite:"none",domain:n,expires:H4(new Date(Date.now()),24)}),v.data)).catch(YN),e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6];const u=c;let d;e[7]!==o?(d=()=>{localStorage.removeItem("token"),localStorage.removeItem("user"),o("Authorization")},e[7]=o,e[8]=d):d=e[8];const f=d;let h;return e[9]!==u||e[10]!==f?(h={isAuthenticated:l,login:u,logout:f},e[9]=u,e[10]=f,e[11]=h):h=e[11],h};function qN(){const e=localStorage.getItem("token");return e!==null&&e.length>0}function YN(e){return console.log(e),null}const GN=()=>{const e=Re.c(18);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=["Authorization"],e[0]=t):t=e[0];const[,,n]=I0(t),{msalScopes:r,msalExtraScopes:i}=m.useContext(Jf),{instance:o,inProgress:a}=hy.useMsal(),s=hy.useIsAuthenticated();let l;e[1]!==s?(l=()=>s,e[1]=s,e[2]=l):l=e[2];const c=l;let u;e[3]!==c||e[4]!==a?(u=()=>!c()&&a!==mO.InteractionStatus.None,e[3]=c,e[4]=a,e[5]=u):u=e[5];const d=u;let f;e[6]!==o||e[7]!==i||e[8]!==r?(f=async()=>o.loginRedirect({scopes:r,extraScopesToConsent:i}).then(KN).catch(ZN),e[6]=o,e[7]=i,e[8]=r,e[9]=f):f=e[9];const h=f;let p;e[10]!==o||e[11]!==n?(p=()=>{o.logout(),localStorage.removeItem("user"),n("Authorization")},e[10]=o,e[11]=n,e[12]=p):p=e[12];const g=p;let v;return e[13]!==c||e[14]!==d||e[15]!==h||e[16]!==g?(v={isAuthenticated:c,isAuthenticating:d,login:h,logout:g},e[13]=c,e[14]=d,e[15]=h,e[16]=g,e[17]=v):v=e[17],v};function KN(){return""}function ZN(){return null}const M$=()=>{const e=Re.c(13),{useMsal:t}=m.useContext(Jf),n=gO.useQueryClient(),r=VN(),i=GN();let o;e[0]!==r||e[1]!==i||e[2]!==n||e[3]!==t?(o=(d,f)=>{const h=t?i.login():r.login(d,f);return n.invalidateQueries(),h},e[0]=r,e[1]=i,e[2]=n,e[3]=t,e[4]=o):o=e[4];const a=o,s=t?i.isAuthenticated:r.isAuthenticated;let l;e[5]!==i||e[6]!==t?(l=t?i.isAuthenticating:XN,e[5]=i,e[6]=t,e[7]=l):l=e[7];const c=t?i.logout:r.logout;let u;return e[8]!==s||e[9]!==l||e[10]!==c||e[11]!==a?(u={isAuthenticated:s,isAuthenticating:l,login:a,logout:c},e[8]=s,e[9]=l,e[10]=c,e[11]=a,e[12]=u):u=e[12],u};function XN(){return!1}const QN="_toast_1s57i_1",gl={toast:QN},JN=e=>{switch(e){case"success":return 5e3;case"info":return 5e3;case"danger":return 1e4;case"warning":return 1e4;case"prompt":return 1e4;default:return 5e3}},ah=()=>{const e=Re.c(1),t=eD;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n={addNotification:t},e[0]=n):n=e[0],n};function eD(e,t){const n=ZC(e),r=JN(t),i=y.jsxs(y.Fragment,{children:[n,y.jsx(AC,{onClick:()=>Fa.dismiss(n),type:"button",style:{position:"absolute",fontSize:"12px",top:"calc(50% - 6px)",right:"8px"}})]});e:switch(t){case"success":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(RR,{size:12}),className:ue("luminus-toast-success rounded shadow bg-success",gl.toast)});break e}case"danger":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(_R,{size:12}),className:ue("luminus-toast-danger rounded shadow bg-danger",gl.toast)});break e}case"warning":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(bR,{size:12}),className:ue("luminus-toast-warning rounded shadow bg-warning",gl.toast)});break e}case"info":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(xR,{size:12}),className:ue("luminus-toast-info rounded shadow bg-info",gl.toast)});break e}case"prompt":{Fa(i,{id:n,duration:r,position:"top-center",icon:y.jsx(wR,{size:12}),className:ue("luminus-toast-prompt rounded shadow bg-light",gl.toast)});break e}}}const tD=Qt.CancelToken,sh=e=>{const{authenticated:t=!0,differentBaseUrl:n,silent:r=!1,customToken:i,ignoreDelegation:o,noToastOnStatus:a}={...e},{language:s,axiosOptions:l,texts:{axios:c}}=m.useContext(ln),{delegation:u}=m.useContext(VC),{getToken:d}=m.useContext(Jf),f=m.useMemo(()=>(u==null?void 0:u.id)??null,[u==null?void 0:u.id]),{addNotification:h}=ah(),{isAuthenticating:p}=M$(),g=m.useMemo(()=>Qt.create(l),[l]),v=m.useCallback(async b=>{var T,k,O;if(t&&!b.headers.Authorization){if(p())return console.log("Authentication in progress, waiting for token..."),Promise.reject(new Error("Authentication in progress"));const j=i?{token:i,expiresOn:H4(new Date(Date.now()),1)}:await d();if(!j)return console.log("No bearer token"),Promise.reject(new Error("No bearer token"));if(K4(j.expiresOn))return console.log("Token expired"),Promise.reject(new Error("Token expired"));b.headers.Authorization=`Bearer ${j.token}`}f!==null&&!o&&(b.headers.DelegationId=f.toString());const $=localStorage.getItem("search-use-asterisk")!=="false";return b.headers["Search-Use-Asterisk"]=$?"true":"false",(T=b.url)!=null&&T.includes("culture=")?b.url=(k=b.url)==null?void 0:k.replace(/culture=[a-z]{2}/,`culture=${s}`):b.url=`${b.url}${(O=b.url)!=null&&O.includes("?")?"&":"?"}culture=${s}`,b},[t,d,s,i,f,o,p]),x=m.useCallback(b=>{var k,O;if(console.log(b),Qt.isCancel(b)||b.message==="Authentication in progress"||b.message==="No bearer token"||b.message==="Token expired")return Promise.reject(b);const $=k0(b);if($.length>0){const j=$.find(S=>S.name.toLowerCase()==="others");return j?(!r&&h(j.errors,"danger"),Promise.reject(b)):(!r&&h(c.validationError,"warning"),Promise.reject(b))}const T=GC(b);return T!==null?(!r&&h(`${c.permissionError}: ${M0(", ",...T)}`,"danger"),Promise.reject(b)):(a??[]).includes((k=b.response)==null?void 0:k.status)?Promise.reject(b):((O=b.response)==null?void 0:O.status)===403?(!r&&h(c.forbiddenError,"danger"),Promise.reject(b)):b.message&&b.message==="Network Error"?(!r&&h(c.networkError,"danger"),Promise.reject(b)):(Qt.isCancel(b)||(!r&&h(c.unexpectedError,"danger"),(b.response||b.request)&&!r&&h(c.unexpectedError,"danger")),Promise.reject(b))},[h,c.forbiddenError,c.networkError,c.permissionError,c.unexpectedError,c.validationError,r,a]),[_,w]=m.useState(!1);return m.useEffect(()=>{n&&(g.defaults.baseURL=n)},[n,g.defaults]),m.useEffect(()=>{g.interceptors.request.clear();const b=g.interceptors.request.use(v,$=>Promise.reject($));return w(!0),()=>{g.interceptors.request.eject(b),w(!1)}},[g.interceptors.request,v]),m.useEffect(()=>{g.interceptors.response.clear();const b=g.interceptors.response.use($=>$,x);return()=>{g.interceptors.response.eject(b)}},[g.interceptors.response,x]),m.useMemo(()=>({...g,interceptorsUsed:_}),[g,_])};let Il;const P0=()=>{const e=Re.c(15),{show:t,text:n,showConfirm:r,hideConfirm:i,textSm:o}=m.useContext(jC);let a;e[0]!==i?(a=()=>{i()},e[0]=i,e[1]=a):a=e[1];const s=a;let l;e[2]!==s?(l=()=>{s(),Il&&Il(!0)},e[2]=s,e[3]=l):l=e[3];const c=l;let u;e[4]!==s?(u=()=>{s(),Il&&Il(!1)},e[4]=s,e[5]=u):u=e[5];const d=u;let f;e[6]!==r?(f=async(g,v)=>(r(g,v),new Promise(nD)),e[6]=r,e[7]=f):f=e[7];const h=f;let p;return e[8]!==h||e[9]!==d||e[10]!==c||e[11]!==t||e[12]!==n||e[13]!==o?(p={confirm:h,onConfirm:c,onCancel:d,show:t,text:n,textSm:o},e[8]=h,e[9]=d,e[10]=c,e[11]=t,e[12]=n,e[13]=o,e[14]=p):p=e[14],p};function nD(e){Il=e}var xt;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(xt||(xt={}));var zg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(zg||(zg={}));const Ce=xt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=e=>{switch(typeof e){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return Number.isNaN(e)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(e)?Ce.array:e===null?Ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ce.promise:typeof Map<"u"&&e instanceof Map?Ce.map:typeof Set<"u"&&e instanceof Set?Ce.set:typeof Date<"u"&&e instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},he=xt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),rD=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class lr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(this),r}static assert(t){if(!(t instanceof lr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}lr.create=e=>new lr(e);const $s=(e,t)=>{let n;switch(e.code){case he.invalid_type:e.received===Ce.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case he.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,xt.jsonStringifyReplacer)}`;break;case he.unrecognized_keys:n=`Unrecognized key(s) in object: ${xt.joinValues(e.keys,", ")}`;break;case he.invalid_union:n="Invalid input";break;case he.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${xt.joinValues(e.options)}`;break;case he.invalid_enum_value:n=`Invalid enum value. Expected ${xt.joinValues(e.options)}, received '${e.received}'`;break;case he.invalid_arguments:n="Invalid function arguments";break;case he.invalid_return_type:n="Invalid function return type";break;case he.invalid_date:n="Invalid date";break;case he.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:xt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case he.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case he.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case he.custom:n="Invalid input";break;case he.invalid_intersection_types:n="Intersection results could not be merged";break;case he.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case he.not_finite:n="Number must be finite";break;default:n=t.defaultError,xt.assertNever(e)}return{message:n}};let A$=$s;function iD(e){A$=e}function Ud(){return A$}const Hd=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)s=c(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},oD=[];function _e(e,t){const n=Ud(),r=Hd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===$s?void 0:$s].filter(i=>!!i)});e.common.issues.push(r)}class In{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return ze;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return In.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const ze=Object.freeze({status:"aborted"}),es=e=>({status:"dirty",value:e}),Hn=e=>({status:"valid",value:e}),Wg=e=>e.status==="aborted",Ug=e=>e.status==="dirty",la=e=>e.status==="valid",ac=e=>typeof Promise<"u"&&e instanceof Promise;var Oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Oe||(Oe={}));class ei{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ex=(e,t)=>{if(la(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new lr(e.common.issues);return this._error=n,this._error}}};function ot(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{const{message:l}=e;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:i}}class ut{get description(){return this._def.description}_getType(t){return _i(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new In,ctx:{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ac(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},i=this._parseSync({data:t,path:r.path,parent:r});return Ex(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return la(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>la(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(ac(i)?i:Promise.resolve(i));return Ex(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:he.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Dr({schema:this,typeName:Ue.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Kr.create(this,this._def)}nullable(){return bo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this)}promise(){return Ts.create(this,this._def)}or(t){return uc.create([this,t],this._def)}and(t){return dc.create(this,t,this._def)}transform(t){return new Dr({...ot(this._def),schema:this,typeName:Ue.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new gc({...ot(this._def),innerType:this,defaultValue:n,typeName:Ue.ZodDefault})}brand(){return new L0({typeName:Ue.ZodBranded,type:this,...ot(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new vc({...ot(this._def),innerType:this,catchValue:n,typeName:Ue.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return iu.create(this,t)}readonly(){return bc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const aD=/^c[^\s-]{8,}$/i,sD=/^[0-9a-z]+$/,lD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,uD=/^[a-z0-9_-]{21}$/i,dD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fD=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hD=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let um;const mD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,bD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,R$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wD=new RegExp(`^${R$}$`);function j$(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function _D(e){return new RegExp(`^${j$(e)}$`)}function N$(e){let t=`${R$}T${j$(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function CD(e,t){return!!((t==="v4"||!t)&&mD.test(e)||(t==="v6"||!t)&&vD.test(e))}function $D(e,t){if(!dD.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function SD(e,t){return!!((t==="v4"||!t)&&gD.test(e)||(t==="v6"||!t)&&bD.test(e))}class Rr extends ut{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ce.string){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_type,expected:Ce.string,received:o.parsedType}),ze}const r=new In;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?_e(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&_e(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")hD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"email",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")um||(um=new RegExp(pD,"u")),um.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"emoji",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")cD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"uuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")uD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"nanoid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")aD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"cuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")sD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"cuid2",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")lD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"ulid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),_e(i,{validation:"url",code:he.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"regex",code:he.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?N$(o).test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?wD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?_D(o).test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{code:he.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?fD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"duration",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?CD(t.data,o.version)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"ip",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?$D(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"jwt",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?SD(t.data,o.version)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"cidr",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?yD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"base64",code:he.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?xD.test(t.data)||(i=this._getOrReturnCtx(t,i),_e(i,{validation:"base64url",code:he.invalid_string,message:o.message}),r.dirty()):xt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:he.invalid_string,...Oe.errToObj(r)})}_addCheck(t){return new Rr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Oe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Oe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Oe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Oe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Oe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Oe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Oe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Oe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Oe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Oe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Oe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Oe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Oe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Oe.errToObj(n)})}nonempty(t){return this.min(1,Oe.errToObj(t))}trim(){return new Rr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Rr.create=e=>new Rr({checks:[],typeName:Ue.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ot(e)});function TD(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}class mo extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ce.number){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_type,expected:Ce.number,received:o.parsedType}),ze}let r;const i=new In;for(const o of this._def.checks)o.kind==="int"?xt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),_e(r,{code:he.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?TD(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),_e(r,{code:he.not_finite,message:o.message}),i.dirty()):xt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Oe.toString(n))}setLimit(t,n,r,i){return new mo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Oe.toString(i)}]})}_addCheck(t){return new mo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Oe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&xt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}mo.create=e=>new mo({checks:[],typeName:Ue.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ot(e)});class go extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ce.bigint)return this._getInvalidInput(t);let r;const i=new In;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),_e(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):xt.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return _e(n,{code:he.invalid_type,expected:Ce.bigint,received:n.parsedType}),ze}gte(t,n){return this.setLimit("min",t,!0,Oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Oe.toString(n))}setLimit(t,n,r,i){return new go({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Oe.toString(i)}]})}_addCheck(t){return new go({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}go.create=e=>new go({checks:[],typeName:Ue.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ot(e)});class sc extends ut{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ce.boolean){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.boolean,received:r.parsedType}),ze}return Hn(t.data)}}sc.create=e=>new sc({typeName:Ue.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ot(e)});class ca extends ut{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ce.date){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_type,expected:Ce.date,received:o.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return _e(o,{code:he.invalid_date}),ze}const r=new In;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),_e(i,{code:he.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):xt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ca({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Oe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Oe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ca.create=e=>new ca({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ue.ZodDate,...ot(e)});class Vd extends ut{_parse(t){if(this._getType(t)!==Ce.symbol){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.symbol,received:r.parsedType}),ze}return Hn(t.data)}}Vd.create=e=>new Vd({typeName:Ue.ZodSymbol,...ot(e)});class lc extends ut{_parse(t){if(this._getType(t)!==Ce.undefined){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.undefined,received:r.parsedType}),ze}return Hn(t.data)}}lc.create=e=>new lc({typeName:Ue.ZodUndefined,...ot(e)});class cc extends ut{_parse(t){if(this._getType(t)!==Ce.null){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.null,received:r.parsedType}),ze}return Hn(t.data)}}cc.create=e=>new cc({typeName:Ue.ZodNull,...ot(e)});class Ss extends ut{constructor(){super(...arguments),this._any=!0}_parse(t){return Hn(t.data)}}Ss.create=e=>new Ss({typeName:Ue.ZodAny,...ot(e)});class ta extends ut{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Hn(t.data)}}ta.create=e=>new ta({typeName:Ue.ZodUnknown,...ot(e)});class Di extends ut{_parse(t){const n=this._getOrReturnCtx(t);return _e(n,{code:he.invalid_type,expected:Ce.never,received:n.parsedType}),ze}}Di.create=e=>new Di({typeName:Ue.ZodNever,...ot(e)});class qd extends ut{_parse(t){if(this._getType(t)!==Ce.undefined){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.void,received:r.parsedType}),ze}return Hn(t.data)}}qd.create=e=>new qd({typeName:Ue.ZodVoid,...ot(e)});class Nr extends ut{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Ce.array)return _e(n,{code:he.invalid_type,expected:Ce.array,received:n.parsedType}),ze;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(_e(n,{code:a?he.too_big:he.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(_e(n,{code:he.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(_e(n,{code:he.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new ei(n,a,n.path,s)))).then(a=>In.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new ei(n,a,n.path,s)));return In.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Nr({...this._def,minLength:{value:t,message:Oe.toString(n)}})}max(t,n){return new Nr({...this._def,maxLength:{value:t,message:Oe.toString(n)}})}length(t,n){return new Nr({...this._def,exactLength:{value:t,message:Oe.toString(n)}})}nonempty(t){return this.min(1,t)}}Nr.create=(e,t)=>new Nr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ue.ZodArray,...ot(t)});function Ja(e){if(e instanceof an){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Kr.create(Ja(r))}return new an({...e._def,shape:()=>t})}else return e instanceof Nr?new Nr({...e._def,type:Ja(e.element)}):e instanceof Kr?Kr.create(Ja(e.unwrap())):e instanceof bo?bo.create(Ja(e.unwrap())):e instanceof ti?ti.create(e.items.map(t=>Ja(t))):e}class an extends ut{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=xt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ce.object){const c=this._getOrReturnCtx(t);return _e(c,{code:he.invalid_type,expected:Ce.object,received:c.parsedType}),ze}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Di&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||s.push(c);const l=[];for(const c of a){const u=o[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ei(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Di){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")s.length>0&&(_e(i,{code:he.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ei(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then(c=>In.mergeObjectSync(r,c)):In.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Oe.errToObj,new an({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,a;const i=((a=(o=this._def).errorMap)==null?void 0:a.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Oe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new an({...this._def,unknownKeys:"strip"})}passthrough(){return new an({...this._def,unknownKeys:"passthrough"})}extend(t){return new an({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new an({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ue.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new an({...this._def,catchall:t})}pick(t){const n={};for(const r of xt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new an({...this._def,shape:()=>n})}omit(t){const n={};for(const r of xt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new an({...this._def,shape:()=>n})}deepPartial(){return Ja(this)}partial(t){const n={};for(const r of xt.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new an({...this._def,shape:()=>n})}required(t){const n={};for(const r of xt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Kr;)o=o._def.innerType;n[r]=o}return new an({...this._def,shape:()=>n})}keyof(){return D$(xt.objectKeys(this.shape))}}an.create=(e,t)=>new an({shape:()=>e,unknownKeys:"strip",catchall:Di.create(),typeName:Ue.ZodObject,...ot(t)});an.strictCreate=(e,t)=>new an({shape:()=>e,unknownKeys:"strict",catchall:Di.create(),typeName:Ue.ZodObject,...ot(t)});an.lazycreate=(e,t)=>new an({shape:e,unknownKeys:"strip",catchall:Di.create(),typeName:Ue.ZodObject,...ot(t)});class uc extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new lr(s.ctx.common.issues));return _e(n,{code:he.invalid_union,unionErrors:a}),ze}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new lr(l));return _e(n,{code:he.invalid_union,unionErrors:s}),ze}}get options(){return this._def.options}}uc.create=(e,t)=>new uc({options:e,typeName:Ue.ZodUnion,...ot(t)});const gi=e=>e instanceof hc?gi(e.schema):e instanceof Dr?gi(e.innerType()):e instanceof pc?[e.value]:e instanceof vo?e.options:e instanceof mc?xt.objectValues(e.enum):e instanceof gc?gi(e._def.innerType):e instanceof lc?[void 0]:e instanceof cc?[null]:e instanceof Kr?[void 0,...gi(e.unwrap())]:e instanceof bo?[null,...gi(e.unwrap())]:e instanceof L0||e instanceof bc?gi(e.unwrap()):e instanceof vc?gi(e._def.innerType):[];class lh extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.object)return _e(n,{code:he.invalid_type,expected:Ce.object,received:n.parsedType}),ze;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(_e(n,{code:he.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=gi(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new lh({typeName:Ue.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ot(r)})}}function Hg(e,t){const n=_i(e),r=_i(t);if(e===t)return{valid:!0,data:e};if(n===Ce.object&&r===Ce.object){const i=xt.objectKeys(t),o=xt.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=Hg(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===Ce.array&&r===Ce.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=Hg(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Ce.date&&r===Ce.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class dc extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(Wg(o)||Wg(a))return ze;const s=Hg(o.value,a.value);return s.valid?((Ug(o)||Ug(a))&&n.dirty(),{status:n.value,value:s.data}):(_e(r,{code:he.invalid_intersection_types}),ze)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}dc.create=(e,t,n)=>new dc({left:e,right:t,typeName:Ue.ZodIntersection,...ot(n)});class ti extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.array)return _e(r,{code:he.invalid_type,expected:Ce.array,received:r.parsedType}),ze;if(r.data.length<this._def.items.length)return _e(r,{code:he.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&r.data.length>this._def.items.length&&(_e(r,{code:he.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new ei(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>In.mergeArray(n,a)):In.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ti({...this._def,rest:t})}}ti.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ti({items:e,typeName:Ue.ZodTuple,rest:null,...ot(t)})};class fc extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.object)return _e(r,{code:he.invalid_type,expected:Ce.object,received:r.parsedType}),ze;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new ei(r,s,r.path,s)),value:a._parse(new ei(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?In.mergeObjectAsync(n,i):In.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ut?new fc({keyType:t,valueType:n,typeName:Ue.ZodRecord,...ot(r)}):new fc({keyType:Rr.create(),valueType:t,typeName:Ue.ZodRecord,...ot(n)})}}class Yd extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.map)return _e(r,{code:he.invalid_type,expected:Ce.map,received:r.parsedType}),ze;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:i._parse(new ei(r,s,r.path,[c,"key"])),value:o._parse(new ei(r,l,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return ze;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return ze;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}}Yd.create=(e,t,n)=>new Yd({valueType:t,keyType:e,typeName:Ue.ZodMap,...ot(n)});class ua extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.set)return _e(r,{code:he.invalid_type,expected:Ce.set,received:r.parsedType}),ze;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(_e(r,{code:he.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(_e(r,{code:he.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return ze;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const s=[...r.data.values()].map((l,c)=>o._parse(new ei(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new ua({...this._def,minSize:{value:t,message:Oe.toString(n)}})}max(t,n){return new ua({...this._def,maxSize:{value:t,message:Oe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ua.create=(e,t)=>new ua({valueType:e,minSize:null,maxSize:null,typeName:Ue.ZodSet,...ot(t)});class as extends ut{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.function)return _e(n,{code:he.invalid_type,expected:Ce.function,received:n.parsedType}),ze;function r(s,l){return Hd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),$s].filter(c=>!!c),issueData:{code:he.invalid_arguments,argumentsError:l}})}function i(s,l){return Hd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),$s].filter(c=>!!c),issueData:{code:he.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Ts){const s=this;return Hn(async function(...l){const c=new lr([]),u=await s._def.args.parseAsync(l,o).catch(h=>{throw c.addIssue(r(l,h)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw c.addIssue(i(d,h)),c})})}else{const s=this;return Hn(function(...l){const c=s._def.args.safeParse(l,o);if(!c.success)throw new lr([r(l,c.error)]);const u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new lr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new as({...this._def,args:ti.create(t).rest(ta.create())})}returns(t){return new as({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new as({args:t||ti.create([]).rest(ta.create()),returns:n||ta.create(),typeName:Ue.ZodFunction,...ot(r)})}}class hc extends ut{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}hc.create=(e,t)=>new hc({getter:e,typeName:Ue.ZodLazy,...ot(t)});class pc extends ut{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return _e(n,{received:n.data,code:he.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}pc.create=(e,t)=>new pc({value:e,typeName:Ue.ZodLiteral,...ot(t)});function D$(e,t){return new vo({values:e,typeName:Ue.ZodEnum,...ot(t)})}class vo extends ut{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return _e(n,{expected:xt.joinValues(r),received:n.parsedType,code:he.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return _e(n,{received:n.data,code:he.invalid_enum_value,options:r}),ze}return Hn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return vo.create(t,{...this._def,...n})}exclude(t,n=this._def){return vo.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}vo.create=D$;class mc extends ut{_parse(t){const n=xt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ce.string&&r.parsedType!==Ce.number){const i=xt.objectValues(n);return _e(r,{expected:xt.joinValues(i),received:r.parsedType,code:he.invalid_type}),ze}if(this._cache||(this._cache=new Set(xt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=xt.objectValues(n);return _e(r,{received:r.data,code:he.invalid_enum_value,options:i}),ze}return Hn(t.data)}get enum(){return this._def.values}}mc.create=(e,t)=>new mc({values:e,typeName:Ue.ZodNativeEnum,...ot(t)});class Ts extends ut{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.promise&&n.common.async===!1)return _e(n,{code:he.invalid_type,expected:Ce.promise,received:n.parsedType}),ze;const r=n.parsedType===Ce.promise?n.data:Promise.resolve(n.data);return Hn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ts.create=(e,t)=>new Ts({type:e,typeName:Ue.ZodPromise,...ot(t)});class Dr extends ut{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{_e(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return ze;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?ze:l.status==="dirty"||n.value==="dirty"?es(l.value):l});{if(n.value==="aborted")return ze;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?ze:s.status==="dirty"||n.value==="dirty"?es(s.value):s}}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ze:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?ze:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!la(a))return ze;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>la(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):ze);xt.assertNever(i)}}Dr.create=(e,t,n)=>new Dr({schema:e,typeName:Ue.ZodEffects,effect:t,...ot(n)});Dr.createWithPreprocess=(e,t,n)=>new Dr({schema:t,effect:{type:"preprocess",transform:e},typeName:Ue.ZodEffects,...ot(n)});class Kr extends ut{_parse(t){return this._getType(t)===Ce.undefined?Hn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Kr.create=(e,t)=>new Kr({innerType:e,typeName:Ue.ZodOptional,...ot(t)});class bo extends ut{_parse(t){return this._getType(t)===Ce.null?Hn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bo.create=(e,t)=>new bo({innerType:e,typeName:Ue.ZodNullable,...ot(t)});class gc extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ce.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}gc.create=(e,t)=>new gc({innerType:e,typeName:Ue.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ot(t)});class vc extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ac(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new lr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}vc.create=(e,t)=>new vc({innerType:e,typeName:Ue.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ot(t)});class Gd extends ut{_parse(t){if(this._getType(t)!==Ce.nan){const r=this._getOrReturnCtx(t);return _e(r,{code:he.invalid_type,expected:Ce.nan,received:r.parsedType}),ze}return{status:"valid",value:t.data}}}Gd.create=e=>new Gd({typeName:Ue.ZodNaN,...ot(e)});const ED=Symbol("zod_brand");class L0 extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class iu extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ze:o.status==="dirty"?(n.dirty(),es(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ze:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new iu({in:t,out:n,typeName:Ue.ZodPipeline})}}class bc extends ut{_parse(t){const n=this._def.innerType._parse(t),r=i=>(la(i)&&(i.value=Object.freeze(i.value)),i);return ac(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}bc.create=(e,t)=>new bc({innerType:e,typeName:Ue.ZodReadonly,...ot(t)});function kx(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function I$(e,t={},n){return e?Ss.create().superRefine((r,i)=>{const o=e(r);if(o instanceof Promise)return o.then(a=>{if(!a){const s=kx(t,r),l=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:l})}});if(!o){const a=kx(t,r),s=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:s})}}):Ss.create()}const kD={object:an.lazycreate};var Ue;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ue||(Ue={}));const OD=(e,t={message:`Input not instance of ${e.name}`})=>I$(n=>n instanceof e,t),F0=Rr.create,P$=mo.create,MD=Gd.create,AD=go.create,L$=sc.create,RD=ca.create,jD=Vd.create,ND=lc.create,DD=cc.create,F$=Ss.create,ID=ta.create,PD=Di.create,LD=qd.create,B$=Nr.create,Si=an.create,FD=an.strictCreate,BD=uc.create,zD=lh.create,WD=dc.create,UD=ti.create,HD=fc.create,VD=Yd.create,qD=ua.create,YD=as.create,GD=hc.create,KD=pc.create,z$=vo.create,ZD=mc.create,XD=Ts.create,Ox=Dr.create,QD=Kr.create,JD=bo.create,eI=Dr.createWithPreprocess,tI=iu.create,nI=()=>F0().optional(),rI=()=>P$().optional(),iI=()=>L$().optional(),Pl={string:e=>Rr.create({...e,coerce:!0}),number:e=>mo.create({...e,coerce:!0}),boolean:e=>sc.create({...e,coerce:!0}),bigint:e=>go.create({...e,coerce:!0}),date:e=>ca.create({...e,coerce:!0})},oI=ze,Ll=Object.freeze(Object.defineProperty({__proto__:null,BRAND:ED,DIRTY:es,EMPTY_PATH:oD,INVALID:ze,NEVER:oI,OK:Hn,ParseStatus:In,Schema:ut,ZodAny:Ss,ZodArray:Nr,ZodBigInt:go,ZodBoolean:sc,ZodBranded:L0,ZodCatch:vc,ZodDate:ca,ZodDefault:gc,ZodDiscriminatedUnion:lh,ZodEffects:Dr,ZodEnum:vo,ZodError:lr,get ZodFirstPartyTypeKind(){return Ue},ZodFunction:as,ZodIntersection:dc,ZodIssueCode:he,ZodLazy:hc,ZodLiteral:pc,ZodMap:Yd,ZodNaN:Gd,ZodNativeEnum:mc,ZodNever:Di,ZodNull:cc,ZodNullable:bo,ZodNumber:mo,ZodObject:an,ZodOptional:Kr,ZodParsedType:Ce,ZodPipeline:iu,ZodPromise:Ts,ZodReadonly:bc,ZodRecord:fc,ZodSchema:ut,ZodSet:ua,ZodString:Rr,ZodSymbol:Vd,ZodTransformer:Dr,ZodTuple:ti,ZodType:ut,ZodUndefined:lc,ZodUnion:uc,ZodUnknown:ta,ZodVoid:qd,addIssueToContext:_e,any:F$,array:B$,bigint:AD,boolean:L$,coerce:Pl,custom:I$,date:RD,datetimeRegex:N$,defaultErrorMap:$s,discriminatedUnion:zD,effect:Ox,enum:z$,function:YD,getErrorMap:Ud,getParsedType:_i,instanceof:OD,intersection:WD,isAborted:Wg,isAsync:ac,isDirty:Ug,isValid:la,late:kD,lazy:GD,literal:KD,makeIssue:Hd,map:VD,nan:MD,nativeEnum:ZD,never:PD,null:DD,nullable:JD,number:P$,object:Si,get objectUtil(){return zg},oboolean:iI,onumber:rI,optional:QD,ostring:nI,pipeline:tI,preprocess:eI,promise:XD,quotelessJson:rD,record:HD,set:qD,setErrorMap:iD,strictObject:FD,string:F0,symbol:jD,transformer:Ox,tuple:UD,undefined:ND,union:BD,unknown:ID,get util(){return xt},void:LD},Symbol.toStringTag,{value:"Module"})),ch=()=>{const e=Re.c(41),{texts:t}=m.useContext(ln),{formValidation:n}=t;let r;e[0]!==n?(r=R=>{let M=(R!=null&&R.useCoerce?Pl:Ll).string({invalid_type_error:n.required,required_error:n.required});return R!=null&&R.email&&(M=M.email(n.invalidEmail)),R!=null&&R.length&&(M=M.min(R.length,n.length(R.length))),R!=null&&R.minLength&&(M=M.min(R.minLength,n.minLength(R.minLength))),R!=null&&R.maxLength&&(M=M.max(R.maxLength,n.maxLength(R.maxLength))),R!=null&&R.numeric&&(M=M.regex(/^\d+$/,n.noCharactersOtherThanNumbers)),R!=null&&R.regex&&(M=M.regex(R.regex,n.invalidFormat)),M.transform(aI)},e[0]=n,e[1]=r):r=e[1];const i=r;let o;e[2]!==i?(o=R=>i(R).nullable().optional().transform(sI),e[2]=i,e[3]=o):o=e[3];const a=o;let s;e[4]!==n?(s=R=>{const M=(R==null?void 0:R.min)??Number.MIN_SAFE_INTEGER,I=(R==null?void 0:R.max)??Number.MAX_SAFE_INTEGER,F=(R!=null&&R.useCoerce?Pl:Ll).number({invalid_type_error:n.required,required_error:n.required}).min(M,n.lessThanMin(M)).max(I,n.moreThanMax(I));return F.transform(lI),F},e[4]=n,e[5]=s):s=e[5];const l=s;let c;e[6]!==l?(c=R=>l(R).nullable().optional().transform(cI),e[6]=l,e[7]=c):c=e[7];const u=c;let d;e[8]!==n.required?(d=R=>(R!=null&&R.useCoerce?Pl:Ll).boolean({invalid_type_error:n.required,required_error:n.required}).transform(uI),e[8]=n.required,e[9]=d):d=e[9];const f=d;let h;e[10]!==n.invalidDate||e[11]!==n.required?(h=R=>(R!=null&&R.useCoerce?Pl:Ll).string({invalid_type_error:n.required,required_error:n.required}).refine(QC,{message:n.invalidDate}).transform(dI),e[10]=n.invalidDate,e[11]=n.required,e[12]=h):h=e[12];const p=h;let g;e[13]!==p?(g=R=>p(R).nullable().optional().transform(fI),e[13]=p,e[14]=g):g=e[14];const v=g;let x;e[15]!==n.required?(x=(R,M)=>z$(R,{invalid_type_error:n.required,required_error:n.required}).transform(hI),e[15]=n.required,e[16]=x):x=e[16];const _=x;let w;e[17]!==_?(w=(R,M)=>_(R,M).nullable().transform(pI),e[17]=_,e[18]=w):w=e[18];const C=w;let b;e[19]!==u?(b=R=>Si({id:u({useCoerce:!0})}).nullable().transform(mI),e[19]=u,e[20]=b):b=e[20];const $=b;let T;e[21]!==l?(T=R=>Si({id:l()}).transform(gI),e[21]=l,e[22]=T):T=e[22];const k=T;let O;e[23]!==a?(O=R=>Si({id:a({useCoerce:!0})}).nullable().transform(vI),e[23]=a,e[24]=O):O=e[24];const j=O;let S;e[25]!==i?(S=R=>Si({id:i()}).transform(bI),e[25]=i,e[26]=S):S=e[26];const E=S,A=xI;let D;return e[27]!==f||e[28]!==v||e[29]!==p||e[30]!==C||e[31]!==_||e[32]!==u||e[33]!==l||e[34]!==$||e[35]!==k||e[36]!==j||e[37]!==E||e[38]!==a||e[39]!==i?(D={zString:a,zStringRequired:i,zNumber:u,zNumberRequired:l,zBool:f,zDate:v,zDateRequired:p,zEnum:C,zEnumRequired:_,zObjectIdInt:$,zObjectIdIntRequired:k,zObjectIdStr:j,zObjectIdStrRequired:E,zFile:A},e[27]=f,e[28]=v,e[29]=p,e[30]=C,e[31]=_,e[32]=u,e[33]=l,e[34]=$,e[35]=k,e[36]=j,e[37]=E,e[38]=a,e[39]=i,e[40]=D):D=e[40],D};function aI(e){return e??null}function sI(e){return e??null}function lI(e){return e??null}function cI(e){return e??null}function uI(e){return e??null}function dI(e){return e??null}function fI(e){return e??null}function hI(e){return e??null}function pI(e){return e??null}function mI(e){return e??null}function gI(e){return e??null}function vI(e){return e??null}function bI(e){return e??null}function yI(e){return Array.from(e??[])}function xI(e){const{required:t,multiple:n,maxFileSize:r}=e;return F$().transform(yI).refine(o=>!t||(o==null?void 0:o.length)>0,"File is required.").refine(o=>n||(o==null?void 0:o.length)<=1,"Multiple files not allowed.").refine(o=>o.every(a=>a.size<=r),`Maximum file size is ${ws(r)}.`).transform(o=>(n?o:o==null?void 0:o[0])??null)}const W$=(e,t)=>{const n=Re.c(4);let r,i;n[0]!==t||n[1]!==e?(r=()=>{const o=a=>{e.some(s=>s.current&&s.current.contains(a.target))||t()};return document.addEventListener("mouseup",o),()=>{document.removeEventListener("mouseup",o)}},i=[e,t],n[0]=t,n[1]=e,n[2]=r,n[3]=i):(r=n[2],i=n[3]),m.useEffect(r,i)},U$=()=>{const e=Re.c(4),{user:t}=m.useContext(HC);let n;e[0]!==(t==null?void 0:t.permissions)?(n=(o,a)=>{const s=a===void 0?"any":a;return o.length===0?!0:s==="any"?o.some(l=>{var c;return(c=t==null?void 0:t.permissions)==null?void 0:c.includes(l)}):o.every(l=>{var c;return(c=t==null?void 0:t.permissions)==null?void 0:c.includes(l)})},e[0]=t==null?void 0:t.permissions,e[1]=n):n=e[1];const r=n;let i;return e[2]!==r?(i={checkUserHasPermissions:r},e[2]=r,e[3]=i):i=e[3],i},H$=(e,t)=>{const n=Re.c(6);let r,i;n[0]!==e?(r=()=>(document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}),i=[e],n[0]=e,n[1]=r,n[2]=i):(r=n[1],i=n[2]),m.useEffect(r,i);let o,a;n[3]!==t?(o=()=>t===void 0?wI:(document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}),a=[t],n[3]=t,n[4]=o,n[5]=a):(o=n[4],a=n[5]),m.useEffect(o,a)};function wI(){}const B0=(e,t,n)=>{let r;e:{if(n){r=e;break e}if(e!=="date"&&e!=="datetime-local"&&e!=="time"){r=e;break e}if(!t){r="text";break e}r=e}return r},V$=()=>{const{addNotification:e}=ah(),{texts:{clipboard:t}}=m.useContext(ln);return{copyToClipboard:m.useCallback(async r=>{var i;try{await((i=navigator.clipboard)==null?void 0:i.writeText(r)),e(t.copySuccess(r),"prompt")}catch(o){console.error(o),e(t.copyError,"danger")}},[e,t])}},ou=()=>{const e=Re.c(7),[t,n]=m.useState(window.innerWidth),[r,i]=m.useState(window.innerHeight);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{n(window.innerWidth),i(window.innerHeight)},e[0]=o):o=e[0];const a=o;let s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=()=>(window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)),l=[],e[1]=s,e[2]=l):(s=e[1],l=e[2]),m.useEffect(s,l);const c=t<992;let u;return e[3]!==r||e[4]!==c||e[5]!==t?(u={width:t,height:r,isMobile:c},e[3]=r,e[4]=c,e[5]=t,e[6]=u):u=e[6],u},q$=m.createContext({addHelmet:e=>{},removeHelmet:()=>{}}),Y$=m.createContext(void 0),Mx={falseIfNotInit:!1},uh=e=>{const{falseIfNotInit:t}=e===void 0?Mx:e,n=t===void 0?Mx.falseIfNotInit:t,r=m.useContext(Y$);if(!n&&r===void 0)throw new Error("FormDisabledProvider not initilized. Probably tried to use useFormDisabledContext outside FormDisabledProvider.");return r??!1},_I="_button_1wjon_1",CI="_filled_1wjon_7",$I="_sm_1wjon_13",SI="_md_1wjon_18",TI="_lg_1wjon_23",Ba={button:_I,filled:CI,sm:$I,md:SI,lg:TI},da=e=>{const t=Re.c(24);let n,r,i,o,a,s;t[0]!==e?({variant:o,color:a,size:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s):(n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6]);const l=o===void 0?"filled":o,c=a===void 0?"primary":a,u=s===void 0?"md":s;if(i.as==="link"){const d=i.href??"/",f=`luminus-primary-button ${c} btn ${l==="outlined"?`btn-outline-${c}`:`btn-${c}`} ${r??""}`,h=Ba[l],p=Ba[u];let g;t[7]!==f||t[8]!==h||t[9]!==p?(g=ue(f,Ba.button,h,p),t[7]=f,t[8]=h,t[9]=p,t[10]=g):g=t[10];let v;return t[11]!==n||t[12]!==i||t[13]!==d||t[14]!==g?(v=y.jsx(Ps.Link,{to:d,className:g,...i,children:n}),t[11]=n,t[12]=i,t[13]=d,t[14]=g,t[15]=v):v=t[15],v}if(i.as==="button"||i.as===void 0){const d=`luminus-primary-button ${c} btn ${l==="outlined"?`btn-outline-${c}`:`btn-${c}`} ${r??""}`,f=Ba[l],h=Ba[u];let p;t[16]!==d||t[17]!==f||t[18]!==h?(p=ue(d,Ba.button,f,h),t[16]=d,t[17]=f,t[18]=h,t[19]=p):p=t[19];let g;return t[20]!==n||t[21]!==i||t[22]!==p?(g=y.jsx("button",{type:"button",className:p,...i,children:n}),t[20]=n,t[21]=i,t[22]=p,t[23]=g):g=t[23],g}return null},EI="_button_1r3i0_1",Vg={button:EI},dh=e=>{const t=Re.c(21);let n,r,i,o,a;t[0]!==e?({color:a,icon:i,className:r,children:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a):(n=t[1],r=t[2],i=t[3],o=t[4],a=t[5]);const s=a===void 0?"primary":a;if(o.as==="link"){const l=o.href??"/",c=`luminus-context-button btn text-${s} ${r??""}`;let u;t[6]!==c?(u=ue(c,Vg.button),t[6]=c,t[7]=u):u=t[7];let d;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==l||t[12]!==u?(d=y.jsxs(Ps.Link,{to:l,className:u,...o,children:[i,n]}),t[8]=n,t[9]=i,t[10]=o,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}if(o.as==="button"||o.as===void 0){const l=`luminus-context-button btn text-${s} ${r??""}`;let c;t[14]!==l?(c=ue(l,Vg.button),t[14]=l,t[15]=c):c=t[15];let u;return t[16]!==n||t[17]!==i||t[18]!==o||t[19]!==c?(u=y.jsxs("button",{type:"button",className:c,...o,children:[i,n]}),t[16]=n,t[17]=i,t[18]=o,t[19]=c,t[20]=u):u=t[20],u}return null},kI="_icon-button_15e26_1",OI="_sm_15e26_14",MI="_md_15e26_23",AI="_lg_15e26_32",qu={"icon-button":"_icon-button_15e26_1",iconButton:kI,sm:OI,md:MI,lg:AI},au=e=>{const t=Re.c(23);let n,r,i,o,a,s;t[0]!==e?({type:o,color:a,size:s,children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s):(n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6]);const l=o===void 0?"button":o,c=a===void 0?"primary":a,u=s===void 0?"md":s;if(i.as==="link"){const d=i.href??"/",f=`luminus-icon-button btn text-${c} ${r??""}`,h=qu[u];let p;t[7]!==f||t[8]!==h?(p=ue(f,qu.iconButton,h),t[7]=f,t[8]=h,t[9]=p):p=t[9];let g;return t[10]!==n||t[11]!==i||t[12]!==d||t[13]!==p?(g=y.jsx(Ps.Link,{to:d,className:p,...i,children:n}),t[10]=n,t[11]=i,t[12]=d,t[13]=p,t[14]=g):g=t[14],g}if(i.as==="button"||i.as===void 0){const d=`luminus-icon-button btn text-${c} ${r??""}`,f=qu[u];let h;t[15]!==d||t[16]!==f?(h=ue(d,qu.iconButton,f),t[15]=d,t[16]=f,t[17]=h):h=t[17];let p;return t[18]!==n||t[19]!==i||t[20]!==h||t[21]!==l?(p=y.jsx("button",{type:l,className:h,...i,children:n}),t[18]=n,t[19]=i,t[20]=h,t[21]=l,t[22]=p):p=t[22],p}return null};var z0={},Kd={exports:{}};Kd.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",g="[object Map]",v="[object Number]",x="[object Null]",_="[object Object]",w="[object Promise]",C="[object Proxy]",b="[object RegExp]",$="[object Set]",T="[object String]",k="[object Symbol]",O="[object Undefined]",j="[object WeakMap]",S="[object ArrayBuffer]",E="[object DataView]",A="[object Float32Array]",D="[object Float64Array]",R="[object Int8Array]",M="[object Int16Array]",I="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",P="[object Uint16Array]",z="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,Z={};Z[A]=Z[D]=Z[R]=Z[M]=Z[I]=Z[F]=Z[U]=Z[P]=Z[z]=!0,Z[s]=Z[l]=Z[S]=Z[u]=Z[E]=Z[d]=Z[f]=Z[h]=Z[g]=Z[v]=Z[_]=Z[b]=Z[$]=Z[T]=Z[j]=!1;var J=typeof Zn=="object"&&Zn&&Zn.Object===Object&&Zn,ee=typeof self=="object"&&self&&self.Object===Object&&self,W=J||ee||Function("return this")(),L=t&&!t.nodeType&&t,B=L&&!0&&e&&!e.nodeType&&e,q=B&&B.exports===L,N=q&&J.process,Q=function(){try{return N&&N.binding&&N.binding("util")}catch{}}(),X=Q&&Q.isTypedArray;function G(K,ne){for(var fe=-1,Se=K==null?0:K.length,Jt=0,st=[];++fe<Se;){var un=K[fe];ne(un,fe,K)&&(st[Jt++]=un)}return st}function se(K,ne){for(var fe=-1,Se=ne.length,Jt=K.length;++fe<Se;)K[Jt+fe]=ne[fe];return K}function te(K,ne){for(var fe=-1,Se=K==null?0:K.length;++fe<Se;)if(ne(K[fe],fe,K))return!0;return!1}function re(K,ne){for(var fe=-1,Se=Array(K);++fe<K;)Se[fe]=ne(fe);return Se}function ae(K){return function(ne){return K(ne)}}function ce(K,ne){return K.has(ne)}function ve(K,ne){return K==null?void 0:K[ne]}function ge(K){var ne=-1,fe=Array(K.size);return K.forEach(function(Se,Jt){fe[++ne]=[Jt,Se]}),fe}function be(K,ne){return function(fe){return K(ne(fe))}}function Te(K){var ne=-1,fe=Array(K.size);return K.forEach(function(Se){fe[++ne]=Se}),fe}var de=Array.prototype,le=Function.prototype,we=Object.prototype,Be=W["__core-js_shared__"],Bt=le.toString,Le=we.hasOwnProperty,gt=function(){var K=/[^.]+$/.exec(Be&&Be.keys&&Be.keys.IE_PROTO||"");return K?"Symbol(src)_1."+K:""}(),_t=we.toString,nn=RegExp("^"+Bt.call(Le).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=q?W.Buffer:void 0,je=W.Symbol,vt=W.Uint8Array,qe=we.propertyIsEnumerable,bt=de.splice,at=je?je.toStringTag:void 0,At=Object.getOwnPropertySymbols,Ke=Ee?Ee.isBuffer:void 0,De=be(Object.keys,Object),We=Da(W,"DataView"),Qe=Da(W,"Map"),Ie=Da(W,"Promise"),Je=Da(W,"Set"),ht=Da(W,"WeakMap"),nt=Da(Object,"create"),Ne=jo(We),ke=jo(Qe),He=jo(Ie),yt=jo(Je),et=jo(ht),pt=je?je.prototype:void 0,tn=pt?pt.valueOf:void 0;function zt(K){var ne=-1,fe=K==null?0:K.length;for(this.clear();++ne<fe;){var Se=K[ne];this.set(Se[0],Se[1])}}function Ht(){this.__data__=nt?nt(null):{},this.size=0}function vn(K){var ne=this.has(K)&&delete this.__data__[K];return this.size-=ne?1:0,ne}function Kt(K){var ne=this.__data__;if(nt){var fe=ne[K];return fe===r?void 0:fe}return Le.call(ne,K)?ne[K]:void 0}function $e(K){var ne=this.__data__;return nt?ne[K]!==void 0:Le.call(ne,K)}function Ze(K,ne){var fe=this.__data__;return this.size+=this.has(K)?0:1,fe[K]=nt&&ne===void 0?r:ne,this}zt.prototype.clear=Ht,zt.prototype.delete=vn,zt.prototype.get=Kt,zt.prototype.has=$e,zt.prototype.set=Ze;function Ct(K){var ne=-1,fe=K==null?0:K.length;for(this.clear();++ne<fe;){var Se=K[ne];this.set(Se[0],Se[1])}}function cn(){this.__data__=[],this.size=0}function Zt(K){var ne=this.__data__,fe=di(ne,K);if(fe<0)return!1;var Se=ne.length-1;return fe==Se?ne.pop():bt.call(ne,fe,1),--this.size,!0}function Pe(K){var ne=this.__data__,fe=di(ne,K);return fe<0?void 0:ne[fe][1]}function Fe(K){return di(this.__data__,K)>-1}function ct(K,ne){var fe=this.__data__,Se=di(fe,K);return Se<0?(++this.size,fe.push([K,ne])):fe[Se][1]=ne,this}Ct.prototype.clear=cn,Ct.prototype.delete=Zt,Ct.prototype.get=Pe,Ct.prototype.has=Fe,Ct.prototype.set=ct;function Rt(K){var ne=-1,fe=K==null?0:K.length;for(this.clear();++ne<fe;){var Se=K[ne];this.set(Se[0],Se[1])}}function $t(){this.size=0,this.__data__={hash:new zt,map:new(Qe||Ct),string:new zt}}function Xe(K){var ne=Hi(this,K).delete(K);return this.size-=ne?1:0,ne}function St(K){return Hi(this,K).get(K)}function kr(K){return Hi(this,K).has(K)}function fn(K,ne){var fe=Hi(this,K),Se=fe.size;return fe.set(K,ne),this.size+=fe.size==Se?0:1,this}Rt.prototype.clear=$t,Rt.prototype.delete=Xe,Rt.prototype.get=St,Rt.prototype.has=kr,Rt.prototype.set=fn;function hn(K){var ne=-1,fe=K==null?0:K.length;for(this.__data__=new Rt;++ne<fe;)this.add(K[ne])}function Pn(K){return this.__data__.set(K,r),this}function ko(K){return this.__data__.has(K)}hn.prototype.add=hn.prototype.push=Pn,hn.prototype.has=ko;function wt(K){var ne=this.__data__=new Ct(K);this.size=ne.size}function Oo(){this.__data__=new Ct,this.size=0}function Me(K){var ne=this.__data__,fe=ne.delete(K);return this.size=ne.size,fe}function Br(K){return this.__data__.get(K)}function Mo(K){return this.__data__.has(K)}function ja(K,ne){var fe=this.__data__;if(fe instanceof Ct){var Se=fe.__data__;if(!Qe||Se.length<n-1)return Se.push([K,ne]),this.size=++fe.size,this;fe=this.__data__=new Rt(Se)}return fe.set(K,ne),this.size=fe.size,this}wt.prototype.clear=Oo,wt.prototype.delete=Me,wt.prototype.get=Br,wt.prototype.has=Mo,wt.prototype.set=ja;function Na(K,ne){var fe=Nu(K),Se=!fe&&cO(K),Jt=!fe&&!Se&&Wp(K),st=!fe&&!Se&&!Jt&&dy(K),un=fe||Se||Jt||st,_n=un?re(K.length,String):[],Tn=_n.length;for(var rn in K)Le.call(K,rn)&&!(un&&(rn=="length"||Jt&&(rn=="offset"||rn=="parent")||st&&(rn=="buffer"||rn=="byteLength"||rn=="byteOffset")||iO(rn,Tn)))&&_n.push(rn);return _n}function di(K,ne){for(var fe=K.length;fe--;)if(sy(K[fe][0],ne))return fe;return-1}function Au(K,ne,fe){var Se=ne(K);return Nu(K)?Se:se(Se,fe(K))}function fi(K){return K==null?K===void 0?O:x:at&&at in Object(K)?nO(K):lO(K)}function ll(K){return ul(K)&&fi(K)==s}function Ao(K,ne,fe,Se,Jt){return K===ne?!0:K==null||ne==null||!ul(K)&&!ul(ne)?K!==K&&ne!==ne:cl(K,ne,fe,Se,Ao,Jt)}function cl(K,ne,fe,Se,Jt,st){var un=Nu(K),_n=Nu(ne),Tn=un?l:Vi(K),rn=_n?l:Vi(ne);Tn=Tn==s?_:Tn,rn=rn==s?_:rn;var ar=Tn==_,Or=rn==_,kn=Tn==rn;if(kn&&Wp(K)){if(!Wp(ne))return!1;un=!0,ar=!1}if(kn&&!ar)return st||(st=new wt),un||dy(K)?Ln(K,ne,fe,Se,Jt,st):Bp(K,ne,Tn,fe,Se,Jt,st);if(!(fe&i)){var fr=ar&&Le.call(K,"__wrapped__"),hr=Or&&Le.call(ne,"__wrapped__");if(fr||hr){var qi=fr?K.value():K,hi=hr?ne.value():ne;return st||(st=new wt),Jt(qi,hi,fe,Se,st)}}return kn?(st||(st=new wt),zp(K,ne,fe,Se,Jt,st)):!1}function Ru(K){if(!uy(K)||aO(K))return!1;var ne=ly(K)?nn:H;return ne.test(jo(K))}function Ro(K){return ul(K)&&cy(K.length)&&!!Z[fi(K)]}function ju(K){if(!sO(K))return De(K);var ne=[];for(var fe in Object(K))Le.call(K,fe)&&fe!="constructor"&&ne.push(fe);return ne}function Ln(K,ne,fe,Se,Jt,st){var un=fe&i,_n=K.length,Tn=ne.length;if(_n!=Tn&&!(un&&Tn>_n))return!1;var rn=st.get(K);if(rn&&st.get(ne))return rn==ne;var ar=-1,Or=!0,kn=fe&o?new hn:void 0;for(st.set(K,ne),st.set(ne,K);++ar<_n;){var fr=K[ar],hr=ne[ar];if(Se)var qi=un?Se(hr,fr,ar,ne,K,st):Se(fr,hr,ar,K,ne,st);if(qi!==void 0){if(qi)continue;Or=!1;break}if(kn){if(!te(ne,function(hi,No){if(!ce(kn,No)&&(fr===hi||Jt(fr,hi,fe,Se,st)))return kn.push(No)})){Or=!1;break}}else if(!(fr===hr||Jt(fr,hr,fe,Se,st))){Or=!1;break}}return st.delete(K),st.delete(ne),Or}function Bp(K,ne,fe,Se,Jt,st,un){switch(fe){case E:if(K.byteLength!=ne.byteLength||K.byteOffset!=ne.byteOffset)return!1;K=K.buffer,ne=ne.buffer;case S:return!(K.byteLength!=ne.byteLength||!st(new vt(K),new vt(ne)));case u:case d:case v:return sy(+K,+ne);case f:return K.name==ne.name&&K.message==ne.message;case b:case T:return K==ne+"";case g:var _n=ge;case $:var Tn=Se&i;if(_n||(_n=Te),K.size!=ne.size&&!Tn)return!1;var rn=un.get(K);if(rn)return rn==ne;Se|=o,un.set(K,ne);var ar=Ln(_n(K),_n(ne),Se,Jt,st,un);return un.delete(K),ar;case k:if(tn)return tn.call(K)==tn.call(ne)}return!1}function zp(K,ne,fe,Se,Jt,st){var un=fe&i,_n=zr(K),Tn=_n.length,rn=zr(ne),ar=rn.length;if(Tn!=ar&&!un)return!1;for(var Or=Tn;Or--;){var kn=_n[Or];if(!(un?kn in ne:Le.call(ne,kn)))return!1}var fr=st.get(K);if(fr&&st.get(ne))return fr==ne;var hr=!0;st.set(K,ne),st.set(ne,K);for(var qi=un;++Or<Tn;){kn=_n[Or];var hi=K[kn],No=ne[kn];if(Se)var fy=un?Se(No,hi,kn,ne,K,st):Se(hi,No,kn,K,ne,st);if(!(fy===void 0?hi===No||Jt(hi,No,fe,Se,st):fy)){hr=!1;break}qi||(qi=kn=="constructor")}if(hr&&!qi){var Du=K.constructor,Iu=ne.constructor;Du!=Iu&&"constructor"in K&&"constructor"in ne&&!(typeof Du=="function"&&Du instanceof Du&&typeof Iu=="function"&&Iu instanceof Iu)&&(hr=!1)}return st.delete(K),st.delete(ne),hr}function zr(K){return Au(K,fO,rO)}function Hi(K,ne){var fe=K.__data__;return oO(ne)?fe[typeof ne=="string"?"string":"hash"]:fe.map}function Da(K,ne){var fe=ve(K,ne);return Ru(fe)?fe:void 0}function nO(K){var ne=Le.call(K,at),fe=K[at];try{K[at]=void 0;var Se=!0}catch{}var Jt=_t.call(K);return Se&&(ne?K[at]=fe:delete K[at]),Jt}var rO=At?function(K){return K==null?[]:(K=Object(K),G(At(K),function(ne){return qe.call(K,ne)}))}:hO,Vi=fi;(We&&Vi(new We(new ArrayBuffer(1)))!=E||Qe&&Vi(new Qe)!=g||Ie&&Vi(Ie.resolve())!=w||Je&&Vi(new Je)!=$||ht&&Vi(new ht)!=j)&&(Vi=function(K){var ne=fi(K),fe=ne==_?K.constructor:void 0,Se=fe?jo(fe):"";if(Se)switch(Se){case Ne:return E;case ke:return g;case He:return w;case yt:return $;case et:return j}return ne});function iO(K,ne){return ne=ne??a,!!ne&&(typeof K=="number"||Y.test(K))&&K>-1&&K%1==0&&K<ne}function oO(K){var ne=typeof K;return ne=="string"||ne=="number"||ne=="symbol"||ne=="boolean"?K!=="__proto__":K===null}function aO(K){return!!gt&&gt in K}function sO(K){var ne=K&&K.constructor,fe=typeof ne=="function"&&ne.prototype||we;return K===fe}function lO(K){return _t.call(K)}function jo(K){if(K!=null){try{return Bt.call(K)}catch{}try{return K+""}catch{}}return""}function sy(K,ne){return K===ne||K!==K&&ne!==ne}var cO=ll(function(){return arguments}())?ll:function(K){return ul(K)&&Le.call(K,"callee")&&!qe.call(K,"callee")},Nu=Array.isArray;function uO(K){return K!=null&&cy(K.length)&&!ly(K)}var Wp=Ke||pO;function dO(K,ne){return Ao(K,ne)}function ly(K){if(!uy(K))return!1;var ne=fi(K);return ne==h||ne==p||ne==c||ne==C}function cy(K){return typeof K=="number"&&K>-1&&K%1==0&&K<=a}function uy(K){var ne=typeof K;return K!=null&&(ne=="object"||ne=="function")}function ul(K){return K!=null&&typeof K=="object"}var dy=X?ae(X):Ro;function fO(K){return uO(K)?Na(K):ju(K)}function hO(){return[]}function pO(){return!1}e.exports=dO})(Kd,Kd.exports);var RI=Kd.exports,G$={exports:{}};(function(e,t){var n=function(){var r=function(b,$){var T=236,k=17,O=b,j=o[$],S=null,E=0,A=null,D=[],R={},M=function(W,L){E=O*4+17,S=function(B){for(var q=new Array(B),N=0;N<B;N+=1){q[N]=new Array(B);for(var Q=0;Q<B;Q+=1)q[N][Q]=null}return q}(E),I(0,0),I(E-7,0),I(0,E-7),P(),U(),V(W,L),O>=7&&z(W),A==null&&(A=Z(O,j,D)),H(A,L)},I=function(W,L){for(var B=-1;B<=7;B+=1)if(!(W+B<=-1||E<=W+B))for(var q=-1;q<=7;q+=1)L+q<=-1||E<=L+q||(0<=B&&B<=6&&(q==0||q==6)||0<=q&&q<=6&&(B==0||B==6)||2<=B&&B<=4&&2<=q&&q<=4?S[W+B][L+q]=!0:S[W+B][L+q]=!1)},F=function(){for(var W=0,L=0,B=0;B<8;B+=1){M(!0,B);var q=s.getLostPoint(R);(B==0||W>q)&&(W=q,L=B)}return L},U=function(){for(var W=8;W<E-8;W+=1)S[W][6]==null&&(S[W][6]=W%2==0);for(var L=8;L<E-8;L+=1)S[6][L]==null&&(S[6][L]=L%2==0)},P=function(){for(var W=s.getPatternPosition(O),L=0;L<W.length;L+=1)for(var B=0;B<W.length;B+=1){var q=W[L],N=W[B];if(S[q][N]==null)for(var Q=-2;Q<=2;Q+=1)for(var X=-2;X<=2;X+=1)Q==-2||Q==2||X==-2||X==2||Q==0&&X==0?S[q+Q][N+X]=!0:S[q+Q][N+X]=!1}},z=function(W){for(var L=s.getBCHTypeNumber(O),B=0;B<18;B+=1){var q=!W&&(L>>B&1)==1;S[Math.floor(B/3)][B%3+E-8-3]=q}for(var B=0;B<18;B+=1){var q=!W&&(L>>B&1)==1;S[B%3+E-8-3][Math.floor(B/3)]=q}},V=function(W,L){for(var B=j<<3|L,q=s.getBCHTypeInfo(B),N=0;N<15;N+=1){var Q=!W&&(q>>N&1)==1;N<6?S[N][8]=Q:N<8?S[N+1][8]=Q:S[E-15+N][8]=Q}for(var N=0;N<15;N+=1){var Q=!W&&(q>>N&1)==1;N<8?S[8][E-N-1]=Q:N<9?S[8][15-N-1+1]=Q:S[8][15-N-1]=Q}S[E-8][8]=!W},H=function(W,L){for(var B=-1,q=E-1,N=7,Q=0,X=s.getMaskFunction(L),G=E-1;G>0;G-=2)for(G==6&&(G-=1);;){for(var se=0;se<2;se+=1)if(S[q][G-se]==null){var te=!1;Q<W.length&&(te=(W[Q]>>>N&1)==1);var re=X(q,G-se);re&&(te=!te),S[q][G-se]=te,N-=1,N==-1&&(Q+=1,N=7)}if(q+=B,q<0||E<=q){q-=B,B=-B;break}}},Y=function(W,L){for(var B=0,q=0,N=0,Q=new Array(L.length),X=new Array(L.length),G=0;G<L.length;G+=1){var se=L[G].dataCount,te=L[G].totalCount-se;q=Math.max(q,se),N=Math.max(N,te),Q[G]=new Array(se);for(var re=0;re<Q[G].length;re+=1)Q[G][re]=255&W.getBuffer()[re+B];B+=se;var ae=s.getErrorCorrectPolynomial(te),ce=c(Q[G],ae.getLength()-1),ve=ce.mod(ae);X[G]=new Array(ae.getLength()-1);for(var re=0;re<X[G].length;re+=1){var ge=re+ve.getLength()-X[G].length;X[G][re]=ge>=0?ve.getAt(ge):0}}for(var be=0,re=0;re<L.length;re+=1)be+=L[re].totalCount;for(var Te=new Array(be),de=0,re=0;re<q;re+=1)for(var G=0;G<L.length;G+=1)re<Q[G].length&&(Te[de]=Q[G][re],de+=1);for(var re=0;re<N;re+=1)for(var G=0;G<L.length;G+=1)re<X[G].length&&(Te[de]=X[G][re],de+=1);return Te},Z=function(W,L,B){for(var q=u.getRSBlocks(W,L),N=d(),Q=0;Q<B.length;Q+=1){var X=B[Q];N.put(X.getMode(),4),N.put(X.getLength(),s.getLengthInBits(X.getMode(),W)),X.write(N)}for(var G=0,Q=0;Q<q.length;Q+=1)G+=q[Q].dataCount;if(N.getLengthInBits()>G*8)throw"code length overflow. ("+N.getLengthInBits()+">"+G*8+")";for(N.getLengthInBits()+4<=G*8&&N.put(0,4);N.getLengthInBits()%8!=0;)N.putBit(!1);for(;!(N.getLengthInBits()>=G*8||(N.put(T,8),N.getLengthInBits()>=G*8));)N.put(k,8);return Y(N,q)};R.addData=function(W,L){L=L||"Byte";var B=null;switch(L){case"Numeric":B=f(W);break;case"Alphanumeric":B=h(W);break;case"Byte":B=p(W);break;case"Kanji":B=g(W);break;default:throw"mode:"+L}D.push(B),A=null},R.isDark=function(W,L){if(W<0||E<=W||L<0||E<=L)throw W+","+L;return S[W][L]},R.getModuleCount=function(){return E},R.make=function(){if(O<1){for(var W=1;W<40;W++){for(var L=u.getRSBlocks(W,j),B=d(),q=0;q<D.length;q++){var N=D[q];B.put(N.getMode(),4),B.put(N.getLength(),s.getLengthInBits(N.getMode(),W)),N.write(B)}for(var Q=0,q=0;q<L.length;q++)Q+=L[q].dataCount;if(B.getLengthInBits()<=Q*8)break}O=W}M(!1,F())},R.createTableTag=function(W,L){W=W||2,L=typeof L>"u"?W*4:L;var B="";B+='<table style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: "+L+"px;",B+='">',B+="<tbody>";for(var q=0;q<R.getModuleCount();q+=1){B+="<tr>";for(var N=0;N<R.getModuleCount();N+=1)B+='<td style="',B+=" border-width: 0px; border-style: none;",B+=" border-collapse: collapse;",B+=" padding: 0px; margin: 0px;",B+=" width: "+W+"px;",B+=" height: "+W+"px;",B+=" background-color: ",B+=R.isDark(q,N)?"#000000":"#ffffff",B+=";",B+='"/>';B+="</tr>"}return B+="</tbody>",B+="</table>",B},R.createSvgTag=function(W,L,B,q){var N={};typeof arguments[0]=="object"&&(N=arguments[0],W=N.cellSize,L=N.margin,B=N.alt,q=N.title),W=W||2,L=typeof L>"u"?W*4:L,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-description":null,q=typeof q=="string"?{text:q}:q||{},q.text=q.text||null,q.id=q.text?q.id||"qrcode-title":null;var Q=R.getModuleCount()*W+L*2,X,G,se,te,re="",ae;for(ae="l"+W+",0 0,"+W+" -"+W+",0 0,-"+W+"z ",re+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',re+=N.scalable?"":' width="'+Q+'px" height="'+Q+'px"',re+=' viewBox="0 0 '+Q+" "+Q+'" ',re+=' preserveAspectRatio="xMinYMin meet"',re+=q.text||B.text?' role="img" aria-labelledby="'+J([q.id,B.id].join(" ").trim())+'"':"",re+=">",re+=q.text?'<title id="'+J(q.id)+'">'+J(q.text)+"</title>":"",re+=B.text?'<description id="'+J(B.id)+'">'+J(B.text)+"</description>":"",re+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',re+='<path d="',se=0;se<R.getModuleCount();se+=1)for(te=se*W+L,X=0;X<R.getModuleCount();X+=1)R.isDark(se,X)&&(G=X*W+L,re+="M"+G+","+te+ae);return re+='" stroke="transparent" fill="black"/>',re+="</svg>",re},R.createDataURL=function(W,L){W=W||2,L=typeof L>"u"?W*4:L;var B=R.getModuleCount()*W+L*2,q=L,N=B-L;return C(B,B,function(Q,X){if(q<=Q&&Q<N&&q<=X&&X<N){var G=Math.floor((Q-q)/W),se=Math.floor((X-q)/W);return R.isDark(se,G)?0:1}else return 1})},R.createImgTag=function(W,L,B){W=W||2,L=typeof L>"u"?W*4:L;var q=R.getModuleCount()*W+L*2,N="";return N+="<img",N+=' src="',N+=R.createDataURL(W,L),N+='"',N+=' width="',N+=q,N+='"',N+=' height="',N+=q,N+='"',B&&(N+=' alt="',N+=J(B),N+='"'),N+="/>",N};var J=function(W){for(var L="",B=0;B<W.length;B+=1){var q=W.charAt(B);switch(q){case"<":L+="&lt;";break;case">":L+="&gt;";break;case"&":L+="&amp;";break;case'"':L+="&quot;";break;default:L+=q;break}}return L},ee=function(W){var L=1;W=typeof W>"u"?L*2:W;var B=R.getModuleCount()*L+W*2,q=W,N=B-W,Q,X,G,se,te,re={"██":"█","█ ":"▀"," █":"▄"," ":" "},ae={"██":"▀","█ ":"▀"," █":" "," ":" "},ce="";for(Q=0;Q<B;Q+=2){for(G=Math.floor((Q-q)/L),se=Math.floor((Q+1-q)/L),X=0;X<B;X+=1)te="█",q<=X&&X<N&&q<=Q&&Q<N&&R.isDark(G,Math.floor((X-q)/L))&&(te=" "),q<=X&&X<N&&q<=Q+1&&Q+1<N&&R.isDark(se,Math.floor((X-q)/L))?te+=" ":te+="█",ce+=W<1&&Q+1>=N?ae[te]:re[te];ce+=`
245
245
  `}return B%2&&W>0?ce.substring(0,ce.length-B-1)+Array(B+1).join("▀"):ce.substring(0,ce.length-1)};return R.createASCII=function(W,L){if(W=W||1,W<2)return ee(L);W-=1,L=typeof L>"u"?W*2:L;var B=R.getModuleCount()*W+L*2,q=L,N=B-L,Q,X,G,se,te=Array(W+1).join("██"),re=Array(W+1).join(" "),ae="",ce="";for(Q=0;Q<B;Q+=1){for(G=Math.floor((Q-q)/W),ce="",X=0;X<B;X+=1)se=1,q<=X&&X<N&&q<=Q&&Q<N&&R.isDark(G,Math.floor((X-q)/W))&&(se=0),ce+=se?te:re;for(G=0;G<W;G+=1)ae+=ce+`
246
246
  `}return ae.substring(0,ae.length-1)},R.renderTo2dContext=function(W,L){L=L||2;for(var B=R.getModuleCount(),q=0;q<B;q++)for(var N=0;N<B;N++)W.fillStyle=R.isDark(q,N)?"black":"white",W.fillRect(q*L,N*L,L,L)},R};r.stringToBytesFuncs={default:function(b){for(var $=[],T=0;T<b.length;T+=1){var k=b.charCodeAt(T);$.push(k&255)}return $}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(b,$){var T=function(){for(var O=_(b),j=function(){var U=O.read();if(U==-1)throw"eof";return U},S=0,E={};;){var A=O.read();if(A==-1)break;var D=j(),R=j(),M=j(),I=String.fromCharCode(A<<8|D),F=R<<8|M;E[I]=F,S+=1}if(S!=$)throw S+" != "+$;return E}(),k=63;return function(O){for(var j=[],S=0;S<O.length;S+=1){var E=O.charCodeAt(S);if(E<128)j.push(E);else{var A=T[O.charAt(S)];typeof A=="number"?(A&255)==A?j.push(A):(j.push(A>>>8),j.push(A&255)):j.push(k)}}return j}};var i={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},o={L:1,M:0,Q:3,H:2},a={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=function(){var b=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],$=1335,T=7973,k=21522,O={},j=function(S){for(var E=0;S!=0;)E+=1,S>>>=1;return E};return O.getBCHTypeInfo=function(S){for(var E=S<<10;j(E)-j($)>=0;)E^=$<<j(E)-j($);return(S<<10|E)^k},O.getBCHTypeNumber=function(S){for(var E=S<<12;j(E)-j(T)>=0;)E^=T<<j(E)-j(T);return S<<12|E},O.getPatternPosition=function(S){return b[S-1]},O.getMaskFunction=function(S){switch(S){case a.PATTERN000:return function(E,A){return(E+A)%2==0};case a.PATTERN001:return function(E,A){return E%2==0};case a.PATTERN010:return function(E,A){return A%3==0};case a.PATTERN011:return function(E,A){return(E+A)%3==0};case a.PATTERN100:return function(E,A){return(Math.floor(E/2)+Math.floor(A/3))%2==0};case a.PATTERN101:return function(E,A){return E*A%2+E*A%3==0};case a.PATTERN110:return function(E,A){return(E*A%2+E*A%3)%2==0};case a.PATTERN111:return function(E,A){return(E*A%3+(E+A)%2)%2==0};default:throw"bad maskPattern:"+S}},O.getErrorCorrectPolynomial=function(S){for(var E=c([1],0),A=0;A<S;A+=1)E=E.multiply(c([1,l.gexp(A)],0));return E},O.getLengthInBits=function(S,E){if(1<=E&&E<10)switch(S){case i.MODE_NUMBER:return 10;case i.MODE_ALPHA_NUM:return 9;case i.MODE_8BIT_BYTE:return 8;case i.MODE_KANJI:return 8;default:throw"mode:"+S}else if(E<27)switch(S){case i.MODE_NUMBER:return 12;case i.MODE_ALPHA_NUM:return 11;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 10;default:throw"mode:"+S}else if(E<41)switch(S){case i.MODE_NUMBER:return 14;case i.MODE_ALPHA_NUM:return 13;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 12;default:throw"mode:"+S}else throw"type:"+E},O.getLostPoint=function(S){for(var E=S.getModuleCount(),A=0,D=0;D<E;D+=1)for(var R=0;R<E;R+=1){for(var M=0,I=S.isDark(D,R),F=-1;F<=1;F+=1)if(!(D+F<0||E<=D+F))for(var U=-1;U<=1;U+=1)R+U<0||E<=R+U||F==0&&U==0||I==S.isDark(D+F,R+U)&&(M+=1);M>5&&(A+=3+M-5)}for(var D=0;D<E-1;D+=1)for(var R=0;R<E-1;R+=1){var P=0;S.isDark(D,R)&&(P+=1),S.isDark(D+1,R)&&(P+=1),S.isDark(D,R+1)&&(P+=1),S.isDark(D+1,R+1)&&(P+=1),(P==0||P==4)&&(A+=3)}for(var D=0;D<E;D+=1)for(var R=0;R<E-6;R+=1)S.isDark(D,R)&&!S.isDark(D,R+1)&&S.isDark(D,R+2)&&S.isDark(D,R+3)&&S.isDark(D,R+4)&&!S.isDark(D,R+5)&&S.isDark(D,R+6)&&(A+=40);for(var R=0;R<E;R+=1)for(var D=0;D<E-6;D+=1)S.isDark(D,R)&&!S.isDark(D+1,R)&&S.isDark(D+2,R)&&S.isDark(D+3,R)&&S.isDark(D+4,R)&&!S.isDark(D+5,R)&&S.isDark(D+6,R)&&(A+=40);for(var z=0,R=0;R<E;R+=1)for(var D=0;D<E;D+=1)S.isDark(D,R)&&(z+=1);var V=Math.abs(100*z/E/E-50)/5;return A+=V*10,A},O}(),l=function(){for(var b=new Array(256),$=new Array(256),T=0;T<8;T+=1)b[T]=1<<T;for(var T=8;T<256;T+=1)b[T]=b[T-4]^b[T-5]^b[T-6]^b[T-8];for(var T=0;T<255;T+=1)$[b[T]]=T;var k={};return k.glog=function(O){if(O<1)throw"glog("+O+")";return $[O]},k.gexp=function(O){for(;O<0;)O+=255;for(;O>=256;)O-=255;return b[O]},k}();function c(b,$){if(typeof b.length>"u")throw b.length+"/"+$;var T=function(){for(var O=0;O<b.length&&b[O]==0;)O+=1;for(var j=new Array(b.length-O+$),S=0;S<b.length-O;S+=1)j[S]=b[S+O];return j}(),k={};return k.getAt=function(O){return T[O]},k.getLength=function(){return T.length},k.multiply=function(O){for(var j=new Array(k.getLength()+O.getLength()-1),S=0;S<k.getLength();S+=1)for(var E=0;E<O.getLength();E+=1)j[S+E]^=l.gexp(l.glog(k.getAt(S))+l.glog(O.getAt(E)));return c(j,0)},k.mod=function(O){if(k.getLength()-O.getLength()<0)return k;for(var j=l.glog(k.getAt(0))-l.glog(O.getAt(0)),S=new Array(k.getLength()),E=0;E<k.getLength();E+=1)S[E]=k.getAt(E);for(var E=0;E<O.getLength();E+=1)S[E]^=l.gexp(l.glog(O.getAt(E))+j);return c(S,0).mod(O)},k}var u=function(){var b=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],$=function(O,j){var S={};return S.totalCount=O,S.dataCount=j,S},T={},k=function(O,j){switch(j){case o.L:return b[(O-1)*4+0];case o.M:return b[(O-1)*4+1];case o.Q:return b[(O-1)*4+2];case o.H:return b[(O-1)*4+3];default:return}};return T.getRSBlocks=function(O,j){var S=k(O,j);if(typeof S>"u")throw"bad rs block @ typeNumber:"+O+"/errorCorrectionLevel:"+j;for(var E=S.length/3,A=[],D=0;D<E;D+=1)for(var R=S[D*3+0],M=S[D*3+1],I=S[D*3+2],F=0;F<R;F+=1)A.push($(M,I));return A},T}(),d=function(){var b=[],$=0,T={};return T.getBuffer=function(){return b},T.getAt=function(k){var O=Math.floor(k/8);return(b[O]>>>7-k%8&1)==1},T.put=function(k,O){for(var j=0;j<O;j+=1)T.putBit((k>>>O-j-1&1)==1)},T.getLengthInBits=function(){return $},T.putBit=function(k){var O=Math.floor($/8);b.length<=O&&b.push(0),k&&(b[O]|=128>>>$%8),$+=1},T},f=function(b){var $=i.MODE_NUMBER,T=b,k={};k.getMode=function(){return $},k.getLength=function(S){return T.length},k.write=function(S){for(var E=T,A=0;A+2<E.length;)S.put(O(E.substring(A,A+3)),10),A+=3;A<E.length&&(E.length-A==1?S.put(O(E.substring(A,A+1)),4):E.length-A==2&&S.put(O(E.substring(A,A+2)),7))};var O=function(S){for(var E=0,A=0;A<S.length;A+=1)E=E*10+j(S.charAt(A));return E},j=function(S){if("0"<=S&&S<="9")return S.charCodeAt(0)-48;throw"illegal char :"+S};return k},h=function(b){var $=i.MODE_ALPHA_NUM,T=b,k={};k.getMode=function(){return $},k.getLength=function(j){return T.length},k.write=function(j){for(var S=T,E=0;E+1<S.length;)j.put(O(S.charAt(E))*45+O(S.charAt(E+1)),11),E+=2;E<S.length&&j.put(O(S.charAt(E)),6)};var O=function(j){if("0"<=j&&j<="9")return j.charCodeAt(0)-48;if("A"<=j&&j<="Z")return j.charCodeAt(0)-65+10;switch(j){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+j}};return k},p=function(b){var $=i.MODE_8BIT_BYTE,T=r.stringToBytes(b),k={};return k.getMode=function(){return $},k.getLength=function(O){return T.length},k.write=function(O){for(var j=0;j<T.length;j+=1)O.put(T[j],8)},k},g=function(b){var $=i.MODE_KANJI,T=r.stringToBytesFuncs.SJIS;if(!T)throw"sjis not supported.";(function(j,S){var E=T(j);if(E.length!=2||(E[0]<<8|E[1])!=S)throw"sjis not supported."})("友",38726);var k=T(b),O={};return O.getMode=function(){return $},O.getLength=function(j){return~~(k.length/2)},O.write=function(j){for(var S=k,E=0;E+1<S.length;){var A=(255&S[E])<<8|255&S[E+1];if(33088<=A&&A<=40956)A-=33088;else if(57408<=A&&A<=60351)A-=49472;else throw"illegal char at "+(E+1)+"/"+A;A=(A>>>8&255)*192+(A&255),j.put(A,13),E+=2}if(E<S.length)throw"illegal char at "+(E+1)},O},v=function(){var b=[],$={};return $.writeByte=function(T){b.push(T&255)},$.writeShort=function(T){$.writeByte(T),$.writeByte(T>>>8)},$.writeBytes=function(T,k,O){k=k||0,O=O||T.length;for(var j=0;j<O;j+=1)$.writeByte(T[j+k])},$.writeString=function(T){for(var k=0;k<T.length;k+=1)$.writeByte(T.charCodeAt(k))},$.toByteArray=function(){return b},$.toString=function(){var T="";T+="[";for(var k=0;k<b.length;k+=1)k>0&&(T+=","),T+=b[k];return T+="]",T},$},x=function(){var b=0,$=0,T=0,k="",O={},j=function(E){k+=String.fromCharCode(S(E&63))},S=function(E){if(!(E<0)){if(E<26)return 65+E;if(E<52)return 97+(E-26);if(E<62)return 48+(E-52);if(E==62)return 43;if(E==63)return 47}throw"n:"+E};return O.writeByte=function(E){for(b=b<<8|E&255,$+=8,T+=1;$>=6;)j(b>>>$-6),$-=6},O.flush=function(){if($>0&&(j(b<<6-$),b=0,$=0),T%3!=0)for(var E=3-T%3,A=0;A<E;A+=1)k+="="},O.toString=function(){return k},O},_=function(b){var $=b,T=0,k=0,O=0,j={};j.read=function(){for(;O<8;){if(T>=$.length){if(O==0)return-1;throw"unexpected end of file./"+O}var E=$.charAt(T);if(T+=1,E=="=")return O=0,-1;if(E.match(/^\s$/))continue;k=k<<6|S(E.charCodeAt(0)),O+=6}var A=k>>>O-8&255;return O-=8,A};var S=function(E){if(65<=E&&E<=90)return E-65;if(97<=E&&E<=122)return E-97+26;if(48<=E&&E<=57)return E-48+52;if(E==43)return 62;if(E==47)return 63;throw"c:"+E};return j},w=function(b,$){var T=b,k=$,O=new Array(b*$),j={};j.setPixel=function(D,R,M){O[R*T+D]=M},j.write=function(D){D.writeString("GIF87a"),D.writeShort(T),D.writeShort(k),D.writeByte(128),D.writeByte(0),D.writeByte(0),D.writeByte(0),D.writeByte(0),D.writeByte(0),D.writeByte(255),D.writeByte(255),D.writeByte(255),D.writeString(","),D.writeShort(0),D.writeShort(0),D.writeShort(T),D.writeShort(k),D.writeByte(0);var R=2,M=E(R);D.writeByte(R);for(var I=0;M.length-I>255;)D.writeByte(255),D.writeBytes(M,I,255),I+=255;D.writeByte(M.length-I),D.writeBytes(M,I,M.length-I),D.writeByte(0),D.writeString(";")};var S=function(D){var R=D,M=0,I=0,F={};return F.write=function(U,P){if(U>>>P)throw"length over";for(;M+P>=8;)R.writeByte(255&(U<<M|I)),P-=8-M,U>>>=8-M,I=0,M=0;I=U<<M|I,M=M+P},F.flush=function(){M>0&&R.writeByte(I)},F},E=function(D){for(var R=1<<D,M=(1<<D)+1,I=D+1,F=A(),U=0;U<R;U+=1)F.add(String.fromCharCode(U));F.add(String.fromCharCode(R)),F.add(String.fromCharCode(M));var P=v(),z=S(P);z.write(R,I);var V=0,H=String.fromCharCode(O[V]);for(V+=1;V<O.length;){var Y=String.fromCharCode(O[V]);V+=1,F.contains(H+Y)?H=H+Y:(z.write(F.indexOf(H),I),F.size()<4095&&(F.size()==1<<I&&(I+=1),F.add(H+Y)),H=Y)}return z.write(F.indexOf(H),I),z.write(M,I),z.flush(),P.toByteArray()},A=function(){var D={},R=0,M={};return M.add=function(I){if(M.contains(I))throw"dup key:"+I;D[I]=R,R+=1},M.size=function(){return R},M.indexOf=function(I){return D[I]},M.contains=function(I){return typeof D[I]<"u"},M};return j},C=function(b,$,T){for(var k=w(b,$),O=0;O<$;O+=1)for(var j=0;j<b;j+=1)k.setPixel(j,O,T(j,O));var S=v();k.write(S);for(var E=x(),A=S.toByteArray(),D=0;D<A.length;D+=1)E.writeByte(A[D]);return E.flush(),"data:image/gif;base64,"+E};return r}();(function(){n.stringToBytesFuncs["UTF-8"]=function(r){function i(o){for(var a=[],s=0;s<o.length;s++){var l=o.charCodeAt(s);l<128?a.push(l):l<2048?a.push(192|l>>6,128|l&63):l<55296||l>=57344?a.push(224|l>>12,128|l>>6&63,128|l&63):(s++,l=65536+((l&1023)<<10|o.charCodeAt(s)&1023),a.push(240|l>>18,128|l>>12&63,128|l>>6&63,128|l&63))}return a}return i(r)}})(),function(r){e.exports=r()}(function(){return n})})(G$);var jI=G$.exports,NI=Zn&&Zn.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qg=Zn&&Zn.__assign||function(){return qg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},qg.apply(this,arguments)};Object.defineProperty(z0,"__esModule",{value:!0});exports.QRCode_1=z0.QRCode=void 0;var DI=RI,II=jI,dm=m,PI=function(e){NI(t,e);function t(n){var r=e.call(this,n)||this;return r.canvasRef=dm.createRef(),r}return t.prototype.download=function(n,r){if(this.canvasRef.current){var i=void 0;switch(n){case"jpg":i="image/jpeg";break;case"webp":i="image/webp";break;case"png":default:i="image/png";break}var o=this.canvasRef.current.toDataURL(i,1),a=document.createElement("a");a.download=r??"react-qrcode-logo",a.href=o,a.click()}},t.prototype.utf16to8=function(n){var r="",i,o,a=n.length;for(i=0;i<a;i++)o=n.charCodeAt(i),o>=1&&o<=127?r+=n.charAt(i):o>2047?(r+=String.fromCharCode(224|o>>12&15),r+=String.fromCharCode(128|o>>6&63),r+=String.fromCharCode(128|o>>0&63)):(r+=String.fromCharCode(192|o>>6&31),r+=String.fromCharCode(128|o>>0&63));return r},t.prototype.drawRoundedSquare=function(n,r,i,o,a,s,l,c){c.lineWidth=n,c.fillStyle=a,c.strokeStyle=a,i+=n/2,r+=n/2,o-=n,Array.isArray(s)||(s=[s,s,s,s]),s=s.map(function(p){return p=Math.min(p,o/2),p<0?0:p});var u=s[0]||0,d=s[1]||0,f=s[2]||0,h=s[3]||0;c.beginPath(),c.moveTo(r+u,i),c.lineTo(r+o-d,i),d&&c.quadraticCurveTo(r+o,i,r+o,i+d),c.lineTo(r+o,i+o-f),f&&c.quadraticCurveTo(r+o,i+o,r+o-f,i+o),c.lineTo(r+h,i+o),h&&c.quadraticCurveTo(r,i+o,r,i+o-h),c.lineTo(r,i+u),u&&c.quadraticCurveTo(r,i,r+u,i),c.closePath(),c.stroke(),l&&c.fill()},t.prototype.drawPositioningPattern=function(n,r,i,o,a,s,l){l===void 0&&(l=[0,0,0,0]);var c=Math.ceil(r),u,d;typeof l!="number"&&!Array.isArray(l)?(u=l.outer||0,d=l.inner||0):(u=l,d=u);var f,h;typeof s!="string"?(f=s.outer,h=s.inner):(f=s,h=s);var p=o*r+i,g=a*r+i,v=r*7;this.drawRoundedSquare(c,g,p,v,f,u,!1,n),v=r*3,p+=r*2,g+=r*2,this.drawRoundedSquare(c,g,p,v,h,d,!0,n)},t.prototype.isInPositioninZone=function(n,r,i){return i.some(function(o){return r>=o.row&&r<=o.row+7&&n>=o.col&&n<=o.col+7})},t.prototype.transformPixelLengthIntoNumberOfCells=function(n,r){return n/r},t.prototype.isCoordinateInImage=function(n,r,i,o,a,s,l,c){if(c){var u=2,d=this.transformPixelLengthIntoNumberOfCells(a,l),f=this.transformPixelLengthIntoNumberOfCells(s,l),h=this.transformPixelLengthIntoNumberOfCells(i,l)-1,p=this.transformPixelLengthIntoNumberOfCells(o,l)-1;return r>=d-u&&r<=d+h+u&&n>=f-u&&n<=f+p+u}else return!1},t.prototype.shouldComponentUpdate=function(n){return!DI(this.props,n)},t.prototype.componentDidMount=function(){this.update()},t.prototype.componentDidUpdate=function(){this.update()},t.prototype.update=function(){var n,r=this.props,i=r.value,o=r.ecLevel,a=r.enableCORS,s=r.bgColor,l=r.fgColor,c=r.logoImage,u=r.logoOpacity,d=r.logoOnLoad,f=r.removeQrCodeBehindLogo,h=r.qrStyle,p=r.eyeRadius,g=r.eyeColor,v=r.logoPaddingStyle,x=+this.props.size,_=+this.props.quietZone,w=this.props.logoWidth?+this.props.logoWidth:0,C=this.props.logoHeight?+this.props.logoHeight:0,b=this.props.logoPadding?+this.props.logoPadding:0,$=II(0,o);$.addData(this.utf16to8(i)),$.make();var T=(n=this.canvasRef)===null||n===void 0?void 0:n.current,k=T.getContext("2d"),O=x+2*_,j=$.getModuleCount(),S=x/j,E=window.devicePixelRatio||1;T.height=T.width=O*E,k.scale(E,E),k.fillStyle=s,k.fillRect(0,0,O,O);var A=_,D=[{row:0,col:0},{row:0,col:j-7},{row:j-7,col:0}];if(k.strokeStyle=l,h==="dots"){k.fillStyle=l;for(var R=S/2,M=0;M<j;M++)for(var I=0;I<j;I++)$.isDark(M,I)&&!this.isInPositioninZone(M,I,D)&&(k.beginPath(),k.arc(Math.round(I*S)+R+A,Math.round(M*S)+R+A,R/100*75,0,2*Math.PI,!1),k.closePath(),k.fill())}else if(h==="fluid"){for(var R=Math.ceil(S/2),M=0;M<j;M++)for(var I=0;I<j;I++)if($.isDark(M,I)&&!this.isInPositioninZone(M,I,D)){var F=[!1,!1,!1,!1];M>0&&!$.isDark(M-1,I)&&I>0&&!$.isDark(M,I-1)&&(F[0]=!0),M>0&&!$.isDark(M-1,I)&&I<j-1&&!$.isDark(M,I+1)&&(F[1]=!0),M<j-1&&!$.isDark(M+1,I)&&I<j-1&&!$.isDark(M,I+1)&&(F[2]=!0),M<j-1&&!$.isDark(M+1,I)&&I>0&&!$.isDark(M,I-1)&&(F[3]=!0);var U=Math.ceil((I+1)*S)-Math.floor(I*S),P=Math.ceil((M+1)*S)-Math.floor(M*S);k.fillStyle=l,k.beginPath(),k.arc(Math.round(I*S)+R+A,Math.round(M*S)+R+A,R,0,2*Math.PI,!1),k.closePath(),k.fill(),F[0]||k.fillRect(Math.round(I*S)+A,Math.round(M*S)+A,U/2,P/2),F[1]||k.fillRect(Math.round(I*S)+A+Math.floor(U/2),Math.round(M*S)+A,U/2,P/2),F[2]||k.fillRect(Math.round(I*S)+A+Math.floor(U/2),Math.round(M*S)+A+Math.floor(P/2),U/2,P/2),F[3]||k.fillRect(Math.round(I*S)+A,Math.round(M*S)+A+Math.floor(P/2),U/2,P/2)}}else for(var M=0;M<j;M++)for(var I=0;I<j;I++)if($.isDark(M,I)&&!this.isInPositioninZone(M,I,D)){k.fillStyle=l;var U=Math.ceil((I+1)*S)-Math.floor(I*S),P=Math.ceil((M+1)*S)-Math.floor(M*S);k.fillRect(Math.round(I*S)+A,Math.round(M*S)+A,U,P)}for(var z=0;z<3;z++){var V=D[z],M=V.row,I=V.col,H=p,Y=void 0;Array.isArray(H)&&(H=H[z]),typeof H=="number"&&(H=[H,H,H,H]),g?Array.isArray(g)?Y=g[z]:Y=g:Y=l,this.drawPositioningPattern(k,S,A,M,I,Y,H)}if(c){var Z=new Image;a&&(Z.crossOrigin="Anonymous"),Z.onload=function(J){k.save();var ee=w||x*.2,W=C||ee,L=(x-ee)/2,B=(x-W)/2;if(f||b){k.beginPath(),k.strokeStyle=s,k.fillStyle=s;var q=ee+2*b,N=W+2*b,Q=L+A-b,X=B+A-b;if(v==="circle"){var G=Q+q/2,se=X+N/2;k.ellipse(G,se,q/2,N/2,0,0,2*Math.PI),k.stroke(),k.fill()}else k.fillRect(Q,X,q,N)}k.globalAlpha=u,k.drawImage(Z,L+A,B+A,ee,W),k.restore(),d&&d(J)},Z.src=c}},t.prototype.render=function(){var n,r=+this.props.size+2*+this.props.quietZone;return dm.createElement("canvas",{id:(n=this.props.id)!==null&&n!==void 0?n:"react-qrcode-logo",height:r,width:r,style:qg({height:r+"px",width:r+"px"},this.props.style),ref:this.canvasRef})},t.defaultProps={value:"https://reactjs.org/",ecLevel:"M",enableCORS:!1,size:150,quietZone:10,bgColor:"#FFFFFF",fgColor:"#000000",logoOpacity:1,qrStyle:"squares",eyeRadius:[0,0,0],logoPaddingStyle:"square"},t}(dm.Component);exports.QRCode_1=z0.QRCode=PI;const LI="_floating-label_3xm9u_1",FI="_without-label_3xm9u_21",BI="_floating-label-check_3xm9u_184",fm={floatingLabel:LI,withoutLabel:FI,floatingLabelCheck:BI},zI=e=>{const t=Re.c(3),{hint:n,children:r}=e;let i;return t[0]!==r||t[1]!==n?(i=n?y.jsx(O0,{text:n,placement:"top",children:r}):r,t[0]=r,t[1]=n,t[2]=i):i=t[2],i},fh=({ref:e,hidden:t,children:n,className:r,isInvalid:i,isForRadioInput:o,inputContainerClassName:a,isForCheckInput:s,hint:l,required:c,disabled:u,...d})=>{const{ProjectIconComponent:f}=m.useContext(ln),h=d.withoutLabel?"":y.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[d.label,c?y.jsx("span",{className:ue("fw-bold",{"text-danger":!u}),style:{fontSize:"16px"},children:"*"}):null,l?y.jsx("div",{className:"d-flex align-items-center",children:y.jsx(f,{icon:"info"})}):null]});return s?y.jsx("div",{className:ue("luminus-floating-label-check",fm.floatingLabelCheck),children:n}):y.jsx(zI,{hint:l,children:y.jsx(y0,{ref:e,label:y.jsx("div",{className:"d-flex gap-1 align-items-center",children:h}),hidden:t??!1,className:ue(`luminus-floating-label ${r??""}`,fm.floatingLabel,{[a??""]:a},{[fm.withoutLabel]:d.withoutLabel}),children:n})})};fh.displayName="FloatingLabelInput";const WI="_row-label-input_i295l_1",UI="_label_i295l_4",HI="_input-container_i295l_9",VI="_keep-check-label_i295l_132",qI="_is-invalid_i295l_160",vl={rowLabelInput:WI,label:UI,inputContainer:HI,keepCheckLabel:VI,isInvalid:qI},su=({ref:e,hidden:t,children:n,required:r,disabled:i,className:o,isInvalid:a,isForRadioInput:s,isForTextAreaInput:l,inputContainerClassName:c,hint:u,...d})=>{const{ProjectIconComponent:f}=m.useContext(ln),h=d.withoutLabel?y.jsx(y.Fragment,{}):y.jsx("label",{className:ue("label col-6",{"col-12":l},vl.label),children:y.jsxs(zn,{variant:"form-label",className:ue("d-flex gap-1 align-items-center",a?"text-danger":""),children:[d.label,r?y.jsx("span",{className:ue("fw-bold",{"text-danger":!i}),style:{fontSize:"16px"},children:"*"}):null,u?y.jsx("div",{className:"d-flex align-items-center",style:{paddingTop:"2px"},children:y.jsx(f,{icon:"info"})}):null]})});return y.jsxs("div",{ref:e,className:ue("luminus-row-label row gx-0 gy-0",{"is-invalid":a},{[vl.isInvalid]:a},{[o??""]:o},{"d-none":t},vl.rowLabelInput),children:[u?y.jsx(O0,{text:u,placement:"top",children:h}):h,y.jsx("div",{className:ue("input-container",vl.inputContainer,{"col-6":!d.withoutLabel&&!l},{"col-12":d.withoutLabel||l},{[vl.keepCheckLabel]:s},{[c??""]:c}),children:n})]})};su.displayName="RowLabelInput";const K$=e=>{const t=Re.c(4),{ref:n,children:r,className:i,hidden:o}=e,a=`${o?"d-none":""} ${i}`;let s;return t[0]!==r||t[1]!==n||t[2]!==a?(s=y.jsx("div",{ref:n,className:a,children:r}),t[0]=r,t[1]=n,t[2]=a,t[3]=s):s=t[3],s};K$.displayName="NoInputContainer";const Z$=e=>{const t=Re.c(8),{currentSelection:n,selectedItemNavigateTo:r,children:i}=e;if(!n||!n.id||!r){let l;return t[0]!==i?(l=y.jsx("div",{className:"luminus-input-container position-relative w-100",children:i}),t[0]=i,t[1]=l):l=t[1],l}let o;t[2]!==n||t[3]!==r?(o=r(n),t[2]=n,t[3]=r,t[4]=o):o=t[4];const a=o;let s;return t[5]!==i||t[6]!==a?(s=y.jsx(Ps.Link,{to:a,className:"luminus-input-container position-relative w-100 text-decoration-none",children:i}),t[5]=i,t[6]=a,t[7]=s):s=t[7],s},X$=({InputContainer:e=fh,type:t,value:n,onChange:r,debounceMs:i,label:o,withoutLabel:a,placeholder:s,size:l,hidden:c,disabled:u,showClearIcon:d,clearValue:f,list:h,className:p,step:g,minLength:v,maxLength:x,noSelectOnFocus:_,hint:w,onConfirm:C,autoComplete:b})=>{var P,z,V;const $=t==="number",T=m.useCallback(()=>{if(!r)return;const H=f??null;r($?H?Number(H):null:(H==null?void 0:H.toString())??"")},[f,$,r]),k=m.useRef(null),[O,j]=m.useState((n==null?void 0:n.toString())??""),S=m.useCallback(H=>{const Y=H;r&&r($?Y==null||Y===""?null:Number(Y):Y||null)},[$,r]),E=m.useCallback(H=>{var Z;const Y=(Z=H.target)==null?void 0:Z.value;if(!i){S(Y);return}j(Y),k.current!==null&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>{S(Y)},i)},[i,S]),A=m.useMemo(()=>{if(C!==void 0)return H=>{H.key==="Enter"&&C&&C()}},[C]);m.useEffect(()=>{j(n===null?"":n.toString())},[n]);const[D,R]=m.useState(!1),M=B0(t,n?n.toString()??null:null,D),I=m.useRef(null),F=(((P=I.current)==null?void 0:P.scrollWidth)??0)>(((z=I.current)==null?void 0:z.clientWidth)??0),U=(V=I.current)==null?void 0:V.getBoundingClientRect();return y.jsxs(e,{withoutLabel:a,label:o??"",hidden:c,className:p,hint:w,disabled:u,children:[y.jsx(si.Control,{type:M,placeholder:s??o,size:l,value:i?O:(n==null?void 0:n.toString())??"",onChange:E,className:p??"",hidden:c,disabled:u??!1,list:h,onFocus:H=>{R(!0),!_&&H.target.select()},onBlur:()=>R(!1),onKeyDown:A,step:g,minLength:v,maxLength:x,autoComplete:b,ref:I}),d&&n!==null&&r&&!u&&y.jsx("div",{className:`luminus-input-remove-icon ${t!=="text"?"inset":""}`,children:y.jsx(au,{color:"secondary",size:"sm",onClick:T,children:y.jsx(Qc,{})})}),F?y.jsx("div",{className:"luminus-overflow-tooltip",style:{opacity:0,position:"fixed",top:((U==null?void 0:U.top)??0)+((U==null?void 0:U.height)??0),left:(U==null?void 0:U.left)??0},children:i?O:(n==null?void 0:n.toString())??""}):null]})},Q$=e=>{const t=Re.c(7),{value:n,MiniDetailComponent:r,children:i,miniDetailPlacement:o}=e;if(!n||!r)return i;let a;t[0]!==n?(a=n.toString(),t[0]=n,t[1]=a):a=t[1];let s;return t[2]!==r||t[3]!==i||t[4]!==o||t[5]!==a?(s=y.jsx(r,{id:a,placement:o,children:i}),t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s):s=t[6],s},J$=({InputContainer:e=fh,value:t,options:n,onChange:r,label:i,withoutLabel:o,isNumber:a,size:s,hidden:l,disabled:c,noSortOptions:u,className:d,suffixIdToName:f,noEmptyOption:h,appendCurrentSelectionWithName:p,dropdownWidth:g,hint:v,addNewOptionPath:x,refreshOptions:_,MiniDetailComponent:w,miniDetailPlacement:C,selectedItemNavigateTo:b,noRemoveButton:$})=>{const{texts:{customSelect:T}}=m.useContext(ln),[k,O]=m.useState(!1),[j,S]=m.useState(""),E=m.useCallback(U=>{S(U)},[]),A=m.useMemo(()=>n.find(U=>U.id===t)??null,[n,t]),D=m.useCallback(U=>{var P;return U===null?"":!U.name||U.name.length===0?((P=U.id)==null?void 0:P.toString())??"":f?`${U.name} (${U.id})`:U.name},[f]),R=m.useMemo(()=>{const U=n?[...n]:[];return p!==void 0&&t!==void 0&&t!==null&&(U.some(P=>P.id===t)||U.push({id:t,name:p})),U.map(P=>({id:P.id,name:D(P)})).filter(P=>A0(P.name,j)).sort((P,z)=>u?0:(P.name??"").localeCompare(z.name??""))},[n,u,j,D,p,t]),M=m.useCallback(U=>{var P;r&&r((U==null?void 0:U.id)===void 0||(U==null?void 0:U.id)===null?null:a?Number(U.id):(P=U.id)==null?void 0:P.toString())},[r,a]),I=m.useCallback(U=>{O(!1),M(U)},[M]),F=m.useRef(null);return y.jsx(y.Fragment,{children:y.jsxs(e,{withoutLabel:o,label:i??"",hidden:l,inputContainerClassName:ue({"luminus-dropdown-select-open":k}),className:d,hint:v,disabled:c,children:[y.jsx(Z$,{currentSelection:A,selectedItemNavigateTo:b,children:y.jsx(Q$,{value:t,MiniDetailComponent:w,miniDetailPlacement:C,children:y.jsxs(si.Select,{ref:F,size:s,value:t??"",onMouseDown:U=>{U.currentTarget.focus(),U.preventDefault()},onClick:()=>{!c&&O(!0)},onChange:()=>{},className:ue("w-100",{"luminus-dropdown-picker-disabled":c}),hidden:l,children:[h&&!(t==null||t==="")?void 0:y.jsx("option",{value:""}),t!=null&&y.jsx("option",{value:t,children:D(A)})]})})}),F.current&&y.jsx(p5,{show:k,onCancel:()=>O(!1),items:R,currentSelection:A??null,onSelectionChange:I,onSearchQueryChange:E,texts:T,disabled:c,inputRef:F,autoHideSearch:!0,allItemsLength:n.length,itemsNameWidth:g,addNewOptionPath:x,refreshOptions:_,noRemoveButton:$})]})})};function YI(e){return dt({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function GI(e){return dt({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function KI(e){return dt({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function ZI(e){return dt({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm250.2-143.7c-12.2-12-47-8.7-64.4-6.5-17.2-10.5-28.7-25-36.8-46.3 3.9-16.1 10.1-40.6 5.4-56-4.2-26.2-37.8-23.6-42.6-5.9-4.4 16.1-.4 38.5 7 67.1-10 23.9-24.9 56-35.4 74.4-20 10.3-47 26.2-51 46.2-3.3 15.8 26 55.2 76.1-31.2 22.4-7.4 46.8-16.5 68.4-20.1 18.9 10.2 41 17 55.8 17 25.5 0 28-28.2 17.5-38.7zm-198.1 77.8c5.1-13.7 24.5-29.5 30.4-35-19 30.3-30.4 35.7-30.4 35zm81.6-190.6c7.4 0 6.7 32.1 1.8 40.8-4.4-13.9-4.3-40.8-1.8-40.8zm-24.4 136.6c9.7-16.9 18-37 24.7-54.7 8.3 15.1 18.9 27.2 30.1 35.5-20.8 4.3-38.9 13.1-54.8 19.2zm131.6-5s-5 6-37.3-7.8c35.1-2.6 40.9 5.4 37.3 7.8z"},child:[]}]})(e)}const W0=e=>{const t=Re.c(66),{InputContainer:n,formField:r,label:i,resetsFields:o,options:a,isNumber:s,size:l,showClearIcon:c,clearValue:u,noSortOptions:d,required:f,hidden:h,disabled:p,withoutLabel:g,hint:v,className:x}=e,_=n===void 0?su:n,{control:w,getValues:C,setValue:b}=dn.useFormContext(),{isSubmitted:$}=dn.useFormState();let T;t[0]===Symbol.for("react.memo_cache_sentinel")?(T={falseIfNotInit:!0},t[0]=T):T=t[0];const k=uh(T);let O;t[1]!==w||t[2]!==r?(O={name:r,control:w},t[1]=w,t[2]=r,t[3]=O):O=t[3];const{field:j,fieldState:S}=dn.useController(O),{value:E,onChange:A,onBlur:D,ref:R,name:M}=j,{error:I}=S;console.log("disabled ",p),console.log("formDisabled ",k);const[F,U]=m.useState(!1);let P;if(t[4]!==d||t[5]!==a){let ce;t[7]!==d?(ce=(ve,ge)=>d?0:(ve.name??"").localeCompare(ge.name??""),t[7]=d,t[8]=ce):ce=t[8],P=a.toSorted(ce),t[4]=d,t[5]=a,t[6]=P}else P=t[6];const z=P;let V;t[9]!==u||t[10]!==r||t[11]!==s||t[12]!==b||t[13]!==F?(V=()=>{const ce=u??null;s?b(r,ce===null?null:Number(ce),{shouldDirty:!0,shouldValidate:F}):b(r,(ce==null?void 0:ce.toString())??"",{shouldDirty:!0,shouldValidate:F})},t[9]=u,t[10]=r,t[11]=s,t[12]=b,t[13]=F,t[14]=V):V=t[14];const H=V,Y=p||k;console.log(Y);let Z;t[15]!==r||t[16]!==C||t[17]!==b?(Z=()=>{console.log("useEffect selectOptions"),b(r,C(r))},t[15]=r,t[16]=C,t[17]=b,t[18]=Z):Z=t[18];let J;t[19]!==r||t[20]!==C||t[21]!==z||t[22]!==b?(J=[z,r,C,b],t[19]=r,t[20]=C,t[21]=z,t[22]=b,t[23]=J):J=t[23],m.useEffect(Z,J);let ee,W;t[24]!==$?(ee=()=>{$&&U(!0)},W=[$],t[24]=$,t[25]=ee,t[26]=W):(ee=t[25],W=t[26]),m.useEffect(ee,W);const L=I!==void 0;let B;t[27]!==A||t[28]!==s||t[29]!==o||t[30]!==b||t[31]!==F?(B=ce=>{const ve=ce.target.value;let ge;s?ge=ve===""?null:parseInt(ve,10):ge=ve===""?null:ve,A(ge),o&&o.forEach(be=>b(be,null,{shouldDirty:!0,shouldValidate:F}))},t[27]=A,t[28]=s,t[29]=o,t[30]=b,t[31]=F,t[32]=B):B=t[32];const q=B,N=i??"",Q=E??"";let X;t[33]===Symbol.for("react.memo_cache_sentinel")?(X=y.jsx("option",{value:""}),t[33]=X):X=t[33];let G;t[34]!==z?(G=z.map(XI),t[34]=z,t[35]=G):G=t[35];let se;t[36]!==Y||t[37]!==M||t[38]!==D||t[39]!==R||t[40]!==q||t[41]!==h||t[42]!==L||t[43]!==l||t[44]!==Q||t[45]!==G?(se=y.jsxs(si.Select,{size:l,name:M,value:Q,onChange:q,onBlur:D,ref:R,isInvalid:L,hidden:h,disabled:Y,className:"w-100",children:[X,G]}),t[36]=Y,t[37]=M,t[38]=D,t[39]=R,t[40]=q,t[41]=h,t[42]=L,t[43]=l,t[44]=Q,t[45]=G,t[46]=se):se=t[46];let te;t[47]!==H||t[48]!==E||t[49]!==c?(te=c&&E!=null&&y.jsx("div",{className:"luminus-input-remove-icon inset",children:y.jsx(au,{color:"secondary",size:"sm",onClick:H,children:y.jsx(Qc,{})})}),t[47]=H,t[48]=E,t[49]=c,t[50]=te):te=t[50];let re;t[51]!==I?(re=I&&y.jsx(Th,{message:I.message}),t[51]=I,t[52]=re):re=t[52];let ae;return t[53]!==_||t[54]!==Y||t[55]!==x||t[56]!==h||t[57]!==v||t[58]!==L||t[59]!==f||t[60]!==N||t[61]!==se||t[62]!==te||t[63]!==re||t[64]!==g?(ae=y.jsx(y.Fragment,{children:y.jsxs(_,{label:N,required:f,disabled:Y,hidden:h,withoutLabel:g,isInvalid:L,hint:v,className:x,children:[se,te,re]})}),t[53]=_,t[54]=Y,t[55]=x,t[56]=h,t[57]=v,t[58]=L,t[59]=f,t[60]=N,t[61]=se,t[62]=te,t[63]=re,t[64]=g,t[65]=ae):ae=t[65],ae};function XI(e){return y.jsx("option",{value:e.id??"",children:e.name},e.id)}const U0=e=>{const t=Re.c(61),{InputContainer:n,formField:r,label:i,resetsFields:o,size:a,showClearIcon:s,clearValue:l,required:c,hidden:u,disabled:d,rows:f,withoutLabel:h,customFormControlProps:p,minLength:g,maxLength:v,hint:x,onChange:_,className:w}=e,C=n===void 0?su:n,{control:b,setValue:$}=dn.useFormContext(),{isSubmitted:T}=dn.useFormState();let k;t[0]===Symbol.for("react.memo_cache_sentinel")?(k={falseIfNotInit:!0},t[0]=k):k=t[0];const O=uh(k),[j,S]=m.useState(!1);let E;t[1]!==b||t[2]!==r?(E={name:r,control:b},t[1]=b,t[2]=r,t[3]=E):E=t[3];const{field:A,fieldState:D}=dn.useController(E),{onChange:R,onBlur:M,ref:I,value:F,name:U}=A,{error:P}=D;let z;t[4]!==p?(z=p??{},t[4]=p,t[5]=z):z=t[5];let V,H,Y;t[6]!==z?({onChange:H,onBlur:V,...Y}=z,t[6]=z,t[7]=V,t[8]=H,t[9]=Y):(V=t[7],H=t[8],Y=t[9]);let Z;t[10]!==l||t[11]!==r||t[12]!==$||t[13]!==j?(Z=()=>{const be=l??null,Te=be==null||be===""?null:be.toString();$(r,Te,{shouldDirty:!0,shouldValidate:j})},t[10]=l,t[11]=r,t[12]=$,t[13]=j,t[14]=Z):Z=t[14];const J=Z,ee=d||O;let W,L;t[15]!==T?(W=()=>{T&&S(!0)},L=[T],t[15]=T,t[16]=W,t[17]=L):(W=t[16],L=t[17]),m.useEffect(W,L);const B=P!==void 0;let q;t[18]!==H||t[19]!==R||t[20]!==_||t[21]!==o||t[22]!==$||t[23]!==j?(q=be=>{const Te=be.target.value,de=Te==null||Te===""?null:Te;R(de),o&&o.forEach(le=>$(le,null,{shouldDirty:!0,shouldValidate:j})),_&&_(de),H&&H(be)},t[18]=H,t[19]=R,t[20]=_,t[21]=o,t[22]=$,t[23]=j,t[24]=q):q=t[24];const N=q;let Q;t[25]!==V||t[26]!==M?(Q=be=>{M(),V&&V(be)},t[25]=V,t[26]=M,t[27]=Q):Q=t[27];const X=Q,G=F!=null&&F!=="",se=i??"",te=F??"",re=f??2;let ae;t[28]!==ee||t[29]!==U||t[30]!==I||t[31]!==X||t[32]!==N||t[33]!==u||t[34]!==B||t[35]!==v||t[36]!==g||t[37]!==Y||t[38]!==a||t[39]!==te||t[40]!==re?(ae=y.jsx(si.Control,{as:"textarea",name:U,size:a,value:te,onChange:N,onBlur:X,ref:I,isInvalid:B,hidden:u,disabled:ee,rows:re,className:"w-100",minLength:g,maxLength:v,...Y}),t[28]=ee,t[29]=U,t[30]=I,t[31]=X,t[32]=N,t[33]=u,t[34]=B,t[35]=v,t[36]=g,t[37]=Y,t[38]=a,t[39]=te,t[40]=re,t[41]=ae):ae=t[41];let ce;t[42]!==J||t[43]!==G||t[44]!==s?(ce=s&&G&&y.jsx("div",{className:"luminus-input-remove-icon",children:y.jsx(au,{color:"secondary",size:"sm",onClick:J,children:y.jsx(Qc,{})})}),t[42]=J,t[43]=G,t[44]=s,t[45]=ce):ce=t[45];let ve;t[46]!==P?(ve=P&&y.jsx(Th,{message:P.message}),t[46]=P,t[47]=ve):ve=t[47];let ge;return t[48]!==C||t[49]!==ee||t[50]!==w||t[51]!==u||t[52]!==x||t[53]!==B||t[54]!==c||t[55]!==se||t[56]!==ae||t[57]!==ce||t[58]!==ve||t[59]!==h?(ge=y.jsxs(C,{label:se,required:c,disabled:ee,hidden:u,withoutLabel:h,isInvalid:B,className:w,hint:x,isForTextAreaInput:!0,children:[ae,ce,ve]}),t[48]=C,t[49]=ee,t[50]=w,t[51]=u,t[52]=x,t[53]=B,t[54]=c,t[55]=se,t[56]=ae,t[57]=ce,t[58]=ve,t[59]=h,t[60]=ge):ge=t[60],ge},Es=({ref:e,InputContainer:t=su,type:n,formField:r,label:i,placeholder:o,size:a,resetsFields:s,showClearIcon:l,clearValue:c,required:u,hidden:d,disabled:f,withoutLabel:h,list:p,step:g,CustomOnChangeComponent:v,noSelectOnFocus:x,minLength:_,maxLength:w,hint:C,onChange:b,className:$,autoComplete:T})=>{var q,N,Q,X;const{control:k,setValue:O}=dn.useFormContext(),{isSubmitted:j}=dn.useFormState(),S=uh({falseIfNotInit:!0}),{field:{value:E,onChange:A,onBlur:D,ref:R,name:M},fieldState:{error:I}}=dn.useController({name:r,control:k}),[F,U]=m.useState(!1),P=m.useCallback(()=>{const G=c??null;n==="number"?O(r,G!==null?Number(G):null,{shouldDirty:!0,shouldValidate:F}):O(r,(G==null?void 0:G.toString())??"",{shouldDirty:!0,shouldValidate:F})},[c,n,O,r,F]),z=m.useMemo(()=>f||S,[f,S]),V=I!==void 0,[H,Y]=m.useState(!1),Z=B0(n,E??null,H),J=m.useCallback(G=>{const se=G.target.value;let te=se;n==="number"?te=se===""?null:Number(se):te=se===""?null:se,A(te),s&&s.forEach(re=>O(re,null,{shouldDirty:!0,shouldValidate:F})),b&&b(te===null?null:n==="number"?te??null:te.toString())},[A,b,s,O,F,n]),ee=m.useCallback(()=>{Y(!1),D()},[D]),W=m.useRef(null),L=(((q=W.current)==null?void 0:q.scrollWidth)??0)>(((N=W.current)==null?void 0:N.clientWidth)??0),B=(Q=W.current)==null?void 0:Q.getBoundingClientRect();return m.useImperativeHandle(e,()=>W.current,[W]),m.useEffect(()=>{j&&U(!0)},[j]),y.jsxs(t,{label:i,required:u,disabled:z,hidden:d,withoutLabel:h??!1,isInvalid:V,hint:C,className:$,children:[y.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[y.jsx(si.Control,{type:Z,placeholder:o??i,size:a,name:M,value:E??"",onChange:J,onBlur:ee,onFocus:G=>{Y(!0),!x&&G.target.select()},ref:G=>{R(G),W.current=G},isInvalid:V,hidden:d,disabled:z,list:p,className:"w-100",step:g,minLength:_,maxLength:w,autoComplete:T}),v&&y.jsx("div",{className:"custom-picker-button",children:v})]}),l&&E!=null&&y.jsx("div",{className:`luminus-input-remove-icon ${n!=="text"?"inset":""}`,children:y.jsx(au,{color:"secondary",size:"sm",onClick:P,children:y.jsx(Qc,{})})}),L?y.jsx("div",{className:"luminus-overflow-tooltip",style:{opacity:0,position:"fixed",top:((B==null?void 0:B.top)??0)+((B==null?void 0:B.height)??0),left:(B==null?void 0:B.left)??0,pointerEvents:"none"},children:((X=W.current)==null?void 0:X.value)??""}):null,I&&y.jsx(Th,{message:I.message})]})},QI="_item_1dy8x_1",eS={item:QI},Yo=e=>{const t=Re.c(17);let n,r,i,o,a,s,l;t[0]!==e?({color:s,icon:i,className:r,children:n,to:l,as:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=l):(n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7]);const u=`btn luminus-dropdown-item text-nowrap rounded text-${s===void 0?"primary":s} ${r??""}`;let d;t[8]!==u?(d=ue(u,eS.item),t[8]=u,t[9]=d):d=t[9];const f=o==="link"?Ps.Link:void 0,h=l??"";let p;return t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==d||t[14]!==f||t[15]!==h?(p=y.jsxs(xs.Item,{className:d,as:f,to:h,...a,children:[i,n]}),t[10]=n,t[11]=i,t[12]=a,t[13]=d,t[14]=f,t[15]=h,t[16]=p):p=t[16],p},JI="_button_qhwih_1",eP={button:JI},H0=({ref:e,color:t="primary",icon:n=y.jsx(RC,{size:21}),text:r,onClick:i,className:o,children:a,...s})=>y.jsxs("button",{type:"button",ref:e,onClick:l=>{l.preventDefault(),i(l)},"aria-label":"dropdown toggle",className:ue(`btn luminus-context-button text-${t} ${o??""}`,eP.button),...s,children:[n,r]}),V0=e=>{const t=Re.c(2);let n;return t[0]!==e?(n=y.jsx(xs.Toggle,{...e}),t[0]=e,t[1]=n):n=t[1],n},tP="_divider_1e6rk_1",nP={divider:tP},Yg=e=>{const t=Re.c(4),{className:n}=e;let r;t[0]!==n?(r=ue("luminus-dropdown-divider",n,nP.divider),t[0]=n,t[1]=r):r=t[1];let i;return t[2]!==r?(i=y.jsx(xs.Divider,{className:r}),t[2]=r,t[3]=i):i=t[3],i},rP="_dropdown_1lk66_1",iP={dropdown:rP},q0=e=>{const t=Re.c(14);let n,r,i,o;t[0]!==e?({toggle:o,children:r,align:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o):(n=t[1],r=t[2],i=t[3],o=t[4]);let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=ue("luminus-dropdown rounded shadow",iP.dropdown),t[5]=a):a=t[5];let s;t[6]!==n||t[7]!==r?(s=y.jsx(xs.Menu,{className:a,align:n,children:r}),t[6]=n,t[7]=r,t[8]=s):s=t[8];let l;return t[9]!==n||t[10]!==i||t[11]!==s||t[12]!==o?(l=y.jsxs(xs,{...i,align:n,children:[o,s]}),t[9]=n,t[10]=i,t[11]=s,t[12]=o,t[13]=l):l=t[13],l},oP="_wrapper_1tb6d_1",aP="_controls_1tb6d_16",sP="_explorerWindow_1tb6d_20",lP="_folderList_1tb6d_28",cP="_fileList_1tb6d_35",uP="_dndText_1tb6d_61",Do={wrapper:oP,controls:aP,explorerWindow:sP,folderList:lP,fileList:cP,dndText:uP},xn=m.createContext({apiActions:{},loadDocuments(){throw new Error("DocumentsContext was not initialized.")},reducer:[{},{}],entityType:"",entityId:-1}),dP="_defaultFolder_8tlxv_1",fP="_names_8tlxv_5",hP="_folderType_8tlxv_9",hm={defaultFolder:dP,names:fP,folderType:hP},tS=e=>{const t=Re.c(19),{isActive:n,isDefault:r,folderName:i,typeName:o}=e,{ProjectIconComponent:a}=m.useContext(ln),s=`folder${n?"-filled":""}`,l=r?hm.defaultFolder:"text-primary";let c;t[0]!==l?(c=ue("d-inline-block",l),t[0]=l,t[1]=c):c=t[1];let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={className:"d-block"},t[2]=u):u=t[2];let d;t[3]!==a||t[4]!==s||t[5]!==c?(d=y.jsx(a,{icon:s,className:c,iconProps:u,size:18}),t[3]=a,t[4]=s,t[5]=c,t[6]=d):d=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=ue("d-flex flex-column gap-0 align-items-start",hm.names),t[7]=f):f=t[7];const h=n?"fw-bold":"";let p;t[8]!==i||t[9]!==h?(p=y.jsx("span",{className:h,children:i}),t[8]=i,t[9]=h,t[10]=p):p=t[10];let g;t[11]!==o?(g=o?y.jsxs("span",{className:hm.folderType,children:["(",o,")"]}):null,t[11]=o,t[12]=g):g=t[12];let v;t[13]!==p||t[14]!==g?(v=y.jsxs("div",{className:f,children:[p,g]}),t[13]=p,t[14]=g,t[15]=v):v=t[15];let x;return t[16]!==v||t[17]!==d?(x=y.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[d,v]}),t[16]=v,t[17]=d,t[18]=x):x=t[18],x},pP=e=>{const t=Re.c(9),{customText:n}=e,{reducer:r}=m.useContext(xn),[i,o]=r;let a;t[0]!==o?(a=()=>{o({type:"select-folder",folderId:"root"})},t[0]=o,t[1]=a):a=t[1];const s=a;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=ue("border-0 bg-transparent"),t[2]=l):l=t[2];const c=n??"root",u=i.activeFolder==="root";let d;t[3]!==c||t[4]!==u?(d=y.jsx(tS,{folderName:c,isActive:u,typeName:"",isDefault:!0}),t[3]=c,t[4]=u,t[5]=d):d=t[5];let f;return t[6]!==s||t[7]!==d?(f=y.jsx("li",{children:y.jsx("button",{onClick:s,type:"button",className:l,children:d})}),t[6]=s,t[7]=d,t[8]=f):f=t[8],f};function mP(e){if(e.state!=="openned-modal")throw new Error('Not in "openned-modal" state!')}const nS=()=>{const e=sh(),{startLoading:t,stopLoading:n}=m.useContext(Qf),{reducer:[,r]}=m.useContext(xn),i=m.useCallback(async(a,s)=>{t("documents-renameFolder");try{await e.put("/documents/folder/rename",{folderId:a,name:s}),r({type:"update-folders",folderIds:[a],newProperties:{name:s}})}finally{n("documents-renameFolder")}},[e,r,t,n]),o=m.useCallback(async a=>{t("documentsFolderCreate");try{const s=await e.post("/documents/folder",a);r({type:"create-folder",folderData:a,folderId:s.data.id,isOnlyRead:s.data.onlyRead})}finally{n("documentsFolderCreate")}},[e,r,t,n]);return{renameFolder:i,createFolder:o}},Ax=(e,t,n)=>{if(e&&"reportValidity"in e){const r=dn.get(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},rS=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Ax(r.ref,n,e):r.refs&&r.refs.forEach(i=>Ax(i,n,e))}},gP=(e,t)=>{t.shouldUseNativeValidation&&rS(e,t);const n={};for(const r in e){const i=dn.get(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(vP(t.names||Object.keys(e),r)){const a=Object.assign({},dn.get(n,r));dn.set(a,"root",o),dn.set(n,r,a)}else dn.set(n,r,o)}return n},vP=(e,t)=>e.some(n=>n.startsWith(t+"."));var bP=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var l=n[a].types,c=l&&l[r.code];n[a]=dn.appendErrors(a,t,n,i,c?[].concat(c,r.message):r.message)}e.shift()}return n},hh=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(a,s){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return o.shouldUseNativeValidation&&rS({},o),{errors:{},values:n.raw?r:c}})}catch(c){return s(c)}return l&&l.then?l.then(void 0,s):l}(0,function(a){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(a))return{values:{},errors:gP(bP(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}};const yP=()=>{const e=Re.c(14),{reducer:t,entityId:n,entityType:r}=m.useContext(xn),[i]=t,{zNumberRequired:o,zStringRequired:a}=ch(),{createFolder:s}=nS();let l,c;if(e[0]!==o||e[1]!==a){const g=Si({name:a(),documentTypeId:o()});c=dn.useForm,l=hh(g),e[0]=o,e[1]=a,e[2]=l,e[3]=c}else l=e[2],c=e[3];let u;e[4]!==l?(u={resolver:l},e[4]=l,e[5]=u):u=e[5];const d=c(u);let f;e[6]!==s||e[7]!==n||e[8]!==r||e[9]!==i.activeFolder?(f=async g=>{const v={...g,dbObjectId:n.toString(),entity:r,parentFolderId:i.activeFolder==="root"?null:i.activeFolder};await s(v)},e[6]=s,e[7]=n,e[8]=r,e[9]=i.activeFolder,e[10]=f):f=e[10];const h=f;let p;return e[11]!==d||e[12]!==h?(p={formMethods:d,onSubmit:h},e[11]=d,e[12]=h,e[13]=p):p=e[13],p},xP=e=>{var b;const t=Re.c(38),{handleClose:n}=e,{texts:r}=m.useContext(ln),{documents:i}=r,{reducer:o,entityType:a}=m.useContext(xn),[s]=o;if(mP(s),s.modalType!=="create-folder")throw new Error("Tried to render CreateFolderModal without create-folder modal type reducer state.");const{onSubmit:l,formMethods:c}=yP();let u;t[0]!==c||t[1]!==l?(u=c.handleSubmit(l),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d;if(t[3]!==i||t[4]!==a||t[5]!==s.chosenFolderId||t[6]!==s.foldersMap){let $;t[8]!==a||t[9]!==s.chosenFolderId||t[10]!==s.foldersMap?($=((b=s.foldersMap.get(s.chosenFolderId))==null?void 0:b.name)??a,t[8]=a,t[9]=s.chosenFolderId,t[10]=s.foldersMap,t[11]=$):$=t[11],d=i.createFolderInFolder($),t[3]=i,t[4]=a,t[5]=s.chosenFolderId,t[6]=s.foldersMap,t[7]=d}else d=t[7];let f;t[12]!==d?(f=y.jsx(Xn.Header,{closeButton:!0,children:y.jsx(Xn.Title,{children:d})}),t[12]=d,t[13]=f):f=t[13];let h;t[14]!==i.name?(h=y.jsx(Es,{formField:"name",type:"text",label:i.name,required:!0}),t[14]=i.name,t[15]=h):h=t[15];let p;t[16]!==i.folderType||t[17]!==s.documentTypes?(p=y.jsx(W0,{options:s.documentTypes,formField:"documentTypeId",label:i.folderType,isNumber:!0,required:!0}),t[16]=i.folderType,t[17]=s.documentTypes,t[18]=p):p=t[18];let g;t[19]!==h||t[20]!==p?(g=y.jsxs(Xn.Body,{children:[h,p]}),t[19]=h,t[20]=p,t[21]=g):g=t[21];let v;t[22]!==i.cancel||t[23]!==n?(v=y.jsx(da,{onClick:n,variant:"outlined",color:"secondary",children:i.cancel}),t[22]=i.cancel,t[23]=n,t[24]=v):v=t[24];let x;t[25]!==i.createFolder?(x=y.jsx(da,{type:"submit",children:i.createFolder}),t[25]=i.createFolder,t[26]=x):x=t[26];let _;t[27]!==x||t[28]!==v?(_=y.jsxs(Xn.Footer,{children:[v,x]}),t[27]=x,t[28]=v,t[29]=_):_=t[29];let w;t[30]!==_||t[31]!==u||t[32]!==f||t[33]!==g?(w=y.jsxs(si,{onSubmit:u,children:[f,g,_]}),t[30]=_,t[31]=u,t[32]=f,t[33]=g,t[34]=w):w=t[34];let C;return t[35]!==c||t[36]!==w?(C=y.jsx(y.Fragment,{children:y.jsx(dn.FormProvider,{...c,children:w})}),t[35]=c,t[36]=w,t[37]=C):C=t[37],C},iS=100,wP=(e,t)=>{const n=sh(),{startLoading:r,stopLoading:i}=m.useContext(Qf),{loadDocuments:o}=m.useContext(xn),{zStringRequired:a,zString:s,zNumberRequired:l,zDateRequired:c}=ch(),u=Si({name:a(),description:s(),validToDate:c(),documentTypeId:l()}),d=dn.useForm({resolver:hh(u),defaultValues:{...e,validToDate:eh(e.validToDate)}}),f=m.useCallback(async h=>{r("documents-updateProperties");try{await n.put(`/documents/${e.id}/update-info`,h),await o(),t()}finally{i("documents-updateProperties")}},[n,e.id,t,o,r,i]);return{formMethods:d,onSubmit:f}},_P=e=>{const t=Re.c(38),{handleClose:n,file:r}=e,{texts:i}=m.useContext(ln),{documents:o}=i,{reducer:a}=m.useContext(xn),[s]=a,{formMethods:l,onSubmit:c}=wP(r,n);let u;t[0]!==o.editFileProperties?(u=y.jsx(Xn.Header,{closeButton:!0,children:y.jsx(Xn.Title,{children:o.editFileProperties})}),t[0]=o.editFileProperties,t[1]=u):u=t[1];let d;t[2]!==l||t[3]!==c?(d=l.handleSubmit(c),t[2]=l,t[3]=c,t[4]=d):d=t[4];let f;t[5]!==o.name?(f=y.jsx(Es,{formField:"name",type:"text",label:o.name,required:!0}),t[5]=o.name,t[6]=f):f=t[6];let h;t[7]!==o.validSince?(h=y.jsx(Es,{formField:"validToDate",type:"date",label:o.validSince,required:!0}),t[7]=o.validSince,t[8]=h):h=t[8];let p;t[9]!==o.category||t[10]!==s.documentTypes?(p=y.jsx(W0,{formField:"documentTypeId",label:o.category,options:s.documentTypes,isNumber:!0,required:!0}),t[9]=o.category,t[10]=s.documentTypes,t[11]=p):p=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g={maxLength:iS},t[12]=g):g=t[12];let v;t[13]!==o.description?(v=y.jsx(U0,{formField:"description",label:o.description,customFormControlProps:g}),t[13]=o.description,t[14]=v):v=t[14];let x;t[15]!==f||t[16]!==h||t[17]!==p||t[18]!==v?(x=y.jsxs(Xn.Body,{children:[f,h,p,v]}),t[15]=f,t[16]=h,t[17]=p,t[18]=v,t[19]=x):x=t[19];let _;t[20]!==o.cancel||t[21]!==n?(_=y.jsx(da,{onClick:n,color:"secondary",variant:"outlined",children:o.cancel}),t[20]=o.cancel,t[21]=n,t[22]=_):_=t[22];let w;t[23]!==o.save?(w=y.jsx(da,{type:"submit",children:o.save}),t[23]=o.save,t[24]=w):w=t[24];let C;t[25]!==_||t[26]!==w?(C=y.jsxs(Xn.Footer,{children:[_,w]}),t[25]=_,t[26]=w,t[27]=C):C=t[27];let b;t[28]!==x||t[29]!==C||t[30]!==d?(b=y.jsxs(si,{onSubmit:d,children:[x,C]}),t[28]=x,t[29]=C,t[30]=d,t[31]=b):b=t[31];let $;t[32]!==l||t[33]!==b?($=y.jsx(dn.FormProvider,{...l,children:b}),t[32]=l,t[33]=b,t[34]=$):$=t[34];let T;return t[35]!==$||t[36]!==u?(T=y.jsxs(y.Fragment,{children:[u,$]}),t[35]=$,t[36]=u,t[37]=T):T=t[37],T},CP=e=>{const t=Re.c(9),{handleClose:n}=e,{reducer:r}=m.useContext(xn),[i]=r;let o;e:{if(i.markedFiles.length!==1){o=void 0;break e}let l;if(t[0]!==i.constantFiles||t[1]!==i.markedFiles[0]){let c;t[3]!==i.markedFiles[0]?(c=u=>u.id===i.markedFiles[0],t[3]=i.markedFiles[0],t[4]=c):c=t[4],l=i.constantFiles.find(c),t[0]=i.constantFiles,t[1]=i.markedFiles[0],t[2]=l}else l=t[2];o=l}const a=o;if(a===void 0){n();let l;return t[5]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(y.Fragment,{}),t[5]=l):l=t[5],l}let s;return t[6]!==a||t[7]!==n?(s=y.jsx(_P,{file:a,handleClose:n}),t[6]=a,t[7]=n,t[8]=s):s=t[8],s},$P=()=>{const{reducer:[e,t]}=m.useContext(xn),n=m.useCallback(()=>{t({type:"close-modal"})},[t]),r=m.useMemo(()=>{if(e.state!=="openned-modal")return null;switch(e.modalType){case"create-folder":return y.jsx(xP,{handleClose:n});case"edit-file-properties":return y.jsx(CP,{handleClose:n});default:return null}},[e.state,e.modalType]);return y.jsx(Xn,{show:e.state==="openned-modal",onHide:n,children:r})},Rx="documents_drag_image_element",Zd="drop-container-highlight-class",jx="data-drop-container-id",Nx="data-draggable-id",SP=()=>{const e=document.getElementById(Rx);if(e!==null)return e;const t=document.createElement("div");return t.id=Rx,t.style.position="absolute",t.style.top=`${-window.outerHeight}px`,t.style.left=`${-window.outerWidth}px`,t.style.width="50px",t.style.height="50px",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",t.style.color="white",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.fontSize="16px",t.style.borderRadius="5px",document.body.appendChild(t),t},Y0=()=>{const e=Re.c(12),{apiActions:t,reducer:n}=m.useContext(xn),{moveDocuments:r}=t,[i]=n;let o;e[0]!==i.markedFiles?(o=x=>{var _;if(i.markedFiles.length>0){const w=SP();w.innerHTML=i.markedFiles.length.toString(),x.dataTransfer.setDragImage(w,0,0),x.dataTransfer.clearData(),x.dataTransfer.setData("application/json",JSON.stringify(i.markedFiles)),x.dataTransfer.dropEffect="none",x.dataTransfer.effectAllowed="move"}else x.dataTransfer.setData("application/json",JSON.stringify([parseInt(((_=x.currentTarget.attributes.getNamedItem(Nx))==null?void 0:_.nodeValue)??"",10)])),x.dataTransfer.dropEffect="none",x.dataTransfer.effectAllowed="move"},e[0]=i.markedFiles,e[1]=o):o=e[1];const a=o;let s;e[2]!==a||e[3]!==i.markedFiles?(s=x=>({[Nx]:x,draggable:i.markedFiles.length===0||i.markedFiles.includes(x),onDragStart:a}),e[2]=a,e[3]=i.markedFiles,e[4]=s):s=e[4];const l=s;let c;e[5]!==r?(c=x=>_=>{var b;_.preventDefault(),_.stopPropagation(),_.currentTarget.classList.remove(Zd);const w=_.dataTransfer.files;if(x&&w&&w.length>0){x(w);return}const C=_.dataTransfer.getData("application/json");if(C){const $=JSON.parse(C),T=parseInt(((b=_.currentTarget.attributes.getNamedItem(jx))==null?void 0:b.value)??"",10);r(T,$)}},e[5]=r,e[6]=c):c=e[6];const u=c,d=EP,f=kP,h=OP;let p;e[7]!==u?(p=(x,_)=>({onDrop:u(_==null?void 0:_.onFilesDrop),onDragOver:d(),onDragEnter:f(_==null?void 0:_.ignoreInner),onDragLeave:h,[jx]:x}),e[7]=u,e[8]=p):p=e[8];const g=p;let v;return e[9]!==l||e[10]!==g?(v={getDraggableProps:l,getDropProps:g},e[9]=l,e[10]=g,e[11]=v):v=e[11],v};function TP(e){e.preventDefault(),e.stopPropagation()}function EP(){return TP}function kP(e){return t=>{t.preventDefault(),t.stopPropagation(),t.dataTransfer.types.includes("Files")?(t.dataTransfer.dropEffect="copy",t.currentTarget.classList.add(Zd)):!e&&t.dataTransfer.types.includes("application/json")?(t.dataTransfer.dropEffect="move",t.currentTarget.classList.add(Zd)):t.dataTransfer.dropEffect="none"}}function OP(e){e.preventDefault(),e.stopPropagation(),e.target===e.currentTarget&&(e.dataTransfer.dropEffect="none",e.currentTarget.classList.remove(Zd))}function oS(e,t,n){for(let r=0;r<e.childrenIds.length;r++){const i=e.childrenIds[r];if(i===t)return!0;const o=n.get(i);if(o&&oS(o,t,n))return!0}return!1}function MP(e){if(e.activeFolder==="root")return!1;const t=e.foldersMap.get(e.activeFolder);return!(t!=null&&t.onlyRead)}function aS(e,t){const n=t.get(e);return n===void 0?"":n.parentId===null?n.name:`${aS(n.parentId,t)}/${n.name}`}const AP=()=>{const e=Re.c(6),{zString:t,zStringRequired:n,zNumberRequired:r}=ch();let i;e[0]!==r||e[1]!==t||e[2]!==n?(i=Si({validToDate:n(),description:t(),name:t(),documentTypeId:r()}),e[0]=r,e[1]=t,e[2]=n,e[3]=i):i=e[3];const o=i;let a;return e[4]!==o?(a={formSchema:o},e[4]=o,e[5]=a):a=e[5],a},G0=e=>{var Z;const t=Re.c(69),{handleClose:n,files:r,targetFolderId:i}=e,{texts:o}=m.useContext(ln),{documents:a}=o,{reducer:s,apiActions:l}=m.useContext(xn),[c]=s,{uploadFiles:u}=l;let d;t[0]!==r?(d=[...r],t[0]=r,t[1]=d):d=t[1];const f=d,h=i??c.activeFolder;let p;t[2]!==h||t[3]!==c.foldersMap?(p=h==="root"?void 0:c.foldersMap.get(h),t[2]=h,t[3]=c.foldersMap,t[4]=p):p=t[4];const g=p,{formSchema:v}=AP();let x;t[5]!==v?(x=hh(v),t[5]=v,t[6]=x):x=t[6];let _;t[7]===Symbol.for("react.memo_cache_sentinel")?(_=eh(new Date().toISOString()),t[7]=_):_=t[7];let w;t[8]!==h||t[9]!==c.documentTypes||t[10]!==c.foldersMap?(w=(Z=c.documentTypes.find(J=>{var ee;return J.name===((ee=c.foldersMap.get(h))==null?void 0:ee.defaultDocType)}))==null?void 0:Z.id,t[8]=h,t[9]=c.documentTypes,t[10]=c.foldersMap,t[11]=w):w=t[11];let C;t[12]!==w?(C={validToDate:_,documentTypeId:w},t[12]=w,t[13]=C):C=t[13];let b;t[14]!==x||t[15]!==C?(b={resolver:x,defaultValues:C},t[14]=x,t[15]=C,t[16]=b):b=t[16];const $=dn.useForm(b);let T;t[17]!==r||t[18]!==h||t[19]!==n||t[20]!==u?(T=async J=>{h!=="root"&&(await u(r,{folderId:h,...J}),n())},t[17]=r,t[18]=h,t[19]=n,t[20]=u,t[21]=T):T=t[21];const k=T;let O;t[22]!==a||t[23]!==r.length||t[24]!==g.name?(O=a.uploadFilesPrompt(r.length,g.name),t[22]=a,t[23]=r.length,t[24]=g.name,t[25]=O):O=t[25];let j;t[26]!==f?(j=y.jsx("ul",{children:f.map(RP)}),t[26]=f,t[27]=j):j=t[27];let S;t[28]!==O||t[29]!==j?(S=y.jsx(Xn.Header,{closeButton:!0,children:y.jsxs("div",{children:[O,j]})}),t[28]=O,t[29]=j,t[30]=S):S=t[30];let E;t[31]!==$||t[32]!==k?(E=$.handleSubmit(k),t[31]=$,t[32]=k,t[33]=E):E=t[33];let A;t[34]!==a.documentType||t[35]!==c.documentTypes?(A=y.jsx(W0,{formField:"documentTypeId",label:a.documentType,options:c.documentTypes,isNumber:!0,required:!0}),t[34]=a.documentType,t[35]=c.documentTypes,t[36]=A):A=t[36];let D;t[37]!==a.validSince?(D=y.jsx(Es,{formField:"validToDate",label:a.validSince,type:"date",required:!0}),t[37]=a.validSince,t[38]=D):D=t[38];let R;t[39]!==a.name||t[40]!==f.length?(R=f.length===1?y.jsx(Es,{formField:"name",label:a.name,type:"text"}):null,t[39]=a.name,t[40]=f.length,t[41]=R):R=t[41];let M;t[42]===Symbol.for("react.memo_cache_sentinel")?(M={maxLength:iS},t[42]=M):M=t[42];let I;t[43]!==a.description?(I=y.jsx(U0,{formField:"description",label:a.description,customFormControlProps:M}),t[43]=a.description,t[44]=I):I=t[44];let F;t[45]!==A||t[46]!==D||t[47]!==R||t[48]!==I?(F=y.jsxs(Xn.Body,{children:[A,D,R,I]}),t[45]=A,t[46]=D,t[47]=R,t[48]=I,t[49]=F):F=t[49];let U;t[50]!==a.cancel||t[51]!==n?(U=y.jsx(da,{variant:"outlined",color:"secondary",onClick:n,children:a.cancel}),t[50]=a.cancel,t[51]=n,t[52]=U):U=t[52];let P;t[53]!==a.upload?(P=y.jsx(da,{type:"submit",children:a.upload}),t[53]=a.upload,t[54]=P):P=t[54];let z;t[55]!==U||t[56]!==P?(z=y.jsxs(Xn.Footer,{children:[U,P]}),t[55]=U,t[56]=P,t[57]=z):z=t[57];let V;t[58]!==E||t[59]!==F||t[60]!==z?(V=y.jsxs(si,{onSubmit:E,children:[F,z]}),t[58]=E,t[59]=F,t[60]=z,t[61]=V):V=t[61];let H;t[62]!==$||t[63]!==V?(H=y.jsx(dn.FormProvider,{...$,children:V}),t[62]=$,t[63]=V,t[64]=H):H=t[64];let Y;return t[65]!==n||t[66]!==S||t[67]!==H?(Y=y.jsxs(Xn,{show:!0,onHide:n,children:[S,H]}),t[65]=n,t[66]=S,t[67]=H,t[68]=Y):Y=t[68],Y};function RP(e,t){return y.jsxs("li",{children:[e.name," - ",ws(e.size)]},`${e.name}-${t}`)}const jP="_folder_1cktt_1",NP="_collapseArrowDiv_1cktt_8",DP="_button_1cktt_20",IP="_nestedList_1cktt_24",PP="_numberOfFiles_1cktt_31",LP="_collapseArrow_1cktt_8",Io={folder:jP,collapseArrowDiv:NP,button:DP,nestedList:IP,numberOfFiles:PP,collapseArrow:LP},sS=e=>{const t=Re.c(59),{dirId:n,writePermissions:r}=e,{ProjectIconComponent:i}=m.useContext(ln),{reducer:o}=m.useContext(xn),[a,s]=o,{getDropProps:l}=Y0(),[c,u]=m.useState(null),[d,f]=m.useState(!0);let h,p;t[0]!==n||t[1]!==a.foldersMap?(p=a.foldersMap.get(n),t[0]=n,t[1]=a.foldersMap,t[2]=p):p=t[2];const g=p;if(g===void 0)throw new Error(`tried to get dir with id ${n}`);h=g;const v=h;let x;t[3]!==n||t[4]!==v||t[5]!==s||t[6]!==a.activeFolder||t[7]!==a.foldersMap?(x=()=>{a.activeFolder!=="root"&&oS(v,a.activeFolder,a.foldersMap)&&s({type:"select-folder",folderId:n}),f(!0)},t[3]=n,t[4]=v,t[5]=s,t[6]=a.activeFolder,t[7]=a.foldersMap,t[8]=x):x=t[8];const _=x,w=v.childrenIds.length>0;let C;t[9]!==n||t[10]!==s?(C=()=>{s({type:"select-folder",folderId:n})},t[9]=n,t[10]=s,t[11]=C):C=t[11];const b=C;let $;if(t[12]!==n||t[13]!==a.filteredFiles){let V;t[15]!==n?(V=H=>H.folderId===n&&H.archive===!1,t[15]=n,t[16]=V):V=t[16],$=a.filteredFiles.filter(V),t[12]=n,t[13]=a.filteredFiles,t[14]=$}else $=t[14];const T=$.length;let k;t[17]!==i||t[18]!==_||t[19]!==w||t[20]!==d?(k=w?d?y.jsx("button",{onClick:()=>f(!1),type:"button",children:y.jsx(i,{icon:"chevron-right",iconProps:{className:Io.collapseArrow}})}):y.jsx("button",{onClick:_,type:"button",children:y.jsx(i,{icon:"chevron-down",iconProps:{className:Io.collapseArrow}})}):null,t[17]=i,t[18]=_,t[19]=w,t[20]=d,t[21]=k):k=t[21];let O;t[22]!==k?(O=y.jsx("div",{className:Io.collapseArrowDiv,children:k}),t[22]=k,t[23]=O):O=t[23];let j;t[24]===Symbol.for("react.memo_cache_sentinel")?(j=ue(Io.button),t[24]=j):j=t[24];let S;t[25]!==n||t[26]!==v.onlyRead||t[27]!==l||t[28]!==r?(S=r&&!v.onlyRead?l(n,{onFilesDrop:V=>u(V)}):{},t[25]=n,t[26]=v.onlyRead,t[27]=l,t[28]=r,t[29]=S):S=t[29];const E=v.defaultDocType??"",A=n===a.activeFolder;let D;t[30]!==v.isDefault||t[31]!==v.name||t[32]!==E||t[33]!==A?(D=y.jsx(tS,{isDefault:v.isDefault,folderName:v.name,typeName:E,isActive:A}),t[30]=v.isDefault,t[31]=v.name,t[32]=E,t[33]=A,t[34]=D):D=t[34];let R;t[35]!==T?(R=T>0?y.jsxs("span",{className:Io.numberOfFiles,children:["[",T,"]"]}):void 0,t[35]=T,t[36]=R):R=t[36];let M;t[37]!==D||t[38]!==R?(M=y.jsxs("div",{className:"d-flex align-items-center gap-2",children:[D,R]}),t[37]=D,t[38]=R,t[39]=M):M=t[39];let I;t[40]!==b||t[41]!==S||t[42]!==M?(I=y.jsx("button",{className:j,onClick:b,type:"button",...S,children:M}),t[40]=b,t[41]=S,t[42]=M,t[43]=I):I=t[43];let F;t[44]!==v.childrenIds||t[45]!==w||t[46]!==d||t[47]!==r?(F=w?d?null:y.jsx("ul",{className:Io.nestedList,children:v==null?void 0:v.childrenIds.map(V=>y.jsx(sS,{dirId:V,writePermissions:r},V))}):void 0,t[44]=v.childrenIds,t[45]=w,t[46]=d,t[47]=r,t[48]=F):F=t[48];let U;t[49]!==I||t[50]!==F||t[51]!==O?(U=y.jsxs("li",{className:Io.folder,children:[O,I,F]}),t[49]=I,t[50]=F,t[51]=O,t[52]=U):U=t[52];let P;t[53]!==n||t[54]!==c?(P=c!==null?y.jsx(G0,{files:c,handleClose:()=>u(null),targetFolderId:n}):null,t[53]=n,t[54]=c,t[55]=P):P=t[55];let z;return t[56]!==U||t[57]!==P?(z=y.jsxs(y.Fragment,{children:[U,P]}),t[56]=U,t[57]=P,t[58]=z):z=t[58],z},FP="_wrapper_1th2u_1",BP="_downloadButton_1th2u_9",Gg={wrapper:FP,downloadButton:BP};function ph(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dx={exports:{}};/*!
247
247
  Copyright (c) 2018 Jed Watson.