@nano-lib/util 1.0.15 → 1.1.0
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.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.mjs +54 -35
- package/lib/utils/common.d.ts +3 -1
- package/package.json +5 -1
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { validHttp, validExternal, validString, validNumberStr, validEmptyObject
|
|
|
7
7
|
export { addResizeListener, removeResizeListener } from './utils/event';
|
|
8
8
|
export { sm2Crypto, sm4Crypto, sm2Encrypt, sm2Decrypt, sm4Encrypt, sm4Decrypt } from './utils/crypto';
|
|
9
9
|
export { faceLivingEvent, faceLivingEventHint, getFaceGestureResult, getFaceVideoFrame } from './utils/face';
|
|
10
|
-
export { NOOP, debounce, sleep, countdownTimer, creatCancelTask, downloadFile, getRandomItemInArray, getFullUrl, getArrayFullUrl, getGenderByIdNumber, getBirthdayByIdNumber, getPercentage, trimArray, loadCss, loadJs } from './utils/common';
|
|
10
|
+
export { NOOP, debounce, sleep, countdownTimer, creatCancelTask, ricTask, downloadFile, getRandomItemInArray, getFullUrl, getArrayFullUrl, getGenderByIdNumber, getBirthdayByIdNumber, getMapLocationIcon, getPercentage, trimArray, loadCss, loadJs } from './utils/common';
|
|
11
11
|
export declare const CONSTANTS: {
|
|
12
12
|
DATE_VALUE_FORMAT: Map<string, "YYYY-MM-DD" | "YYYY-MM-DD HH:mm:ss" | "YYYY-MM" | "YYYY" | "HH:mm:ss">;
|
|
13
13
|
COMMON_TEXT: {
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $n=(t,i,o,s)=>(t/=s/2,t<1?o/2*t*t+i:(t--,-o/2*(t*(t-2)-1)+i)),Un=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||(t=>window.setTimeout(t,1e3/60));function jn(t,i){if(i){document.querySelector(i).scrollTop=t;return}document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function Zn(t){return t?document.querySelector(t).scrollTop:document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function Gn(t){const{target:i,to:o=0,duration:s=500,callback:u}=t??{},f=Zn(i),d=o-f,a=20;let b=0;const m=function(){b+=a;const v=$n(b,f,d,s);jn(v,i),b<s?Un(m):u&&u()};m()}function Jn(t,i){switch(arguments.length){case 1:return parseInt((Math.random()*t+1).toString(),10);case 2:return parseInt((Math.random()*(i-t+1)+t).toString(),10);default:return 0}}function Wn(){let t="";const i=[];for(let o=0;o<=15;o++)i[o]=o.toString(16);for(let o=1;o<=36;o++)o===9||o===14||o===19||o===24?t+="-":o===15?t+=4:o===20?t+=i[Math.random()*4|8]:t+=i[Math.random()*16|0];return t}function xt(t,i){if(!t)return"-";t.toString().length===10&&(t=+t*1e3),i??(i="YYYY-MM-DD HH:mm:ss");const o=new Date(t),s=(d,a,b=" ")=>{if(d.length>=a)return d;const m=a-d.length;let v=Math.ceil(m/b.length);for(;v>>=1;)b+=b,v===1&&(b+=b);return b.slice(0,m)+d};let u;const f={"Y+":o.getFullYear().toString(),"M+":(o.getMonth()+1).toString(),"D+":o.getDate().toString(),"H+":o.getHours().toString(),"m+":o.getMinutes().toString(),"s+":o.getSeconds().toString()};for(const d in f)u=new RegExp("("+d+")").exec(i),u&&(i=i.replace(u[1],u[1].length==1?f[d]:s(f[d],u[1].length,"0")));return i}function Xn(t,i){`${t}`.length===10?t=parseInt(t+"")*1e3:t=+t;const o=new Date(t),u=(Date.now()-Number(o))/1e3;return u<30?"刚刚":u<3600?`${Math.ceil(u/60)}分钟前`:u<3600*24?`${Math.ceil(u/3600)}小时前`:u<3600*24*2?"1天前":i?xt(t,i):`${o.getMonth()+1}月${o.getDate()}日${o.getHours()}时${o.getMinutes()}分`}function Kn(t){const i=t||new Date,o=new Date(i),s=new Date(i);return o.setHours(0,0,0),s.setHours(23,59,59),{dateRange:[xt(o),xt(s)],timestampRange:[o.getTime(),s.getTime()]}}const Qn={set(t,i){sessionStorage&&t&&i&&sessionStorage.setItem(t,i)},get(t){return!sessionStorage||!t?null:sessionStorage.getItem(t)},setJSON(t,i){i&&this.set(t,JSON.stringify(i))},getJSON(t){const i=this.get(t);return i?JSON.parse(i):null},remove(t){sessionStorage.removeItem(t)},clear(){sessionStorage.clear()}},tr={set(t,i){localStorage&&t&&i&&localStorage.setItem(t,i)},get(t){return!localStorage||!t?null:localStorage.getItem(t)},setJSON(t,i){i&&this.set(t,JSON.stringify(i))},getJSON(t){const i=this.get(t);return i?JSON.parse(i):null},remove(t){localStorage.removeItem(t)},clear(){localStorage.clear()}};function er(t,i){if(!t||!i)return;let o=t.className;const s=o.indexOf(i);s===-1?o+=`${i}`:o=o.substring(0,s)+o.substring(s+i.length),t.className=o}function Pt(t,i){return t.className.match(new RegExp("(?:\\s|^)"+i+"(?:\\s|$)"))}function nr(t,i){Pt(t,i)||(t.className+=` ${i}`)}function rr(t,i){if(Pt(t,i)){const o=new RegExp("(?:\\s|^)"+i+"(?:\\s|$)");t.className=t.className.replace(o," ")}}function ir(t){let i=!1;return function(...o){i||(i=!0,window.requestAnimationFrame(()=>{t.apply(this,o),i=!1}))}}function or(t){t&&(t.oncontextmenu=()=>!1)}function sr(t){return/^(http(s)?:\/\/)/.test(t)}function fr(t){return/^(https?:|mailto:|tel:)/.test(t)}function cr(t){return Object.prototype.toString.call(t)==="[object String]"}function ur(t){return/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t)}function ar(t){return!Object.keys(t).length}function hr(t){return/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t)}function lr(t,i=8){return new RegExp(`^S*(?=S{${i}},})(?=S*d)(?=S*[A-Z])(?=S*[a-z])(?=S*[!@#$%^&*?])S*$`).test(t)}function dr(t){return/^(([^<>()\[\]\\.,;:\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,}))$/.test(t)}function zt(t){return/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(t)}function pr(t){return/^0\d{2,3}-?\d{7,8}$/.test(t)}function gr(t){return/^1[3-9]\d{9}$/.test(t)}const qt=()=>{};function xr(t){return new Promise(i=>setTimeout(i,t))}function mr(t,i){return new Promise(o=>{const s=setInterval(()=>{if(t===0)return clearInterval(s),o(!0),!1;i&&i(t),t--},1e3)})}function vr(t,i){const o=t.slice(),s=[];let u=o.length;const f=[];if(i>u)return null;for(;i--;){const d=Math.floor(Math.random()*u);s[i]=o[d in f?f[d]:d],f[d]=--u in f?f[u]:u}return s}function yr(t,i){let o=null;return function(...s){o!==null&&clearTimeout(o),o=setTimeout(()=>{t.apply(this,s),o=null},i)}}function br(t){if(!zt(t))throw new Error("Please provide a valid ID number!");const i=t.length,o=i===15?t[i-1]:t[i-2];return parseInt(o)%2===1?"1":"2"}function wr(t){if(!zt(t))throw new Error("Please provide a valid ID number!");return t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14)}const se=(t,i="")=>{i||(i=location.origin);const o=new RegExp(/^http(s)?:\/\//),s=new RegExp(/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i);return o.test(t)||s.test(t)?t:i+t},Tr=(t,i="")=>{typeof t=="string"&&(t=t===""?[]:t.split(","));for(const o in t)t[o]=se(t[o],i);return t};function Fr(t){let i=qt;return(...o)=>new Promise((s,u)=>{i(),i=()=>{s=u=qt},t(...o).then(f=>s(f),f=>u(f))})}function Sr(t,i){const o=document.createElement("a");o.download=i,o.href=t,o.click()}function fe(t){const i=[];for(let o=0;o<t.length;o++)t[o]&&i.push(t[o]);return i}function Er(t,i,o=!1){let s=Math.round(t/i*1e4)/100;return Number.isNaN(s)&&(s=0),o?Math.floor(s):s}function Br(t){const i=document.createElement("link");i.rel="stylesheet",i.href=t,i.crossOrigin="anonymous",document.getElementsByTagName("head")[0].appendChild(i)}function _r(t){return new Promise((i,o)=>{const s=document.createElement("script");s.type="text/javascript",s.src=t,s.onload=()=>i(),s.onerror=u=>o(u),document.getElementsByTagName("head")[0].appendChild(s)})}const Rr=[["date","YYYY-MM-DD"],["daterange","YYYY-MM-DD"],["datetime","YYYY-MM-DD HH:mm:ss"],["datetimerange","YYYY-MM-DD HH:mm:ss"],["month","YYYY-MM"],["monthrange","YYYY-MM"],["year","YYYY"],["yearrange","YYYY"],["time","HH:mm:ss"]],Dr={view:"查看",add:"添加",edit:"编辑",delete:"删除",save:"保存",reset:"重置",close:"关闭",confirm:"确定",submit:"提交",cancel:"取消",success:"成功",fail:"失败",open:"启用",disable:"禁用",refresh:"刷新",show:"显示",hide:"隐藏",search:"搜索",expand:"展开",collapse:"收起",upload:"上传",download:"下载",copy:"复制",clear:"清除",fuzzyQuery:"模糊查询",ing:"中",loading:"加载中...",select:"请选择",attachment:"附件",icon:"图标",picture:"图片",start:"开始",end:"结束",range:"范围",date:"日期",month:"月份",year:"年份",time:"时间",yes:"是",no:"否",have:"有",noHave:"无",unfilled:"未填写",selectAll:"全选",all:"全部",export:"导出",import:"导入",defaultErrorCode:"系统未知错误,请反馈给管理员"},Ar={400:"请求失败,请您稍后重试!",401:"认证失败,无法访问系统资源!",403:"当前操作没有权限!",404:"你所访问的资源不存在!",405:"请求错误,禁止访问系统资源!",408:"请求超时,请您稍后重试!",500:"服务异常!",502:"网关错误!",503:"服务不可用!",504:"网关超时!"},Ir=new Map(Rr),et=Dr,Or=Ar,ce=["jpg","jpeg","png","bmp","gif"],ue=["mp3","mp4","webm","ogg","3gp"],ae=["doc","docx","xls","xlsx","ppt","txt","pdf","zip"],Mr=[...ce,...ue,...ae];function qr(t){return Or[t]??et.defaultErrorCode}function Cr(t){return t==null?et.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?et.yes:et.no)}function Pr(t){return t==null?et.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?et.have:et.noHave)}function zr(t){return t?t.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):""}function Lr(t,i,o){if(i??(i=4),o??(o=4),t){const s=t.length;return t.substring(0,i)+"*".repeat(s-i-o)+t.substring(s-o)}return""}function Hr(t){return t.replace(/( |^)[a-z]/g,i=>i.toUpperCase())}function Nr(t){return t.replace(/( |^)[A-Z]/g,i=>i.toLowerCase())}function Yr(t,i){const o=t.find(s=>s.value===i);return o?o.label:""}function kr(t,i,o){const s=[],u=i.split(","),f=o.split(",");return Array.from(new Set(u)).forEach(a=>{const b=t.find(m=>m.value===a);b&&f.forEach(m=>{var B;const v=(B=b.children)==null?void 0:B.find(_=>_.value===m);v&&s.push(v)})}),s.map(a=>a.label).join()}function he(t,i,o){var f;if(!i)return"";const s=i.split(","),u=o.find(d=>d.value===s[t]);return u?((f=u.children)!=null&&f.length&&he(t+1,i,u.children),u.label):""}function Vr(t,i,o){if(!t)return"";const s=t.split(","),u=[],f=s.length-1,d=s.findIndex(a=>a===o);if(d!==-1){const a=s[f]===o;s.splice(a?0:d,a?f:1)}return s.forEach(a=>{const b=i.find(m=>m.value===a);b&&u.push(b)}),u.map(a=>a.label).join()}function $r(t){let i="";for(const o of Object.keys(t)){const s=t[o],u=`${encodeURIComponent(o)}=`;if(s!==null&&typeof s<"u")if(typeof s=="object"){for(const f of Object.keys(s))if(s[f]!==null&&typeof s[f]<"u"){const d=`${o}[${f}]`,a=`${encodeURIComponent(d)}=`;i+=`${a+encodeURIComponent(s[f])}&`}}else i+=`${u+encodeURIComponent(s)}&`}return i}function Ur(t){return t?fe(Object.keys(t).map(i=>t[i]===void 0?"":`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`)).join("&"):""}function jr(t){const i=decodeURIComponent(t.split("?")[1]).replace(/\+/g," ");if(!i)return{};const o={};return i.split("&").forEach(u=>{const f=u.indexOf("=");if(f!==-1){const d=u.substring(0,f),a=u.substring(f+1,u.length);o[d]=a}}),o}var le=function(){if(typeof Map<"u")return Map;function t(i,o){var s=-1;return i.some(function(u,f){return u[0]===o?(s=f,!0):!1}),s}return function(){function i(){this.__entries__=[]}return Object.defineProperty(i.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),i.prototype.get=function(o){var s=t(this.__entries__,o),u=this.__entries__[s];return u&&u[1]},i.prototype.set=function(o,s){var u=t(this.__entries__,o);~u?this.__entries__[u][1]=s:this.__entries__.push([o,s])},i.prototype.delete=function(o){var s=this.__entries__,u=t(s,o);~u&&s.splice(u,1)},i.prototype.has=function(o){return!!~t(this.__entries__,o)},i.prototype.clear=function(){this.__entries__.splice(0)},i.prototype.forEach=function(o,s){s===void 0&&(s=null);for(var u=0,f=this.__entries__;u<f.length;u++){var d=f[u];o.call(s,d[1],d[0])}},i}()}(),Ct=typeof window<"u"&&typeof document<"u"&&window.document===document,mt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Zr=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(mt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Gr=2;function Jr(t,i){var o=!1,s=!1,u=0;function f(){o&&(o=!1,t()),s&&a()}function d(){Zr(f)}function a(){var b=Date.now();if(o){if(b-u<Gr)return;s=!0}else o=!0,s=!1,setTimeout(d,i);u=b}return a}var Wr=20,Xr=["top","right","bottom","left","width","height","size","weight"],Kr=typeof MutationObserver<"u",Qr=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Jr(this.refresh.bind(this),Wr)}return t.prototype.addObserver=function(i){~this.observers_.indexOf(i)||this.observers_.push(i),this.connected_||this.connect_()},t.prototype.removeObserver=function(i){var o=this.observers_,s=o.indexOf(i);~s&&o.splice(s,1),!o.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var i=this.updateObservers_();i&&this.refresh()},t.prototype.updateObservers_=function(){var i=this.observers_.filter(function(o){return o.gatherActive(),o.hasActive()});return i.forEach(function(o){return o.broadcastActive()}),i.length>0},t.prototype.connect_=function(){!Ct||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Kr?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!Ct||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(i){var o=i.propertyName,s=o===void 0?"":o,u=Xr.some(function(f){return!!~s.indexOf(f)});u&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),de=function(t,i){for(var o=0,s=Object.keys(i);o<s.length;o++){var u=s[o];Object.defineProperty(t,u,{value:i[u],enumerable:!1,writable:!1,configurable:!0})}return t},ot=function(t){var i=t&&t.ownerDocument&&t.ownerDocument.defaultView;return i||mt},pe=yt(0,0,0,0);function vt(t){return parseFloat(t)||0}function Zt(t){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return i.reduce(function(s,u){var f=t["border-"+u+"-width"];return s+vt(f)},0)}function ti(t){for(var i=["top","right","bottom","left"],o={},s=0,u=i;s<u.length;s++){var f=u[s],d=t["padding-"+f];o[f]=vt(d)}return o}function ei(t){var i=t.getBBox();return yt(0,0,i.width,i.height)}function ni(t){var i=t.clientWidth,o=t.clientHeight;if(!i&&!o)return pe;var s=ot(t).getComputedStyle(t),u=ti(s),f=u.left+u.right,d=u.top+u.bottom,a=vt(s.width),b=vt(s.height);if(s.boxSizing==="border-box"&&(Math.round(a+f)!==i&&(a-=Zt(s,"left","right")+f),Math.round(b+d)!==o&&(b-=Zt(s,"top","bottom")+d)),!ii(t)){var m=Math.round(a+f)-i,v=Math.round(b+d)-o;Math.abs(m)!==1&&(a-=m),Math.abs(v)!==1&&(b-=v)}return yt(u.left,u.top,a,b)}var ri=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ot(t).SVGGraphicsElement}:function(t){return t instanceof ot(t).SVGElement&&typeof t.getBBox=="function"}}();function ii(t){return t===ot(t).document.documentElement}function oi(t){return Ct?ri(t)?ei(t):ni(t):pe}function si(t){var i=t.x,o=t.y,s=t.width,u=t.height,f=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,d=Object.create(f.prototype);return de(d,{x:i,y:o,width:s,height:u,top:o,right:i+s,bottom:u+o,left:i}),d}function yt(t,i,o,s){return{x:t,y:i,width:o,height:s}}var fi=function(){function t(i){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=yt(0,0,0,0),this.target=i}return t.prototype.isActive=function(){var i=oi(this.target);return this.contentRect_=i,i.width!==this.broadcastWidth||i.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var i=this.contentRect_;return this.broadcastWidth=i.width,this.broadcastHeight=i.height,i},t}(),ci=function(){function t(i,o){var s=si(o);de(this,{target:i,contentRect:s})}return t}(),ui=function(){function t(i,o,s){if(this.activeObservations_=[],this.observations_=new le,typeof i!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=i,this.controller_=o,this.callbackCtx_=s}return t.prototype.observe=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof ot(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var o=this.observations_;o.has(i)||(o.set(i,new fi(i)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof ot(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var o=this.observations_;o.has(i)&&(o.delete(i),o.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var i=this;this.clearActive(),this.observations_.forEach(function(o){o.isActive()&&i.activeObservations_.push(o)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var i=this.callbackCtx_,o=this.activeObservations_.map(function(s){return new ci(s.target,s.broadcastRect())});this.callback_.call(i,o,i),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),ge=typeof WeakMap<"u"?new WeakMap:new le,xe=function(){function t(i){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var o=Qr.getInstance(),s=new ui(i,o,this);ge.set(this,s)}return t}();["observe","unobserve","disconnect"].forEach(function(t){xe.prototype[t]=function(){var i;return(i=ge.get(this))[t].apply(i,arguments)}});var ai=function(){return typeof mt.ResizeObserver<"u"?mt.ResizeObserver:xe}();function hi(t){for(const i of t){const o=i.target.__resizeListeners__||[];o.length&&o.forEach(s=>s())}}function li(t,i){typeof window>"u"||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new ai(hi),t.__ro__.observe(t)),t.__resizeListeners__.push(i))}function di(t,i){!t||!t.__resizeListeners__||(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(i),1),t.__resizeListeners__.length||t.__ro__.disconnect())}var gt={exports:{}},pi=gt.exports,Gt;function bt(){return Gt||(Gt=1,function(t,i){(function(){var o,s=0xdeadbeefcafe,u=(s&16777215)==15715070;function f(e,n,r){e!=null&&(typeof e=="number"?this.fromNumber(e,n,r):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function d(){return new f(null)}function a(e,n,r,c,x,y){for(;--y>=0;){var S=n*this[e++]+r[c]+x;x=Math.floor(S/67108864),r[c++]=S&67108863}return x}function b(e,n,r,c,x,y){for(var S=n&32767,E=n>>15;--y>=0;){var N=this[e]&32767,k=this[e++]>>15,Z=E*N+k*S;N=S*N+((Z&32767)<<15)+r[c]+(x&1073741823),x=(N>>>30)+(Z>>>15)+E*k+(x>>>30),r[c++]=N&1073741823}return x}function m(e,n,r,c,x,y){for(var S=n&16383,E=n>>14;--y>=0;){var N=this[e]&16383,k=this[e++]>>14,Z=E*N+k*S;N=S*N+((Z&16383)<<14)+r[c]+x,x=(N>>28)+(Z>>14)+E*k,r[c++]=N&268435455}return x}var v=typeof navigator<"u";v&&u&&navigator.appName=="Microsoft Internet Explorer"?(f.prototype.am=b,o=30):v&&u&&navigator.appName!="Netscape"?(f.prototype.am=a,o=26):(f.prototype.am=m,o=28),f.prototype.DB=o,f.prototype.DM=(1<<o)-1,f.prototype.DV=1<<o;var B=52;f.prototype.FV=Math.pow(2,B),f.prototype.F1=B-o,f.prototype.F2=2*o-B;var _="0123456789abcdefghijklmnopqrstuvwxyz",O=new Array,R,q;for(R=48,q=0;q<=9;++q)O[R++]=q;for(R=97,q=10;q<36;++q)O[R++]=q;for(R=65,q=10;q<36;++q)O[R++]=q;function p(e){return _.charAt(e)}function w(e,n){var r=O[e.charCodeAt(n)];return r??-1}function g(e){for(var n=this.t-1;n>=0;--n)e[n]=this[n];e.t=this.t,e.s=this.s}function l(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function T(e){var n=d();return n.fromInt(e),n}function h(e,n){var r;if(n==16)r=4;else if(n==8)r=3;else if(n==256)r=8;else if(n==2)r=1;else if(n==32)r=5;else if(n==4)r=2;else{this.fromRadix(e,n);return}this.t=0,this.s=0;for(var c=e.length,x=!1,y=0;--c>=0;){var S=r==8?e[c]&255:w(e,c);if(S<0){e.charAt(c)=="-"&&(x=!0);continue}x=!1,y==0?this[this.t++]=S:y+r>this.DB?(this[this.t-1]|=(S&(1<<this.DB-y)-1)<<y,this[this.t++]=S>>this.DB-y):this[this.t-1]|=S<<y,y+=r,y>=this.DB&&(y-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,y>0&&(this[this.t-1]|=(1<<this.DB-y)-1<<y)),this.clamp(),x&&f.ZERO.subTo(this,this)}function F(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function A(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else if(e==4)n=2;else return this.toRadix(e);var r=(1<<n)-1,c,x=!1,y="",S=this.t,E=this.DB-S*this.DB%n;if(S-- >0)for(E<this.DB&&(c=this[S]>>E)>0&&(x=!0,y=p(c));S>=0;)E<n?(c=(this[S]&(1<<E)-1)<<n-E,c|=this[--S]>>(E+=this.DB-n)):(c=this[S]>>(E-=n)&r,E<=0&&(E+=this.DB,--S)),c>0&&(x=!0),x&&(y+=p(c));return x?y:"0"}function M(){var e=d();return f.ZERO.subTo(this,e),e}function C(){return this.s<0?this.negate():this}function L(e){var n=this.s-e.s;if(n!=0)return n;var r=this.t;if(n=r-e.t,n!=0)return this.s<0?-n:n;for(;--r>=0;)if((n=this[r]-e[r])!=0)return n;return 0}function D(e){var n=1,r;return(r=e>>>16)!=0&&(e=r,n+=16),(r=e>>8)!=0&&(e=r,n+=8),(r=e>>4)!=0&&(e=r,n+=4),(r=e>>2)!=0&&(e=r,n+=2),(r=e>>1)!=0&&(e=r,n+=1),n}function P(){return this.t<=0?0:this.DB*(this.t-1)+D(this[this.t-1]^this.s&this.DM)}function z(e,n){var r;for(r=this.t-1;r>=0;--r)n[r+e]=this[r];for(r=e-1;r>=0;--r)n[r]=0;n.t=this.t+e,n.s=this.s}function H(e,n){for(var r=e;r<this.t;++r)n[r-e]=this[r];n.t=Math.max(this.t-e,0),n.s=this.s}function $(e,n){var r=e%this.DB,c=this.DB-r,x=(1<<c)-1,y=Math.floor(e/this.DB),S=this.s<<r&this.DM,E;for(E=this.t-1;E>=0;--E)n[E+y+1]=this[E]>>c|S,S=(this[E]&x)<<r;for(E=y-1;E>=0;--E)n[E]=0;n[y]=S,n.t=this.t+y+1,n.s=this.s,n.clamp()}function K(e,n){n.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){n.t=0;return}var c=e%this.DB,x=this.DB-c,y=(1<<c)-1;n[0]=this[r]>>c;for(var S=r+1;S<this.t;++S)n[S-r-1]|=(this[S]&y)<<x,n[S-r]=this[S]>>c;c>0&&(n[this.t-r-1]|=(this.s&y)<<x),n.t=this.t-r,n.clamp()}function G(e,n){for(var r=0,c=0,x=Math.min(e.t,this.t);r<x;)c+=this[r]-e[r],n[r++]=c&this.DM,c>>=this.DB;if(e.t<this.t){for(c-=e.s;r<this.t;)c+=this[r],n[r++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;r<e.t;)c-=e[r],n[r++]=c&this.DM,c>>=this.DB;c-=e.s}n.s=c<0?-1:0,c<-1?n[r++]=this.DV+c:c>0&&(n[r++]=c),n.t=r,n.clamp()}function it(e,n){var r=this.abs(),c=e.abs(),x=r.t;for(n.t=x+c.t;--x>=0;)n[x]=0;for(x=0;x<c.t;++x)n[x+r.t]=r.am(0,c[x],n,x,0,r.t);n.s=0,n.clamp(),this.s!=e.s&&f.ZERO.subTo(n,n)}function ct(e){for(var n=this.abs(),r=e.t=2*n.t;--r>=0;)e[r]=0;for(r=0;r<n.t-1;++r){var c=n.am(r,n[r],e,2*r,0,1);(e[r+n.t]+=n.am(r+1,2*n[r],e,2*r+1,c,n.t-r-1))>=n.DV&&(e[r+n.t]-=n.DV,e[r+n.t+1]=1)}e.t>0&&(e[e.t-1]+=n.am(r,n[r],e,2*r,0,1)),e.s=0,e.clamp()}function ut(e,n,r){var c=e.abs();if(!(c.t<=0)){var x=this.abs();if(x.t<c.t){n!=null&&n.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=d());var y=d(),S=this.s,E=e.s,N=this.DB-D(c[c.t-1]);N>0?(c.lShiftTo(N,y),x.lShiftTo(N,r)):(c.copyTo(y),x.copyTo(r));var k=y.t,Z=y[k-1];if(Z!=0){var j=Z*(1<<this.F1)+(k>1?y[k-2]>>this.F2:0),Q=this.FV/j,lt=(1<<this.F1)/j,W=1<<this.F2,X=r.t,dt=X-k,tt=n??d();for(y.dlShiftTo(dt,tt),r.compareTo(tt)>=0&&(r[r.t++]=1,r.subTo(tt,r)),f.ONE.dlShiftTo(k,tt),tt.subTo(y,y);y.t<k;)y[y.t++]=0;for(;--dt>=0;){var St=r[--X]==Z?this.DM:Math.floor(r[X]*Q+(r[X-1]+W)*lt);if((r[X]+=y.am(0,St,r,dt,0,k))<St)for(y.dlShiftTo(dt,tt),r.subTo(tt,r);r[X]<--St;)r.subTo(tt,r)}n!=null&&(r.drShiftTo(k,n),S!=E&&f.ZERO.subTo(n,n)),r.t=k,r.clamp(),N>0&&r.rShiftTo(N,r),S<0&&f.ZERO.subTo(r,r)}}}function at(e){var n=d();return this.abs().divRemTo(e,null,n),this.s<0&&n.compareTo(f.ZERO)>0&&e.subTo(n,n),n}function I(e){this.m=e}function ye(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function be(e){return e}function we(e){e.divRemTo(this.m,null,e)}function Te(e,n,r){e.multiplyTo(n,r),this.reduce(r)}function Fe(e,n){e.squareTo(n),this.reduce(n)}I.prototype.convert=ye,I.prototype.revert=be,I.prototype.reduce=we,I.prototype.mulTo=Te,I.prototype.sqrTo=Fe;function Se(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var n=e&3;return n=n*(2-(e&15)*n)&15,n=n*(2-(e&255)*n)&255,n=n*(2-((e&65535)*n&65535))&65535,n=n*(2-e*n%this.DV)%this.DV,n>0?this.DV-n:-n}function nt(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Ee(e){var n=d();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&n.compareTo(f.ZERO)>0&&this.m.subTo(n,n),n}function Be(e){var n=d();return e.copyTo(n),this.reduce(n),n}function _e(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var r=e[n]&32767,c=r*this.mpl+((r*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=n+this.m.t,e[r]+=this.m.am(0,c,e,n,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Re(e,n){e.squareTo(n),this.reduce(n)}function De(e,n,r){e.multiplyTo(n,r),this.reduce(r)}nt.prototype.convert=Ee,nt.prototype.revert=Be,nt.prototype.reduce=_e,nt.prototype.mulTo=De,nt.prototype.sqrTo=Re;function Ae(){return(this.t>0?this[0]&1:this.s)==0}function Ie(e,n){if(e>4294967295||e<1)return f.ONE;var r=d(),c=d(),x=n.convert(this),y=D(e)-1;for(x.copyTo(r);--y>=0;)if(n.sqrTo(r,c),(e&1<<y)>0)n.mulTo(c,x,r);else{var S=r;r=c,c=S}return n.revert(r)}function Oe(e,n){var r;return e<256||n.isEven()?r=new I(n):r=new nt(n),this.exp(e,r)}f.prototype.copyTo=g,f.prototype.fromInt=l,f.prototype.fromString=h,f.prototype.clamp=F,f.prototype.dlShiftTo=z,f.prototype.drShiftTo=H,f.prototype.lShiftTo=$,f.prototype.rShiftTo=K,f.prototype.subTo=G,f.prototype.multiplyTo=it,f.prototype.squareTo=ct,f.prototype.divRemTo=ut,f.prototype.invDigit=Se,f.prototype.isEven=Ae,f.prototype.exp=Ie,f.prototype.toString=A,f.prototype.negate=M,f.prototype.abs=C,f.prototype.compareTo=L,f.prototype.bitLength=P,f.prototype.mod=at,f.prototype.modPowInt=Oe,f.ZERO=T(0),f.ONE=T(1);function Me(){var e=d();return this.copyTo(e),e}function qe(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Ce(){return this.t==0?this.s:this[0]<<24>>24}function Pe(){return this.t==0?this.s:this[0]<<16>>16}function ze(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Le(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function He(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var n=this.chunkSize(e),r=Math.pow(e,n),c=T(r),x=d(),y=d(),S="";for(this.divRemTo(c,x,y);x.signum()>0;)S=(r+y.intValue()).toString(e).substr(1)+S,x.divRemTo(c,x,y);return y.intValue().toString(e)+S}function Ne(e,n){this.fromInt(0),n==null&&(n=10);for(var r=this.chunkSize(n),c=Math.pow(n,r),x=!1,y=0,S=0,E=0;E<e.length;++E){var N=w(e,E);if(N<0){e.charAt(E)=="-"&&this.signum()==0&&(x=!0);continue}S=n*S+N,++y>=r&&(this.dMultiply(c),this.dAddOffset(S,0),y=0,S=0)}y>0&&(this.dMultiply(Math.pow(n,y)),this.dAddOffset(S,0)),x&&f.ZERO.subTo(this,this)}function Ye(e,n,r){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(f.ONE.shiftLeft(e-1),wt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(f.ONE.shiftLeft(e-1),this);else{var c=new Array,x=e&7;c.length=(e>>3)+1,n.nextBytes(c),x>0?c[0]&=(1<<x)-1:c[0]=0,this.fromString(c,256)}}function ke(){var e=this.t,n=new Array;n[0]=this.s;var r=this.DB-e*this.DB%8,c,x=0;if(e-- >0)for(r<this.DB&&(c=this[e]>>r)!=(this.s&this.DM)>>r&&(n[x++]=c|this.s<<this.DB-r);e>=0;)r<8?(c=(this[e]&(1<<r)-1)<<8-r,c|=this[--e]>>(r+=this.DB-8)):(c=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(c&128)!=0&&(c|=-256),x==0&&(this.s&128)!=(c&128)&&++x,(x>0||c!=this.s)&&(n[x++]=c);return n}function Ve(e){return this.compareTo(e)==0}function $e(e){return this.compareTo(e)<0?this:e}function Ue(e){return this.compareTo(e)>0?this:e}function je(e,n,r){var c,x,y=Math.min(e.t,this.t);for(c=0;c<y;++c)r[c]=n(this[c],e[c]);if(e.t<this.t){for(x=e.s&this.DM,c=y;c<this.t;++c)r[c]=n(this[c],x);r.t=this.t}else{for(x=this.s&this.DM,c=y;c<e.t;++c)r[c]=n(x,e[c]);r.t=e.t}r.s=n(this.s,e.s),r.clamp()}function Ze(e,n){return e&n}function Ge(e){var n=d();return this.bitwiseTo(e,Ze,n),n}function wt(e,n){return e|n}function Je(e){var n=d();return this.bitwiseTo(e,wt,n),n}function Nt(e,n){return e^n}function We(e){var n=d();return this.bitwiseTo(e,Nt,n),n}function Yt(e,n){return e&~n}function Xe(e){var n=d();return this.bitwiseTo(e,Yt,n),n}function Ke(){for(var e=d(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e}function Qe(e){var n=d();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n}function tn(e){var n=d();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n}function en(e){if(e==0)return-1;var n=0;return(e&65535)==0&&(e>>=16,n+=16),(e&255)==0&&(e>>=8,n+=8),(e&15)==0&&(e>>=4,n+=4),(e&3)==0&&(e>>=2,n+=2),(e&1)==0&&++n,n}function nn(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+en(this[e]);return this.s<0?this.t*this.DB:-1}function rn(e){for(var n=0;e!=0;)e&=e-1,++n;return n}function on(){for(var e=0,n=this.s&this.DM,r=0;r<this.t;++r)e+=rn(this[r]^n);return e}function sn(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:(this[n]&1<<e%this.DB)!=0}function fn(e,n){var r=f.ONE.shiftLeft(e);return this.bitwiseTo(r,n,r),r}function cn(e){return this.changeBit(e,wt)}function un(e){return this.changeBit(e,Yt)}function an(e){return this.changeBit(e,Nt)}function hn(e,n){for(var r=0,c=0,x=Math.min(e.t,this.t);r<x;)c+=this[r]+e[r],n[r++]=c&this.DM,c>>=this.DB;if(e.t<this.t){for(c+=e.s;r<this.t;)c+=this[r],n[r++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;r<e.t;)c+=e[r],n[r++]=c&this.DM,c>>=this.DB;c+=e.s}n.s=c<0?-1:0,c>0?n[r++]=c:c<-1&&(n[r++]=this.DV+c),n.t=r,n.clamp()}function ln(e){var n=d();return this.addTo(e,n),n}function dn(e){var n=d();return this.subTo(e,n),n}function pn(e){var n=d();return this.multiplyTo(e,n),n}function gn(){var e=d();return this.squareTo(e),e}function xn(e){var n=d();return this.divRemTo(e,n,null),n}function mn(e){var n=d();return this.divRemTo(e,null,n),n}function vn(e){var n=d(),r=d();return this.divRemTo(e,n,r),new Array(n,r)}function yn(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function bn(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}}function st(){}function kt(e){return e}function wn(e,n,r){e.multiplyTo(n,r)}function Tn(e,n){e.squareTo(n)}st.prototype.convert=kt,st.prototype.revert=kt,st.prototype.mulTo=wn,st.prototype.sqrTo=Tn;function Fn(e){return this.exp(e,new st)}function Sn(e,n,r){var c=Math.min(this.t+e.t,n);for(r.s=0,r.t=c;c>0;)r[--c]=0;var x;for(x=r.t-this.t;c<x;++c)r[c+this.t]=this.am(0,e[c],r,c,0,this.t);for(x=Math.min(e.t,n);c<x;++c)this.am(0,e[c],r,c,0,n-c);r.clamp()}function En(e,n,r){--n;var c=r.t=this.t+e.t-n;for(r.s=0;--c>=0;)r[c]=0;for(c=Math.max(n-this.t,0);c<e.t;++c)r[this.t+c-n]=this.am(n-c,e[c],r,0,0,this.t+c-n);r.clamp(),r.drShiftTo(1,r)}function rt(e){this.r2=d(),this.q3=d(),f.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Bn(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=d();return e.copyTo(n),this.reduce(n),n}function _n(e){return e}function Rn(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function Dn(e,n){e.squareTo(n),this.reduce(n)}function An(e,n,r){e.multiplyTo(n,r),this.reduce(r)}rt.prototype.convert=Bn,rt.prototype.revert=_n,rt.prototype.reduce=Rn,rt.prototype.mulTo=An,rt.prototype.sqrTo=Dn;function In(e,n){var r=e.bitLength(),c,x=T(1),y;if(r<=0)return x;r<18?c=1:r<48?c=3:r<144?c=4:r<768?c=5:c=6,r<8?y=new I(n):n.isEven()?y=new rt(n):y=new nt(n);var S=new Array,E=3,N=c-1,k=(1<<c)-1;if(S[1]=y.convert(this),c>1){var Z=d();for(y.sqrTo(S[1],Z);E<=k;)S[E]=d(),y.mulTo(Z,S[E-2],S[E]),E+=2}var j=e.t-1,Q,lt=!0,W=d(),X;for(r=D(e[j])-1;j>=0;){for(r>=N?Q=e[j]>>r-N&k:(Q=(e[j]&(1<<r+1)-1)<<N-r,j>0&&(Q|=e[j-1]>>this.DB+r-N)),E=c;(Q&1)==0;)Q>>=1,--E;if((r-=E)<0&&(r+=this.DB,--j),lt)S[Q].copyTo(x),lt=!1;else{for(;E>1;)y.sqrTo(x,W),y.sqrTo(W,x),E-=2;E>0?y.sqrTo(x,W):(X=x,x=W,W=X),y.mulTo(W,S[Q],x)}for(;j>=0&&(e[j]&1<<r)==0;)y.sqrTo(x,W),X=x,x=W,W=X,--r<0&&(r=this.DB-1,--j)}return y.revert(x)}function On(e){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var c=n;n=r,r=c}var x=n.getLowestSetBit(),y=r.getLowestSetBit();if(y<0)return n;for(x<y&&(y=x),y>0&&(n.rShiftTo(y,n),r.rShiftTo(y,r));n.signum()>0;)(x=n.getLowestSetBit())>0&&n.rShiftTo(x,n),(x=r.getLowestSetBit())>0&&r.rShiftTo(x,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r));return y>0&&r.lShiftTo(y,r),r}function Mn(e){if(e<=0)return 0;var n=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(n==0)r=this[0]%e;else for(var c=this.t-1;c>=0;--c)r=(n*r+this[c])%e;return r}function qn(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return f.ZERO;for(var r=e.clone(),c=this.clone(),x=T(1),y=T(0),S=T(0),E=T(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),n?((!x.isEven()||!y.isEven())&&(x.addTo(this,x),y.subTo(e,y)),x.rShiftTo(1,x)):y.isEven()||y.subTo(e,y),y.rShiftTo(1,y);for(;c.isEven();)c.rShiftTo(1,c),n?((!S.isEven()||!E.isEven())&&(S.addTo(this,S),E.subTo(e,E)),S.rShiftTo(1,S)):E.isEven()||E.subTo(e,E),E.rShiftTo(1,E);r.compareTo(c)>=0?(r.subTo(c,r),n&&x.subTo(S,x),y.subTo(E,y)):(c.subTo(r,c),n&&S.subTo(x,S),E.subTo(y,E))}if(c.compareTo(f.ONE)!=0)return f.ZERO;if(E.compareTo(e)>=0)return E.subtract(e);if(E.signum()<0)E.addTo(e,E);else return E;return E.signum()<0?E.add(e):E}var V=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Cn=(1<<26)/V[V.length-1];function Pn(e){var n,r=this.abs();if(r.t==1&&r[0]<=V[V.length-1]){for(n=0;n<V.length;++n)if(r[0]==V[n])return!0;return!1}if(r.isEven())return!1;for(n=1;n<V.length;){for(var c=V[n],x=n+1;x<V.length&&c<Cn;)c*=V[x++];for(c=r.modInt(c);n<x;)if(c%V[n++]==0)return!1}return r.millerRabin(e)}function zn(e){var n=this.subtract(f.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var c=n.shiftRight(r);e=e+1>>1,e>V.length&&(e=V.length);for(var x=d(),y=0;y<e;++y){x.fromInt(V[Math.floor(Math.random()*V.length)]);var S=x.modPow(c,this);if(S.compareTo(f.ONE)!=0&&S.compareTo(n)!=0){for(var E=1;E++<r&&S.compareTo(n)!=0;)if(S=S.modPowInt(2,this),S.compareTo(f.ONE)==0)return!1;if(S.compareTo(n)!=0)return!1}}return!0}f.prototype.chunkSize=ze,f.prototype.toRadix=He,f.prototype.fromRadix=Ne,f.prototype.fromNumber=Ye,f.prototype.bitwiseTo=je,f.prototype.changeBit=fn,f.prototype.addTo=hn,f.prototype.dMultiply=yn,f.prototype.dAddOffset=bn,f.prototype.multiplyLowerTo=Sn,f.prototype.multiplyUpperTo=En,f.prototype.modInt=Mn,f.prototype.millerRabin=zn,f.prototype.clone=Me,f.prototype.intValue=qe,f.prototype.byteValue=Ce,f.prototype.shortValue=Pe,f.prototype.signum=Le,f.prototype.toByteArray=ke,f.prototype.equals=Ve,f.prototype.min=$e,f.prototype.max=Ue,f.prototype.and=Ge,f.prototype.or=Je,f.prototype.xor=We,f.prototype.andNot=Xe,f.prototype.not=Ke,f.prototype.shiftLeft=Qe,f.prototype.shiftRight=tn,f.prototype.getLowestSetBit=nn,f.prototype.bitCount=on,f.prototype.testBit=sn,f.prototype.setBit=cn,f.prototype.clearBit=un,f.prototype.flipBit=an,f.prototype.add=ln,f.prototype.subtract=dn,f.prototype.multiply=pn,f.prototype.divide=xn,f.prototype.remainder=mn,f.prototype.divideAndRemainder=vn,f.prototype.modPow=In,f.prototype.modInverse=qn,f.prototype.pow=Fn,f.prototype.gcd=On,f.prototype.isProbablePrime=Pn,f.prototype.square=gn,f.prototype.Barrett=rt;var ht,U,Y;function Ln(e){U[Y++]^=e&255,U[Y++]^=e>>8&255,U[Y++]^=e>>16&255,U[Y++]^=e>>24&255,Y>=Ft&&(Y-=Ft)}function Vt(){Ln(new Date().getTime())}if(U==null){U=new Array,Y=0;var J;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var $t=new Uint8Array(32);for(window.crypto.getRandomValues($t),J=0;J<32;++J)U[Y++]=$t[J]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Ut=window.crypto.random(32);for(J=0;J<Ut.length;++J)U[Y++]=Ut.charCodeAt(J)&255}}for(;Y<Ft;)J=Math.floor(65536*Math.random()),U[Y++]=J>>>8,U[Y++]=J&255;Y=0,Vt()}function Hn(){if(ht==null){for(Vt(),ht=Vn(),ht.init(U),Y=0;Y<U.length;++Y)U[Y]=0;Y=0}return ht.next()}function Nn(e){var n;for(n=0;n<e.length;++n)e[n]=Hn()}function jt(){}jt.prototype.nextBytes=Nn;function Tt(){this.i=0,this.j=0,this.S=new Array}function Yn(e){var n,r,c;for(n=0;n<256;++n)this.S[n]=n;for(r=0,n=0;n<256;++n)r=r+this.S[n]+e[n%e.length]&255,c=this.S[n],this.S[n]=this.S[r],this.S[r]=c;this.i=0,this.j=0}function kn(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}Tt.prototype.init=Yn,Tt.prototype.next=kn;function Vn(){return new Tt}var Ft=256;t.exports={default:f,BigInteger:f,SecureRandom:jt}}).call(pi)}(gt)),gt.exports}var Et,Jt;function gi(){if(Jt)return Et;Jt=1;const{BigInteger:t}=bt();function i(b){let m=b.toString(16);if(m[0]!=="-")m.length%2===1?m="0"+m:m.match(/^[0-7]/)||(m="00"+m);else{m=m.substr(1);let v=m.length;v%2===1?v+=1:m.match(/^[0-7]/)||(v+=2);let B="";for(let _=0;_<v;_++)B+="f";B=new t(B,16),m=B.xor(b).add(t.ONE),m=m.toString(16).replace(/^-/,"")}return m}class o{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const m=this.v.length/2;let v=m.toString(16);return v.length%2===1&&(v="0"+v),m<128?v:(128+v.length/2).toString(16)+v}getValue(){return""}}class s extends o{constructor(m){super(),this.t="02",m&&(this.v=i(m))}getValue(){return this.v}}class u extends o{constructor(m){super(),this.t="30",this.asn1Array=m}getValue(){return this.v=this.asn1Array.map(m=>m.getEncodedHex()).join(""),this.v}}function f(b,m){return+b[m+2]<8?1:+b.substr(m+2,2)&128}function d(b,m){const v=f(b,m),B=b.substr(m+2,v*2);return B?(+B[0]<8?new t(B,16):new t(B.substr(2),16)).intValue():-1}function a(b,m){const v=f(b,m);return m+(v+1)*2}return Et={encodeDer(b,m){const v=new s(b),B=new s(m);return new u([v,B]).getEncodedHex()},decodeDer(b){const m=a(b,0),v=a(b,m),B=d(b,m),_=b.substr(v,B*2),O=v+_.length,R=a(b,O),q=d(b,O),p=b.substr(R,q*2),w=new t(_,16),g=new t(p,16);return{r:w,s:g}}},Et}var Bt,Wt;function xi(){if(Wt)return Bt;Wt=1;const{BigInteger:t}=bt(),i=new t("2"),o=new t("3");class s{constructor(a,b){this.x=b,this.q=a}equals(a){return a===this?!0:this.q.equals(a.q)&&this.x.equals(a.x)}toBigInteger(){return this.x}negate(){return new s(this.q,this.x.negate().mod(this.q))}add(a){return new s(this.q,this.x.add(a.toBigInteger()).mod(this.q))}subtract(a){return new s(this.q,this.x.subtract(a.toBigInteger()).mod(this.q))}multiply(a){return new s(this.q,this.x.multiply(a.toBigInteger()).mod(this.q))}divide(a){return new s(this.q,this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new s(this.q,this.x.square().mod(this.q))}}class u{constructor(a,b,m,v){this.curve=a,this.x=b,this.y=m,this.z=v??t.ONE,this.zinv=null}getX(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(a){return a===this?!0:this.isInfinity()?a.isInfinity():a.isInfinity()?this.isInfinity():a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(t.ZERO)?a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(t.ZERO):!1}isInfinity(){return this.x===null&&this.y===null?!0:this.z.equals(t.ZERO)&&!this.y.toBigInteger().equals(t.ZERO)}negate(){return new u(this.curve,this.x,this.y.negate(),this.z)}add(a){if(this.isInfinity())return a;if(a.isInfinity())return this;const b=this.x.toBigInteger(),m=this.y.toBigInteger(),v=this.z,B=a.x.toBigInteger(),_=a.y.toBigInteger(),O=a.z,R=this.curve.q,q=b.multiply(O).mod(R),p=B.multiply(v).mod(R),w=q.subtract(p),g=m.multiply(O).mod(R),l=_.multiply(v).mod(R),T=g.subtract(l);if(t.ZERO.equals(w))return t.ZERO.equals(T)?this.twice():this.curve.infinity;const h=q.add(p),F=v.multiply(O).mod(R),A=w.square().mod(R),M=w.multiply(A).mod(R),C=F.multiply(T.square()).subtract(h.multiply(A)).mod(R),L=w.multiply(C).mod(R),D=T.multiply(A.multiply(q).subtract(C)).subtract(g.multiply(M)).mod(R),P=M.multiply(F).mod(R);return new u(this.curve,this.curve.fromBigInteger(L),this.curve.fromBigInteger(D),P)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const a=this.x.toBigInteger(),b=this.y.toBigInteger(),m=this.z,v=this.curve.q,B=this.curve.a.toBigInteger(),_=a.square().multiply(o).add(B.multiply(m.square())).mod(v),O=b.shiftLeft(1).multiply(m).mod(v),R=b.square().mod(v),q=R.multiply(a).multiply(m).mod(v),p=O.square().mod(v),w=_.square().subtract(q.shiftLeft(3)).mod(v),g=O.multiply(w).mod(v),l=_.multiply(q.shiftLeft(2).subtract(w)).subtract(p.shiftLeft(1).multiply(R)).mod(v),T=O.multiply(p).mod(v);return new u(this.curve,this.curve.fromBigInteger(g),this.curve.fromBigInteger(l),T)}multiply(a){if(this.isInfinity())return this;if(!a.signum())return this.curve.infinity;const b=a.multiply(o),m=this.negate();let v=this;for(let B=b.bitLength()-2;B>0;B--){v=v.twice();const _=b.testBit(B),O=a.testBit(B);_!==O&&(v=v.add(_?this:m))}return v}}class f{constructor(a,b,m){this.q=a,this.a=this.fromBigInteger(b),this.b=this.fromBigInteger(m),this.infinity=new u(this,null,null)}equals(a){return a===this?!0:this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b)}fromBigInteger(a){return new s(this.q,a)}decodePointHex(a){switch(parseInt(a.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const b=this.fromBigInteger(new t(a.substr(2),16));let m=this.fromBigInteger(b.multiply(b.square()).add(b.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new t("4")).add(t.ONE),this.q));return m.toBigInteger().mod(i).equals(new t(a.substr(0,2),16).subtract(i))||(m=m.negate()),new u(this,b,m);case 4:case 6:case 7:const v=(a.length-2)/2,B=a.substr(2,v),_=a.substr(v+2,v);return new u(this,this.fromBigInteger(new t(B,16)),this.fromBigInteger(new t(_,16)));default:return null}}}return Bt={ECPointFp:u,ECCurveFp:f},Bt}var _t,Xt;function mi(){if(Xt)return _t;Xt=1;const{BigInteger:t,SecureRandom:i}=bt(),{ECCurveFp:o}=xi(),s=new i,{curve:u,G:f,n:d}=b();function a(){return u}function b(){const g=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),l=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),T=new t("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),h=new o(g,l,T),M=h.decodePointHex("04"+"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7"+"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),C=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16);return{curve:h,G:M,n:C}}function m(g,l,T){const F=(g?new t(g,l,T):new t(d.bitLength(),s)).mod(d.subtract(t.ONE)).add(t.ONE),A=_(F.toString(16),64),M=f.multiply(F),C=_(M.getX().toBigInteger().toString(16),64),L=_(M.getY().toBigInteger().toString(16),64),D="04"+C+L;return{privateKey:A,publicKey:D}}function v(g){if(g.length!==130)throw new Error("Invalid public key to compress");const l=(g.length-2)/2,T=g.substr(2,l),h=new t(g.substr(l+2,l),16);let F="03";return h.mod(new t("2")).equals(t.ZERO)&&(F="02"),F+T}function B(g){g=unescape(encodeURIComponent(g));const l=g.length,T=[];for(let F=0;F<l;F++)T[F>>>2]|=(g.charCodeAt(F)&255)<<24-F%4*8;const h=[];for(let F=0;F<l;F++){const A=T[F>>>2]>>>24-F%4*8&255;h.push((A>>>4).toString(16)),h.push((A&15).toString(16))}return h.join("")}function _(g,l){return g.length>=l?g:new Array(l-g.length+1).join("0")+g}function O(g){return g.map(l=>(l=l.toString(16),l.length===1?"0"+l:l)).join("")}function R(g){const l=[];let T=0;for(let h=0;h<g.length*2;h+=2)l[h>>>3]|=parseInt(g[T],10)<<24-h%8*4,T++;try{const h=[];for(let F=0;F<g.length;F++){const A=l[F>>>2]>>>24-F%4*8&255;h.push(String.fromCharCode(A))}return decodeURIComponent(escape(h.join("")))}catch{throw new Error("Malformed UTF-8 data")}}function q(g){const l=[];let T=g.length;T%2!==0&&(g=_(g,T+1)),T=g.length;for(let h=0;h<T;h+=2)l.push(parseInt(g.substr(h,2),16));return l}function p(g){const l=u.decodePointHex(g);if(!l)return!1;const T=l.getX();return l.getY().square().equals(T.multiply(T.square()).add(T.multiply(u.a)).add(u.b))}function w(g,l){const T=u.decodePointHex(g);if(!T)return!1;const h=u.decodePointHex(l);return h?T.equals(h):!1}return _t={getGlobalCurve:a,generateEcparam:b,generateKeyPairHex:m,compressPublicKeyHex:v,utf8ToHex:B,leftPad:_,arrayToHex:O,arrayToUtf8:R,hexToArray:q,verifyPublicKey:p,comparePublicKeyHex:w},_t}var Rt,Kt;function me(){if(Kt)return Rt;Kt=1;const t=new Uint32Array(68),i=new Uint32Array(64);function o(B,_){const O=_&31;return B<<O|B>>>32-O}function s(B,_){const O=[];for(let R=B.length-1;R>=0;R--)O[R]=(B[R]^_[R])&255;return O}function u(B){return B^o(B,9)^o(B,17)}function f(B){return B^o(B,15)^o(B,23)}function d(B){let _=B.length*8,O=_%512;O=O>=448?512-O%448-1:448-O-1;const R=new Array((O-7)/8),q=new Array(8);for(let h=0,F=R.length;h<F;h++)R[h]=0;for(let h=0,F=q.length;h<F;h++)q[h]=0;_=_.toString(2);for(let h=7;h>=0;h--)if(_.length>8){const F=_.length-8;q[h]=parseInt(_.substr(F),2),_=_.substr(0,F)}else _.length>0&&(q[h]=parseInt(_,2),_="");const p=new Uint8Array([...B,128,...R,...q]),w=new DataView(p.buffer,0),g=p.length/64,l=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let h=0;h<g;h++){t.fill(0),i.fill(0);const F=16*h;for(let I=0;I<16;I++)t[I]=w.getUint32((F+I)*4,!1);for(let I=16;I<68;I++)t[I]=f(t[I-16]^t[I-9]^o(t[I-3],15))^o(t[I-13],7)^t[I-6];for(let I=0;I<64;I++)i[I]=t[I]^t[I+4];const A=2043430169,M=2055708042;let C=l[0],L=l[1],D=l[2],P=l[3],z=l[4],H=l[5],$=l[6],K=l[7],G,it,ct,ut,at;for(let I=0;I<64;I++)at=I>=0&&I<=15?A:M,G=o(o(C,12)+z+o(at,I),7),it=G^o(C,12),ct=(I>=0&&I<=15?C^L^D:C&L|C&D|L&D)+P+it+i[I],ut=(I>=0&&I<=15?z^H^$:z&H|~z&$)+K+G+t[I],P=D,D=o(L,9),L=C,C=ct,K=$,$=o(H,19),H=z,z=u(ut);l[0]^=C,l[1]^=L,l[2]^=D,l[3]^=P,l[4]^=z,l[5]^=H,l[6]^=$,l[7]^=K}const T=[];for(let h=0,F=l.length;h<F;h++){const A=l[h];T.push((A&4278190080)>>>24,(A&16711680)>>>16,(A&65280)>>>8,A&255)}return T}const a=64,b=new Uint8Array(a),m=new Uint8Array(a);for(let B=0;B<a;B++)b[B]=54,m[B]=92;function v(B,_){for(_.length>a&&(_=d(_));_.length<a;)_.push(0);const O=s(_,b),R=s(_,m),q=d([...O,...B]);return d([...R,...q])}return Rt={sm3:d,hmac:v},Rt}var Dt,Qt;function vi(){if(Qt)return Dt;Qt=1;const{BigInteger:t}=bt(),{encodeDer:i,decodeDer:o}=gi(),s=mi(),u=me().sm3,{G:f,curve:d,n:a}=s.generateEcparam(),b=0;function m(p,w,g=1){p=typeof p=="string"?s.hexToArray(s.utf8ToHex(p)):Array.prototype.slice.call(p),w=s.getGlobalCurve().decodePointHex(w);const l=s.generateKeyPairHex(),T=new t(l.privateKey,16);let h=l.publicKey;h.length>128&&(h=h.substr(h.length-128));const F=w.multiply(T),A=s.hexToArray(s.leftPad(F.getX().toBigInteger().toRadix(16),64)),M=s.hexToArray(s.leftPad(F.getY().toBigInteger().toRadix(16),64)),C=s.arrayToHex(u([].concat(A,p,M)));let L=1,D=0,P=[];const z=[].concat(A,M),H=()=>{P=u([...z,L>>24&255,L>>16&255,L>>8&255,L&255]),L++,D=0};H();for(let K=0,G=p.length;K<G;K++)D===P.length&&H(),p[K]^=P[D++]&255;const $=s.arrayToHex(p);return g===b?h+$+C:h+C+$}function v(p,w,g=1,{output:l="string"}={}){w=new t(w,16);let T=p.substr(128,64),h=p.substr(192);g===b&&(T=p.substr(p.length-64),h=p.substr(128,p.length-128-64));const F=s.hexToArray(h),M=s.getGlobalCurve().decodePointHex("04"+p.substr(0,128)).multiply(w),C=s.hexToArray(s.leftPad(M.getX().toBigInteger().toRadix(16),64)),L=s.hexToArray(s.leftPad(M.getY().toBigInteger().toRadix(16),64));let D=1,P=0,z=[];const H=[].concat(C,L),$=()=>{z=u([...H,D>>24&255,D>>16&255,D>>8&255,D&255]),D++,P=0};$();for(let G=0,it=F.length;G<it;G++)P===z.length&&$(),F[G]^=z[P++]&255;return s.arrayToHex(u([].concat(C,F,L)))===T.toLowerCase()?l==="array"?F:s.arrayToUtf8(F):l==="array"?[]:""}function B(p,w,{pointPool:g,der:l,hash:T,publicKey:h,userId:F}={}){let A=typeof p=="string"?s.utf8ToHex(p):s.arrayToHex(p);T&&(h=h||R(w),A=O(A,h,F));const M=new t(w,16),C=new t(A,16);let L=null,D=null,P=null;do{do{let z;g&&g.length?z=g.pop():z=q(),L=z.k,D=C.add(z.x1).mod(a)}while(D.equals(t.ZERO)||D.add(L).equals(a));P=M.add(t.ONE).modInverse(a).multiply(L.subtract(D.multiply(M))).mod(a)}while(P.equals(t.ZERO));return l?i(D,P):s.leftPad(D.toString(16),64)+s.leftPad(P.toString(16),64)}function _(p,w,g,{der:l,hash:T,userId:h}={}){let F=typeof p=="string"?s.utf8ToHex(p):s.arrayToHex(p);T&&(F=O(F,g,h));let A,M;if(l){const H=o(w);A=H.r,M=H.s}else A=new t(w.substring(0,64),16),M=new t(w.substring(64),16);const C=d.decodePointHex(g),L=new t(F,16),D=A.add(M).mod(a);if(D.equals(t.ZERO))return!1;const P=f.multiply(M).add(C.multiply(D)),z=L.add(P.getX().toBigInteger()).mod(a);return A.equals(z)}function O(p,w,g="1234567812345678"){g=s.utf8ToHex(g);const l=s.leftPad(f.curve.a.toBigInteger().toRadix(16),64),T=s.leftPad(f.curve.b.toBigInteger().toRadix(16),64),h=s.leftPad(f.getX().toBigInteger().toRadix(16),64),F=s.leftPad(f.getY().toBigInteger().toRadix(16),64);let A,M;if(w.length===128)A=w.substr(0,64),M=w.substr(64,64);else{const P=f.curve.decodePointHex(w);A=s.leftPad(P.getX().toBigInteger().toRadix(16),64),M=s.leftPad(P.getY().toBigInteger().toRadix(16),64)}const C=s.hexToArray(g+l+T+h+F+A+M),L=g.length*4;C.unshift(L&255),C.unshift(L>>8&255);const D=u(C);return s.arrayToHex(u(D.concat(s.hexToArray(p))))}function R(p){const w=f.multiply(new t(p,16)),g=s.leftPad(w.getX().toBigInteger().toString(16),64),l=s.leftPad(w.getY().toBigInteger().toString(16),64);return"04"+g+l}function q(){const p=s.generateKeyPairHex(),w=d.decodePointHex(p.publicKey);return p.k=new t(p.privateKey,16),p.x1=w.getX().toBigInteger(),p}return Dt={generateKeyPairHex:s.generateKeyPairHex,compressPublicKeyHex:s.compressPublicKeyHex,comparePublicKeyHex:s.comparePublicKeyHex,doEncrypt:m,doDecrypt:v,doSignature:B,doVerifySignature:_,getPublicKeyFromPrivateKey:R,getPoint:q,verifyPublicKey:s.verifyPublicKey},Dt}var At,te;function yi(){if(te)return At;te=1;const{sm3:t,hmac:i}=me();function o(d,a){return d.length>=a?d:new Array(a-d.length+1).join("0")+d}function s(d){return d.map(a=>(a=a.toString(16),a.length===1?"0"+a:a)).join("")}function u(d){const a=[];let b=d.length;b%2!==0&&(d=o(d,b+1)),b=d.length;for(let m=0;m<b;m+=2)a.push(parseInt(d.substr(m,2),16));return a}function f(d){const a=[];for(let b=0,m=d.length;b<m;b++){const v=d.codePointAt(b);if(v<=127)a.push(v);else if(v<=2047)a.push(192|v>>>6),a.push(128|v&63);else if(v<=55295||v>=57344&&v<=65535)a.push(224|v>>>12),a.push(128|v>>>6&63),a.push(128|v&63);else if(v>=65536&&v<=1114111)b++,a.push(240|v>>>18&28),a.push(128|v>>>12&63),a.push(128|v>>>6&63),a.push(128|v&63);else throw a.push(v),new Error("input is not supported")}return a}return At=function(d,a){if(d=typeof d=="string"?f(d):Array.prototype.slice.call(d),a){if((a.mode||"hmac")!=="hmac")throw new Error("invalid mode");let m=a.key;if(!m)throw new Error("invalid key");return m=typeof m=="string"?u(m):Array.prototype.slice.call(m),s(i(d,m))}return s(t(d))},At}var It,ee;function bi(){if(ee)return It;ee=1;const t=0,i=32,o=16,s=[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],u=[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 f(p){const w=[];for(let g=0,l=p.length;g<l;g+=2)w.push(parseInt(p.substr(g,2),16));return w}function d(p){return p.map(w=>(w=w.toString(16),w.length===1?"0"+w:w)).join("")}function a(p){const w=[];for(let g=0,l=p.length;g<l;g++){const T=p.codePointAt(g);if(T<=127)w.push(T);else if(T<=2047)w.push(192|T>>>6),w.push(128|T&63);else if(T<=55295||T>=57344&&T<=65535)w.push(224|T>>>12),w.push(128|T>>>6&63),w.push(128|T&63);else if(T>=65536&&T<=1114111)g++,w.push(240|T>>>18&28),w.push(128|T>>>12&63),w.push(128|T>>>6&63),w.push(128|T&63);else throw w.push(T),new Error("input is not supported")}return w}function b(p){const w=[];for(let g=0,l=p.length;g<l;g++)p[g]>=240&&p[g]<=247?(w.push(String.fromCodePoint(((p[g]&7)<<18)+((p[g+1]&63)<<12)+((p[g+2]&63)<<6)+(p[g+3]&63))),g+=3):p[g]>=224&&p[g]<=239?(w.push(String.fromCodePoint(((p[g]&15)<<12)+((p[g+1]&63)<<6)+(p[g+2]&63))),g+=2):p[g]>=192&&p[g]<=223?(w.push(String.fromCodePoint(((p[g]&31)<<6)+(p[g+1]&63))),g++):w.push(String.fromCodePoint(p[g]));return w.join("")}function m(p,w){const g=w&31;return p<<g|p>>>32-g}function v(p){return(s[p>>>24&255]&255)<<24|(s[p>>>16&255]&255)<<16|(s[p>>>8&255]&255)<<8|s[p&255]&255}function B(p){return p^m(p,2)^m(p,10)^m(p,18)^m(p,24)}function _(p){return p^m(p,13)^m(p,23)}function O(p,w,g){const l=new Array(4),T=new Array(4);for(let h=0;h<4;h++)T[0]=p[4*h]&255,T[1]=p[4*h+1]&255,T[2]=p[4*h+2]&255,T[3]=p[4*h+3]&255,l[h]=T[0]<<24|T[1]<<16|T[2]<<8|T[3];for(let h=0,F;h<32;h+=4)F=l[1]^l[2]^l[3]^g[h+0],l[0]^=B(v(F)),F=l[2]^l[3]^l[0]^g[h+1],l[1]^=B(v(F)),F=l[3]^l[0]^l[1]^g[h+2],l[2]^=B(v(F)),F=l[0]^l[1]^l[2]^g[h+3],l[3]^=B(v(F));for(let h=0;h<16;h+=4)w[h]=l[3-h/4]>>>24&255,w[h+1]=l[3-h/4]>>>16&255,w[h+2]=l[3-h/4]>>>8&255,w[h+3]=l[3-h/4]&255}function R(p,w,g){const l=new Array(4),T=new Array(4);for(let h=0;h<4;h++)T[0]=p[0+4*h]&255,T[1]=p[1+4*h]&255,T[2]=p[2+4*h]&255,T[3]=p[3+4*h]&255,l[h]=T[0]<<24|T[1]<<16|T[2]<<8|T[3];l[0]^=2746333894,l[1]^=1453994832,l[2]^=1736282519,l[3]^=2993693404;for(let h=0,F;h<32;h+=4)F=l[1]^l[2]^l[3]^u[h+0],w[h+0]=l[0]^=_(v(F)),F=l[2]^l[3]^l[0]^u[h+1],w[h+1]=l[1]^=_(v(F)),F=l[3]^l[0]^l[1]^u[h+2],w[h+2]=l[2]^=_(v(F)),F=l[0]^l[1]^l[2]^u[h+3],w[h+3]=l[3]^=_(v(F));if(g===t)for(let h=0,F;h<16;h++)F=w[h],w[h]=w[31-h],w[31-h]=F}function q(p,w,g,{padding:l="pkcs#7",mode:T,iv:h=[],output:F="string"}={}){if(T==="cbc"&&(typeof h=="string"&&(h=f(h)),h.length!==128/8))throw new Error("iv is invalid");if(typeof w=="string"&&(w=f(w)),w.length!==128/8)throw new Error("key is invalid");if(typeof p=="string"?g!==t?p=a(p):p=f(p):p=[...p],(l==="pkcs#5"||l==="pkcs#7")&&g!==t){const P=o-p.length%o;for(let z=0;z<P;z++)p.push(P)}const A=new Array(i);R(w,A,g);const M=[];let C=h,L=p.length,D=0;for(;L>=o;){const P=p.slice(D,D+16),z=new Array(16);if(T==="cbc")for(let H=0;H<o;H++)g!==t&&(P[H]^=C[H]);O(P,z,A);for(let H=0;H<o;H++)T==="cbc"&&g===t&&(z[H]^=C[H]),M[D+H]=z[H];T==="cbc"&&(g!==t?C=z:C=P),L-=o,D+=o}if((l==="pkcs#5"||l==="pkcs#7")&&g===t){const P=M.length,z=M[P-1];for(let H=1;H<=z;H++)if(M[P-H]!==z)throw new Error("padding is invalid");M.splice(P-z,z)}return F!=="array"?g!==t?d(M):b(M):M}return It={encrypt(p,w,g){return q(p,w,1,g)},decrypt(p,w,g){return q(p,w,0,g)}},It}var Ot,ne;function wi(){return ne||(ne=1,Ot={sm2:vi(),sm3:yi(),sm4:bi()}),Ot}var ve=wi();const Lt=ve.sm2,Ht=ve.sm4,Ti=(t,i,o="04")=>o+Lt.doEncrypt(t,i),Fi=(t,i,o="04")=>Lt.doDecrypt(t.startsWith(o)?t.slice(2):t,i),Si=(t,i)=>Ht.encrypt(t,i),Ei=(t,i)=>Ht.decrypt(t,i);let ft=[],Bi={consecutiveFrames:0,lastBlinkTime:0},_i={consecutiveFrames:0,lastBlinkTime:0};const Ri=new Map([["nod",[zi,30,100]],["shake",[Pi,7,100]],["mouth",[Ci,.35,100]],["eye",[qi,.3,100]]]),Di=["nod","shake","mouth","eye"],Ai={nod:"请点点头",shake:"请摇摇头",mouth:"请张张嘴",eye:"请眨眨眼"};function re(t,i){if(t.length!==i.length)throw new Error("euclideanDistance: arr1.length !== arr2.length");const o=Array.from(t),s=Array.from(i);return Math.sqrt(o.map((u,f)=>u-s[f]).reduce((u,f)=>u+Math.pow(f,2),0))}function*Ii(t,i,o=8,s=0){for(let u=o;u>0;u--)yield t(i,.5,s)}function pt(t){return[t.x,t.y]}function Mt(t,i){const o=t.x-i.x,s=t.y-i.y;return Math.sqrt(o*o+s*s)}function ie(t){const i=Mt(t[1],t[5]),o=Mt(t[2],t[4]),s=Mt(t[0],t[3]);return(i+o)/(2*s)}function Oi(t){const i=re(pt(t[13]),pt(t[19])),o=re(pt(t[0]),pt(t[6]));return i/o}function Mi(t){const i=t.positions[30],o=t.positions[36],s=t.positions[45],u=(o.x+s.x)/2;return(i.x-u)/(s.x-o.x)*30}function qi(t,i){const o=Date.now(),s=oe(ie(t.getLeftEye()),i,Bi,o),u=oe(ie(t.getRightEye()),i,_i,o);return!!(s||u)}function oe(t,i,o,s){if(t<i)o.consecutiveFrames++;else if(o.consecutiveFrames>=3&&s-o.lastBlinkTime>500)return o.lastBlinkTime=s,o.consecutiveFrames=0,!0;return!1}function Ci(t,i){return Oi(t.getMouth())>i}function Pi(t,i){const o=Mi(t);return Math.abs(o)>i}function zi(t,i){const o=ft.length,s=t.positions[33];if(o<5)ft.push(s.y);else if(o===5){const u=Math.min(...ft);if(Math.max(...ft)-u>i)return!0;ft=[]}return!1}function Li(t,i="blob",o=1){return new Promise(s=>{const u=document.createElement("canvas"),f=u.getContext("2d");u.width=t.videoWidth,u.height=t.videoHeight,f==null||f.drawImage(t,0,0,u.width,u.height),i==="blob"?u.toBlob(d=>{const a=new FileReader;a.onload=()=>s(a.result),a.readAsArrayBuffer(d)},"image/png",o):s(u.toDataURL("image/png",o))})}async function Hi(t,i,o,s=5){const[u,f,d]=Ri.get(o);if(!u)return!1;const a=[],b=Ii(t,i,s,d);for(const m of b){const v=await m;if(!v)continue;const B=u(v.landmarks,f);a.push(B)}return a.includes(!0)}const Ni={DATE_VALUE_FORMAT:Ir,COMMON_TEXT:et,IMAGE_TYPE:ce,MEDIA_TYPE:ue,DOC_TYPE:ae,FILE_TYPE:Mr},Yi={encodeURIToParams:$r,paramsToQueryString:Ur,queryStringToParams:jr,errorCodeToString:qr,YNToString:Cr,HNToString:Pr,valueToLabel:Yr,chargeToLabel:kr,cascaderToLabel:he,multipleSelectToLabel:Vr,phoneToAsterisk:zr,idNumberToAsterisk:Lr,firstLetterToUpperCase:Hr,firstLetterToLowerCase:Nr},ki={validHttp:sr,validExternal:fr,validString:cr,validNumberStr:ur,validEmptyObject:ar,validURL:hr,validPassword:lr,validEmail:dr,validIdNumber:zt,validPhone:gr,validTel:pr},Vi={scrollTo:Gn,addClass:nr,removeClass:rr,hasClass:Pt,toggleClass:er,noContextmenu:or,useRafThrottle:ir},$i={parseTime:xt,getTimeDistance:Xn,getDayRange:Kn},Ui={local:tr,session:Qn},ji={uuid:Wn,randomNum:Jn};exports.CONSTANTS=Ni;exports.NOOP=qt;exports.addResizeListener=li;exports.cacheUtil=Ui;exports.countdownTimer=mr;exports.creatCancelTask=Fr;exports.dateUtil=$i;exports.debounce=yr;exports.downloadFile=Sr;exports.elementUtil=Vi;exports.faceLivingEvent=Di;exports.faceLivingEventHint=Ai;exports.getArrayFullUrl=Tr;exports.getBirthdayByIdNumber=wr;exports.getFaceGestureResult=Hi;exports.getFaceVideoFrame=Li;exports.getFullUrl=se;exports.getGenderByIdNumber=br;exports.getPercentage=Er;exports.getRandomItemInArray=vr;exports.loadCss=Br;exports.loadJs=_r;exports.randomUtil=ji;exports.removeResizeListener=di;exports.sleep=xr;exports.sm2Crypto=Lt;exports.sm2Decrypt=Fi;exports.sm2Encrypt=Ti;exports.sm4Crypto=Ht;exports.sm4Decrypt=Ei;exports.sm4Encrypt=Si;exports.toUtil=Yi;exports.trimArray=fe;exports.validUtil=ki;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $n=(t,i,o,s)=>(t/=s/2,t<1?o/2*t*t+i:(t--,-o/2*(t*(t-2)-1)+i)),Un=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||(t=>window.setTimeout(t,1e3/60));function jn(t,i){if(i){document.querySelector(i).scrollTop=t;return}document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function Zn(t){return t?document.querySelector(t).scrollTop:document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function Gn(t){const{target:i,to:o=0,duration:s=500,callback:u}=t??{},f=Zn(i),d=o-f,a=20;let b=0;const m=function(){b+=a;const v=$n(b,f,d,s);jn(v,i),b<s?Un(m):u&&u()};m()}function Jn(t,i){switch(arguments.length){case 1:return parseInt((Math.random()*t+1).toString(),10);case 2:return parseInt((Math.random()*(i-t+1)+t).toString(),10);default:return 0}}function Wn(){let t="";const i=[];for(let o=0;o<=15;o++)i[o]=o.toString(16);for(let o=1;o<=36;o++)o===9||o===14||o===19||o===24?t+="-":o===15?t+=4:o===20?t+=i[Math.random()*4|8]:t+=i[Math.random()*16|0];return t}function xt(t,i){if(!t)return"-";t.toString().length===10&&(t=+t*1e3),i??(i="YYYY-MM-DD HH:mm:ss");const o=new Date(t),s=(d,a,b=" ")=>{if(d.length>=a)return d;const m=a-d.length;let v=Math.ceil(m/b.length);for(;v>>=1;)b+=b,v===1&&(b+=b);return b.slice(0,m)+d};let u;const f={"Y+":o.getFullYear().toString(),"M+":(o.getMonth()+1).toString(),"D+":o.getDate().toString(),"H+":o.getHours().toString(),"m+":o.getMinutes().toString(),"s+":o.getSeconds().toString()};for(const d in f)u=new RegExp("("+d+")").exec(i),u&&(i=i.replace(u[1],u[1].length==1?f[d]:s(f[d],u[1].length,"0")));return i}function Xn(t,i){`${t}`.length===10?t=parseInt(t+"")*1e3:t=+t;const o=new Date(t),u=(Date.now()-Number(o))/1e3;return u<30?"刚刚":u<3600?`${Math.ceil(u/60)}分钟前`:u<3600*24?`${Math.ceil(u/3600)}小时前`:u<3600*24*2?"1天前":i?xt(t,i):`${o.getMonth()+1}月${o.getDate()}日${o.getHours()}时${o.getMinutes()}分`}function Kn(t){const i=t||new Date,o=new Date(i),s=new Date(i);return o.setHours(0,0,0),s.setHours(23,59,59),{dateRange:[xt(o),xt(s)],timestampRange:[o.getTime(),s.getTime()]}}const Qn={set(t,i){sessionStorage&&t&&i&&sessionStorage.setItem(t,i)},get(t){return!sessionStorage||!t?null:sessionStorage.getItem(t)},setJSON(t,i){i&&this.set(t,JSON.stringify(i))},getJSON(t){const i=this.get(t);return i?JSON.parse(i):null},remove(t){sessionStorage.removeItem(t)},clear(){sessionStorage.clear()}},tr={set(t,i){localStorage&&t&&i&&localStorage.setItem(t,i)},get(t){return!localStorage||!t?null:localStorage.getItem(t)},setJSON(t,i){i&&this.set(t,JSON.stringify(i))},getJSON(t){const i=this.get(t);return i?JSON.parse(i):null},remove(t){localStorage.removeItem(t)},clear(){localStorage.clear()}};function er(t,i){if(!t||!i)return;let o=t.className;const s=o.indexOf(i);s===-1?o+=`${i}`:o=o.substring(0,s)+o.substring(s+i.length),t.className=o}function Pt(t,i){return t.className.match(new RegExp("(?:\\s|^)"+i+"(?:\\s|$)"))}function nr(t,i){Pt(t,i)||(t.className+=` ${i}`)}function rr(t,i){if(Pt(t,i)){const o=new RegExp("(?:\\s|^)"+i+"(?:\\s|$)");t.className=t.className.replace(o," ")}}function ir(t){let i=!1;return function(...o){i||(i=!0,window.requestAnimationFrame(()=>{t.apply(this,o),i=!1}))}}function or(t){t&&(t.oncontextmenu=()=>!1)}function sr(t){return/^(http(s)?:\/\/)/.test(t)}function fr(t){return/^(https?:|mailto:|tel:)/.test(t)}function cr(t){return Object.prototype.toString.call(t)==="[object String]"}function ur(t){return/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t)}function ar(t){return!Object.keys(t).length}function hr(t){return/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t)}function lr(t,i=8){return new RegExp(`^S*(?=S{${i}},})(?=S*d)(?=S*[A-Z])(?=S*[a-z])(?=S*[!@#$%^&*?])S*$`).test(t)}function dr(t){return/^(([^<>()\[\]\\.,;:\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,}))$/.test(t)}function zt(t){return/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(t)}function pr(t){return/^0\d{2,3}-?\d{7,8}$/.test(t)}function gr(t){return/^1[3-9]\d{9}$/.test(t)}const qt=()=>{};function xr(t){return new Promise(i=>setTimeout(i,t))}function mr(t,i){return new Promise(o=>{const s=setInterval(()=>{if(t===0)return clearInterval(s),o(!0),!1;i&&i(t),t--},1e3)})}function vr(t,i){const o=t.slice(),s=[];let u=o.length;const f=[];if(i>u)return null;for(;i--;){const d=Math.floor(Math.random()*u);s[i]=o[d in f?f[d]:d],f[d]=--u in f?f[u]:u}return s}function yr(t,i){let o=null;return function(...s){o!==null&&clearTimeout(o),o=setTimeout(()=>{t.apply(this,s),o=null},i)}}function br(t){if(!zt(t))throw new Error("Please provide a valid ID number!");const i=t.length,o=i===15?t[i-1]:t[i-2];return parseInt(o)%2===1?"1":"2"}function wr(t){if(!zt(t))throw new Error("Please provide a valid ID number!");return t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14)}const se=(t,i="")=>{i||(i=location.origin);const o=new RegExp(/^http(s)?:\/\//),s=new RegExp(/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i);return o.test(t)||s.test(t)?t:i+t},Tr=(t,i="")=>{typeof t=="string"&&(t=t===""?[]:t.split(","));for(const o in t)t[o]=se(t[o],i);return t};function Fr(t){if(!t.length)return;let i=0;function o(){requestIdleCallback(s=>{for(;i<t.length&&s.timeRemaining()>0;)t[i++]();i<t.length&&o()})}o()}function Sr(t){let i=qt;return(...o)=>new Promise((s,u)=>{i(),i=()=>{s=u=qt},t(...o).then(f=>s(f),f=>u(f))})}function Er(t,i){const o=document.createElement("a");o.download=i,o.href=t,o.click()}function fe(t){const i=[];for(let o=0;o<t.length;o++)t[o]&&i.push(t[o]);return i}function Br(t,i,o=!1){let s=Math.round(t/i*1e4)/100;return Number.isNaN(s)&&(s=0),o?Math.floor(s):s}function _r(t){const i=document.createElement("link");i.rel="stylesheet",i.href=t,i.crossOrigin="anonymous",document.getElementsByTagName("head")[0].appendChild(i)}function Rr(t){return new Promise((i,o)=>{const s=document.createElement("script");s.type="text/javascript",s.src=t,s.onload=()=>i(),s.onerror=u=>o(u),document.getElementsByTagName("head")[0].appendChild(s)})}function Dr(t,i=48,o=48){const s=t.replace("#","");return`data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}"><path d="M787.510356 387.850445c0-152.160515-123.350352-275.511891-275.510868-275.511891S236.487597 235.68993 236.487597 387.850445c0 44.665269 10.640338 86.841857 29.507034 124.151601l-0.010233-0.001023 0.059352 0.100284c5.548366 10.962679 11.812023 21.500687 18.723434 31.56081L511.999488 926.678464l227.234351-383.021463c6.909363-10.057053 13.170974-20.593014 18.71934-31.552623l0.062422-0.104377-0.011256 0.002047C776.870018 474.692303 787.510356 432.515714 787.510356 387.850445zM511.999488 506.802628c-74.596975 0-135.070278-60.47228-135.070278-135.070278 0-74.595952 60.47228-135.069255 135.070278-135.069255 74.595952 0 135.069255 60.473303 135.069255 135.069255C647.068743 446.330348 586.59544 506.802628 511.999488 506.802628z" fill="%23${s}"></path></svg>`}const Ar=[["date","YYYY-MM-DD"],["daterange","YYYY-MM-DD"],["datetime","YYYY-MM-DD HH:mm:ss"],["datetimerange","YYYY-MM-DD HH:mm:ss"],["month","YYYY-MM"],["monthrange","YYYY-MM"],["year","YYYY"],["yearrange","YYYY"],["time","HH:mm:ss"]],Ir={view:"查看",add:"添加",edit:"编辑",delete:"删除",save:"保存",reset:"重置",close:"关闭",confirm:"确定",submit:"提交",cancel:"取消",success:"成功",fail:"失败",open:"启用",disable:"禁用",refresh:"刷新",show:"显示",hide:"隐藏",search:"搜索",expand:"展开",collapse:"收起",upload:"上传",download:"下载",copy:"复制",clear:"清除",fuzzyQuery:"模糊查询",ing:"中",loading:"加载中...",select:"请选择",attachment:"附件",icon:"图标",picture:"图片",start:"开始",end:"结束",range:"范围",date:"日期",month:"月份",year:"年份",time:"时间",yes:"是",no:"否",have:"有",noHave:"无",unfilled:"未填写",selectAll:"全选",all:"全部",export:"导出",import:"导入",defaultErrorCode:"系统未知错误,请反馈给管理员"},Mr={400:"请求失败,请您稍后重试!",401:"认证失败,无法访问系统资源!",403:"当前操作没有权限!",404:"你所访问的资源不存在!",405:"请求错误,禁止访问系统资源!",408:"请求超时,请您稍后重试!",500:"服务异常!",502:"网关错误!",503:"服务不可用!",504:"网关超时!"},Or=new Map(Ar),et=Ir,qr=Mr,ce=["jpg","jpeg","png","bmp","gif"],ue=["mp3","mp4","webm","ogg","3gp"],ae=["doc","docx","xls","xlsx","ppt","txt","pdf","zip"],Cr=[...ce,...ue,...ae];function Pr(t){return qr[t]??et.defaultErrorCode}function zr(t){return t==null?et.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?et.yes:et.no)}function Lr(t){return t==null?et.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?et.have:et.noHave)}function Hr(t){return t?t.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):""}function Nr(t,i,o){if(i??(i=4),o??(o=4),t){const s=t.length;return t.substring(0,i)+"*".repeat(s-i-o)+t.substring(s-o)}return""}function Yr(t){return t.replace(/( |^)[a-z]/g,i=>i.toUpperCase())}function kr(t){return t.replace(/( |^)[A-Z]/g,i=>i.toLowerCase())}function Vr(t,i){const o=t.find(s=>s.value===i);return o?o.label:""}function $r(t,i,o){const s=[],u=i.split(","),f=o.split(",");return Array.from(new Set(u)).forEach(a=>{const b=t.find(m=>m.value===a);b&&f.forEach(m=>{var B;const v=(B=b.children)==null?void 0:B.find(_=>_.value===m);v&&s.push(v)})}),s.map(a=>a.label).join()}function he(t,i,o){var f;if(!i)return"";const s=i.split(","),u=o.find(d=>d.value===s[t]);return u?((f=u.children)!=null&&f.length&&he(t+1,i,u.children),u.label):""}function Ur(t,i,o){if(!t)return"";const s=t.split(","),u=[],f=s.length-1,d=s.findIndex(a=>a===o);if(d!==-1){const a=s[f]===o;s.splice(a?0:d,a?f:1)}return s.forEach(a=>{const b=i.find(m=>m.value===a);b&&u.push(b)}),u.map(a=>a.label).join()}function jr(t){let i="";for(const o of Object.keys(t)){const s=t[o],u=`${encodeURIComponent(o)}=`;if(s!==null&&typeof s<"u")if(typeof s=="object"){for(const f of Object.keys(s))if(s[f]!==null&&typeof s[f]<"u"){const d=`${o}[${f}]`,a=`${encodeURIComponent(d)}=`;i+=`${a+encodeURIComponent(s[f])}&`}}else i+=`${u+encodeURIComponent(s)}&`}return i}function Zr(t){return t?fe(Object.keys(t).map(i=>t[i]===void 0?"":`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`)).join("&"):""}function Gr(t){const i=decodeURIComponent(t.split("?")[1]).replace(/\+/g," ");if(!i)return{};const o={};return i.split("&").forEach(u=>{const f=u.indexOf("=");if(f!==-1){const d=u.substring(0,f),a=u.substring(f+1,u.length);o[d]=a}}),o}var le=function(){if(typeof Map<"u")return Map;function t(i,o){var s=-1;return i.some(function(u,f){return u[0]===o?(s=f,!0):!1}),s}return function(){function i(){this.__entries__=[]}return Object.defineProperty(i.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),i.prototype.get=function(o){var s=t(this.__entries__,o),u=this.__entries__[s];return u&&u[1]},i.prototype.set=function(o,s){var u=t(this.__entries__,o);~u?this.__entries__[u][1]=s:this.__entries__.push([o,s])},i.prototype.delete=function(o){var s=this.__entries__,u=t(s,o);~u&&s.splice(u,1)},i.prototype.has=function(o){return!!~t(this.__entries__,o)},i.prototype.clear=function(){this.__entries__.splice(0)},i.prototype.forEach=function(o,s){s===void 0&&(s=null);for(var u=0,f=this.__entries__;u<f.length;u++){var d=f[u];o.call(s,d[1],d[0])}},i}()}(),Ct=typeof window<"u"&&typeof document<"u"&&window.document===document,mt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Jr=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(mt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Wr=2;function Xr(t,i){var o=!1,s=!1,u=0;function f(){o&&(o=!1,t()),s&&a()}function d(){Jr(f)}function a(){var b=Date.now();if(o){if(b-u<Wr)return;s=!0}else o=!0,s=!1,setTimeout(d,i);u=b}return a}var Kr=20,Qr=["top","right","bottom","left","width","height","size","weight"],ti=typeof MutationObserver<"u",ei=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Xr(this.refresh.bind(this),Kr)}return t.prototype.addObserver=function(i){~this.observers_.indexOf(i)||this.observers_.push(i),this.connected_||this.connect_()},t.prototype.removeObserver=function(i){var o=this.observers_,s=o.indexOf(i);~s&&o.splice(s,1),!o.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var i=this.updateObservers_();i&&this.refresh()},t.prototype.updateObservers_=function(){var i=this.observers_.filter(function(o){return o.gatherActive(),o.hasActive()});return i.forEach(function(o){return o.broadcastActive()}),i.length>0},t.prototype.connect_=function(){!Ct||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ti?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!Ct||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(i){var o=i.propertyName,s=o===void 0?"":o,u=Qr.some(function(f){return!!~s.indexOf(f)});u&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),de=function(t,i){for(var o=0,s=Object.keys(i);o<s.length;o++){var u=s[o];Object.defineProperty(t,u,{value:i[u],enumerable:!1,writable:!1,configurable:!0})}return t},ot=function(t){var i=t&&t.ownerDocument&&t.ownerDocument.defaultView;return i||mt},pe=yt(0,0,0,0);function vt(t){return parseFloat(t)||0}function Zt(t){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return i.reduce(function(s,u){var f=t["border-"+u+"-width"];return s+vt(f)},0)}function ni(t){for(var i=["top","right","bottom","left"],o={},s=0,u=i;s<u.length;s++){var f=u[s],d=t["padding-"+f];o[f]=vt(d)}return o}function ri(t){var i=t.getBBox();return yt(0,0,i.width,i.height)}function ii(t){var i=t.clientWidth,o=t.clientHeight;if(!i&&!o)return pe;var s=ot(t).getComputedStyle(t),u=ni(s),f=u.left+u.right,d=u.top+u.bottom,a=vt(s.width),b=vt(s.height);if(s.boxSizing==="border-box"&&(Math.round(a+f)!==i&&(a-=Zt(s,"left","right")+f),Math.round(b+d)!==o&&(b-=Zt(s,"top","bottom")+d)),!si(t)){var m=Math.round(a+f)-i,v=Math.round(b+d)-o;Math.abs(m)!==1&&(a-=m),Math.abs(v)!==1&&(b-=v)}return yt(u.left,u.top,a,b)}var oi=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ot(t).SVGGraphicsElement}:function(t){return t instanceof ot(t).SVGElement&&typeof t.getBBox=="function"}}();function si(t){return t===ot(t).document.documentElement}function fi(t){return Ct?oi(t)?ri(t):ii(t):pe}function ci(t){var i=t.x,o=t.y,s=t.width,u=t.height,f=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,d=Object.create(f.prototype);return de(d,{x:i,y:o,width:s,height:u,top:o,right:i+s,bottom:u+o,left:i}),d}function yt(t,i,o,s){return{x:t,y:i,width:o,height:s}}var ui=function(){function t(i){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=yt(0,0,0,0),this.target=i}return t.prototype.isActive=function(){var i=fi(this.target);return this.contentRect_=i,i.width!==this.broadcastWidth||i.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var i=this.contentRect_;return this.broadcastWidth=i.width,this.broadcastHeight=i.height,i},t}(),ai=function(){function t(i,o){var s=ci(o);de(this,{target:i,contentRect:s})}return t}(),hi=function(){function t(i,o,s){if(this.activeObservations_=[],this.observations_=new le,typeof i!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=i,this.controller_=o,this.callbackCtx_=s}return t.prototype.observe=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof ot(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var o=this.observations_;o.has(i)||(o.set(i,new ui(i)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof ot(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var o=this.observations_;o.has(i)&&(o.delete(i),o.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var i=this;this.clearActive(),this.observations_.forEach(function(o){o.isActive()&&i.activeObservations_.push(o)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var i=this.callbackCtx_,o=this.activeObservations_.map(function(s){return new ai(s.target,s.broadcastRect())});this.callback_.call(i,o,i),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),ge=typeof WeakMap<"u"?new WeakMap:new le,xe=function(){function t(i){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var o=ei.getInstance(),s=new hi(i,o,this);ge.set(this,s)}return t}();["observe","unobserve","disconnect"].forEach(function(t){xe.prototype[t]=function(){var i;return(i=ge.get(this))[t].apply(i,arguments)}});var li=function(){return typeof mt.ResizeObserver<"u"?mt.ResizeObserver:xe}();function di(t){for(const i of t){const o=i.target.__resizeListeners__||[];o.length&&o.forEach(s=>s())}}function pi(t,i){typeof window>"u"||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new li(di),t.__ro__.observe(t)),t.__resizeListeners__.push(i))}function gi(t,i){!t||!t.__resizeListeners__||(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(i),1),t.__resizeListeners__.length||t.__ro__.disconnect())}var gt={exports:{}},xi=gt.exports,Gt;function bt(){return Gt||(Gt=1,function(t,i){(function(){var o,s=0xdeadbeefcafe,u=(s&16777215)==15715070;function f(e,n,r){e!=null&&(typeof e=="number"?this.fromNumber(e,n,r):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function d(){return new f(null)}function a(e,n,r,c,x,y){for(;--y>=0;){var S=n*this[e++]+r[c]+x;x=Math.floor(S/67108864),r[c++]=S&67108863}return x}function b(e,n,r,c,x,y){for(var S=n&32767,E=n>>15;--y>=0;){var N=this[e]&32767,k=this[e++]>>15,Z=E*N+k*S;N=S*N+((Z&32767)<<15)+r[c]+(x&1073741823),x=(N>>>30)+(Z>>>15)+E*k+(x>>>30),r[c++]=N&1073741823}return x}function m(e,n,r,c,x,y){for(var S=n&16383,E=n>>14;--y>=0;){var N=this[e]&16383,k=this[e++]>>14,Z=E*N+k*S;N=S*N+((Z&16383)<<14)+r[c]+x,x=(N>>28)+(Z>>14)+E*k,r[c++]=N&268435455}return x}var v=typeof navigator<"u";v&&u&&navigator.appName=="Microsoft Internet Explorer"?(f.prototype.am=b,o=30):v&&u&&navigator.appName!="Netscape"?(f.prototype.am=a,o=26):(f.prototype.am=m,o=28),f.prototype.DB=o,f.prototype.DM=(1<<o)-1,f.prototype.DV=1<<o;var B=52;f.prototype.FV=Math.pow(2,B),f.prototype.F1=B-o,f.prototype.F2=2*o-B;var _="0123456789abcdefghijklmnopqrstuvwxyz",M=new Array,R,q;for(R=48,q=0;q<=9;++q)M[R++]=q;for(R=97,q=10;q<36;++q)M[R++]=q;for(R=65,q=10;q<36;++q)M[R++]=q;function p(e){return _.charAt(e)}function w(e,n){var r=M[e.charCodeAt(n)];return r??-1}function g(e){for(var n=this.t-1;n>=0;--n)e[n]=this[n];e.t=this.t,e.s=this.s}function l(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function T(e){var n=d();return n.fromInt(e),n}function h(e,n){var r;if(n==16)r=4;else if(n==8)r=3;else if(n==256)r=8;else if(n==2)r=1;else if(n==32)r=5;else if(n==4)r=2;else{this.fromRadix(e,n);return}this.t=0,this.s=0;for(var c=e.length,x=!1,y=0;--c>=0;){var S=r==8?e[c]&255:w(e,c);if(S<0){e.charAt(c)=="-"&&(x=!0);continue}x=!1,y==0?this[this.t++]=S:y+r>this.DB?(this[this.t-1]|=(S&(1<<this.DB-y)-1)<<y,this[this.t++]=S>>this.DB-y):this[this.t-1]|=S<<y,y+=r,y>=this.DB&&(y-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,y>0&&(this[this.t-1]|=(1<<this.DB-y)-1<<y)),this.clamp(),x&&f.ZERO.subTo(this,this)}function F(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function A(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else if(e==4)n=2;else return this.toRadix(e);var r=(1<<n)-1,c,x=!1,y="",S=this.t,E=this.DB-S*this.DB%n;if(S-- >0)for(E<this.DB&&(c=this[S]>>E)>0&&(x=!0,y=p(c));S>=0;)E<n?(c=(this[S]&(1<<E)-1)<<n-E,c|=this[--S]>>(E+=this.DB-n)):(c=this[S]>>(E-=n)&r,E<=0&&(E+=this.DB,--S)),c>0&&(x=!0),x&&(y+=p(c));return x?y:"0"}function O(){var e=d();return f.ZERO.subTo(this,e),e}function C(){return this.s<0?this.negate():this}function L(e){var n=this.s-e.s;if(n!=0)return n;var r=this.t;if(n=r-e.t,n!=0)return this.s<0?-n:n;for(;--r>=0;)if((n=this[r]-e[r])!=0)return n;return 0}function D(e){var n=1,r;return(r=e>>>16)!=0&&(e=r,n+=16),(r=e>>8)!=0&&(e=r,n+=8),(r=e>>4)!=0&&(e=r,n+=4),(r=e>>2)!=0&&(e=r,n+=2),(r=e>>1)!=0&&(e=r,n+=1),n}function P(){return this.t<=0?0:this.DB*(this.t-1)+D(this[this.t-1]^this.s&this.DM)}function z(e,n){var r;for(r=this.t-1;r>=0;--r)n[r+e]=this[r];for(r=e-1;r>=0;--r)n[r]=0;n.t=this.t+e,n.s=this.s}function H(e,n){for(var r=e;r<this.t;++r)n[r-e]=this[r];n.t=Math.max(this.t-e,0),n.s=this.s}function $(e,n){var r=e%this.DB,c=this.DB-r,x=(1<<c)-1,y=Math.floor(e/this.DB),S=this.s<<r&this.DM,E;for(E=this.t-1;E>=0;--E)n[E+y+1]=this[E]>>c|S,S=(this[E]&x)<<r;for(E=y-1;E>=0;--E)n[E]=0;n[y]=S,n.t=this.t+y+1,n.s=this.s,n.clamp()}function K(e,n){n.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){n.t=0;return}var c=e%this.DB,x=this.DB-c,y=(1<<c)-1;n[0]=this[r]>>c;for(var S=r+1;S<this.t;++S)n[S-r-1]|=(this[S]&y)<<x,n[S-r]=this[S]>>c;c>0&&(n[this.t-r-1]|=(this.s&y)<<x),n.t=this.t-r,n.clamp()}function G(e,n){for(var r=0,c=0,x=Math.min(e.t,this.t);r<x;)c+=this[r]-e[r],n[r++]=c&this.DM,c>>=this.DB;if(e.t<this.t){for(c-=e.s;r<this.t;)c+=this[r],n[r++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;r<e.t;)c-=e[r],n[r++]=c&this.DM,c>>=this.DB;c-=e.s}n.s=c<0?-1:0,c<-1?n[r++]=this.DV+c:c>0&&(n[r++]=c),n.t=r,n.clamp()}function it(e,n){var r=this.abs(),c=e.abs(),x=r.t;for(n.t=x+c.t;--x>=0;)n[x]=0;for(x=0;x<c.t;++x)n[x+r.t]=r.am(0,c[x],n,x,0,r.t);n.s=0,n.clamp(),this.s!=e.s&&f.ZERO.subTo(n,n)}function ct(e){for(var n=this.abs(),r=e.t=2*n.t;--r>=0;)e[r]=0;for(r=0;r<n.t-1;++r){var c=n.am(r,n[r],e,2*r,0,1);(e[r+n.t]+=n.am(r+1,2*n[r],e,2*r+1,c,n.t-r-1))>=n.DV&&(e[r+n.t]-=n.DV,e[r+n.t+1]=1)}e.t>0&&(e[e.t-1]+=n.am(r,n[r],e,2*r,0,1)),e.s=0,e.clamp()}function ut(e,n,r){var c=e.abs();if(!(c.t<=0)){var x=this.abs();if(x.t<c.t){n!=null&&n.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=d());var y=d(),S=this.s,E=e.s,N=this.DB-D(c[c.t-1]);N>0?(c.lShiftTo(N,y),x.lShiftTo(N,r)):(c.copyTo(y),x.copyTo(r));var k=y.t,Z=y[k-1];if(Z!=0){var j=Z*(1<<this.F1)+(k>1?y[k-2]>>this.F2:0),Q=this.FV/j,lt=(1<<this.F1)/j,W=1<<this.F2,X=r.t,dt=X-k,tt=n??d();for(y.dlShiftTo(dt,tt),r.compareTo(tt)>=0&&(r[r.t++]=1,r.subTo(tt,r)),f.ONE.dlShiftTo(k,tt),tt.subTo(y,y);y.t<k;)y[y.t++]=0;for(;--dt>=0;){var St=r[--X]==Z?this.DM:Math.floor(r[X]*Q+(r[X-1]+W)*lt);if((r[X]+=y.am(0,St,r,dt,0,k))<St)for(y.dlShiftTo(dt,tt),r.subTo(tt,r);r[X]<--St;)r.subTo(tt,r)}n!=null&&(r.drShiftTo(k,n),S!=E&&f.ZERO.subTo(n,n)),r.t=k,r.clamp(),N>0&&r.rShiftTo(N,r),S<0&&f.ZERO.subTo(r,r)}}}function at(e){var n=d();return this.abs().divRemTo(e,null,n),this.s<0&&n.compareTo(f.ZERO)>0&&e.subTo(n,n),n}function I(e){this.m=e}function ye(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function be(e){return e}function we(e){e.divRemTo(this.m,null,e)}function Te(e,n,r){e.multiplyTo(n,r),this.reduce(r)}function Fe(e,n){e.squareTo(n),this.reduce(n)}I.prototype.convert=ye,I.prototype.revert=be,I.prototype.reduce=we,I.prototype.mulTo=Te,I.prototype.sqrTo=Fe;function Se(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var n=e&3;return n=n*(2-(e&15)*n)&15,n=n*(2-(e&255)*n)&255,n=n*(2-((e&65535)*n&65535))&65535,n=n*(2-e*n%this.DV)%this.DV,n>0?this.DV-n:-n}function nt(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Ee(e){var n=d();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&n.compareTo(f.ZERO)>0&&this.m.subTo(n,n),n}function Be(e){var n=d();return e.copyTo(n),this.reduce(n),n}function _e(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var r=e[n]&32767,c=r*this.mpl+((r*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=n+this.m.t,e[r]+=this.m.am(0,c,e,n,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Re(e,n){e.squareTo(n),this.reduce(n)}function De(e,n,r){e.multiplyTo(n,r),this.reduce(r)}nt.prototype.convert=Ee,nt.prototype.revert=Be,nt.prototype.reduce=_e,nt.prototype.mulTo=De,nt.prototype.sqrTo=Re;function Ae(){return(this.t>0?this[0]&1:this.s)==0}function Ie(e,n){if(e>4294967295||e<1)return f.ONE;var r=d(),c=d(),x=n.convert(this),y=D(e)-1;for(x.copyTo(r);--y>=0;)if(n.sqrTo(r,c),(e&1<<y)>0)n.mulTo(c,x,r);else{var S=r;r=c,c=S}return n.revert(r)}function Me(e,n){var r;return e<256||n.isEven()?r=new I(n):r=new nt(n),this.exp(e,r)}f.prototype.copyTo=g,f.prototype.fromInt=l,f.prototype.fromString=h,f.prototype.clamp=F,f.prototype.dlShiftTo=z,f.prototype.drShiftTo=H,f.prototype.lShiftTo=$,f.prototype.rShiftTo=K,f.prototype.subTo=G,f.prototype.multiplyTo=it,f.prototype.squareTo=ct,f.prototype.divRemTo=ut,f.prototype.invDigit=Se,f.prototype.isEven=Ae,f.prototype.exp=Ie,f.prototype.toString=A,f.prototype.negate=O,f.prototype.abs=C,f.prototype.compareTo=L,f.prototype.bitLength=P,f.prototype.mod=at,f.prototype.modPowInt=Me,f.ZERO=T(0),f.ONE=T(1);function Oe(){var e=d();return this.copyTo(e),e}function qe(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Ce(){return this.t==0?this.s:this[0]<<24>>24}function Pe(){return this.t==0?this.s:this[0]<<16>>16}function ze(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Le(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function He(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var n=this.chunkSize(e),r=Math.pow(e,n),c=T(r),x=d(),y=d(),S="";for(this.divRemTo(c,x,y);x.signum()>0;)S=(r+y.intValue()).toString(e).substr(1)+S,x.divRemTo(c,x,y);return y.intValue().toString(e)+S}function Ne(e,n){this.fromInt(0),n==null&&(n=10);for(var r=this.chunkSize(n),c=Math.pow(n,r),x=!1,y=0,S=0,E=0;E<e.length;++E){var N=w(e,E);if(N<0){e.charAt(E)=="-"&&this.signum()==0&&(x=!0);continue}S=n*S+N,++y>=r&&(this.dMultiply(c),this.dAddOffset(S,0),y=0,S=0)}y>0&&(this.dMultiply(Math.pow(n,y)),this.dAddOffset(S,0)),x&&f.ZERO.subTo(this,this)}function Ye(e,n,r){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(f.ONE.shiftLeft(e-1),wt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(f.ONE.shiftLeft(e-1),this);else{var c=new Array,x=e&7;c.length=(e>>3)+1,n.nextBytes(c),x>0?c[0]&=(1<<x)-1:c[0]=0,this.fromString(c,256)}}function ke(){var e=this.t,n=new Array;n[0]=this.s;var r=this.DB-e*this.DB%8,c,x=0;if(e-- >0)for(r<this.DB&&(c=this[e]>>r)!=(this.s&this.DM)>>r&&(n[x++]=c|this.s<<this.DB-r);e>=0;)r<8?(c=(this[e]&(1<<r)-1)<<8-r,c|=this[--e]>>(r+=this.DB-8)):(c=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(c&128)!=0&&(c|=-256),x==0&&(this.s&128)!=(c&128)&&++x,(x>0||c!=this.s)&&(n[x++]=c);return n}function Ve(e){return this.compareTo(e)==0}function $e(e){return this.compareTo(e)<0?this:e}function Ue(e){return this.compareTo(e)>0?this:e}function je(e,n,r){var c,x,y=Math.min(e.t,this.t);for(c=0;c<y;++c)r[c]=n(this[c],e[c]);if(e.t<this.t){for(x=e.s&this.DM,c=y;c<this.t;++c)r[c]=n(this[c],x);r.t=this.t}else{for(x=this.s&this.DM,c=y;c<e.t;++c)r[c]=n(x,e[c]);r.t=e.t}r.s=n(this.s,e.s),r.clamp()}function Ze(e,n){return e&n}function Ge(e){var n=d();return this.bitwiseTo(e,Ze,n),n}function wt(e,n){return e|n}function Je(e){var n=d();return this.bitwiseTo(e,wt,n),n}function Nt(e,n){return e^n}function We(e){var n=d();return this.bitwiseTo(e,Nt,n),n}function Yt(e,n){return e&~n}function Xe(e){var n=d();return this.bitwiseTo(e,Yt,n),n}function Ke(){for(var e=d(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e}function Qe(e){var n=d();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n}function tn(e){var n=d();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n}function en(e){if(e==0)return-1;var n=0;return(e&65535)==0&&(e>>=16,n+=16),(e&255)==0&&(e>>=8,n+=8),(e&15)==0&&(e>>=4,n+=4),(e&3)==0&&(e>>=2,n+=2),(e&1)==0&&++n,n}function nn(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+en(this[e]);return this.s<0?this.t*this.DB:-1}function rn(e){for(var n=0;e!=0;)e&=e-1,++n;return n}function on(){for(var e=0,n=this.s&this.DM,r=0;r<this.t;++r)e+=rn(this[r]^n);return e}function sn(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:(this[n]&1<<e%this.DB)!=0}function fn(e,n){var r=f.ONE.shiftLeft(e);return this.bitwiseTo(r,n,r),r}function cn(e){return this.changeBit(e,wt)}function un(e){return this.changeBit(e,Yt)}function an(e){return this.changeBit(e,Nt)}function hn(e,n){for(var r=0,c=0,x=Math.min(e.t,this.t);r<x;)c+=this[r]+e[r],n[r++]=c&this.DM,c>>=this.DB;if(e.t<this.t){for(c+=e.s;r<this.t;)c+=this[r],n[r++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;r<e.t;)c+=e[r],n[r++]=c&this.DM,c>>=this.DB;c+=e.s}n.s=c<0?-1:0,c>0?n[r++]=c:c<-1&&(n[r++]=this.DV+c),n.t=r,n.clamp()}function ln(e){var n=d();return this.addTo(e,n),n}function dn(e){var n=d();return this.subTo(e,n),n}function pn(e){var n=d();return this.multiplyTo(e,n),n}function gn(){var e=d();return this.squareTo(e),e}function xn(e){var n=d();return this.divRemTo(e,n,null),n}function mn(e){var n=d();return this.divRemTo(e,null,n),n}function vn(e){var n=d(),r=d();return this.divRemTo(e,n,r),new Array(n,r)}function yn(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function bn(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}}function st(){}function kt(e){return e}function wn(e,n,r){e.multiplyTo(n,r)}function Tn(e,n){e.squareTo(n)}st.prototype.convert=kt,st.prototype.revert=kt,st.prototype.mulTo=wn,st.prototype.sqrTo=Tn;function Fn(e){return this.exp(e,new st)}function Sn(e,n,r){var c=Math.min(this.t+e.t,n);for(r.s=0,r.t=c;c>0;)r[--c]=0;var x;for(x=r.t-this.t;c<x;++c)r[c+this.t]=this.am(0,e[c],r,c,0,this.t);for(x=Math.min(e.t,n);c<x;++c)this.am(0,e[c],r,c,0,n-c);r.clamp()}function En(e,n,r){--n;var c=r.t=this.t+e.t-n;for(r.s=0;--c>=0;)r[c]=0;for(c=Math.max(n-this.t,0);c<e.t;++c)r[this.t+c-n]=this.am(n-c,e[c],r,0,0,this.t+c-n);r.clamp(),r.drShiftTo(1,r)}function rt(e){this.r2=d(),this.q3=d(),f.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Bn(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=d();return e.copyTo(n),this.reduce(n),n}function _n(e){return e}function Rn(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function Dn(e,n){e.squareTo(n),this.reduce(n)}function An(e,n,r){e.multiplyTo(n,r),this.reduce(r)}rt.prototype.convert=Bn,rt.prototype.revert=_n,rt.prototype.reduce=Rn,rt.prototype.mulTo=An,rt.prototype.sqrTo=Dn;function In(e,n){var r=e.bitLength(),c,x=T(1),y;if(r<=0)return x;r<18?c=1:r<48?c=3:r<144?c=4:r<768?c=5:c=6,r<8?y=new I(n):n.isEven()?y=new rt(n):y=new nt(n);var S=new Array,E=3,N=c-1,k=(1<<c)-1;if(S[1]=y.convert(this),c>1){var Z=d();for(y.sqrTo(S[1],Z);E<=k;)S[E]=d(),y.mulTo(Z,S[E-2],S[E]),E+=2}var j=e.t-1,Q,lt=!0,W=d(),X;for(r=D(e[j])-1;j>=0;){for(r>=N?Q=e[j]>>r-N&k:(Q=(e[j]&(1<<r+1)-1)<<N-r,j>0&&(Q|=e[j-1]>>this.DB+r-N)),E=c;(Q&1)==0;)Q>>=1,--E;if((r-=E)<0&&(r+=this.DB,--j),lt)S[Q].copyTo(x),lt=!1;else{for(;E>1;)y.sqrTo(x,W),y.sqrTo(W,x),E-=2;E>0?y.sqrTo(x,W):(X=x,x=W,W=X),y.mulTo(W,S[Q],x)}for(;j>=0&&(e[j]&1<<r)==0;)y.sqrTo(x,W),X=x,x=W,W=X,--r<0&&(r=this.DB-1,--j)}return y.revert(x)}function Mn(e){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var c=n;n=r,r=c}var x=n.getLowestSetBit(),y=r.getLowestSetBit();if(y<0)return n;for(x<y&&(y=x),y>0&&(n.rShiftTo(y,n),r.rShiftTo(y,r));n.signum()>0;)(x=n.getLowestSetBit())>0&&n.rShiftTo(x,n),(x=r.getLowestSetBit())>0&&r.rShiftTo(x,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r));return y>0&&r.lShiftTo(y,r),r}function On(e){if(e<=0)return 0;var n=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(n==0)r=this[0]%e;else for(var c=this.t-1;c>=0;--c)r=(n*r+this[c])%e;return r}function qn(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return f.ZERO;for(var r=e.clone(),c=this.clone(),x=T(1),y=T(0),S=T(0),E=T(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),n?((!x.isEven()||!y.isEven())&&(x.addTo(this,x),y.subTo(e,y)),x.rShiftTo(1,x)):y.isEven()||y.subTo(e,y),y.rShiftTo(1,y);for(;c.isEven();)c.rShiftTo(1,c),n?((!S.isEven()||!E.isEven())&&(S.addTo(this,S),E.subTo(e,E)),S.rShiftTo(1,S)):E.isEven()||E.subTo(e,E),E.rShiftTo(1,E);r.compareTo(c)>=0?(r.subTo(c,r),n&&x.subTo(S,x),y.subTo(E,y)):(c.subTo(r,c),n&&S.subTo(x,S),E.subTo(y,E))}if(c.compareTo(f.ONE)!=0)return f.ZERO;if(E.compareTo(e)>=0)return E.subtract(e);if(E.signum()<0)E.addTo(e,E);else return E;return E.signum()<0?E.add(e):E}var V=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Cn=(1<<26)/V[V.length-1];function Pn(e){var n,r=this.abs();if(r.t==1&&r[0]<=V[V.length-1]){for(n=0;n<V.length;++n)if(r[0]==V[n])return!0;return!1}if(r.isEven())return!1;for(n=1;n<V.length;){for(var c=V[n],x=n+1;x<V.length&&c<Cn;)c*=V[x++];for(c=r.modInt(c);n<x;)if(c%V[n++]==0)return!1}return r.millerRabin(e)}function zn(e){var n=this.subtract(f.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var c=n.shiftRight(r);e=e+1>>1,e>V.length&&(e=V.length);for(var x=d(),y=0;y<e;++y){x.fromInt(V[Math.floor(Math.random()*V.length)]);var S=x.modPow(c,this);if(S.compareTo(f.ONE)!=0&&S.compareTo(n)!=0){for(var E=1;E++<r&&S.compareTo(n)!=0;)if(S=S.modPowInt(2,this),S.compareTo(f.ONE)==0)return!1;if(S.compareTo(n)!=0)return!1}}return!0}f.prototype.chunkSize=ze,f.prototype.toRadix=He,f.prototype.fromRadix=Ne,f.prototype.fromNumber=Ye,f.prototype.bitwiseTo=je,f.prototype.changeBit=fn,f.prototype.addTo=hn,f.prototype.dMultiply=yn,f.prototype.dAddOffset=bn,f.prototype.multiplyLowerTo=Sn,f.prototype.multiplyUpperTo=En,f.prototype.modInt=On,f.prototype.millerRabin=zn,f.prototype.clone=Oe,f.prototype.intValue=qe,f.prototype.byteValue=Ce,f.prototype.shortValue=Pe,f.prototype.signum=Le,f.prototype.toByteArray=ke,f.prototype.equals=Ve,f.prototype.min=$e,f.prototype.max=Ue,f.prototype.and=Ge,f.prototype.or=Je,f.prototype.xor=We,f.prototype.andNot=Xe,f.prototype.not=Ke,f.prototype.shiftLeft=Qe,f.prototype.shiftRight=tn,f.prototype.getLowestSetBit=nn,f.prototype.bitCount=on,f.prototype.testBit=sn,f.prototype.setBit=cn,f.prototype.clearBit=un,f.prototype.flipBit=an,f.prototype.add=ln,f.prototype.subtract=dn,f.prototype.multiply=pn,f.prototype.divide=xn,f.prototype.remainder=mn,f.prototype.divideAndRemainder=vn,f.prototype.modPow=In,f.prototype.modInverse=qn,f.prototype.pow=Fn,f.prototype.gcd=Mn,f.prototype.isProbablePrime=Pn,f.prototype.square=gn,f.prototype.Barrett=rt;var ht,U,Y;function Ln(e){U[Y++]^=e&255,U[Y++]^=e>>8&255,U[Y++]^=e>>16&255,U[Y++]^=e>>24&255,Y>=Ft&&(Y-=Ft)}function Vt(){Ln(new Date().getTime())}if(U==null){U=new Array,Y=0;var J;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var $t=new Uint8Array(32);for(window.crypto.getRandomValues($t),J=0;J<32;++J)U[Y++]=$t[J]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Ut=window.crypto.random(32);for(J=0;J<Ut.length;++J)U[Y++]=Ut.charCodeAt(J)&255}}for(;Y<Ft;)J=Math.floor(65536*Math.random()),U[Y++]=J>>>8,U[Y++]=J&255;Y=0,Vt()}function Hn(){if(ht==null){for(Vt(),ht=Vn(),ht.init(U),Y=0;Y<U.length;++Y)U[Y]=0;Y=0}return ht.next()}function Nn(e){var n;for(n=0;n<e.length;++n)e[n]=Hn()}function jt(){}jt.prototype.nextBytes=Nn;function Tt(){this.i=0,this.j=0,this.S=new Array}function Yn(e){var n,r,c;for(n=0;n<256;++n)this.S[n]=n;for(r=0,n=0;n<256;++n)r=r+this.S[n]+e[n%e.length]&255,c=this.S[n],this.S[n]=this.S[r],this.S[r]=c;this.i=0,this.j=0}function kn(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}Tt.prototype.init=Yn,Tt.prototype.next=kn;function Vn(){return new Tt}var Ft=256;t.exports={default:f,BigInteger:f,SecureRandom:jt}}).call(xi)}(gt)),gt.exports}var Et,Jt;function mi(){if(Jt)return Et;Jt=1;const{BigInteger:t}=bt();function i(b){let m=b.toString(16);if(m[0]!=="-")m.length%2===1?m="0"+m:m.match(/^[0-7]/)||(m="00"+m);else{m=m.substr(1);let v=m.length;v%2===1?v+=1:m.match(/^[0-7]/)||(v+=2);let B="";for(let _=0;_<v;_++)B+="f";B=new t(B,16),m=B.xor(b).add(t.ONE),m=m.toString(16).replace(/^-/,"")}return m}class o{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const m=this.v.length/2;let v=m.toString(16);return v.length%2===1&&(v="0"+v),m<128?v:(128+v.length/2).toString(16)+v}getValue(){return""}}class s extends o{constructor(m){super(),this.t="02",m&&(this.v=i(m))}getValue(){return this.v}}class u extends o{constructor(m){super(),this.t="30",this.asn1Array=m}getValue(){return this.v=this.asn1Array.map(m=>m.getEncodedHex()).join(""),this.v}}function f(b,m){return+b[m+2]<8?1:+b.substr(m+2,2)&128}function d(b,m){const v=f(b,m),B=b.substr(m+2,v*2);return B?(+B[0]<8?new t(B,16):new t(B.substr(2),16)).intValue():-1}function a(b,m){const v=f(b,m);return m+(v+1)*2}return Et={encodeDer(b,m){const v=new s(b),B=new s(m);return new u([v,B]).getEncodedHex()},decodeDer(b){const m=a(b,0),v=a(b,m),B=d(b,m),_=b.substr(v,B*2),M=v+_.length,R=a(b,M),q=d(b,M),p=b.substr(R,q*2),w=new t(_,16),g=new t(p,16);return{r:w,s:g}}},Et}var Bt,Wt;function vi(){if(Wt)return Bt;Wt=1;const{BigInteger:t}=bt(),i=new t("2"),o=new t("3");class s{constructor(a,b){this.x=b,this.q=a}equals(a){return a===this?!0:this.q.equals(a.q)&&this.x.equals(a.x)}toBigInteger(){return this.x}negate(){return new s(this.q,this.x.negate().mod(this.q))}add(a){return new s(this.q,this.x.add(a.toBigInteger()).mod(this.q))}subtract(a){return new s(this.q,this.x.subtract(a.toBigInteger()).mod(this.q))}multiply(a){return new s(this.q,this.x.multiply(a.toBigInteger()).mod(this.q))}divide(a){return new s(this.q,this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new s(this.q,this.x.square().mod(this.q))}}class u{constructor(a,b,m,v){this.curve=a,this.x=b,this.y=m,this.z=v??t.ONE,this.zinv=null}getX(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(a){return a===this?!0:this.isInfinity()?a.isInfinity():a.isInfinity()?this.isInfinity():a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(t.ZERO)?a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(t.ZERO):!1}isInfinity(){return this.x===null&&this.y===null?!0:this.z.equals(t.ZERO)&&!this.y.toBigInteger().equals(t.ZERO)}negate(){return new u(this.curve,this.x,this.y.negate(),this.z)}add(a){if(this.isInfinity())return a;if(a.isInfinity())return this;const b=this.x.toBigInteger(),m=this.y.toBigInteger(),v=this.z,B=a.x.toBigInteger(),_=a.y.toBigInteger(),M=a.z,R=this.curve.q,q=b.multiply(M).mod(R),p=B.multiply(v).mod(R),w=q.subtract(p),g=m.multiply(M).mod(R),l=_.multiply(v).mod(R),T=g.subtract(l);if(t.ZERO.equals(w))return t.ZERO.equals(T)?this.twice():this.curve.infinity;const h=q.add(p),F=v.multiply(M).mod(R),A=w.square().mod(R),O=w.multiply(A).mod(R),C=F.multiply(T.square()).subtract(h.multiply(A)).mod(R),L=w.multiply(C).mod(R),D=T.multiply(A.multiply(q).subtract(C)).subtract(g.multiply(O)).mod(R),P=O.multiply(F).mod(R);return new u(this.curve,this.curve.fromBigInteger(L),this.curve.fromBigInteger(D),P)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const a=this.x.toBigInteger(),b=this.y.toBigInteger(),m=this.z,v=this.curve.q,B=this.curve.a.toBigInteger(),_=a.square().multiply(o).add(B.multiply(m.square())).mod(v),M=b.shiftLeft(1).multiply(m).mod(v),R=b.square().mod(v),q=R.multiply(a).multiply(m).mod(v),p=M.square().mod(v),w=_.square().subtract(q.shiftLeft(3)).mod(v),g=M.multiply(w).mod(v),l=_.multiply(q.shiftLeft(2).subtract(w)).subtract(p.shiftLeft(1).multiply(R)).mod(v),T=M.multiply(p).mod(v);return new u(this.curve,this.curve.fromBigInteger(g),this.curve.fromBigInteger(l),T)}multiply(a){if(this.isInfinity())return this;if(!a.signum())return this.curve.infinity;const b=a.multiply(o),m=this.negate();let v=this;for(let B=b.bitLength()-2;B>0;B--){v=v.twice();const _=b.testBit(B),M=a.testBit(B);_!==M&&(v=v.add(_?this:m))}return v}}class f{constructor(a,b,m){this.q=a,this.a=this.fromBigInteger(b),this.b=this.fromBigInteger(m),this.infinity=new u(this,null,null)}equals(a){return a===this?!0:this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b)}fromBigInteger(a){return new s(this.q,a)}decodePointHex(a){switch(parseInt(a.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const b=this.fromBigInteger(new t(a.substr(2),16));let m=this.fromBigInteger(b.multiply(b.square()).add(b.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new t("4")).add(t.ONE),this.q));return m.toBigInteger().mod(i).equals(new t(a.substr(0,2),16).subtract(i))||(m=m.negate()),new u(this,b,m);case 4:case 6:case 7:const v=(a.length-2)/2,B=a.substr(2,v),_=a.substr(v+2,v);return new u(this,this.fromBigInteger(new t(B,16)),this.fromBigInteger(new t(_,16)));default:return null}}}return Bt={ECPointFp:u,ECCurveFp:f},Bt}var _t,Xt;function yi(){if(Xt)return _t;Xt=1;const{BigInteger:t,SecureRandom:i}=bt(),{ECCurveFp:o}=vi(),s=new i,{curve:u,G:f,n:d}=b();function a(){return u}function b(){const g=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),l=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),T=new t("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),h=new o(g,l,T),O=h.decodePointHex("04"+"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7"+"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),C=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16);return{curve:h,G:O,n:C}}function m(g,l,T){const F=(g?new t(g,l,T):new t(d.bitLength(),s)).mod(d.subtract(t.ONE)).add(t.ONE),A=_(F.toString(16),64),O=f.multiply(F),C=_(O.getX().toBigInteger().toString(16),64),L=_(O.getY().toBigInteger().toString(16),64),D="04"+C+L;return{privateKey:A,publicKey:D}}function v(g){if(g.length!==130)throw new Error("Invalid public key to compress");const l=(g.length-2)/2,T=g.substr(2,l),h=new t(g.substr(l+2,l),16);let F="03";return h.mod(new t("2")).equals(t.ZERO)&&(F="02"),F+T}function B(g){g=unescape(encodeURIComponent(g));const l=g.length,T=[];for(let F=0;F<l;F++)T[F>>>2]|=(g.charCodeAt(F)&255)<<24-F%4*8;const h=[];for(let F=0;F<l;F++){const A=T[F>>>2]>>>24-F%4*8&255;h.push((A>>>4).toString(16)),h.push((A&15).toString(16))}return h.join("")}function _(g,l){return g.length>=l?g:new Array(l-g.length+1).join("0")+g}function M(g){return g.map(l=>(l=l.toString(16),l.length===1?"0"+l:l)).join("")}function R(g){const l=[];let T=0;for(let h=0;h<g.length*2;h+=2)l[h>>>3]|=parseInt(g[T],10)<<24-h%8*4,T++;try{const h=[];for(let F=0;F<g.length;F++){const A=l[F>>>2]>>>24-F%4*8&255;h.push(String.fromCharCode(A))}return decodeURIComponent(escape(h.join("")))}catch{throw new Error("Malformed UTF-8 data")}}function q(g){const l=[];let T=g.length;T%2!==0&&(g=_(g,T+1)),T=g.length;for(let h=0;h<T;h+=2)l.push(parseInt(g.substr(h,2),16));return l}function p(g){const l=u.decodePointHex(g);if(!l)return!1;const T=l.getX();return l.getY().square().equals(T.multiply(T.square()).add(T.multiply(u.a)).add(u.b))}function w(g,l){const T=u.decodePointHex(g);if(!T)return!1;const h=u.decodePointHex(l);return h?T.equals(h):!1}return _t={getGlobalCurve:a,generateEcparam:b,generateKeyPairHex:m,compressPublicKeyHex:v,utf8ToHex:B,leftPad:_,arrayToHex:M,arrayToUtf8:R,hexToArray:q,verifyPublicKey:p,comparePublicKeyHex:w},_t}var Rt,Kt;function me(){if(Kt)return Rt;Kt=1;const t=new Uint32Array(68),i=new Uint32Array(64);function o(B,_){const M=_&31;return B<<M|B>>>32-M}function s(B,_){const M=[];for(let R=B.length-1;R>=0;R--)M[R]=(B[R]^_[R])&255;return M}function u(B){return B^o(B,9)^o(B,17)}function f(B){return B^o(B,15)^o(B,23)}function d(B){let _=B.length*8,M=_%512;M=M>=448?512-M%448-1:448-M-1;const R=new Array((M-7)/8),q=new Array(8);for(let h=0,F=R.length;h<F;h++)R[h]=0;for(let h=0,F=q.length;h<F;h++)q[h]=0;_=_.toString(2);for(let h=7;h>=0;h--)if(_.length>8){const F=_.length-8;q[h]=parseInt(_.substr(F),2),_=_.substr(0,F)}else _.length>0&&(q[h]=parseInt(_,2),_="");const p=new Uint8Array([...B,128,...R,...q]),w=new DataView(p.buffer,0),g=p.length/64,l=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let h=0;h<g;h++){t.fill(0),i.fill(0);const F=16*h;for(let I=0;I<16;I++)t[I]=w.getUint32((F+I)*4,!1);for(let I=16;I<68;I++)t[I]=f(t[I-16]^t[I-9]^o(t[I-3],15))^o(t[I-13],7)^t[I-6];for(let I=0;I<64;I++)i[I]=t[I]^t[I+4];const A=2043430169,O=2055708042;let C=l[0],L=l[1],D=l[2],P=l[3],z=l[4],H=l[5],$=l[6],K=l[7],G,it,ct,ut,at;for(let I=0;I<64;I++)at=I>=0&&I<=15?A:O,G=o(o(C,12)+z+o(at,I),7),it=G^o(C,12),ct=(I>=0&&I<=15?C^L^D:C&L|C&D|L&D)+P+it+i[I],ut=(I>=0&&I<=15?z^H^$:z&H|~z&$)+K+G+t[I],P=D,D=o(L,9),L=C,C=ct,K=$,$=o(H,19),H=z,z=u(ut);l[0]^=C,l[1]^=L,l[2]^=D,l[3]^=P,l[4]^=z,l[5]^=H,l[6]^=$,l[7]^=K}const T=[];for(let h=0,F=l.length;h<F;h++){const A=l[h];T.push((A&4278190080)>>>24,(A&16711680)>>>16,(A&65280)>>>8,A&255)}return T}const a=64,b=new Uint8Array(a),m=new Uint8Array(a);for(let B=0;B<a;B++)b[B]=54,m[B]=92;function v(B,_){for(_.length>a&&(_=d(_));_.length<a;)_.push(0);const M=s(_,b),R=s(_,m),q=d([...M,...B]);return d([...R,...q])}return Rt={sm3:d,hmac:v},Rt}var Dt,Qt;function bi(){if(Qt)return Dt;Qt=1;const{BigInteger:t}=bt(),{encodeDer:i,decodeDer:o}=mi(),s=yi(),u=me().sm3,{G:f,curve:d,n:a}=s.generateEcparam(),b=0;function m(p,w,g=1){p=typeof p=="string"?s.hexToArray(s.utf8ToHex(p)):Array.prototype.slice.call(p),w=s.getGlobalCurve().decodePointHex(w);const l=s.generateKeyPairHex(),T=new t(l.privateKey,16);let h=l.publicKey;h.length>128&&(h=h.substr(h.length-128));const F=w.multiply(T),A=s.hexToArray(s.leftPad(F.getX().toBigInteger().toRadix(16),64)),O=s.hexToArray(s.leftPad(F.getY().toBigInteger().toRadix(16),64)),C=s.arrayToHex(u([].concat(A,p,O)));let L=1,D=0,P=[];const z=[].concat(A,O),H=()=>{P=u([...z,L>>24&255,L>>16&255,L>>8&255,L&255]),L++,D=0};H();for(let K=0,G=p.length;K<G;K++)D===P.length&&H(),p[K]^=P[D++]&255;const $=s.arrayToHex(p);return g===b?h+$+C:h+C+$}function v(p,w,g=1,{output:l="string"}={}){w=new t(w,16);let T=p.substr(128,64),h=p.substr(192);g===b&&(T=p.substr(p.length-64),h=p.substr(128,p.length-128-64));const F=s.hexToArray(h),O=s.getGlobalCurve().decodePointHex("04"+p.substr(0,128)).multiply(w),C=s.hexToArray(s.leftPad(O.getX().toBigInteger().toRadix(16),64)),L=s.hexToArray(s.leftPad(O.getY().toBigInteger().toRadix(16),64));let D=1,P=0,z=[];const H=[].concat(C,L),$=()=>{z=u([...H,D>>24&255,D>>16&255,D>>8&255,D&255]),D++,P=0};$();for(let G=0,it=F.length;G<it;G++)P===z.length&&$(),F[G]^=z[P++]&255;return s.arrayToHex(u([].concat(C,F,L)))===T.toLowerCase()?l==="array"?F:s.arrayToUtf8(F):l==="array"?[]:""}function B(p,w,{pointPool:g,der:l,hash:T,publicKey:h,userId:F}={}){let A=typeof p=="string"?s.utf8ToHex(p):s.arrayToHex(p);T&&(h=h||R(w),A=M(A,h,F));const O=new t(w,16),C=new t(A,16);let L=null,D=null,P=null;do{do{let z;g&&g.length?z=g.pop():z=q(),L=z.k,D=C.add(z.x1).mod(a)}while(D.equals(t.ZERO)||D.add(L).equals(a));P=O.add(t.ONE).modInverse(a).multiply(L.subtract(D.multiply(O))).mod(a)}while(P.equals(t.ZERO));return l?i(D,P):s.leftPad(D.toString(16),64)+s.leftPad(P.toString(16),64)}function _(p,w,g,{der:l,hash:T,userId:h}={}){let F=typeof p=="string"?s.utf8ToHex(p):s.arrayToHex(p);T&&(F=M(F,g,h));let A,O;if(l){const H=o(w);A=H.r,O=H.s}else A=new t(w.substring(0,64),16),O=new t(w.substring(64),16);const C=d.decodePointHex(g),L=new t(F,16),D=A.add(O).mod(a);if(D.equals(t.ZERO))return!1;const P=f.multiply(O).add(C.multiply(D)),z=L.add(P.getX().toBigInteger()).mod(a);return A.equals(z)}function M(p,w,g="1234567812345678"){g=s.utf8ToHex(g);const l=s.leftPad(f.curve.a.toBigInteger().toRadix(16),64),T=s.leftPad(f.curve.b.toBigInteger().toRadix(16),64),h=s.leftPad(f.getX().toBigInteger().toRadix(16),64),F=s.leftPad(f.getY().toBigInteger().toRadix(16),64);let A,O;if(w.length===128)A=w.substr(0,64),O=w.substr(64,64);else{const P=f.curve.decodePointHex(w);A=s.leftPad(P.getX().toBigInteger().toRadix(16),64),O=s.leftPad(P.getY().toBigInteger().toRadix(16),64)}const C=s.hexToArray(g+l+T+h+F+A+O),L=g.length*4;C.unshift(L&255),C.unshift(L>>8&255);const D=u(C);return s.arrayToHex(u(D.concat(s.hexToArray(p))))}function R(p){const w=f.multiply(new t(p,16)),g=s.leftPad(w.getX().toBigInteger().toString(16),64),l=s.leftPad(w.getY().toBigInteger().toString(16),64);return"04"+g+l}function q(){const p=s.generateKeyPairHex(),w=d.decodePointHex(p.publicKey);return p.k=new t(p.privateKey,16),p.x1=w.getX().toBigInteger(),p}return Dt={generateKeyPairHex:s.generateKeyPairHex,compressPublicKeyHex:s.compressPublicKeyHex,comparePublicKeyHex:s.comparePublicKeyHex,doEncrypt:m,doDecrypt:v,doSignature:B,doVerifySignature:_,getPublicKeyFromPrivateKey:R,getPoint:q,verifyPublicKey:s.verifyPublicKey},Dt}var At,te;function wi(){if(te)return At;te=1;const{sm3:t,hmac:i}=me();function o(d,a){return d.length>=a?d:new Array(a-d.length+1).join("0")+d}function s(d){return d.map(a=>(a=a.toString(16),a.length===1?"0"+a:a)).join("")}function u(d){const a=[];let b=d.length;b%2!==0&&(d=o(d,b+1)),b=d.length;for(let m=0;m<b;m+=2)a.push(parseInt(d.substr(m,2),16));return a}function f(d){const a=[];for(let b=0,m=d.length;b<m;b++){const v=d.codePointAt(b);if(v<=127)a.push(v);else if(v<=2047)a.push(192|v>>>6),a.push(128|v&63);else if(v<=55295||v>=57344&&v<=65535)a.push(224|v>>>12),a.push(128|v>>>6&63),a.push(128|v&63);else if(v>=65536&&v<=1114111)b++,a.push(240|v>>>18&28),a.push(128|v>>>12&63),a.push(128|v>>>6&63),a.push(128|v&63);else throw a.push(v),new Error("input is not supported")}return a}return At=function(d,a){if(d=typeof d=="string"?f(d):Array.prototype.slice.call(d),a){if((a.mode||"hmac")!=="hmac")throw new Error("invalid mode");let m=a.key;if(!m)throw new Error("invalid key");return m=typeof m=="string"?u(m):Array.prototype.slice.call(m),s(i(d,m))}return s(t(d))},At}var It,ee;function Ti(){if(ee)return It;ee=1;const t=0,i=32,o=16,s=[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],u=[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 f(p){const w=[];for(let g=0,l=p.length;g<l;g+=2)w.push(parseInt(p.substr(g,2),16));return w}function d(p){return p.map(w=>(w=w.toString(16),w.length===1?"0"+w:w)).join("")}function a(p){const w=[];for(let g=0,l=p.length;g<l;g++){const T=p.codePointAt(g);if(T<=127)w.push(T);else if(T<=2047)w.push(192|T>>>6),w.push(128|T&63);else if(T<=55295||T>=57344&&T<=65535)w.push(224|T>>>12),w.push(128|T>>>6&63),w.push(128|T&63);else if(T>=65536&&T<=1114111)g++,w.push(240|T>>>18&28),w.push(128|T>>>12&63),w.push(128|T>>>6&63),w.push(128|T&63);else throw w.push(T),new Error("input is not supported")}return w}function b(p){const w=[];for(let g=0,l=p.length;g<l;g++)p[g]>=240&&p[g]<=247?(w.push(String.fromCodePoint(((p[g]&7)<<18)+((p[g+1]&63)<<12)+((p[g+2]&63)<<6)+(p[g+3]&63))),g+=3):p[g]>=224&&p[g]<=239?(w.push(String.fromCodePoint(((p[g]&15)<<12)+((p[g+1]&63)<<6)+(p[g+2]&63))),g+=2):p[g]>=192&&p[g]<=223?(w.push(String.fromCodePoint(((p[g]&31)<<6)+(p[g+1]&63))),g++):w.push(String.fromCodePoint(p[g]));return w.join("")}function m(p,w){const g=w&31;return p<<g|p>>>32-g}function v(p){return(s[p>>>24&255]&255)<<24|(s[p>>>16&255]&255)<<16|(s[p>>>8&255]&255)<<8|s[p&255]&255}function B(p){return p^m(p,2)^m(p,10)^m(p,18)^m(p,24)}function _(p){return p^m(p,13)^m(p,23)}function M(p,w,g){const l=new Array(4),T=new Array(4);for(let h=0;h<4;h++)T[0]=p[4*h]&255,T[1]=p[4*h+1]&255,T[2]=p[4*h+2]&255,T[3]=p[4*h+3]&255,l[h]=T[0]<<24|T[1]<<16|T[2]<<8|T[3];for(let h=0,F;h<32;h+=4)F=l[1]^l[2]^l[3]^g[h+0],l[0]^=B(v(F)),F=l[2]^l[3]^l[0]^g[h+1],l[1]^=B(v(F)),F=l[3]^l[0]^l[1]^g[h+2],l[2]^=B(v(F)),F=l[0]^l[1]^l[2]^g[h+3],l[3]^=B(v(F));for(let h=0;h<16;h+=4)w[h]=l[3-h/4]>>>24&255,w[h+1]=l[3-h/4]>>>16&255,w[h+2]=l[3-h/4]>>>8&255,w[h+3]=l[3-h/4]&255}function R(p,w,g){const l=new Array(4),T=new Array(4);for(let h=0;h<4;h++)T[0]=p[0+4*h]&255,T[1]=p[1+4*h]&255,T[2]=p[2+4*h]&255,T[3]=p[3+4*h]&255,l[h]=T[0]<<24|T[1]<<16|T[2]<<8|T[3];l[0]^=2746333894,l[1]^=1453994832,l[2]^=1736282519,l[3]^=2993693404;for(let h=0,F;h<32;h+=4)F=l[1]^l[2]^l[3]^u[h+0],w[h+0]=l[0]^=_(v(F)),F=l[2]^l[3]^l[0]^u[h+1],w[h+1]=l[1]^=_(v(F)),F=l[3]^l[0]^l[1]^u[h+2],w[h+2]=l[2]^=_(v(F)),F=l[0]^l[1]^l[2]^u[h+3],w[h+3]=l[3]^=_(v(F));if(g===t)for(let h=0,F;h<16;h++)F=w[h],w[h]=w[31-h],w[31-h]=F}function q(p,w,g,{padding:l="pkcs#7",mode:T,iv:h=[],output:F="string"}={}){if(T==="cbc"&&(typeof h=="string"&&(h=f(h)),h.length!==128/8))throw new Error("iv is invalid");if(typeof w=="string"&&(w=f(w)),w.length!==128/8)throw new Error("key is invalid");if(typeof p=="string"?g!==t?p=a(p):p=f(p):p=[...p],(l==="pkcs#5"||l==="pkcs#7")&&g!==t){const P=o-p.length%o;for(let z=0;z<P;z++)p.push(P)}const A=new Array(i);R(w,A,g);const O=[];let C=h,L=p.length,D=0;for(;L>=o;){const P=p.slice(D,D+16),z=new Array(16);if(T==="cbc")for(let H=0;H<o;H++)g!==t&&(P[H]^=C[H]);M(P,z,A);for(let H=0;H<o;H++)T==="cbc"&&g===t&&(z[H]^=C[H]),O[D+H]=z[H];T==="cbc"&&(g!==t?C=z:C=P),L-=o,D+=o}if((l==="pkcs#5"||l==="pkcs#7")&&g===t){const P=O.length,z=O[P-1];for(let H=1;H<=z;H++)if(O[P-H]!==z)throw new Error("padding is invalid");O.splice(P-z,z)}return F!=="array"?g!==t?d(O):b(O):O}return It={encrypt(p,w,g){return q(p,w,1,g)},decrypt(p,w,g){return q(p,w,0,g)}},It}var Mt,ne;function Fi(){return ne||(ne=1,Mt={sm2:bi(),sm3:wi(),sm4:Ti()}),Mt}var ve=Fi();const Lt=ve.sm2,Ht=ve.sm4,Si=(t,i,o="04")=>o+Lt.doEncrypt(t,i),Ei=(t,i,o="04")=>Lt.doDecrypt(t.startsWith(o)?t.slice(2):t,i),Bi=(t,i)=>Ht.encrypt(t,i),_i=(t,i)=>Ht.decrypt(t,i);let ft=[],Ri={consecutiveFrames:0,lastBlinkTime:0},Di={consecutiveFrames:0,lastBlinkTime:0};const Ai=new Map([["nod",[Hi,30,100]],["shake",[Li,7,100]],["mouth",[zi,.35,100]],["eye",[Pi,.3,100]]]),Ii=["nod","shake","mouth","eye"],Mi={nod:"请点点头",shake:"请摇摇头",mouth:"请张张嘴",eye:"请眨眨眼"};function re(t,i){if(t.length!==i.length)throw new Error("euclideanDistance: arr1.length !== arr2.length");const o=Array.from(t),s=Array.from(i);return Math.sqrt(o.map((u,f)=>u-s[f]).reduce((u,f)=>u+Math.pow(f,2),0))}function*Oi(t,i,o=8,s=0){for(let u=o;u>0;u--)yield t(i,.5,s)}function pt(t){return[t.x,t.y]}function Ot(t,i){const o=t.x-i.x,s=t.y-i.y;return Math.sqrt(o*o+s*s)}function ie(t){const i=Ot(t[1],t[5]),o=Ot(t[2],t[4]),s=Ot(t[0],t[3]);return(i+o)/(2*s)}function qi(t){const i=re(pt(t[13]),pt(t[19])),o=re(pt(t[0]),pt(t[6]));return i/o}function Ci(t){const i=t.positions[30],o=t.positions[36],s=t.positions[45],u=(o.x+s.x)/2;return(i.x-u)/(s.x-o.x)*30}function Pi(t,i){const o=Date.now(),s=oe(ie(t.getLeftEye()),i,Ri,o),u=oe(ie(t.getRightEye()),i,Di,o);return!!(s||u)}function oe(t,i,o,s){if(t<i)o.consecutiveFrames++;else if(o.consecutiveFrames>=3&&s-o.lastBlinkTime>500)return o.lastBlinkTime=s,o.consecutiveFrames=0,!0;return!1}function zi(t,i){return qi(t.getMouth())>i}function Li(t,i){const o=Ci(t);return Math.abs(o)>i}function Hi(t,i){const o=ft.length,s=t.positions[33];if(o<5)ft.push(s.y);else if(o===5){const u=Math.min(...ft);if(Math.max(...ft)-u>i)return!0;ft=[]}return!1}function Ni(t,i="blob",o=1){return new Promise(s=>{const u=document.createElement("canvas"),f=u.getContext("2d");u.width=t.videoWidth,u.height=t.videoHeight,f==null||f.drawImage(t,0,0,u.width,u.height),i==="blob"?u.toBlob(d=>{const a=new FileReader;a.onload=()=>s(a.result),a.readAsArrayBuffer(d)},"image/png",o):s(u.toDataURL("image/png",o))})}async function Yi(t,i,o,s=5){const[u,f,d]=Ai.get(o);if(!u)return!1;const a=[],b=Oi(t,i,s,d);for(const m of b){const v=await m;if(!v)continue;const B=u(v.landmarks,f);a.push(B)}return a.includes(!0)}const ki={DATE_VALUE_FORMAT:Or,COMMON_TEXT:et,IMAGE_TYPE:ce,MEDIA_TYPE:ue,DOC_TYPE:ae,FILE_TYPE:Cr},Vi={encodeURIToParams:jr,paramsToQueryString:Zr,queryStringToParams:Gr,errorCodeToString:Pr,YNToString:zr,HNToString:Lr,valueToLabel:Vr,chargeToLabel:$r,cascaderToLabel:he,multipleSelectToLabel:Ur,phoneToAsterisk:Hr,idNumberToAsterisk:Nr,firstLetterToUpperCase:Yr,firstLetterToLowerCase:kr},$i={validHttp:sr,validExternal:fr,validString:cr,validNumberStr:ur,validEmptyObject:ar,validURL:hr,validPassword:lr,validEmail:dr,validIdNumber:zt,validPhone:gr,validTel:pr},Ui={scrollTo:Gn,addClass:nr,removeClass:rr,hasClass:Pt,toggleClass:er,noContextmenu:or,useRafThrottle:ir},ji={parseTime:xt,getTimeDistance:Xn,getDayRange:Kn},Zi={local:tr,session:Qn},Gi={uuid:Wn,randomNum:Jn};exports.CONSTANTS=ki;exports.NOOP=qt;exports.addResizeListener=pi;exports.cacheUtil=Zi;exports.countdownTimer=mr;exports.creatCancelTask=Sr;exports.dateUtil=ji;exports.debounce=yr;exports.downloadFile=Er;exports.elementUtil=Ui;exports.faceLivingEvent=Ii;exports.faceLivingEventHint=Mi;exports.getArrayFullUrl=Tr;exports.getBirthdayByIdNumber=wr;exports.getFaceGestureResult=Yi;exports.getFaceVideoFrame=Ni;exports.getFullUrl=se;exports.getGenderByIdNumber=br;exports.getMapLocationIcon=Dr;exports.getPercentage=Br;exports.getRandomItemInArray=vr;exports.loadCss=_r;exports.loadJs=Rr;exports.randomUtil=Gi;exports.removeResizeListener=gi;exports.ricTask=Fr;exports.sleep=xr;exports.sm2Crypto=Lt;exports.sm2Decrypt=Ei;exports.sm2Encrypt=Si;exports.sm4Crypto=Ht;exports.sm4Decrypt=_i;exports.sm4Encrypt=Bi;exports.toUtil=Vi;exports.trimArray=fe;exports.validUtil=$i;
|
package/lib/index.mjs
CHANGED
|
@@ -233,6 +233,19 @@ const pr = (t, i = "") => {
|
|
|
233
233
|
return t;
|
|
234
234
|
};
|
|
235
235
|
function Ei(t) {
|
|
236
|
+
if (!t.length)
|
|
237
|
+
return;
|
|
238
|
+
let i = 0;
|
|
239
|
+
function o() {
|
|
240
|
+
requestIdleCallback((s) => {
|
|
241
|
+
for (; i < t.length && s.timeRemaining() > 0; )
|
|
242
|
+
t[i++]();
|
|
243
|
+
i < t.length && o();
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
o();
|
|
247
|
+
}
|
|
248
|
+
function Bi(t) {
|
|
236
249
|
let i = $t;
|
|
237
250
|
return (...o) => new Promise((s, u) => {
|
|
238
251
|
i(), i = () => {
|
|
@@ -243,7 +256,7 @@ function Ei(t) {
|
|
|
243
256
|
);
|
|
244
257
|
});
|
|
245
258
|
}
|
|
246
|
-
function
|
|
259
|
+
function _i(t, i) {
|
|
247
260
|
const o = document.createElement("a");
|
|
248
261
|
o.download = i, o.href = t, o.click();
|
|
249
262
|
}
|
|
@@ -253,20 +266,24 @@ function gr(t) {
|
|
|
253
266
|
t[o] && i.push(t[o]);
|
|
254
267
|
return i;
|
|
255
268
|
}
|
|
256
|
-
function
|
|
269
|
+
function Ri(t, i, o = !1) {
|
|
257
270
|
let s = Math.round(t / i * 1e4) / 100;
|
|
258
271
|
return Number.isNaN(s) && (s = 0), o ? Math.floor(s) : s;
|
|
259
272
|
}
|
|
260
|
-
function
|
|
273
|
+
function Di(t) {
|
|
261
274
|
const i = document.createElement("link");
|
|
262
275
|
i.rel = "stylesheet", i.href = t, i.crossOrigin = "anonymous", document.getElementsByTagName("head")[0].appendChild(i);
|
|
263
276
|
}
|
|
264
|
-
function
|
|
277
|
+
function Ai(t) {
|
|
265
278
|
return new Promise((i, o) => {
|
|
266
279
|
const s = document.createElement("script");
|
|
267
280
|
s.type = "text/javascript", s.src = t, s.onload = () => i(), s.onerror = (u) => o(u), document.getElementsByTagName("head")[0].appendChild(s);
|
|
268
281
|
});
|
|
269
282
|
}
|
|
283
|
+
function Ii(t, i = 48, o = 48) {
|
|
284
|
+
const s = t.replace("#", "");
|
|
285
|
+
return `data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}"><path d="M787.510356 387.850445c0-152.160515-123.350352-275.511891-275.510868-275.511891S236.487597 235.68993 236.487597 387.850445c0 44.665269 10.640338 86.841857 29.507034 124.151601l-0.010233-0.001023 0.059352 0.100284c5.548366 10.962679 11.812023 21.500687 18.723434 31.56081L511.999488 926.678464l227.234351-383.021463c6.909363-10.057053 13.170974-20.593014 18.71934-31.552623l0.062422-0.104377-0.011256 0.002047C776.870018 474.692303 787.510356 432.515714 787.510356 387.850445zM511.999488 506.802628c-74.596975 0-135.070278-60.47228-135.070278-135.070278 0-74.595952 60.47228-135.069255 135.070278-135.069255 74.595952 0 135.069255 60.473303 135.069255 135.069255C647.068743 446.330348 586.59544 506.802628 511.999488 506.802628z" fill="%23${s}"></path></svg>`;
|
|
286
|
+
}
|
|
270
287
|
const xr = [
|
|
271
288
|
["date", "YYYY-MM-DD"],
|
|
272
289
|
["daterange", "YYYY-MM-DD"],
|
|
@@ -723,10 +740,10 @@ function Qr(t) {
|
|
|
723
740
|
o.length && o.forEach((s) => s());
|
|
724
741
|
}
|
|
725
742
|
}
|
|
726
|
-
function
|
|
743
|
+
function Mi(t, i) {
|
|
727
744
|
typeof window > "u" || (t.__resizeListeners__ || (t.__resizeListeners__ = [], t.__ro__ = new Kr(Qr), t.__ro__.observe(t)), t.__resizeListeners__.push(i));
|
|
728
745
|
}
|
|
729
|
-
function
|
|
746
|
+
function Oi(t, i) {
|
|
730
747
|
!t || !t.__resizeListeners__ || (t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(i), 1), t.__resizeListeners__.length || t.__ro__.disconnect());
|
|
731
748
|
}
|
|
732
749
|
var gt = { exports: {} }, ti = gt.exports, Ut;
|
|
@@ -2447,14 +2464,14 @@ function fi() {
|
|
|
2447
2464
|
}), Mt;
|
|
2448
2465
|
}
|
|
2449
2466
|
var pe = fi();
|
|
2450
|
-
const ge = pe.sm2, xe = pe.sm4,
|
|
2467
|
+
const ge = pe.sm2, xe = pe.sm4, qi = (t, i, o = "04") => o + ge.doEncrypt(t, i), Ci = (t, i, o = "04") => ge.doDecrypt(t.startsWith(o) ? t.slice(2) : t, i), Pi = (t, i) => xe.encrypt(t, i), zi = (t, i) => xe.decrypt(t, i);
|
|
2451
2468
|
let ft = [], ci = { consecutiveFrames: 0, lastBlinkTime: 0 }, ui = { consecutiveFrames: 0, lastBlinkTime: 0 };
|
|
2452
2469
|
const ai = /* @__PURE__ */ new Map([
|
|
2453
2470
|
["nod", [mi, 30, 100]],
|
|
2454
2471
|
["shake", [xi, 7, 100]],
|
|
2455
2472
|
["mouth", [gi, 0.35, 100]],
|
|
2456
2473
|
["eye", [pi, 0.3, 100]]
|
|
2457
|
-
]),
|
|
2474
|
+
]), Hi = ["nod", "shake", "mouth", "eye"], Li = {
|
|
2458
2475
|
nod: "请点点头",
|
|
2459
2476
|
shake: "请摇摇头",
|
|
2460
2477
|
mouth: "请张张嘴",
|
|
@@ -2520,7 +2537,7 @@ function mi(t, i) {
|
|
|
2520
2537
|
}
|
|
2521
2538
|
return !1;
|
|
2522
2539
|
}
|
|
2523
|
-
function
|
|
2540
|
+
function Ni(t, i = "blob", o = 1) {
|
|
2524
2541
|
return new Promise((s) => {
|
|
2525
2542
|
const u = document.createElement("canvas"), f = u.getContext("2d");
|
|
2526
2543
|
u.width = t.videoWidth, u.height = t.videoHeight, f == null || f.drawImage(t, 0, 0, u.width, u.height), i === "blob" ? u.toBlob(
|
|
@@ -2533,7 +2550,7 @@ function Hi(t, i = "blob", o = 1) {
|
|
|
2533
2550
|
) : s(u.toDataURL("image/png", o));
|
|
2534
2551
|
});
|
|
2535
2552
|
}
|
|
2536
|
-
async function
|
|
2553
|
+
async function Yi(t, i, o, s = 5) {
|
|
2537
2554
|
const [u, f, d] = ai.get(o);
|
|
2538
2555
|
if (!u) return !1;
|
|
2539
2556
|
const a = [], b = hi(t, i, s, d);
|
|
@@ -2545,7 +2562,7 @@ async function Li(t, i, o, s = 5) {
|
|
|
2545
2562
|
}
|
|
2546
2563
|
return a.includes(!0);
|
|
2547
2564
|
}
|
|
2548
|
-
const
|
|
2565
|
+
const ki = { DATE_VALUE_FORMAT: yr, COMMON_TEXT: et, IMAGE_TYPE: ie, MEDIA_TYPE: oe, DOC_TYPE: se, FILE_TYPE: wr }, Vi = {
|
|
2549
2566
|
encodeURIToParams: Mr,
|
|
2550
2567
|
paramsToQueryString: Or,
|
|
2551
2568
|
queryStringToParams: qr,
|
|
@@ -2560,7 +2577,7 @@ const Ni = { DATE_VALUE_FORMAT: yr, COMMON_TEXT: et, IMAGE_TYPE: ie, MEDIA_TYPE:
|
|
|
2560
2577
|
idNumberToAsterisk: Br,
|
|
2561
2578
|
firstLetterToUpperCase: _r,
|
|
2562
2579
|
firstLetterToLowerCase: Rr
|
|
2563
|
-
},
|
|
2580
|
+
}, $i = {
|
|
2564
2581
|
validHttp: ir,
|
|
2565
2582
|
validExternal: or,
|
|
2566
2583
|
validString: sr,
|
|
@@ -2572,40 +2589,42 @@ const Ni = { DATE_VALUE_FORMAT: yr, COMMON_TEXT: et, IMAGE_TYPE: ie, MEDIA_TYPE:
|
|
|
2572
2589
|
validIdNumber: Pt,
|
|
2573
2590
|
validPhone: dr,
|
|
2574
2591
|
validTel: lr
|
|
2575
|
-
},
|
|
2592
|
+
}, ji = { scrollTo: Un, addClass: tr, removeClass: er, hasClass: Ct, toggleClass: Qn, noContextmenu: rr, useRafThrottle: nr }, Ui = { parseTime: xt, getTimeDistance: Wn, getDayRange: Jn }, Zi = { local: Kn, session: Xn }, Gi = { uuid: Gn, randomNum: Zn };
|
|
2576
2593
|
export {
|
|
2577
|
-
|
|
2594
|
+
ki as CONSTANTS,
|
|
2578
2595
|
$t as NOOP,
|
|
2579
|
-
|
|
2580
|
-
|
|
2596
|
+
Mi as addResizeListener,
|
|
2597
|
+
Zi as cacheUtil,
|
|
2581
2598
|
yi as countdownTimer,
|
|
2582
|
-
|
|
2583
|
-
|
|
2599
|
+
Bi as creatCancelTask,
|
|
2600
|
+
Ui as dateUtil,
|
|
2584
2601
|
wi as debounce,
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2602
|
+
_i as downloadFile,
|
|
2603
|
+
ji as elementUtil,
|
|
2604
|
+
Hi as faceLivingEvent,
|
|
2605
|
+
Li as faceLivingEventHint,
|
|
2589
2606
|
Si as getArrayFullUrl,
|
|
2590
2607
|
Fi as getBirthdayByIdNumber,
|
|
2591
|
-
|
|
2592
|
-
|
|
2608
|
+
Yi as getFaceGestureResult,
|
|
2609
|
+
Ni as getFaceVideoFrame,
|
|
2593
2610
|
pr as getFullUrl,
|
|
2594
2611
|
Ti as getGenderByIdNumber,
|
|
2595
|
-
|
|
2612
|
+
Ii as getMapLocationIcon,
|
|
2613
|
+
Ri as getPercentage,
|
|
2596
2614
|
bi as getRandomItemInArray,
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2615
|
+
Di as loadCss,
|
|
2616
|
+
Ai as loadJs,
|
|
2617
|
+
Gi as randomUtil,
|
|
2618
|
+
Oi as removeResizeListener,
|
|
2619
|
+
Ei as ricTask,
|
|
2601
2620
|
vi as sleep,
|
|
2602
2621
|
ge as sm2Crypto,
|
|
2603
|
-
|
|
2604
|
-
|
|
2622
|
+
Ci as sm2Decrypt,
|
|
2623
|
+
qi as sm2Encrypt,
|
|
2605
2624
|
xe as sm4Crypto,
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2625
|
+
zi as sm4Decrypt,
|
|
2626
|
+
Pi as sm4Encrypt,
|
|
2627
|
+
Vi as toUtil,
|
|
2609
2628
|
gr as trimArray,
|
|
2610
|
-
|
|
2629
|
+
$i as validUtil
|
|
2611
2630
|
};
|
package/lib/utils/common.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PromiseFn } from '../types';
|
|
1
|
+
import { PromiseFn, Fn } from '../types';
|
|
2
2
|
export declare const NOOP: () => void;
|
|
3
3
|
export declare function sleep(x: number): Promise<unknown>;
|
|
4
4
|
export declare function countdownTimer(x: number, cb: (x: number) => void | undefined): Promise<boolean>;
|
|
@@ -20,9 +20,11 @@ export declare function getGenderByIdNumber(idNumber: string): "1" | "2";
|
|
|
20
20
|
export declare function getBirthdayByIdNumber(idNumber: string): string;
|
|
21
21
|
export declare const getFullUrl: (relativeUrl: string, domain?: string) => string;
|
|
22
22
|
export declare const getArrayFullUrl: (relativeUrls: string | string[], domain?: string) => string[];
|
|
23
|
+
export declare function ricTask(tasks: Fn[]): void;
|
|
23
24
|
export declare function creatCancelTask(asyncTask: PromiseFn): (...args: any[]) => Promise<unknown>;
|
|
24
25
|
export declare function downloadFile(url: string, name: string): void;
|
|
25
26
|
export declare function trimArray<T>(actual: Array<T>): Array<T>;
|
|
26
27
|
export declare function getPercentage(number: number, total: number, integer?: boolean): number;
|
|
27
28
|
export declare function loadCss(url: string): void;
|
|
28
29
|
export declare function loadJs(src: string): Promise<void>;
|
|
30
|
+
export declare function getMapLocationIcon(color: string, width?: number, height?: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nano-lib/util",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Custom utility functions for the nano library",
|
|
5
5
|
"author": "xylo",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"vite-plugin-dts": "^4.5.3"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "pnpm@9.1.3",
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": "^20.0.0",
|
|
49
|
+
"pnpm": "^9.0.0"
|
|
50
|
+
},
|
|
47
51
|
"keywords": [
|
|
48
52
|
"nano-lib",
|
|
49
53
|
"@nano-lib/component",
|