jobsys-explore
Version:
Enhanced component based on vant
2 lines • 72.5 kB
JavaScript
const e=require(`./chunk-C7l7Bl8A.cjs`);let t=require(`vant`),n=require(`lodash-es`),r=require(`axios`);r=e.i(r);let i=require(`dayjs`);i=e.i(i);const a={STATE_CODE_SUCCESS:`SUCCESS`,STATE_CODE_FAIL:`FAIL`,STATE_CODE_NOT_FOUND:`NOT_FOUND`,STATE_CODE_INFO_NOT_COMPLETE:`INCOMPLETE`,STATE_CODE_NOT_ALLOWED:`NOT_ALLOWED`};function o(e){Object.keys(e).forEach(t=>{a[t]=e[t]})}function s(e){let i=null;return e||={},e.loading=!0,{get(n,a){return new Promise((o,s)=>{r.default.get(n,a).then(e=>{o(e)}).catch(e=>{s(e)}).finally(()=>{i&&((0,t.allowMultipleToast)(!1),i.close()),e.loading=!1})})},post(n,a,o){return new Promise((s,c)=>{r.default.post(n,a,o).then(e=>{s(e)}).catch(e=>{c(e)}).finally(()=>{i&&((0,t.allowMultipleToast)(!1),i.close()),e.loading=!1})})},loading(e){return(0,t.closeToast)(!0),(0,t.allowMultipleToast)(),i=(0,n.isString)(e)?(0,t.showLoadingToast)({message:e||`加载中...`,duration:0,forbidClick:!0}):(0,n.isObject)(e)?(0,t.showLoadingToast)({duration:0,...e}):(0,t.showLoadingToast)({message:`加载中...`,duration:0,forbidClick:!0}),this}}}function c(e,t,n){if(!t)return``;n||={value:`value`,label:`text`};let r=t.find(t=>t[n.value]===e);return r?r[n.label]:``}function l(e,t,n){n||={value:`value`,label:`text`,children:`children`};let r=[];function i(e){t.includes(e[n.value])&&r.push(e[n.label]),e[n.children]?.length&&e[n.children].forEach(e=>{i(e)})}return e.forEach(e=>{i(e)}),r}function u(e,t,r){r||={value:`value`,label:`text`,children:`children`};let i=[];return(0,n.reduce)(t,(e,t)=>{let a=(0,n.find)(e,{[r.value]:t});if(a)return i.push(a[r.label]),a[r.children]},e),i}function d(e,t,n){n||={value:`value`,label:`text`,children:`children`};for(let r of e){if(r[n.value]===t)return r;if(r[n.children]&&r[n.children].length){let e=d(r[n.children],t,n);if(e)return e}}return null}function f(e,t,n){return n||={value:`value`,label:`text`,children:`children`},u(e,t,n)}function p(e,t,r){return(0,n.flatMapDeep)(e,(e,n)=>n===t?e:n===r?p(e,t,r):[])}function m(e,t,n){n||={value:`value`,label:`text`,children:`children`};let r=[];function i(e,t,r){for(let a of e)if(a[n.value]===t){r.unshift(a[n.label]);break}else if(a[n.children]&&i(a[n.children],t,r).length>0){r.unshift(a[n.label]);break}return r}return i(e,t,r)}function h(e,t,n){n||={value:`value`,label:`text`,children:`children`};let r=[];function i(e,t,r){for(let a of e)if(a[n.value]===t){r.unshift(a[n.value]);break}else if(a[n.children]&&i(a[n.children],t,r).length>0){r.unshift(a[n.value]);break}return r}return i(e,t,r)}var g={},_={setItem(e,t){g[e]=t},getItem(e){return g[e]},removeItem(e){delete g[e]}};window._printCache=()=>{console.log(JSON.parse(JSON.stringify(g,null,2)))};function v(e,t){let r=t||_,i=!!t;return{get(t){let a=r.getItem(e);return(0,n.isNull)(a)||(0,n.isUndefined)(a)?t:i?JSON.parse(a):a},set(t){r.setItem(e,i?JSON.stringify(t):t)},remove(){r.removeItem(e)}}}function y(e){let{url:t,data:n,csrfToken:r}=e,{method:i}=e;i||=`post`;let a=document.createElement(`form`);if(a.action=t,a.method=i,a.target=`_blank`,a.style.display=`none`,Object.keys(n).forEach(e=>{let t=document.createElement(`input`);t.type=`hidden`,t.name=e,t.value=n[e],a.appendChild(t)}),!r){let e=document.createElement(`input`);e.type=`hidden`,e.name=`_token`,e.value=document.querySelector(`meta[name="csrf-token"]`).getAttribute(`content`),a.appendChild(e)}return document.body.appendChild(a),a}function ee(e,r){let{status:i}=e,o=e.result,s={};s.default=`请求失败, 请检查数据并重试`,s[a.STATE_CODE_FAIL]=`系统错误,请稍候再试`,s[a.STATE_CODE_NOT_FOUND]=`请求的内容不存在`,s[a.STATE_CODE_INFO_NOT_COMPLETE]=`信息不完整`,s[a.STATE_CODE_NOT_ALLOWED]=`没有权限`;let c={[a.STATE_CODE_SUCCESS]:`success`},l=r[i]||r[c[i]]||s[i]||s.default;(0,n.isString)(l)?i===a.STATE_CODE_SUCCESS?(0,t.showSuccessToast)(l):(0,t.showFailToast)(o||l):(0,n.isFunction)(l)&&l()}function te(e,t){ee(e,{success:t})}function ne(e){e&&e.errorFields?e.errorFields.forEach(e=>{(0,t.showFailToast)(e.errors.join(` `))}):e&&e.response?(0,t.showFailToast)(`网络异常`):(0,t.showFailToast)(`请检查填写项`)}function re(e,t){let r=(0,n.cloneDeep)(e);t||={};let a=e=>{for(let r in e){let o;if(i.default.isDayjs(e[r])?o=e[r]:(0,n.isDate)(e[r])&&(o=(0,i.default)(e[r])),o&&t.date){(0,n.isString)(t.date)?e[r]=o.format(t.date):(0,n.isFunction)(t.date)?e[r]=t.date(o):e[r]=o.unix();continue}if((0,n.isBoolean)(e[r])&&t.boolean){t.boolean===!0?e[r]=e[r]?1:0:Array.isArray(t.boolean)&&(e[r]=e[r]?t.boolean?.[0]||1:t.boolean?.[1]||0);continue}if(t.attachment){let i=t.attachment;if((0,n.isObject)(e[r])&&e[r]._type===`file`&&(0,n.isString)(i)&&!(0,n.isUndefined)(e[r][i])){e[r]=e[r][i];continue}else if((0,n.isObject)(e[r])&&(0,n.isFunction)(i)&&e[r]._type===`file`){e[r]=i(e[r]);continue}}(0,n.isArray)(e[r])&&(e[r]=a(e[r]))}return e};return a(r)}const b=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0;function x(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function S(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function C(e,...t){if(!x(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function ie(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);S(e.outputLen),S(e.blockLen)}function ae(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function oe(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}var se=(()=>typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`)(),ce=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function w(e){if(C(e),se)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=ce[e[n]];return t}var T={_0:48,_9:57,A:65,F:70,a:97,f:102};function le(e){if(e>=T._0&&e<=T._9)return e-T._0;if(e>=T.A&&e<=T.F)return e-(T.A-10);if(e>=T.a&&e<=T.f)return e-(T.a-10)}function ue(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(se)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=le(e.charCodeAt(i)),a=le(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function de(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function fe(e){return new TextDecoder().decode(e)}function pe(e){return typeof e==`string`&&(e=de(e)),C(e),e}function E(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];C(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var me=class{};function he(e=32){if(b&&typeof b.getRandomValues==`function`)return b.getRandomValues(new Uint8Array(e));if(b&&typeof b.randomBytes==`function`)return Uint8Array.from(b.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}var ge=BigInt(0),_e=BigInt(1);function ve(e,t){if(typeof t!=`boolean`)throw Error(e+` boolean expected, got `+t)}function ye(e,t=``){if(typeof e!=`boolean`){let n=t&&`"${t}"`;throw Error(n+`expected boolean, got type=`+typeof e)}return e}function be(e,t,n=``){let r=x(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function xe(e){let t=e.toString(16);return t.length&1?`0`+t:t}function Se(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?ge:BigInt(`0x`+e)}function Ce(e){return Se(w(e))}function we(e){return C(e),Se(w(Uint8Array.from(e).reverse()))}function Te(e,t){return ue(e.toString(16).padStart(t*2,`0`))}function Ee(e,t){return Te(e,t).reverse()}function De(e){return ue(xe(e))}function D(e,t,n){let r;if(typeof t==`string`)try{r=ue(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(x(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}function Oe(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function ke(e){return Uint8Array.from(e)}function Ae(e){return Uint8Array.from(e,(t,n)=>{let r=t.charCodeAt(0);if(t.length!==1||r>127)throw Error(`string contains non-ASCII character "${e[n]}" with code ${r} at position ${n}`);return r})}var je=e=>typeof e==`bigint`&&ge<=e;function Me(e,t,n){return je(e)&&je(t)&&je(n)&&t<=e&&e<n}function Ne(e,t,n,r){if(!Me(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function Pe(e){let t;for(t=0;e>ge;e>>=_e,t+=1);return t}function Fe(e,t){return e>>BigInt(t)&_e}function Ie(e,t,n){return e|(n?_e:ge)<<BigInt(t)}const Le=e=>(_e<<BigInt(e))-_e;function Re(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=e=>new Uint8Array(e),i=e=>Uint8Array.of(e),a=r(e),o=r(e),s=0,c=()=>{a.fill(1),o.fill(0),s=0},l=(...e)=>n(o,a,...e),u=(e=r(0))=>{o=l(i(0),e),a=l(),e.length!==0&&(o=l(i(1),e),a=l())},d=()=>{if(s++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){a=l();let t=a.slice();n.push(t),e+=a.length}return E(...n)};return(e,t)=>{c(),u(e);let n;for(;!(n=t(d()));)u();return c(),n}}var ze={bigint:e=>typeof e==`bigint`,function:e=>typeof e==`function`,boolean:e=>typeof e==`boolean`,string:e=>typeof e==`string`,stringOrUint8Array:e=>typeof e==`string`||x(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e==`function`&&Number.isSafeInteger(e.outputLen)};function Be(e,t,n={}){let r=(t,n,r)=>{let i=ze[n];if(typeof i!=`function`)throw Error(`invalid validator function`);let a=e[t];if(!(r&&a===void 0)&&!i(a,e))throw Error(`param `+String(t)+` is invalid. Expected `+n+`, got `+a)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e}function Ve(e){return typeof e==`function`&&Number.isSafeInteger(e.outputLen)}function He(e,t,n={}){if(!e||typeof e!=`object`)throw Error(`expected valid options object`);function r(t,n,r){let i=e[t];if(r&&i===void 0)return;let a=typeof i;if(a!==n||i===null)throw Error(`param "${t}" is invalid: expected ${n}, got ${a}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}const Ue=()=>{throw Error(`not implemented`)};function We(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}const Ge=C,Ke=S,qe=w,Je=fe,O=E,Ye=ue,Xe=x,Ze=he,Qe=de,$e=ve,k=xe,A=Se,et=Ce,tt=we,nt=Te,rt=Ee,it=De,at=D,ot=Oe,st=ke,ct=Ae,lt=Me,ut=Ne,dt=Pe,ft=Fe,pt=Ie,mt=Le,ht=Re,gt=Ue,_t=We,vt=Be,yt=Ve;var bt=class extends me{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ie(e);let n=pe(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),oe(i)}update(e){return ae(this),this.iHash.update(e),this}digestInto(e){ae(this),C(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const xt=(e,t,n)=>new bt(e,t).update(n).digest();xt.create=(e,t)=>new bt(e,t);var j=BigInt(0),M=BigInt(1),N=BigInt(2),St=BigInt(3),Ct=BigInt(4),wt=BigInt(5),Tt=BigInt(7),Et=BigInt(8),Dt=BigInt(9),Ot=BigInt(16);function P(e,t){let n=e%t;return n>=j?n:t+n}function kt(e,t){if(e===j)throw Error(`invert: expected non-zero number`);if(t<=j)throw Error(`invert: expected positive modulus, got `+t);let n=P(e,t),r=t,i=j,a=M,o=M,s=j;for(;n!==j;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==M)throw Error(`invert: does not exist`);return P(i,t)}function At(e,t,n){if(!e.eql(e.sqr(t),n))throw Error(`Cannot find square root`)}function jt(e,t){let n=(e.ORDER+M)/Ct,r=e.pow(t,n);return At(e,r,t),r}function Mt(e,t){let n=(e.ORDER-wt)/Et,r=e.mul(t,N),i=e.pow(r,n),a=e.mul(t,i),o=e.mul(e.mul(a,N),i),s=e.mul(a,e.sub(o,e.ONE));return At(e,s,t),s}function Nt(e){let t=Ht(e),n=Pt(e),r=n(t,t.neg(t.ONE)),i=n(t,r),a=n(t,t.neg(r)),o=(e+Tt)/Ot;return(e,t)=>{let n=e.pow(t,o),s=e.mul(n,r),c=e.mul(n,i),l=e.mul(n,a),u=e.eql(e.sqr(s),t),d=e.eql(e.sqr(c),t);n=e.cmov(n,s,u),s=e.cmov(l,c,d);let f=e.eql(e.sqr(s),t),p=e.cmov(n,s,f);return At(e,p,t),p}}function Pt(e){if(e<St)throw Error(`sqrt is not defined for small field`);let t=e-M,n=0;for(;t%N===j;)t/=N,n++;let r=N,i=Ht(e);for(;Bt(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return jt;let a=i.pow(r,t),o=(t+M)/N;return function(e,r){if(e.is0(r))return r;if(Bt(e,r)!==1)throw Error(`Cannot find square root`);let i=n,s=e.mul(e.ONE,a),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw Error(`Cannot find square root`);let r=M<<BigInt(i-t-1),a=e.pow(s,r);i=t,s=e.sqr(a),c=e.mul(c,s),l=e.mul(l,a)}return l}}function Ft(e){return e%Ct===St?jt:e%Et===wt?Mt:e%Ot===Dt?Nt(e):Pt(e)}var It=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function Lt(e){return He(e,It.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`number`,BITS:`number`})),e}function Rt(e,t,n){if(n<j)throw Error(`invalid exponent, negatives unsupported`);if(n===j)return e.ONE;if(n===M)return t;let r=e.ONE,i=t;for(;n>j;)n&M&&(r=e.mul(r,i)),i=e.sqr(i),n>>=M;return r}function zt(e,t,n=!1){let r=Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),a=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),a),r}function Bt(e,t){let n=(e.ORDER-M)/N,r=e.pow(t,n),i=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!a&&!o)throw Error(`invalid Legendre symbol result`);return i?1:a?0:-1}function Vt(e,t){t!==void 0&&S(t);let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Ht(e,t,n=!1,r={}){if(e<=j)throw Error(`invalid field: expected ORDER > 0, got `+e);let i,a,o=!1,s;if(typeof t==`object`&&t){if(r.sqrt||n)throw Error(`cannot specify opts in two arguments`);let e=t;e.BITS&&(i=e.BITS),e.sqrt&&(a=e.sqrt),typeof e.isLE==`boolean`&&(n=e.isLE),typeof e.modFromBytes==`boolean`&&(o=e.modFromBytes),s=e.allowedLengths}else typeof t==`number`&&(i=t),r.sqrt&&(a=r.sqrt);let{nBitLength:c,nByteLength:l}=Vt(e,i);if(l>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let u,d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:l,MASK:Le(c),ZERO:j,ONE:M,allowedLengths:s,create:t=>P(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return j<=t&&t<e},is0:e=>e===j,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&M)===M,neg:t=>P(-t,e),eql:(e,t)=>e===t,sqr:t=>P(t*t,e),add:(t,n)=>P(t+n,e),sub:(t,n)=>P(t-n,e),mul:(t,n)=>P(t*n,e),pow:(e,t)=>Rt(d,e,t),div:(t,n)=>P(t*kt(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>kt(t,e),sqrt:a||(t=>(u||=Ft(e),u(d,t))),toBytes:e=>n?Ee(e,l):Te(e,l),fromBytes:(t,r=!0)=>{if(s){if(!s.includes(t.length)||t.length>l)throw Error(`Field.fromBytes: expected `+s+` bytes, got `+t.length);let e=new Uint8Array(l);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==l)throw Error(`Field.fromBytes: expected `+l+` bytes, got `+t.length);let i=n?we(t):Ce(t);if(o&&(i=P(i,e)),!r&&!d.isValid(i))throw Error(`invalid field element: outside of range 0..ORDER`);return i},invertBatch:e=>zt(d,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(d)}function Ut(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function Wt(e){let t=Ut(e);return t+Math.ceil(t/2)}function Gt(e,t,n=!1){let r=e.length,i=Ut(t),a=Wt(t);if(r<16||r<a||r>1024)throw Error(`expected `+a+`-1024 bytes of input, got `+r);let o=P(n?we(e):Ce(e),t-M)+M;return n?Ee(o,i):Te(o,i)}var Kt=BigInt(0),F=BigInt(1);function qt(e,t){let n=t.negate();return e?n:t}function Jt(e,t){let n=zt(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function Yt(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function Xt(e,t){Yt(e,t);let n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e;return{windows:n,windowSize:r,mask:Le(e),maxNumber:i,shiftBy:BigInt(e)}}function Zt(e,t,n){let{windowSize:r,mask:i,maxNumber:a,shiftBy:o}=n,s=Number(e&i),c=e>>o;s>r&&(s-=a,c+=F);let l=t*r,u=l+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!=0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:p,offsetF:l}}function Qt(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function $t(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}var en=new WeakMap,tn=new WeakMap;function nn(e){return tn.get(e)||1}function rn(e){if(e!==Kt)throw Error(`invalid wNAF`)}var an=class{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>Kt;)t&F&&(n=n.add(r)),r=r.double(),t>>=F;return n}precomputeWindow(e,t){let{windows:n,windowSize:r}=Xt(t,this.bits),i=[],a=e,o=a;for(let e=0;e<n;e++){o=a,i.push(o);for(let e=1;e<r;e++)o=o.add(a),i.push(o);a=o.double()}return i}wNAF(e,t,n){if(!this.Fn.isValid(n))throw Error(`invalid scalar`);let r=this.ZERO,i=this.BASE,a=Xt(e,this.bits);for(let e=0;e<a.windows;e++){let{nextN:o,offset:s,isZero:c,isNeg:l,isNegF:u,offsetF:d}=Zt(n,e,a);n=o,c?i=i.add(qt(u,t[d])):r=r.add(qt(l,t[s]))}return rn(n),{p:r,f:i}}wNAFUnsafe(e,t,n,r=this.ZERO){let i=Xt(e,this.bits);for(let e=0;e<i.windows&&n!==Kt;e++){let{nextN:a,offset:o,isZero:s,isNeg:c}=Zt(n,e,i);if(n=a,!s){let e=t[o];r=r.add(c?e.negate():e)}}return rn(n),r}getPrecomputes(e,t,n){let r=en.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&(typeof n==`function`&&(r=n(r)),en.set(t,r))),r}cached(e,t,n){let r=nn(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){let i=nn(e);return i===1?this._unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)}createCache(e,t){Yt(t,this.bits),tn.set(e,t),en.delete(e)}hasCache(e){return nn(e)!==1}};function on(e,t,n,r){let i=t,a=e.ZERO,o=e.ZERO;for(;n>Kt||r>Kt;)n&F&&(a=a.add(i)),r&F&&(o=o.add(i)),i=i.double(),n>>=F,r>>=F;return{p1:a,p2:o}}function sn(e,t,n,r){Qt(n,e),$t(r,t);let i=n.length,a=r.length;if(i!==a)throw Error(`arrays of points and scalars must have equal length`);let o=e.ZERO,s=Pe(BigInt(i)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let l=Le(c),u=Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c,f=o;for(let e=d;e>=0;e-=c){u.fill(o);for(let t=0;t<a;t++){let i=r[t],a=Number(i>>BigInt(e)&l);u[a]=u[a].add(n[t])}let t=o;for(let e=u.length-1,n=o;e>0;e--)n=n.add(u[e]),t=t.add(n);if(f=f.add(t),e!==0)for(let e=0;e<c;e++)f=f.double()}return f}function cn(e,t,n){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return Lt(t),t}else return Ht(e,{isLE:n})}function ln(e,t,n={},r){if(r===void 0&&(r=e===`edwards`),!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(typeof n==`bigint`&&n>Kt))throw Error(`CURVE.${e} must be positive bigint`)}let i=cn(t.p,n.Fp,r),a=cn(t.n,n.Fn,r),o=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of o)if(!i.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}var un=(e,t)=>(e+(e>=0?t:-t)/gn)/t;function dn(e,t,n){let[[r,i],[a,o]]=t,s=un(o*e,n),c=un(-i*e,n),l=e-s*r-c*a,u=-s*i-c*o,d=l<L,f=u<L;d&&(l=-l),f&&(u=-u);let p=Le(Math.ceil(Pe(n)/2))+hn;if(l<L||l>=p||u<L||u>=p)throw Error(`splitScalar (endomorphism): failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}function fn(e){if(![`compact`,`recovered`,`der`].includes(e))throw Error(`Signature format must be "compact", "recovered", or "der"`);return e}function pn(e,t){let n={};for(let r of Object.keys(t))n[r]=e[r]===void 0?t[r]:e[r];return ye(n.lowS,`lowS`),ye(n.prehash,`prehash`),n.format!==void 0&&fn(n.format),n}var mn=class extends Error{constructor(e=``){super(e)}};const I={Err:mn,_tlv:{encode:(e,t)=>{let{Err:n}=I;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length&1)throw new n(`tlv.encode: unpadded data`);let r=t.length/2,i=xe(r);if(i.length/2&128)throw new n(`tlv.encode: long form length too big`);let a=r>127?xe(i.length/2|128):``;return xe(e)+a+i+t},decode(e,t){let{Err:n}=I,r=0;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length<2||t[r++]!==e)throw new n(`tlv.decode: wrong tlv`);let i=t[r++],a=!!(i&128),o=0;if(!a)o=i;else{let e=i&127;if(!e)throw new n(`tlv.decode(long): indefinite length not supported`);if(e>4)throw new n(`tlv.decode(long): byte length is too big`);let a=t.subarray(r,r+e);if(a.length!==e)throw new n(`tlv.decode: length bytes not complete`);if(a[0]===0)throw new n(`tlv.decode(long): zero leftmost byte`);for(let e of a)o=o<<8|e;if(r+=e,o<128)throw new n(`tlv.decode(long): not minimal encoding`)}let s=t.subarray(r,r+o);if(s.length!==o)throw new n(`tlv.decode: wrong value length`);return{v:s,l:t.subarray(r+o)}}},_int:{encode(e){let{Err:t}=I;if(e<L)throw new t(`integer: negative integers are not allowed`);let n=xe(e);if(Number.parseInt(n[0],16)&8&&(n=`00`+n),n.length&1)throw new t(`unexpected DER parsing assertion: unpadded hex`);return n},decode(e){let{Err:t}=I;if(e[0]&128)throw new t(`invalid signature integer: negative`);if(e[0]===0&&!(e[1]&128))throw new t(`invalid signature integer: unnecessary leading zero`);return Ce(e)}},toSig(e){let{Err:t,_int:n,_tlv:r}=I,i=D(`signature`,e),{v:a,l:o}=r.decode(48,i);if(o.length)throw new t(`invalid signature: left bytes after parsing`);let{v:s,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t(`invalid signature: left bytes after parsing`);return{r:n.decode(s),s:n.decode(l)}},hexFromSig(e){let{_tlv:t,_int:n}=I,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}};var L=BigInt(0),hn=BigInt(1),gn=BigInt(2),_n=BigInt(3),vn=BigInt(4);function yn(e,t){let{BYTES:n}=e,r;if(typeof t==`bigint`)r=t;else{let i=D(`private key`,t);try{r=e.fromBytes(i)}catch{throw Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw Error(`invalid private key: out of range [1..N-1]`);return r}function bn(e,t={}){let n=ln(`weierstrass`,e,t),{Fp:r,Fn:i}=n,a=n.CURVE,{h:o,n:s}=a;He(t,{},{allowInfinityPoint:`boolean`,clearCofactor:`function`,isTorsionFree:`function`,fromBytes:`function`,toBytes:`function`,endo:`object`,wrapPrivateKey:`boolean`});let{endo:c}=t;if(c&&(!r.is0(a.a)||typeof c.beta!=`bigint`||!Array.isArray(c.basises)))throw Error(`invalid endo: expected "beta": bigint and "basises": array`);let l=Sn(r,i);function u(){if(!r.isOdd)throw Error(`compression is not supported: Field does not have .isOdd()`)}function d(e,t,n){let{x:i,y:a}=t.toAffine(),o=r.toBytes(i);return ye(n,`isCompressed`),n?(u(),E(xn(!r.isOdd(a)),o)):E(Uint8Array.of(4),o,r.toBytes(a))}function f(e){be(e,void 0,`Point`);let{publicKey:t,publicKeyUncompressed:n}=l,i=e.length,a=e[0],o=e.subarray(1);if(i===t&&(a===2||a===3)){let e=r.fromBytes(o);if(!r.isValid(e))throw Error(`bad point: is not on curve, wrong x`);let t=h(e),n;try{n=r.sqrt(t)}catch(e){let t=e instanceof Error?`: `+e.message:``;throw Error(`bad point: is not on curve, sqrt error`+t)}u();let i=r.isOdd(n);return(a&1)==1!==i&&(n=r.neg(n)),{x:e,y:n}}else if(i===n&&a===4){let e=r.BYTES,t=r.fromBytes(o.subarray(0,e)),n=r.fromBytes(o.subarray(e,e*2));if(!g(t,n))throw Error(`bad point: is not on curve`);return{x:t,y:n}}else throw Error(`bad point: got length ${i}, expected compressed=${t} or uncompressed=${n}`)}let p=t.toBytes||d,m=t.fromBytes||f;function h(e){let t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,a.a)),a.b)}function g(e,t){let n=r.sqr(t),i=h(e);return r.eql(n,i)}if(!g(a.Gx,a.Gy))throw Error(`bad curve params: generator point`);let _=r.mul(r.pow(a.a,_n),vn),v=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(_,v)))throw Error(`bad curve params: a or b`);function y(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw Error(`bad point coordinate ${e}`);return t}function ee(e){if(!(e instanceof x))throw Error(`ProjectivePoint expected`)}function te(e){if(!c||!c.basises)throw Error(`no endo`);return dn(e,c.basises,i.ORDER)}let ne=We((e,t)=>{let{X:n,Y:i,Z:a}=e;if(r.eql(a,r.ONE))return{x:n,y:i};let o=e.is0();t??=o?r.ONE:r.inv(a);let s=r.mul(n,t),c=r.mul(i,t),l=r.mul(a,t);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error(`invZ was invalid`);return{x:s,y:c}}),re=We(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw Error(`bad point: ZERO`)}let{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw Error(`bad point: x or y not field elements`);if(!g(n,i))throw Error(`bad point: equation left != right`);if(!e.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`);return!0});function b(e,t,n,i,a){return n=new x(r.mul(n.X,e),n.Y,n.Z),t=qt(i,t),n=qt(a,n),t.add(n)}class x{constructor(e,t,n){this.X=y(`x`,e),this.Y=y(`y`,t,!0),this.Z=y(`z`,n),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error(`invalid affine point`);if(e instanceof x)throw Error(`projective point not allowed`);return r.is0(t)&&r.is0(n)?x.ZERO:new x(t,n,r.ONE)}static fromBytes(e){let t=x.fromAffine(m(be(e,void 0,`point`)));return t.assertValidity(),t}static fromHex(e){return x.fromBytes(D(`pointHex`,e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return C.createCache(this,e),t||this.multiply(_n),this}assertValidity(){re(this)}hasEvenY(){let{y:e}=this.toAffine();if(!r.isOdd)throw Error(`Field doesn't support isOdd`);return!r.isOdd(e)}equals(e){ee(e);let{X:t,Y:n,Z:i}=this,{X:a,Y:o,Z:s}=e,c=r.eql(r.mul(t,s),r.mul(a,i)),l=r.eql(r.mul(n,s),r.mul(o,i));return c&&l}negate(){return new x(this.X,r.neg(this.Y),this.Z)}double(){let{a:e,b:t}=a,n=r.mul(t,_n),{X:i,Y:o,Z:s}=this,c=r.ZERO,l=r.ZERO,u=r.ZERO,d=r.mul(i,i),f=r.mul(o,o),p=r.mul(s,s),m=r.mul(i,o);return m=r.add(m,m),u=r.mul(i,s),u=r.add(u,u),c=r.mul(e,u),l=r.mul(n,p),l=r.add(c,l),c=r.sub(f,l),l=r.add(f,l),l=r.mul(c,l),c=r.mul(m,c),u=r.mul(n,u),p=r.mul(e,p),m=r.sub(d,p),m=r.mul(e,m),m=r.add(m,u),u=r.add(d,d),d=r.add(u,d),d=r.add(d,p),d=r.mul(d,m),l=r.add(l,d),p=r.mul(o,s),p=r.add(p,p),d=r.mul(p,m),c=r.sub(c,d),u=r.mul(p,f),u=r.add(u,u),u=r.add(u,u),new x(c,l,u)}add(e){ee(e);let{X:t,Y:n,Z:i}=this,{X:o,Y:s,Z:c}=e,l=r.ZERO,u=r.ZERO,d=r.ZERO,f=a.a,p=r.mul(a.b,_n),m=r.mul(t,o),h=r.mul(n,s),g=r.mul(i,c),_=r.add(t,n),v=r.add(o,s);_=r.mul(_,v),v=r.add(m,h),_=r.sub(_,v),v=r.add(t,i);let y=r.add(o,c);return v=r.mul(v,y),y=r.add(m,g),v=r.sub(v,y),y=r.add(n,i),l=r.add(s,c),y=r.mul(y,l),l=r.add(h,g),y=r.sub(y,l),d=r.mul(f,v),l=r.mul(p,g),d=r.add(l,d),l=r.sub(h,d),d=r.add(h,d),u=r.mul(l,d),h=r.add(m,m),h=r.add(h,m),g=r.mul(f,g),v=r.mul(p,v),h=r.add(h,g),g=r.sub(m,g),g=r.mul(f,g),v=r.add(v,g),m=r.mul(h,v),u=r.add(u,m),m=r.mul(y,v),l=r.mul(_,l),l=r.sub(l,m),m=r.mul(_,h),d=r.mul(y,d),d=r.add(d,m),new x(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}multiply(e){let{endo:n}=t;if(!i.isValidNot0(e))throw Error(`invalid scalar: out of range`);let r,a,o=e=>C.cached(this,e,e=>Jt(x,e));if(n){let{k1neg:t,k1:i,k2neg:s,k2:c}=te(e),{p:l,f:u}=o(i),{p:d,f}=o(c);a=u.add(f),r=b(n.beta,l,d,t,s)}else{let{p:t,f:n}=o(e);r=t,a=n}return Jt(x,[r,a])[0]}multiplyUnsafe(e){let{endo:n}=t,r=this;if(!i.isValid(e))throw Error(`invalid scalar: out of range`);if(e===L||r.is0())return x.ZERO;if(e===hn)return r;if(C.hasCache(this))return this.multiply(e);if(n){let{k1neg:t,k1:i,k2neg:a,k2:o}=te(e),{p1:s,p2:c}=on(x,r,i,o);return b(n.beta,s,c,t,a)}else return C.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){let r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return ne(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return o===hn?!0:e?e(x,this):C.unsafe(this,s).is0()}clearCofactor(){let{clearCofactor:e}=t;return o===hn?this:e?e(x,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(e=!0){return ye(e,`isCompressed`),this.assertValidity(),p(x,this,e)}toHex(e=!0){return w(this.toBytes(e))}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return Jt(x,e)}static msm(e,t){return sn(x,i,e,t)}static fromPrivateKey(e){return x.BASE.multiply(yn(i,e))}}x.BASE=new x(a.Gx,a.Gy,r.ONE),x.ZERO=new x(r.ZERO,r.ONE,r.ZERO),x.Fp=r,x.Fn=i;let S=i.BITS,C=new an(x,t.endo?Math.ceil(S/2):S);return x.BASE.precompute(8),x}function xn(e){return Uint8Array.of(e?2:3)}function Sn(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Cn(e,t={}){let{Fn:n}=e,r=t.randomBytes||he,i=Object.assign(Sn(e.Fp,n),{seed:Wt(n.ORDER)});function a(e){try{return!!yn(n,e)}catch{return!1}}function o(t,n){let{publicKey:r,publicKeyUncompressed:a}=i;try{let i=t.length;return n===!0&&i!==r||n===!1&&i!==a?!1:!!e.fromBytes(t)}catch{return!1}}function s(e=r(i.seed)){return Gt(be(e,i.seed,`seed`),n.ORDER)}function c(t,r=!0){return e.BASE.multiply(yn(n,t)).toBytes(r)}function l(e){let t=s(e);return{secretKey:t,publicKey:c(t)}}function u(t){if(typeof t==`bigint`)return!1;if(t instanceof e)return!0;let{secretKey:r,publicKey:a,publicKeyUncompressed:o}=i;if(n.allowedLengths||r===a)return;let s=D(`key`,t).length;return s===a||s===o}function d(t,r,i=!0){if(u(t)===!0)throw Error(`first arg must be private key`);if(u(r)===!1)throw Error(`second arg must be public key`);let a=yn(n,t);return e.fromHex(r).multiply(a).toBytes(i)}let f={isValidSecretKey:a,isValidPublicKey:o,randomSecretKey:s,isValidPrivateKey:a,randomPrivateKey:s,normPrivateKeyToScalar:e=>yn(n,e),precompute(t=8,n=e.BASE){return n.precompute(t,!1)}};return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:e,utils:f,lengths:i})}function wn(e,t,n={}){ie(t),He(n,{},{hmac:`function`,lowS:`boolean`,randomBytes:`function`,bits2int:`function`,bits2int_modN:`function`});let r=n.randomBytes||he,i=n.hmac||((e,...n)=>xt(t,e,E(...n))),{Fp:a,Fn:o}=e,{ORDER:s,BITS:c}=o,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:p}=Cn(e,n),m={prehash:!1,lowS:typeof n.lowS==`boolean`?n.lowS:!1,format:void 0,extraEntropy:!1},h=`compact`;function g(e){return e>s>>hn}function _(e,t){if(!o.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function v(e,t){fn(t);let n=p.signature;return be(e,t===`compact`?n:t===`recovered`?n+1:void 0,`${t} signature`)}class y{constructor(e,t,n){this.r=_(`r`,e),this.s=_(`s`,t),n!=null&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,t=h){v(e,t);let n;if(t===`der`){let{r:t,s:n}=I.toSig(be(e));return new y(t,n)}t===`recovered`&&(n=e[0],t=`compact`,e=e.subarray(1));let r=o.BYTES,i=e.subarray(0,r),a=e.subarray(r,r*2);return new y(o.fromBytes(i),o.fromBytes(a),n)}static fromHex(e,t){return this.fromBytes(ue(e),t)}addRecoveryBit(e){return new y(this.r,this.s,e)}recoverPublicKey(t){let n=a.ORDER,{r,s:i,recovery:c}=this;if(c==null||![0,1,2,3].includes(c))throw Error(`recovery id invalid`);if(s*gn<n&&c>1)throw Error(`recovery id is ambiguous for h>1 curve`);let l=c===2||c===3?r+s:r;if(!a.isValid(l))throw Error(`recovery id 2 or 3 invalid`);let u=a.toBytes(l),d=e.fromBytes(E(xn((c&1)==0),u)),f=o.inv(l),p=te(D(`msgHash`,t)),m=o.create(-p*f),h=o.create(i*f),g=e.BASE.multiplyUnsafe(m).add(d.multiplyUnsafe(h));if(g.is0())throw Error(`point at infinify`);return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(e=h){if(fn(e),e===`der`)return ue(I.hexFromSig(this));let t=o.toBytes(this.r),n=o.toBytes(this.s);if(e===`recovered`){if(this.recovery==null)throw Error(`recovery bit must be present`);return E(Uint8Array.of(this.recovery),t,n)}return E(t,n)}toHex(e){return w(this.toBytes(e))}assertValidity(){}static fromCompact(e){return y.fromBytes(D(`sig`,e),`compact`)}static fromDER(e){return y.fromBytes(D(`sig`,e),`der`)}normalizeS(){return this.hasHighS()?new y(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes(`der`)}toDERHex(){return w(this.toBytes(`der`))}toCompactRawBytes(){return this.toBytes(`compact`)}toCompactHex(){return w(this.toBytes(`compact`))}}let ee=n.bits2int||function(e){if(e.length>8192)throw Error(`input is too large`);let t=Ce(e),n=e.length*8-c;return n>0?t>>BigInt(n):t},te=n.bits2int_modN||function(e){return o.create(ee(e))},ne=Le(c);function re(e){return Ne(`num < 2^`+c,e,L,ne),o.toBytes(e)}function b(e,n){return be(e,void 0,`message`),n?be(t(e),void 0,`prehashed message`):e}function S(t,n,i){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{lowS:a,prehash:s,extraEntropy:c}=pn(i,m);t=b(t,s);let l=te(t),u=yn(o,n),d=[re(u),re(l)];if(c!=null&&c!==!1){let e=c===!0?r(p.secretKey):c;d.push(D(`extraEntropy`,e))}let f=E(...d),h=l;function _(t){let n=ee(t);if(!o.isValidNot0(n))return;let r=o.inv(n),i=e.BASE.multiply(n).toAffine(),s=o.create(i.x);if(s===L)return;let c=o.create(r*o.create(h+s*u));if(c===L)return;let l=(i.x===s?0:2)|Number(i.y&hn),d=c;return a&&g(c)&&(d=o.neg(c),l^=1),new y(s,d,l)}return{seed:f,k2sig:_}}function C(e,n,r={}){e=D(`message`,e);let{seed:a,k2sig:s}=S(e,n,r);return Re(t.outputLen,o.BYTES,i)(a,s)}function ae(e){let t,n=typeof e==`string`||x(e),r=!n&&typeof e==`object`&&!!e&&typeof e.r==`bigint`&&typeof e.s==`bigint`;if(!n&&!r)throw Error(`invalid signature, expected Uint8Array, hex string or Signature instance`);if(r)t=new y(e.r,e.s);else if(n){try{t=y.fromBytes(D(`sig`,e),`der`)}catch(e){if(!(e instanceof I.Err))throw e}if(!t)try{t=y.fromBytes(D(`sig`,e),`compact`)}catch{return!1}}return t||!1}function oe(t,n,r,i={}){let{lowS:a,prehash:s,format:c}=pn(i,m);if(r=D(`publicKey`,r),n=b(D(`message`,n),s),`strict`in i)throw Error(`options.strict was renamed to lowS`);let l=c===void 0?ae(t):y.fromBytes(D(`sig`,t),c);if(l===!1)return!1;try{let t=e.fromBytes(r);if(a&&l.hasHighS())return!1;let{r:i,s}=l,c=te(n),u=o.inv(s),d=o.create(c*u),f=o.create(i*u),p=e.BASE.multiplyUnsafe(d).add(t.multiplyUnsafe(f));return p.is0()?!1:o.create(p.x)===i}catch{return!1}}function se(e,t,n={}){let{prehash:r}=pn(n,m);return t=b(t,r),y.fromBytes(e,`recovered`).recoverPublicKey(t).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:p,Point:e,sign:C,verify:oe,recoverPublicKey:se,Signature:y,hash:t})}function Tn(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp,r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:Ht(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function En(e){let{CURVE:t,curveOpts:n}=Tn(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}function Dn(e,t){let n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,Vt(n.Fn.ORDER,n.Fn.BITS))})}function On(e){let{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:i}=En(e);return Dn(e,wn(bn(t,n),r,i))}function kn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function An(e,...t){if(!kn(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function jn(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Mn(e,t){An(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function Nn(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Pn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Fn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function In(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function Ln(e){if(typeof e==`string`)e=In(e);else if(kn(e))e=zn(e);else throw Error(`Uint8Array expected, got `+typeof e);return e}function Rn(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function zn(e){return Uint8Array.from(e)}var R=16,Bn=new Uint8Array(16),z=Nn(Bn),Vn=225,Hn=(e,t,n,r)=>{let i=r&1;return{s3:n<<31|r>>>1,s2:t<<31|n>>>1,s1:e<<31|t>>>1,s0:e>>>1^Vn<<24&-(i&1)}},B=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255|0;function Un(e){e.reverse();let t=e[15]&1,n=0;for(let t=0;t<e.length;t++){let r=e[t];e[t]=r>>>1|n,n=(r&1)<<7}return e[0]^=-t&225,e}var Wn=e=>e>64*1024?8:e>1024?4:2,Gn=class{constructor(e,t){this.blockLen=R,this.outputLen=R,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,e=Ln(e),An(e,16);let n=Fn(e),r=n.getUint32(0,!1),i=n.getUint32(4,!1),a=n.getUint32(8,!1),o=n.getUint32(12,!1),s=[];for(let e=0;e<128;e++)s.push({s0:B(r),s1:B(i),s2:B(a),s3:B(o)}),{s0:r,s1:i,s2:a,s3:o}=Hn(r,i,a,o);let c=Wn(t||1024);if(![1,2,4,8].includes(c))throw Error(`ghash: invalid window size, expected 2, 4 or 8`);this.W=c;let l=128/c,u=this.windowSize=2**c,d=[];for(let e=0;e<l;e++)for(let t=0;t<u;t++){let n=0,r=0,i=0,a=0;for(let o=0;o<c;o++){if(!(t>>>c-o-1&1))continue;let{s0:l,s1:u,s2:d,s3:f}=s[c*e+o];n^=l,r^=u,i^=d,a^=f}d.push({s0:n,s1:r,s2:i,s3:a})}this.t=d}_updateBlock(e,t,n,r){e^=this.s0,t^=this.s1,n^=this.s2,r^=this.s3;let{W:i,t:a,windowSize:o}=this,s=0,c=0,l=0,u=0,d=(1<<i)-1,f=0;for(let p of[e,t,n,r])for(let e=0;e<4;e++){let t=p>>>8*e&255;for(let e=8/i-1;e>=0;e--){let n=t>>>i*e&d,{s0:r,s1:p,s2:m,s3:h}=a[f*o+n];s^=r,c^=p,l^=m,u^=h,f+=1}}this.s0=s,this.s1=c,this.s2=l,this.s3=u}update(e){jn(this),e=Ln(e),An(e);let t=Nn(e),n=Math.floor(e.length/R),r=e.length%R;for(let e=0;e<n;e++)this._updateBlock(t[e*4+0],t[e*4+1],t[e*4+2],t[e*4+3]);return r&&(Bn.set(e.subarray(n*R)),this._updateBlock(z[0],z[1],z[2],z[3]),Pn(z)),this}destroy(){let{t:e}=this;for(let t of e)t.s0=0,t.s1=0,t.s2=0,t.s3=0}digestInto(e){jn(this),Mn(e,this),this.finished=!0;let{s0:t,s1:n,s2:r,s3:i}=this,a=Nn(e);return a[0]=t,a[1]=n,a[2]=r,a[3]=i,e}digest(){let e=new Uint8Array(R);return this.digestInto(e),this.destroy(),e}},Kn=class extends Gn{constructor(e,t){e=Ln(e),An(e);let n=Un(zn(e));super(n,t),Pn(n)}update(e){e=Ln(e),jn(this);let t=Nn(e),n=e.length%R,r=Math.floor(e.length/R);for(let e=0;e<r;e++)this._updateBlock(B(t[e*4+3]),B(t[e*4+2]),B(t[e*4+1]),B(t[e*4+0]));return n&&(Bn.set(e.subarray(r*R)),this._updateBlock(B(z[3]),B(z[2]),B(z[1]),B(z[0])),Pn(z)),this}digestInto(e){jn(this),Mn(e,this),this.finished=!0;let{s0:t,s1:n,s2:r,s3:i}=this,a=Nn(e);return a[0]=t,a[1]=n,a[2]=r,a[3]=i,e.reverse()}};function qn(e){let t=(t,n)=>e(n,t.length).update(Ln(t)).digest(),n=e(new Uint8Array(16),0);return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=(t,n)=>e(t,n),t}const Jn=qn((e,t)=>new Gn(e,t)),Yn=qn((e,t)=>new Kn(e,t));var Xn=Object.defineProperty,Zn=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qn=(e,t)=>{for(var n in t)Xn(e,n,{get:t[n],enumerable:!0})},V=(e,t,n)=>(Zn(e,typeof t==`symbol`?t:t+``,n),n),$n={};Qn($n,{EmptyArray:()=>oi,arrayToHex:()=>qr,arrayToUtf8:()=>Jr,calculateSharedKey:()=>ni,comparePublicKeyHex:()=>Xr,compressPublicKeyHex:()=>Gr,doDecrypt:()=>ci,doEncrypt:()=>si,doSignature:()=>li,doVerifySignature:()=>ui,ecdh:()=>ri,generateKeyPairHex:()=>Wr,getHash:()=>fi,getPoint:()=>hi,getPublicKeyFromPrivateKey:()=>mi,getZ:()=>di,hexToArray:()=>X,initRNGPool:()=>vr,leftPad:()=>Y,precomputePublicKey:()=>pi,utf8ToHex:()=>Kr,verifyPublicKey:()=>Yr});var er=BigInt(0),tr=BigInt(1),nr=BigInt(2);function rr(e){let t=e.toString(16);if(t[0]!==`-`)t.length%2==1?t=`0`+t:t.match(/^[0-7]/)||(t=`00`+t);else{t=t.substring(1);let n=t.length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);let r=``;for(let e=0;e<n;e++)r+=`f`;t=((A(r)^e)+tr).toString(16).replace(/^-/,``)}return t}var ir=class{constructor(e=null,t=`00`,n=`00`,r=``){this.tlv=e,this.t=t,this.l=n,this.v=r}getEncodedHex(){return this.tlv||=(this.v=this.getValue(),this.l=this.getLength(),this.t+this.l+this.v),this.tlv}getLength(){let e=this.v.length/2,t=e.toString(16);return t.length%2==1&&(t=`0`+t),e<128?t:(128+t.length/2).toString(16)+t}getValue(){return``}},ar=class extends ir{constructor(e){super(),this.t=`02`,e&&(this.v=rr(e))}getValue(){return this.v}},or=class extends ir{constructor(e){super(),this.s=e,V(this,`hV`,``),this.t=`04`,e&&(this.v=e.toLowerCase())}getValue(){return this.v}},sr=class extends ir{constructor(e){super(),this.asn1Array=e,V(this,`t`,`30`)}getValue(){return this.v=this.asn1Array.map(e=>e.getEncodedHex()).join(``),this.v}};function cr(e,t){if(+e[t+2]<8)return 1;let n=e.slice(t+2,t+6).slice(0,2);return 1+(parseInt(n,16)-128)}function lr(e,t){let n=cr(e,t),r=e.substring(t+2,t+2+n*2);return r?+(+r[0]<8?A(r):A(r.substring(2))).toString():-1}function ur(e,t){return t+(cr(e,t)+1)*2}function dr(e,t){return new sr([new ar(e),new ar(t)]).getEncodedHex()}function fr(e,t,n,r){return new sr([new ar(e),new ar(t),new or(n),new or(r)]).getEncodedHex()}function pr(e){let t=ur(e,0),n=ur(e,t),r=lr(e,t),i=e.substring(n,n+r*2),a=n+i.length,o=ur(e,a),s=lr(e,a),c=e.substring(o,o+s*2);return{r:A(i),s:A(c)}}function mr(e){function t(e,t){let n=ur(e,t),r=lr(e,t),i=e.substring(n,n+r*2);return{value:i,nextStart:n+i.length}}let{value:n,nextStart:r}=t(e,ur(e,0)),{value:i,nextStart:a}=t(e,r),{value:o,nextStart:s}=t(e,a),{value:c}=t(e,s);return{x:A(n),y:A(i),hash:o,cipher:c}}var hr=16384,gr=new Uint8Array,_r;async function vr(){if(`crypto`in globalThis){_r=globalThis.crypto;return}if(!(gr.length>hr/2))if(`wx`in globalThis&&`getRandomValues`in globalThis.wx)gr=await new Promise(e=>{wx.getRandomValues({length:hr,success(t){e(new Uint8Array(t.randomValues))}})});else try{_r=globalThis.crypto?globalThis.crypto:(await Promise.resolve().then(()=>e.r(1)(require(`./__vite-browser-external-DsQZlCv2.cjs`)))).webcrypto;let t=new Uint8Array(hr);_r.getRandomValues(t),gr=t}catch{throw Error(`no available csprng, abort.`)}}vr();function yr(e){if(gr.length>e){let t=gr.slice(0,e);return gr=gr.slice(e),vr(),t}else throw Error(`random number pool is not ready or insufficient, prevent getting too long random values or too often.`)}function br(e=0){let t=new Uint8Array(e);return _r?_r.getRandomValues(t):yr(e)}var xr=e=>e instanceof Uint8Array,Sr=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw Error(`Non little-endian hardware is not supported`);var Cr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function H(e){if(!xr(e))throw Error(`Uint8Array expected`);let t=``;for(let n=0;n<e.length;n++)t+=Cr[e[n]];return t}var wr=typeof TextEncoder<`u`&&new TextEncoder,Tr=(e,t,n)=>((t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Uint8Array(e.subarray(t,n)));function Er(e){if(wr)return wr.encode(e);let t=e.length,n=new Uint8Array(e.length+(e.length>>1)),r=0,i=e=>{n[r++]=e};for(let a=0;a<t;++a){if(r+5>n.length){let e=new Uint8Array(r+8+(t-a<<1));e.set(n),n=e}let o=e.charCodeAt(a);o<128?i(o):o<2048?(i(192|o>>6),i(128|o&63)):o>55295&&o<57344?(o=65536+(o&1047552)|e.charCodeAt(++a)&1023,i(240|o>>18),i(128|o>>12&63),i(128|o>>6&63),i(128|o&63)):(i(224|o>>12),i(128|o>>6&63),i(128|o&63))}return Tr(n,0,r)}function Dr(e){if(typeof e==`string`&&(e=Er(e)),!xr(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}var Or=class{clone(){return this._cloneInto()}};function kr(e){let t=t=>e().update(Dr(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var Ar=(e,t,n)=>e&t|e&n|t&n,jr=(e,t,n)=>e^t^n,Mr=(e,t,n)=>e&t|~e&n;function Nr(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function U(e,t){let n=t&31;return e<<n|e>>>32-n}function Pr(e){return e^U(e,9)^U(e,17)}function Fr(e){return e^U(e,15)^U(e,23)}var Ir=class extends Or{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,V(this,`buffer`),V(this,`view`),V(this,`finished`,!1),V(this,`length`,0),V(this,`pos`,0),V(this,`destroyed`,!1),this.buffer=new Uint8Array(e),this.view=Sr(this.buffer)}update(e){let{view:t,buffer:n,blockLen:r}=this;e=Dr(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Sr(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Nr(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Sr(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},W=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),G=new Uint32Array(68),Lr=new Uint32Array(64),Rr=2043430169,zr=2055708042,Br=class extends Ir{constructor(){super(64,32,8,!1),V(this,`A`,W[0]|0),V(this,`B`,W[1]|0),V(this,`C`,W[2]|0),V(this,`D`,W[3]|0),V(this,`E`,W[4]|0),V(this,`F`,W[5]|0),V(this,`G`,W[6]|0),V(this,`H`,W[7]|0)}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)G[n]=e.getUint32(t,!1);for(let e=16;e<68;e++)G[e]=Fr(G[e-16]^G[e-9]^U(G[e-3],15))^U(G[e-13],7)^G[e-6];for(let e=0;e<64;e++)Lr[e]=G[e]^G[e+4];let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=e>=0&&e<=15,u=t?Rr:zr,d=U(U(n,12)+o+U(u,e),7),f=d^U(n,12),p=(t?jr(n,r,i):Ar(n,r,i))+a+f+Lr[e]|0,m=(t?jr(o,s,c):Mr(o,s,c))+l+d+G[e]|0;a=i,i=U(r,9),r=n,n=p,l=c,c=U(s,19),s=o,o=Pr(m)}n=n^this.A|0,r=r^this.B|0,i=i^this.C|0,a=a^this.D|0,o=o^this.E|0,s=s^this.F|0,c=c^this.G|0,l=l^this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){G.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},K=kr(()=>new Br),Vr=class extends Or{constructor(e,t){super(),V(this,`oHash`),V(this,`iHash`),V(this,`blockLen`),V(this,`outputLen`),V(this,`finished`,!1),V(this,`destroyed`,!1);let n=Dr(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return this.iHash.update(e),this}digestInto(e){this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Hr=(e,t,n)=>new Vr(e,t).update(n).digest();Hr.create=(e,t)=>new Vr(e,t);var Ur=Ht(BigInt(`115792089210356248756420345214020892766250353991924191454421193933289684991999`)),q=On({a:BigInt(`115792089210356248756420345214020892766250353991924191454421193933289684991996`),b:BigInt(`18505919022281880113072981827955639221458448578012075254857346196103069175443`),Fp:Ur,h:tr,n:BigInt(`115792089210356248756420345214020892766061623724957744567843809356293439045923`),Gx:BigInt(`22963146547237050559479531362550074578802567295341616970375194840604139615431`),Gy:BigInt(`85132369209828568825618990617112496413088388631904505083283536607588877201568`),hash:K,hmac:(e,...t)=>Hr(K,e,O(...t)),randomBytes:br}),J=Ht(BigInt(q.CURVE.n));function Wr(e){let t=e?nt(P(BigInt(e),tr)+tr,32):q.utils.randomPrivateKey(),n=q.getPublicKey(t,!1);return{privateKey:Y(qe(t),64),publicKey:Y(qe(n),64)}}function Gr(e){if(e.length!==130)throw Error(`Invalid public key to compress`);let t=(e.length-2)/2,n=e.substring(2,2+t),r=A(e.substring(t+2,t+t+2)),i=`03`;return P(r,nr)===er&&(i=`02`),i+n}function Kr(e){return qe(Er(e))}function Y(e,t){return e.length>=t?e:Array(t-e.length+1).join(`0`)+e}function qr(e){return e.map(e=>{let t=e.toString(16);return t.length===1?`0`+t:t}).join(``)}function Jr(e){let t=[];for(let n=0,r=e.length;n<r;n++)e[n]>=240&&e[n]<=247?(t.push(String.fromCodePoint(((e[n]&7)<<18)+((e[n+1]&63)<<12)+((e[n+2]&63)<<6)+(e[n+3]&63))),n+=3):e[n]>=224&&e[n]<=239?(t.push(String.fromCodePoint(((e[n]&15)<<12)+((e[n+1]&63)<<6)+(e[n+2]&63))),n+=2):e[n]>=192&&e[n]<=223?(t.push(String.fromCodePoint(((e[n]&31)<<6)+(e[n+1]&63))),n++):t.push(String.fromCodePoint(e[n]));return t.join(``)}function X(e){let t=e.length;t%2!=0&&(e=Y(e,t+1)),t=e.length;let n=t/2,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=parseInt(e.substring(t*2,t*2+2),16);return r}function Yr(e){let t=q.ProjectivePoint.fromHex(e);if(!t)return!1;try{return t.assertValidity(),!0}catch{return!1}}function Xr(e,t){let n=q.ProjectivePoint.fromHex(e);if(!n)return!1;let r=q.ProjectivePoint.fromHex(t);return r?n.equals(r):!1}function Zr(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e.codePointAt(n);if(r<=127)t.push(r);else if(r<=2047)t.push(192|r>>>6),t.push(128|r&63);else if(r<=55295||r>=57344&&r<=65535)t.push(224|r>>>12),t.push(128|r>>>6&63),t.push(128|r&63);else if(r>=65536&&r<=1114111)n++,t.push(240|r>>>18&28),t.push(128|r>>>12&63),t.push(128|r>>>6&63),t.push(128|r&63);else throw t.push(r),Error(`input is not supported`)}return new Uint8Array(t)}function Qr(e,t){if(e=typeof e==`string`?Zr(e):e,t){if((t.mode||`hmac`)!==`hmac`)throw Error(`invalid mode`);let n=t.key;if(!n)throw Error(`invalid key`);return n=typeof n==`string`?X(n):n,H(Hr(K,n,e))}return H(K(e))}function $r(e,t,n){e=typeof e==`string`?Zr(e):e;let r=n==null?oi:typeof n==`string`?Zr(n):n,i=new Uint8Array(t),a=1,o=0,s=oi,c=new Uint8Array(4),l=()=>{c[0]=a>>24&255,c[1]=a>>16&255,c[2]=a>>8&255,c[3]=a&255,s=K(O(e,c,r)),a++,o=0};l();for(let e=0,t=i.length;e<t;e++)o===s.length&&l(),i[e]=s[o++]&255;return i}var ei=A(`80000000000000000000000000000000`),ti=A(`7fffffffffffffffffffffffffffffff`);function ni(e,t,n,r,i,a=!1,o=`1234567812345678`,s=`1234567812345678`){let c=q.ProjectivePoint.fromHex(t.publicKey),l=q.ProjectivePoint.fromHex(r),u=q.ProjectivePoint.fromHex(n),d=di(e.publicKey,o),f=di(n,s);a&&([d,f]=[f,d]);let p=A(t.privateKey),m=A(e.privateKey),h=ei+(c.x&ti),g=J.add(m,J.mulN(h,p)),_=l.x,v=J.add(ei,_&ti),y=l.multiply(v).add(u).multiply(g);return $r(O(X(Y(k(y.x),64)),X(Y(k(y.y),64)),d,f),i)}var{getSharedSecret:ri}=q;function ii(e,t,n){let r=$r(O(e,t),n.length);for(let e=0,t=n.length;e<t;e++)n[e]^=r[e]&255}var ai=0,oi=new Uint8Array;function si(e,t,n=1,r){let i=typeof e==`string`?X(Kr(e)):Uint8Array.from(e),a=typeof t==`string`?q.ProjectivePoint.fromHex(t):t,o=Wr(),s=A(o.privateKey),c=o.publicKey;c.length>128&&(c=c.substring(c.length-128));let l=a.multiply(s),u=X(Y(k(l.x),64)),d=X(Y(k(l.y),64)),f=H(K(O(u,i,d)));ii(u,d,i);let p=H(i);if(r?.asn1){let e=q.ProjectivePoint.fromHex(o.publicKey);return n===ai?fr(e.x,e.y,p,f):fr(e.x,e.y,f,p)}return n===ai?c+p+f:c+f+p}function ci(e,t,n=1,r){let{output:i=`string`,asn1:a=!1}=r||{},o=A(t),s,c,l;if(a){let{x:t,y:r,cipher:i,hash:a}=mr(e);s=q.ProjectivePoint.fromAffine({x:t,y:r}),l=a,c=i,n===ai&&([c,l]=[l,c])}else s=q.ProjectivePoint.fromHex(`04`+e.substring(0,128)),l=e.substring(128,192),c=e.substring(192),n===ai&&(l=e.substring(e.length-64),c=e.substring(128,e.length-64));let u=X(c),d=s.multiply(o),f=X(Y(k(d.x),64)),p=X(Y(k(d.y),64));return ii(f,p,u),qr(Array.from(K(O(f,u,p))))===l.toLowerCase()?i===`array`?u:Jr(u):i===`array`?[]:``}function li(e,t,n={}){let{pointPool:r,der:i,hash:a,publicKey:o,userId:s}=n,c=typeof e==`string`?Kr(e):qr(Array.from(e));a&&(o||=mi(t),c=fi(c,o,s));let l=A(t),u=A(c),d=null,f=null,p=null;do{do{let e;e=r&&r.length?r.pop():hi(),d=e.k,f=J.add(u,e.x1)}while(f===er||f+d===q.CURVE.n);p=J.mul(J.inv(J.addN(l,tr)),J.subN(d,J.mulN(f,l)))}while(p===er);return i?dr(f,p):Y(k(f),64)+Y(k(p),64)}function ui(e,t,n,r={}){let i,{hash:a,der:o,userId:s}=r,c=typeof n==`string`?n:n.toHex(!1);i=a?fi(typeof e==`string`?Kr(e):e,c,s):typeof e==`string`?Kr(e):qr(Array.from(e));let l,u;if(o){let e=pr(t);l=e.r,u=e.s}else l=A(t.substring(0,64)),u=A(t.substring(64));let d=typeof n==`string`?q.ProjectivePoint.fromHex(n):n,f=A(i),p=J.add(l,u);if(p===er)return!1;let m=q.ProjectivePoint.BASE.multiply(u).add(d.multiply(p)),h=J.add(f,m.x);return l===h}function di(e,t=`1234567812345678`){t=Kr(t);let n=Y(k(q.CURVE.a),64),r=Y(k(q.CURVE.b),64),i=Y(k(q.ProjectivePoint.BASE.x),64),a=Y(k(q.ProjectivePoint.BASE.y),64),o,s;if(e.length===128)o=e.substring(0,64),s=e.substring(64,128);else{let t=q.ProjectivePoint.fromHex(e);o=Y(k(t.x),64),s=Y(k(t.y),64)}let c=X(t+n+r+i+a+o+s),l=t.length*4;return K(O(new Uint8Array([l>>8&255,l&255]),c))}function fi(e,t,n=`1234567812345678`){return H(K(O(di(t,n),typeof e==`string`?X(e):e)))}function pi(e,t){let n=q.ProjectivePoint.fromHex(e);return q.utils.precompute(t,n)}function mi(e){return Y(qe(q.getPublicKey(e,!1)),64)}function hi(){let e=Wr(),t=q.ProjectivePoint.fromHex(e.publicKey),n=A(e.privateKey);return{...e,k:n,x1:t.x}}var gi={};Qn(gi,{decrypt:()=>Di,encrypt:()=>Ei,sm4:()=>Ti});var Z=0,_i=32,Q=16,vi=Uint8Array.from([214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72]),yi=new Uint32Array([462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257]);function $(e){return(vi[e>>>24&255]&255)<<24|(vi[e>>>16&255]&255)<<16|(vi[e>>>8&255]&255)<<8|vi[e&255]&255}new Uint32Array(4),new Uint32Array(4);function bi(e,t,n){let r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0;s=e[0]&255,c=e[1]&255,l=e[2]&255,u=e[3]&255,r=s<<24|c<<16|l<<8|u,s=e[4]&255,c=e[5]&255,l=e[6]&255,u=e[7]&255,i=s<<24|c<<16|l<<8|u,s=e[8]&255,c=e[9]&255,l=e[10]&255,u=e[11]&255,a=s<<24|c<<16|l<<8|u,s=e[12]&255,c=e[13]&255,l=e[14]&255,u=e[15]&255,o=s<<24|c<<16|l<<8|u;for(let e=0;e<32;e+=4)s=i^a^o^n[e],s=$(s),r^=s^(s<<2|s>>>30)^(s<<10|s>>>22)^(s<<18|s>>>14)^(s<<24|s>>>8),c=a^o^r^n[e+1],c=$(c),i^=c^(c<<2|c>>>30)^(c<<10|c>>>22)^(c<<18|c>>>14)^(c<<24|c>>>8),l=o^r^i^n[e+2],l=$(l),a^=l^(l<<2|l>>>30)^(l<<10|l>>>22)^(l<<18|l>>>14)^(l<<24|l>>>8),u=r^i^a^n[e+3],u=$(u),o^=u^(u<<2|u>>>30)^(u<<10|u>>>22)^(u<<18|u>>>14)^(u<<24|u>>>8);t[0]=o>>>24&255,t[1]=o>>>16&255,t[2]=o>>>8&255,t[3]=o&255,t[4]=a>>>24&255,t[5]=a>>>16&255,t[6]=a>>>8&255,t[7]=a&255,t[8]=i>>>24&255,t[9]=i>>>16&255,t[10]=i>>>8&255,t[11]=i&255,t[12]=r>>>24&255,t[13]=r>>>16&255,t[14]=r>>>8&255,t[15]=r&255}function xi(e,t,n){let r=0,i=0,a=0,o=0,s=0;r=(e[0]&255)<<24|(e[1]&255)<<16|(e[2]&255)<<8|e[3]&255,i=(e[4]&255)<<24|(e[5]&255)<<16|(e[6]&255)<<8|e[7]&255,a=(e[8]&255)<<24|(e[9]&255)<<16|(e[10]&255)<<8|e[11]&255,o=(e[12]&255)<<24|(e[13]&255)<<16|(e[14]&255)<<8|e[15]&255,r^=2746333894,i^=1453994832,a^=1736282519,o^=2993693404;for(let e=0;e<32;e+=4)s=i^a^o^yi[e+0],s=$(s),r^=s^(s<<13|s>>>19)^(s<<23|s>>>9),t[e+0]=r,s=a^o^r^yi[e+1],s=$(s),i^=s^(s<<13|s>>>19)^(s<<23|s>>>9),t[e+1]=i,s=o^r^i^yi[e+2],s=$(s),a^=s^(s<<13|s>>>19)^(s<<23|s>>>9),t[e+2]=a,s=r^i^a^yi[e+3],s=$(s),o^=s^(s<<13|s>>>19)^(s<<23|s>>>9),t[e+3]=o;if(n===Z)for(let e=0;e<16;e++)[t[e],t[31-e]]=[t[31-e],t[e]]}function Si(e){for(let t=e.length-1;t>=0&&(e[t]++,e[t]===0);t--);}function Ci(e,t,n,r,i,a){function o(){let e=new Uint32Array(_i);xi(t,e,1);let r=new Uint8Array(16).fill(0),i=new Uint8Array(16);bi(r,i,e);let a;if(n.length===12)a=new Uint8Array(16),a.set(n,0),a[15]=1;else{let e=Jn.create(i);e.update(n);let t=new Uint8Array(16);Rn(Fn(t),8,BigInt(n.length*8),!1),e.update(t),a=e.digest()}let o=new Uint8Array(a);Si(o);let s=new Uint8Array(16);return bi(a,s,e),{roundKey:e,h:i,j0:a,counter:o,tagMask:s}}function s(e,t){let n=r.length,i=t.length,a=Jn.create(e);n>0&&a.update(r),a.update(t);let o=new Uint8Array(16),s=Fn(o);return Rn(s,0,BigInt(n*8),!1),Rn(s,8,BigInt(i*8),!1),a.update(o),a.digest()}let{roundKey:c,h:l,j0:u,counter:d,tagMask:f}=o();if(i===Z&&a){let t=s(l,e);for(let e=0;e<16;e++)t[e]^=f[e];let n=0;for(let e=0;e<16;e++)n|=t[e]^a[e];if(n!==0)throw Error(`authentication tag mismatch`)}let p=new Uint8Array(e.length),m=0,h=e.length;for(;h>=Q;){let t=new Uint8Array(Q);bi(d,t,c);for(let n=0;n<Q&&n<h;n++)p[m+n]=e[m+n]^t[n];Si(d),m+=Q,h-=Q}if(h>0){let t=new Uint8Array(Q);bi(d,t,c);for(let n=0;n<h;n++)p[m+n]=e[m+n]^t[n]}if(i!==Z){let e=s(l,p);for(let t=0;t<16;t++)e[t]^=f[t];return{output:p,tag:e}}return{output:p}}var wi=new Uint8Array(16);function Ti(e,t,n,r={}){let{padding:i=`pkcs#7`,mode:a,iv:o=new Uint8Array(16),output:s,associatedData:c,outputTag:l,tag:u}=r;if(a===`gcm`){let r=typeof t==`string`?X(t):Uint8Array.from(t),i=typeof o==`string`?X(o):Uint8Array.from(o),a=c?typeof c==`string`?X(c):Uint8Array.from(c):new Uint8Array,d;d=typeof e==`string`?n===Z?X(e):Zr(e):Uint8Array.from(e);let f=u?typeof u==`string`?X(u):Uint8Array.from(u):void 0,p=Ci(d,r,i,a,n,f);return s===`array`?l&&n!==Z?p:p.output:l&&n!==Z||n!==Z?{output:H(p.output),tag:p.tag?H(p.tag):void 0}:Jr(p.output)}if(a===`cbc`&&(typeof o==`string`&&(o=X(o)),o.length!==128/8))throw Error(`iv is invalid`);if(typeof t==`string`&&(t=X(t)),t.length!==128/8)throw Error(`key is invalid`);if(e=typeof e==`string`?n===Z?X(e):Zr(e):Uint8Array.from(e),(i===`pkcs#5`||i===`pkcs#7`)&&n!==Z){let t=Q-e.length%Q,n=new Uint8Array(e.length+t);n.set(e,0);for(let r=0;r<t;r++)n[e.length+r]=t;e=n}let d=new Uint32Array(_i);xi(t,d,n);let f=new Uint8Array(e.length),p=o,m=e.length,h=0;for(;m>=Q;){let t=e.subarray(h,h+16);if(a===`cbc`)for(let e=0;e<Q;e++)n!==Z&&(t[e]^=p[e]);bi(t,wi,d);for(let e=0;e<Q;e++)a===`cbc`&&n===Z&&(wi[e]^=p[e]),f[h+e]=wi[e];a===`cbc`&&(p=n===Z?t:wi),m-=Q,h+=Q}if((i===`pkcs#5`||i===`pkcs#7`)&&n===Z){let e=f.length,t=f[e-1];for(let n=1;n<=t;n++)if(f[e-n]!==t)throw Error(`padding is invalid`);f=f.slice(0,e-t)}return s===`array`?f:n===Z?Jr(f):H(f)}function Ei(e,t,n={}){return Ti(e,t,1,n)}function Di(e,t,n={}){return Ti(e,t,0,n)}function Oi(e,t,n){return $n.doEncrypt(e,t,n)}function ki(e,t){return Qr(e,t)}function Ai(e,t,n){return gi.encrypt(e,t,n)}function ji(e,t,n){return gi.encrypt(e,t,n)}function Mi(e,t){return(/^\d+$/.test(e)||/^-\d+$/.test(e))&&String(e).length<=10&&(e=parseInt(e+`000`)),t?(0,i.default)(e,t):(0,i.default)(e)}function Ni(e,t){return e?(i.default.isDayjs(e)||(e=(0,i.default)(e)),e.format(t||`YYYY-MM-DD HH:mm`)):``}function Pi(e){return e?(i.default.isDayjs(e)||(e=(0,i.default)(e)),e.unix()):``}function Fi(e,t){return e&&(0,n.isString)(e)&&(e=parseInt(e)),e?(e<9999999999&&(e*=1e3),Ni(new Date(e),t)):``}function Ii(e,t){t||={};let n={};switch(e){case`email`:n.pattern=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,n.message=t.message||`请填写正确的邮箱地址`;break;case`phone`:t.mode===`strict`?n.pattern=/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/:n.pattern=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,n.message=t.message||`请填写正确的手机号码`;break;case`tel`:case`telephone`:t.strict===`strict`?n.pattern=/^\d{3}-\d{8}$|^\d{4}-\d{7,8}$/:n.pattern=/^(?:\d{3}-)?\d{8}$|^(?:\d{4}-)?\d{7,8}$/,n.message=t.message||`请填写正确的座机号码`;break;case`ID`:case`id`:!t.mode||[`china`,`cn`].includes(t.mode?.toLowerCase())?t.version?.toLowerCase()===`v1`?n.pattern=/^[1-9]\d{7}(?:0\d|10|11|12)(?:0[1-9]|[1-2][\d]|30|31)\d{3}$/:t.version?.toLowerCase()===`v2`?n.pattern=/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/:n.pattern=/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/:[`hk`,`hongkong`,`xg`,`xianggang`].includes(t.mode.toLowerCase())||[`macau`,`macao`,`mo`,`aomen`,`am`].includes(t.mode.toLowerCase())?n.pattern=/^[a-zA-Z]\d{6}\([\dA]\)$/:[`taiwan`,`tw`].includes(t.mode.toLowerCase())&&(n.pattern=/^[a-zA-Z][0-9]{9}$/),n.message=t.message||`请填写正确的证件号码`;break;case`passport`:n.pattern=/(^[EeKkGgDdSsPpHh]\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\d{7}$)/,n.message=t.message||`请填写正确的护照号码`;break;case`credit-code`:case`uscc`:n.pattern=/^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/,n.message=t.message||`请填写正确的统一社会信用代码`;break;case`bank-account`:case`bank`:n.pattern=/^[1-9]\d{9,29}$/,n.message=t.message||`请填写正确的银行账号`;break;case`stock`:n.pattern=/^(s[hz]|S[HZ])(000[\d]{3}|002[\d]{3}|300[\d]{3}|600[\d]{3}|60[\d]{4})$/,n.message=t.message||`请填写正确的股票代码`;break;case`url`:t.mode===`image`?n.pattern=/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i:t.mode===`video`?n.pattern=/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i:n.pattern=/^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/,n.message=t.message||`请填写正确的链接`;break;case`md5`:n.pattern=/^([a-f\d]{32}|[A-F\d]{32})$/,n.message=t.message||`请填写正确的md5值`;break;case`base64`:n.pattern=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i,n.message=t.message||`请填写正确的base64值`;break;case`currency`:case`money`:t.mode===`positive`?n.pattern=/^\d+(,\d{3})*(\.\d{1,2})?$/:n.pattern=/^-?\d+(,\d{3})*(\.\d{1,2})?$/,n.message=t.message||`请填写正确的货币金额`;break;case`chinese`:n.pattern=/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,n.message=t.message||`请填写中文字符`;break;case`name`:t.en||t.english?n.pattern=/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/:n.pattern=/^(?:[\u4e00-\u9fa5·]{2,16})$/,n.message=t.message||`请填写正确的姓名`;break;case`decimal`:n.pattern=/^\d+\.\d+$/,n.message=t.message||`请填写正确的小数`;break;case`number`:n.pattern=/^\d{1,}$/,n.message=t.message||`请填写正确的数字`;break;case`date`:n.pattern=/^\d{4}(-)(1[0-2]|0?\d)\1([0-2]\d|\d|30|31)$/,n.message=t.message||`请填写正确的日期`;break;case`time`:t.mode===`12`?n.pattern=/^(?:1[0-2]|0?[1-9]):[0-5]\d:[0-5]\d$/:n.pattern=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/,n.message=t.message||`请填写正确的时间`;break;case`car`:case`plate-number`:case`car-number`:t.mode===`green`||t.mode===`newEnergy`?n.pattern=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-HJ-NP-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$/:t.mode===`notNewEnergy`?n.pattern=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-HJ-NP-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/:n.pattern=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-HJ-NP-Z]{1}(?:(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))|[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1})$/,n.message=t.message||`请填写正确的车牌号`;break;case`version`:n.pattern=/^\d+(?:\.\d+){2}$/,n.message=t.message||`请填写正确的版本号`;break;case`ip`:case`IP`:t.mode===`v6`||t.mode===`ipv6`?n.pattern=/^(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))|\[(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))\](?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$/i:n.pattern=/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]).){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$/,n.message=t.message||`请填写正确的IP地址`;break;case`qq`:n.pattern=/^[1-9][0-9]{4,10}$/,n.message=t.message||`请填写正确的QQ号`;break;case`wechat`:n.pattern=/^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/,n.message=t.message||`请填写正确的微信号`;break;case`alpha-numeric`:case`numeric-alpha`:n.mode===`strict`?n.pattern=/^(?=.*[a-zA-Z])(?=.*\d).+$/:n.pattern=/^[A-Za-z0-9]+$/,n.message=t.message||`请填写字母与数字的组合`;break;case`alpha`:t.mode===`lower`||t.mode===`lowercase`?n.pattern=/^[a-z]+$/:t.mode===`upper`||t.mode===`uppercase`?n.pattern=/^[A-Z]+$/:n.pattern=/^[a-zA-Z]+$/,n.message=t.message||`请填写正确的字母`;break;case`username`:n.pattern=/^[a-zA-Z0-9_-]{4,16}$/,n.message=t.message||`请填写正确的用户名`;break;case`password`:n.pattern=/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/,n.message=t.message||`密码必须包含大小写字母、数字和特殊字符,不少于6位`;break;case`zip`:n.pattern=/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,n.message=t.message||`请填写正确的邮政编码`;break;case`mac`:case`MAC`:n.pattern=/^((([a-f0-9]{2}:){5})|(([a-f0-9]{2}-){5}))[a-f0-9]{2}$/i,n.message=t.message||`请填写正确的MAC地址`;break}return n}Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Fi}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return ji}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Mi}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return Ai}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Ni}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Oi}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return ki}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return h}});
//# sourceMappingURL=hooks-D4gUJQDD.cjs.map