@a-drowned-fish/om-utils 1.0.20 → 1.0.22

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/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,n,r,i,o,s,a,c=require("@fingerprintjs/fingerprintjs"),u=require("sm-crypto"),f=require("node-forge");function h(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})}function d(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function p(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function l(t,e){t-=489;return w()[t]}function w(){const t=["from","base64","prototype","3473424vDHWyC","create","99962cwrhaQ","encode64","234462vvlVcs","Invalid public key: ","sha1","encrypt","message","publicKeyFromPem","712BBOxQW","4186850KmviDo","\n-----END PUBLIC KEY-----","10090jaKVxs","5Mdlpvn","1659648KHrbuc","6SSdyWb","hex","SHA-256","RSA encryption failed: ","construct","replace","RSA-OAEP","undefined","constructor","pki","sha256","Unsupported output encoding: ","padStart","2593241dNiizq","toString","util"];return(w=function(){return t})()}function v(t,e){t-=226;return M()[t]}"function"==typeof SuppressedError&&SuppressedError,function(){const t=l,e=w();for(;;)try{if(226901===-parseInt(t(499))/1*(parseInt(t(522))/2)+-parseInt(t(489))/3+parseInt(t(495))/4*(parseInt(t(498))/5)+-parseInt(t(501))/6*(-parseInt(t(514))/7)+-parseInt(t(500))/8+-parseInt(t(520))/9+parseInt(t(496))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),function(){const t=v,e=M();for(;;)try{if(236838===-parseInt(t(239))/1+parseInt(t(233))/2+parseInt(t(232))/3*(-parseInt(t(241))/4)+-parseInt(t(243))/5+-parseInt(t(253))/6*(parseInt(t(242))/7)+parseInt(t(230))/8*(parseInt(t(263))/9)+parseInt(t(237))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const{sm2:m,sm4:y}=u;function I(t){return h(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function g(t,e={}){const n=v,{allowLeadingZero:r=!1,type:i=n(251)}=e;if(!Number[n(236)](t))throw new Error(n(249));const o={number:"0123456789",alphanumeric:n(235)},s=o[i]||o[n(251)];let a="";r||i!==n(251)?a+=s[Math[n(247)](Math.random()*s.length)]:a+=s[Math[n(247)](9*Math[n(259)]()+1)];for(let e=1;e<t;e++)a+=s[Math.floor(Math.random()*s.length)];return a}class E{constructor(u,f={}){const l=v;t.set(this,""),e[l(238)](this,""),n[l(238)](this,""),r[l(238)](this,""),i[l(238)](this,!1),o[l(238)](this,""),s[l(238)](this,t=>{const n=l;var r,i,o,s,a;if(!t)return"";let c=null===(i=null===(r=y.decrypt(t,d(this,e,"f"),{mode:n(257)}))||void 0===r?void 0:r[n(226)])||void 0===i?void 0:i[n(240)](r);if(/^[0-9A-Fa-f]{64}$/.test(c))c=c[n(250)]();else{const t=null===(o=null==c?void 0:c[n(261)])||void 0===o?void 0:o[n(240)](c,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))c=null===(a=null===(s=t[1])||void 0===s?void 0:s[n(250)])||void 0===a?void 0:a[n(240)](s);else{const t=c.match(/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(c=t[1][n(250)]())}}return c}),a[l(238)](this,()=>h(this,void 0,void 0,function*(){const t=l;return d(this,n,"f")?d(this,n,"f"):d(this,i,"f")?(yield I(100),yield d(this,a,"f")[t(240)](this)):(p(this,i,!0,"f"),c[t(254)]().then(t=>t.get())[t(231)](e=>{const o=t;return p(this,i,!1,"f"),p(this,n,d(this,r,"f")+e[o(244)],"f"),d(this,n,"f")}))})),this[l(258)]=t=>{t&&p(this,o,d(this,s,"f").call(this,t),"f")},this[l(256)]=()=>h(this,void 0,void 0,function*(){const t=l;d(this,n,"f")||(yield d(this,a,"f").call(this));const r={d:d(this,n,"f"),n:g(32,{type:"alphanumeric"}),t:Date.now()[t(255)](),s:""},i=r.d+r.t+r.n;return r.s=y[t(228)](i,d(this,e,"f"),{mode:t(257)}),r}),this.getPublicHeaders=()=>h(this,void 0,void 0,function*(){const r=l;var i,s;if(d(this,n,"f")||(yield d(this,a,"f")[r(240)](this)),!d(this,o,"f"))return yield I(100),yield this[r(262)]();const c={"X-T":Date[r(248)]()[r(255)](),"X-N":g(32,{type:r(252)}),"X-DI":d(this,n,"f"),"X-S":""},u=d(this,e,"f")+d(this,n,"f")+c[r(245)]+c[r(229)];return c[r(246)]=null===(s=null===(i=m[r(234)](u,d(this,o,"f"),{hash:!0,der:!1,mode:0,userId:d(this,t,"f")}))||void 0===i?void 0:i.toUpperCase)||void 0===s?void 0:s[r(240)](i),c});const{uId:w=l(227),deviceId:E,deviceIdPrefix:b=""}=f;p(this,e,u,"f"),p(this,t,w,"f"),p(this,r,b,"f"),E?p(this,n,E,"f"):typeof window!==l(260)&&typeof document!==l(260)&&d(this,a,"f")[l(240)](this)}}t=new WeakMap,e=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakMap;const b=function(t){const e=l;let n=null;const r=new Proxy(t,{construct(t,e){const r=l;return n||(n=typeof Reflect!==r(508)&&Reflect.construct?Reflect[r(505)](t,e):new t(...e),n)}});return r[e(519)][e(509)]=r,r}(E);function M(){const t=["undefined","match","getPublicHeaders","9RhyptE","trim","1234567812345678","encrypt","X-T","1728352BxgLBQ","then","3TbwOvA","17748uDKjzD","doSignature","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","9399090kWlwFZ","set","127951SJMnfq","call","1312072yqIhsh","42kAJrRU","795570loeSmu","visitorId","X-N","X-S","floor","now","长度必须是整数","toUpperCase","number","alphanumeric","312906gQpoUr","load","toString","getRegisterBody","ecb","setAccessToken","random"];return(M=function(){return t})()}exports.BaseOmUtils=E,exports.OmUtils=b,exports.default=b,exports.rsaOaepEncrypt=function(t,e,n={}){const r=l,{outputEncoding:i="hex",oaepHash:o=r(503),mgf1Hash:s=o}=n,a=function(t){const e=l;return t[e(506)](/-----BEGIN PUBLIC KEY-----/,"")[e(506)](/-----END PUBLIC KEY-----/,"")[e(506)](/\s/g,"")}(e);let c;try{c=f[r(510)][r(494)](a)}catch(t){try{const t="-----BEGIN PUBLIC KEY-----\n"+a+r(497);c=f[r(510)][r(494)](t)}catch(t){throw new Error(r(490)+(t instanceof Error?t[r(493)]:String(t)))}}const u=o===r(503)?f.md[r(511)][r(521)]():f.md.sha1[r(521)](),h=s===r(503)?f.md[r(511)][r(521)]():f.md[r(491)][r(521)]();let d;try{const e=c[r(492)](t,r(507),{md:u,mgf1Md:h});d=new Uint8Array(e)}catch(t){throw new Error(r(504)+(t instanceof Error?t[r(493)]:String(t)))}if("hex"===i)return function(t){const e=l;return Array[e(517)](t).map(t=>t[e(515)](16)[e(513)](2,"0")).join("")}(d);if(i===r(518))return f[r(516)][r(523)](d);throw new Error(r(512)+i)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,n,r,i,s,o,a,c=require("@fingerprintjs/fingerprintjs"),f=require("sm-crypto"),u=require("node-forge");function h(t,e,n,r){return new(n||(n=Promise))(function(i,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}c((r=r.apply(t,e||[])).next())})}function p(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function d(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function l(t,e){t-=123;return w()[t]}function w(){const t=["hex","encrypt","935496LctVkQ","RSA-OAEP","\n-----END PUBLIC KEY-----","map","constructor","toString","util","10UzCWjI","22kZxKlr","44cmyfWJ","-----BEGIN PUBLIC KEY-----\n","base64","7tcNzWQ","join","2385630AwuBgV","RSA encryption failed: ","sha256","Invalid public key: ","from","Unsupported output encoding: ","1565764WNHger","738605MnwaRa","3DGqRPk","1100832nFOiUT","replace","SHA-256","construct","publicKeyFromPem","sha1","2384104uIlxKk","pki","8696HdvCfp","create","message"];return(w=function(){return t})()}function m(){const t=["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","match","3PqZmwO","144VXKZwT","207384BAYvfw","then","test","toUpperCase","encrypt","4065855fuXFFh","X-N","1063VuiXoJ","visitorId","undefined","trim","toString","4887076fAncCv","40942100snVxUr","152817MdNYJn","getPublicHeaders","1686IhBcrj","call","X-T","load","doSignature","setAccessToken","alphanumeric","random","length","getRegisterBody","cbc","number","9544974wKvIMY","floor","now","set"];return(m=function(){return t})()}function v(t,e){t-=392;return m()[t]}"function"==typeof SuppressedError&&SuppressedError,function(){const t=l,e=w();for(;;)try{if(216427===-parseInt(t(151))/1*(parseInt(t(138))/2)+parseInt(t(129))/3*(-parseInt(t(127))/4)+parseInt(t(128))/5+parseInt(t(143))/6+-parseInt(t(155))/7*(-parseInt(t(136))/8)+-parseInt(t(157))/9*(parseInt(t(150))/10)+parseInt(t(152))/11*(parseInt(t(130))/12))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),function(){const t=v,e=m();for(;;)try{if(864267===-parseInt(t(421))/1*(-parseInt(t(393))/2)+-parseInt(t(412))/3*(-parseInt(t(426))/4)+parseInt(t(419))/5+parseInt(t(405))/6+parseInt(t(428))/7+-parseInt(t(414))/8*(-parseInt(t(413))/9)+-parseInt(t(427))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const{sm2:y,sm4:I}=f;function g(t){return h(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function E(t,e={}){const n=v,{allowLeadingZero:r=!1,type:i="number"}=e;if(!Number[n(410)](t))throw new Error("长度必须是整数");const s={number:"0123456789",alphanumeric:n(409)},o=s[i]||s[n(404)];let a="";r||i!==n(404)?a+=o[Math[n(406)](Math.random()*o[n(401)])]:a+=o[Math[n(406)](9*Math[n(400)]()+1)];for(let e=1;e<t;e++)a+=o[Math[n(406)](Math[n(400)]()*o[n(401)])];return a}class b{constructor(f,u={}){const l=v;t[l(408)](this,""),e[l(408)](this,""),n.set(this,""),r[l(408)](this,""),i[l(408)](this,!1),s.set(this,""),o[l(408)](this,t=>{const n=l;var r,i,s,o,a;if(!t)return"";let c=null===(i=null===(r=I.decrypt(t,p(this,e,"f"),{mode:n(403)}))||void 0===r?void 0:r[n(424)])||void 0===i?void 0:i[n(394)](r);if(/^[0-9A-Fa-f]{64}$/[n(416)](c))c=c[n(417)]();else{const t=null===(s=null==c?void 0:c.match)||void 0===s?void 0:s[n(394)](c,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))c=null===(a=null===(o=t[1])||void 0===o?void 0:o[n(417)])||void 0===a?void 0:a[n(394)](o);else{const t=c[n(411)](/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(c=t[1].toUpperCase())}}return c}),a.set(this,()=>h(this,void 0,void 0,function*(){const t=l;return p(this,n,"f")?p(this,n,"f"):p(this,i,"f")?(yield g(100),yield p(this,a,"f").call(this)):(d(this,i,!0,"f"),c[t(396)]()[t(415)](t=>t.get()).then(e=>{const s=t;return d(this,i,!1,"f"),d(this,n,p(this,r,"f")+e[s(422)],"f"),p(this,n,"f")}))})),this[l(398)]=t=>{const e=l;t&&d(this,s,p(this,o,"f")[e(394)](this,t),"f")},this[l(402)]=()=>h(this,void 0,void 0,function*(){const t=l;p(this,n,"f")||(yield p(this,a,"f")[t(394)](this));const r={d:p(this,n,"f"),n:E(32,{type:"alphanumeric"}),t:Date.now()[t(425)](),s:""},i=r.d+r.t+r.n;return r.s=I[t(418)](i,p(this,e,"f"),{mode:"cbc"}),r}),this[l(392)]=()=>h(this,void 0,void 0,function*(){const r=l;var i,o;if(p(this,n,"f")||(yield p(this,a,"f").call(this)),!p(this,s,"f"))return yield g(100),yield this[r(392)]();const c={"X-T":Date[r(407)]()[r(425)](),"X-N":E(32,{type:r(399)}),"X-DI":p(this,n,"f"),"X-S":""},f=p(this,e,"f")+p(this,n,"f")+c[r(420)]+c[r(395)];return c["X-S"]=null===(o=null===(i=y[r(397)](f,p(this,s,"f"),{hash:!0,der:!1,mode:0,userId:p(this,t,"f")}))||void 0===i?void 0:i[r(417)])||void 0===o?void 0:o[r(394)](i),c});const{uId:w="1234567812345678",deviceId:m,deviceIdPrefix:b=""}=u;d(this,e,f,"f"),d(this,t,w,"f"),d(this,r,b,"f"),m?d(this,n,m,"f"):typeof window!==l(423)&&typeof document!==l(423)&&p(this,a,"f")[l(394)](this)}}t=new WeakMap,e=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap;const M=function(t){const e=l;let n=null;const r=new Proxy(t,{construct(t,e){const r=l;return n||(n="undefined"!=typeof Reflect&&Reflect[r(133)]?Reflect[r(133)](t,e):new t(...e),n)}});return r.prototype[e(147)]=r,r}(b);exports.BaseOmUtils=b,exports.OmUtils=M,exports.default=M,exports.rsaOaepEncrypt=function(t,e,n={}){const r=l,{outputEncoding:i="hex",oaepHash:s=r(132),mgf1Hash:o=s}=n,a=function(t){const e=l;return t[e(131)](/-----BEGIN PUBLIC KEY-----/,"")[e(131)](/-----END PUBLIC KEY-----/,"").replace(/\s/g,"")}(e);let c;try{c=u[r(137)].publicKeyFromPem(a)}catch(t){try{const t=r(153)+a+r(145);c=u[r(137)][r(134)](t)}catch(t){throw new Error(r(124)+(t instanceof Error?t[r(140)]:String(t)))}}const f=s===r(132)?u.md[r(123)][r(139)]():u.md.sha1[r(139)](),h=o===r(132)?u.md.sha256[r(139)]():u.md[r(135)][r(139)]();let p;try{p=c[r(142)](t,r(144),{md:f,mgf1Md:h})}catch(t){throw new Error(r(158)+(t instanceof Error?t.message:String(t)))}if(i===r(141))return u[r(149)].bytesToHex(p);if("base64"===i)return u[r(149)].encode64(p);throw new Error(r(126)+i)};
package/dist/index.es.js CHANGED
@@ -1 +1 @@
1
- import t from"@fingerprintjs/fingerprintjs";import e from"sm-crypto";import n from"node-forge";function r(t,e,n,r){return new(n||(n=Promise))(function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})}function o(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function i(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}function s(t,e){t-=489;return c()[t]}function a(t,e,r={}){const o=s,{outputEncoding:i="hex",oaepHash:a=o(503),mgf1Hash:c=a}=r,f=function(t){const e=s;return t[e(506)](/-----BEGIN PUBLIC KEY-----/,"")[e(506)](/-----END PUBLIC KEY-----/,"")[e(506)](/\s/g,"")}(e);let h;try{h=n[o(510)][o(494)](f)}catch(t){try{const t="-----BEGIN PUBLIC KEY-----\n"+f+o(497);h=n[o(510)][o(494)](t)}catch(t){throw new Error(o(490)+(t instanceof Error?t[o(493)]:String(t)))}}const u=a===o(503)?n.md[o(511)][o(521)]():n.md.sha1[o(521)](),d=c===o(503)?n.md[o(511)][o(521)]():n.md[o(491)][o(521)]();let p;try{const e=h[o(492)](t,o(507),{md:u,mgf1Md:d});p=new Uint8Array(e)}catch(t){throw new Error(o(504)+(t instanceof Error?t[o(493)]:String(t)))}if("hex"===i)return function(t){const e=s;return Array[e(517)](t).map(t=>t[e(515)](16)[e(513)](2,"0")).join("")}(p);if(i===o(518))return n[o(516)][o(523)](p);throw new Error(o(512)+i)}function c(){const t=["from","base64","prototype","3473424vDHWyC","create","99962cwrhaQ","encode64","234462vvlVcs","Invalid public key: ","sha1","encrypt","message","publicKeyFromPem","712BBOxQW","4186850KmviDo","\n-----END PUBLIC KEY-----","10090jaKVxs","5Mdlpvn","1659648KHrbuc","6SSdyWb","hex","SHA-256","RSA encryption failed: ","construct","replace","RSA-OAEP","undefined","constructor","pki","sha256","Unsupported output encoding: ","padStart","2593241dNiizq","toString","util"];return(c=function(){return t})()}function f(t,e){t-=226;return S()[t]}var h,u,d,p,l,m,w,v;"function"==typeof SuppressedError&&SuppressedError,function(){const t=s,e=c();for(;;)try{if(226901===-parseInt(t(499))/1*(parseInt(t(522))/2)+-parseInt(t(489))/3+parseInt(t(495))/4*(parseInt(t(498))/5)+-parseInt(t(501))/6*(-parseInt(t(514))/7)+-parseInt(t(500))/8+-parseInt(t(520))/9+parseInt(t(496))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),function(){const t=f,e=S();for(;;)try{if(236838===-parseInt(t(239))/1+parseInt(t(233))/2+parseInt(t(232))/3*(-parseInt(t(241))/4)+-parseInt(t(243))/5+-parseInt(t(253))/6*(parseInt(t(242))/7)+parseInt(t(230))/8*(parseInt(t(263))/9)+parseInt(t(237))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const{sm2:y,sm4:I}=e;function g(t){return r(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function E(t,e={}){const n=f,{allowLeadingZero:r=!1,type:o=n(251)}=e;if(!Number[n(236)](t))throw new Error(n(249));const i={number:"0123456789",alphanumeric:n(235)},s=i[o]||i[n(251)];let a="";r||o!==n(251)?a+=s[Math[n(247)](Math.random()*s.length)]:a+=s[Math[n(247)](9*Math[n(259)]()+1)];for(let e=1;e<t;e++)a+=s[Math.floor(Math.random()*s.length)];return a}class b{constructor(e,n={}){const s=f;h.set(this,""),u[s(238)](this,""),d[s(238)](this,""),p[s(238)](this,""),l[s(238)](this,!1),m[s(238)](this,""),w[s(238)](this,t=>{const e=s;var n,r,i,a,c;if(!t)return"";let f=null===(r=null===(n=I.decrypt(t,o(this,u,"f"),{mode:e(257)}))||void 0===n?void 0:n[e(226)])||void 0===r?void 0:r[e(240)](n);if(/^[0-9A-Fa-f]{64}$/.test(f))f=f[e(250)]();else{const t=null===(i=null==f?void 0:f[e(261)])||void 0===i?void 0:i[e(240)](f,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))f=null===(c=null===(a=t[1])||void 0===a?void 0:a[e(250)])||void 0===c?void 0:c[e(240)](a);else{const t=f.match(/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(f=t[1][e(250)]())}}return f}),v[s(238)](this,()=>r(this,void 0,void 0,function*(){const e=s;return o(this,d,"f")?o(this,d,"f"):o(this,l,"f")?(yield g(100),yield o(this,v,"f")[e(240)](this)):(i(this,l,!0,"f"),t[e(254)]().then(t=>t.get())[e(231)](t=>{const n=e;return i(this,l,!1,"f"),i(this,d,o(this,p,"f")+t[n(244)],"f"),o(this,d,"f")}))})),this[s(258)]=t=>{t&&i(this,m,o(this,w,"f").call(this,t),"f")},this[s(256)]=()=>r(this,void 0,void 0,function*(){const t=s;o(this,d,"f")||(yield o(this,v,"f").call(this));const e={d:o(this,d,"f"),n:E(32,{type:"alphanumeric"}),t:Date.now()[t(255)](),s:""},n=e.d+e.t+e.n;return e.s=I[t(228)](n,o(this,u,"f"),{mode:t(257)}),e}),this.getPublicHeaders=()=>r(this,void 0,void 0,function*(){const t=s;var e,n;if(o(this,d,"f")||(yield o(this,v,"f")[t(240)](this)),!o(this,m,"f"))return yield g(100),yield this[t(262)]();const r={"X-T":Date[t(248)]()[t(255)](),"X-N":E(32,{type:t(252)}),"X-DI":o(this,d,"f"),"X-S":""},i=o(this,u,"f")+o(this,d,"f")+r[t(245)]+r[t(229)];return r[t(246)]=null===(n=null===(e=y[t(234)](i,o(this,m,"f"),{hash:!0,der:!1,mode:0,userId:o(this,h,"f")}))||void 0===e?void 0:e.toUpperCase)||void 0===n?void 0:n[t(240)](e),r});const{uId:a=s(227),deviceId:c,deviceIdPrefix:b=""}=n;i(this,u,e,"f"),i(this,h,a,"f"),i(this,p,b,"f"),c?i(this,d,c,"f"):typeof window!==s(260)&&typeof document!==s(260)&&o(this,v,"f")[s(240)](this)}}h=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,l=new WeakMap,m=new WeakMap,w=new WeakMap,v=new WeakMap;const M=function(t){const e=s;let n=null;const r=new Proxy(t,{construct(t,e){const r=s;return n||(n=typeof Reflect!==r(508)&&Reflect.construct?Reflect[r(505)](t,e):new t(...e),n)}});return r[e(519)][e(509)]=r,r}(b);function S(){const t=["undefined","match","getPublicHeaders","9RhyptE","trim","1234567812345678","encrypt","X-T","1728352BxgLBQ","then","3TbwOvA","17748uDKjzD","doSignature","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","9399090kWlwFZ","set","127951SJMnfq","call","1312072yqIhsh","42kAJrRU","795570loeSmu","visitorId","X-N","X-S","floor","now","长度必须是整数","toUpperCase","number","alphanumeric","312906gQpoUr","load","toString","getRegisterBody","ecb","setAccessToken","random"];return(S=function(){return t})()}export{b as BaseOmUtils,M as OmUtils,M as default,a as rsaOaepEncrypt};
1
+ import t from"@fingerprintjs/fingerprintjs";import e from"sm-crypto";import n from"node-forge";function r(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})}function i(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function o(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function s(t,e){t-=123;return c()[t]}function a(t,e,r={}){const i=s,{outputEncoding:o="hex",oaepHash:a=i(132),mgf1Hash:c=a}=r,f=function(t){const e=s;return t[e(131)](/-----BEGIN PUBLIC KEY-----/,"")[e(131)](/-----END PUBLIC KEY-----/,"").replace(/\s/g,"")}(e);let h;try{h=n[i(137)].publicKeyFromPem(f)}catch(t){try{const t=i(153)+f+i(145);h=n[i(137)][i(134)](t)}catch(t){throw new Error(i(124)+(t instanceof Error?t[i(140)]:String(t)))}}const u=a===i(132)?n.md[i(123)][i(139)]():n.md.sha1[i(139)](),p=c===i(132)?n.md.sha256[i(139)]():n.md[i(135)][i(139)]();let d;try{d=h[i(142)](t,i(144),{md:u,mgf1Md:p})}catch(t){throw new Error(i(158)+(t instanceof Error?t.message:String(t)))}if(o===i(141))return n[i(149)].bytesToHex(d);if("base64"===o)return n[i(149)].encode64(d);throw new Error(i(126)+o)}function c(){const t=["hex","encrypt","935496LctVkQ","RSA-OAEP","\n-----END PUBLIC KEY-----","map","constructor","toString","util","10UzCWjI","22kZxKlr","44cmyfWJ","-----BEGIN PUBLIC KEY-----\n","base64","7tcNzWQ","join","2385630AwuBgV","RSA encryption failed: ","sha256","Invalid public key: ","from","Unsupported output encoding: ","1565764WNHger","738605MnwaRa","3DGqRPk","1100832nFOiUT","replace","SHA-256","construct","publicKeyFromPem","sha1","2384104uIlxKk","pki","8696HdvCfp","create","message"];return(c=function(){return t})()}function f(){const t=["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","match","3PqZmwO","144VXKZwT","207384BAYvfw","then","test","toUpperCase","encrypt","4065855fuXFFh","X-N","1063VuiXoJ","visitorId","undefined","trim","toString","4887076fAncCv","40942100snVxUr","152817MdNYJn","getPublicHeaders","1686IhBcrj","call","X-T","load","doSignature","setAccessToken","alphanumeric","random","length","getRegisterBody","cbc","number","9544974wKvIMY","floor","now","set"];return(f=function(){return t})()}function h(t,e){t-=392;return f()[t]}var u,p,d,l,m,w,v,y;"function"==typeof SuppressedError&&SuppressedError,function(){const t=s,e=c();for(;;)try{if(216427===-parseInt(t(151))/1*(parseInt(t(138))/2)+parseInt(t(129))/3*(-parseInt(t(127))/4)+parseInt(t(128))/5+parseInt(t(143))/6+-parseInt(t(155))/7*(-parseInt(t(136))/8)+-parseInt(t(157))/9*(parseInt(t(150))/10)+parseInt(t(152))/11*(parseInt(t(130))/12))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),function(){const t=h,e=f();for(;;)try{if(864267===-parseInt(t(421))/1*(-parseInt(t(393))/2)+-parseInt(t(412))/3*(-parseInt(t(426))/4)+parseInt(t(419))/5+parseInt(t(405))/6+parseInt(t(428))/7+-parseInt(t(414))/8*(-parseInt(t(413))/9)+-parseInt(t(427))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const{sm2:I,sm4:g}=e;function E(t){return r(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function b(t,e={}){const n=h,{allowLeadingZero:r=!1,type:i="number"}=e;if(!Number[n(410)](t))throw new Error("长度必须是整数");const o={number:"0123456789",alphanumeric:n(409)},s=o[i]||o[n(404)];let a="";r||i!==n(404)?a+=s[Math[n(406)](Math.random()*s[n(401)])]:a+=s[Math[n(406)](9*Math[n(400)]()+1)];for(let e=1;e<t;e++)a+=s[Math[n(406)](Math[n(400)]()*s[n(401)])];return a}class M{constructor(e,n={}){const s=h;u[s(408)](this,""),p[s(408)](this,""),d.set(this,""),l[s(408)](this,""),m[s(408)](this,!1),w.set(this,""),v[s(408)](this,t=>{const e=s;var n,r,o,a,c;if(!t)return"";let f=null===(r=null===(n=g.decrypt(t,i(this,p,"f"),{mode:e(403)}))||void 0===n?void 0:n[e(424)])||void 0===r?void 0:r[e(394)](n);if(/^[0-9A-Fa-f]{64}$/[e(416)](f))f=f[e(417)]();else{const t=null===(o=null==f?void 0:f.match)||void 0===o?void 0:o[e(394)](f,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))f=null===(c=null===(a=t[1])||void 0===a?void 0:a[e(417)])||void 0===c?void 0:c[e(394)](a);else{const t=f[e(411)](/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(f=t[1].toUpperCase())}}return f}),y.set(this,()=>r(this,void 0,void 0,function*(){const e=s;return i(this,d,"f")?i(this,d,"f"):i(this,m,"f")?(yield E(100),yield i(this,y,"f").call(this)):(o(this,m,!0,"f"),t[e(396)]()[e(415)](t=>t.get()).then(t=>{const n=e;return o(this,m,!1,"f"),o(this,d,i(this,l,"f")+t[n(422)],"f"),i(this,d,"f")}))})),this[s(398)]=t=>{const e=s;t&&o(this,w,i(this,v,"f")[e(394)](this,t),"f")},this[s(402)]=()=>r(this,void 0,void 0,function*(){const t=s;i(this,d,"f")||(yield i(this,y,"f")[t(394)](this));const e={d:i(this,d,"f"),n:b(32,{type:"alphanumeric"}),t:Date.now()[t(425)](),s:""},n=e.d+e.t+e.n;return e.s=g[t(418)](n,i(this,p,"f"),{mode:"cbc"}),e}),this[s(392)]=()=>r(this,void 0,void 0,function*(){const t=s;var e,n;if(i(this,d,"f")||(yield i(this,y,"f").call(this)),!i(this,w,"f"))return yield E(100),yield this[t(392)]();const r={"X-T":Date[t(407)]()[t(425)](),"X-N":b(32,{type:t(399)}),"X-DI":i(this,d,"f"),"X-S":""},o=i(this,p,"f")+i(this,d,"f")+r[t(420)]+r[t(395)];return r["X-S"]=null===(n=null===(e=I[t(397)](o,i(this,w,"f"),{hash:!0,der:!1,mode:0,userId:i(this,u,"f")}))||void 0===e?void 0:e[t(417)])||void 0===n?void 0:n[t(394)](e),r});const{uId:a="1234567812345678",deviceId:c,deviceIdPrefix:f=""}=n;o(this,p,e,"f"),o(this,u,a,"f"),o(this,l,f,"f"),c?o(this,d,c,"f"):typeof window!==s(423)&&typeof document!==s(423)&&i(this,y,"f")[s(394)](this)}}u=new WeakMap,p=new WeakMap,d=new WeakMap,l=new WeakMap,m=new WeakMap,w=new WeakMap,v=new WeakMap,y=new WeakMap;const k=function(t){const e=s;let n=null;const r=new Proxy(t,{construct(t,e){const r=s;return n||(n="undefined"!=typeof Reflect&&Reflect[r(133)]?Reflect[r(133)](t,e):new t(...e),n)}});return r.prototype[e(147)]=r,r}(M);export{M as BaseOmUtils,k as OmUtils,k as default,a as rsaOaepEncrypt};
@@ -1 +1 @@
1
- var omUtils=function(t,e,n,r){"use strict";function i(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})}function o(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function s(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function a(t,e){t-=489;return c()[t]}function c(){const t=["from","base64","prototype","3473424vDHWyC","create","99962cwrhaQ","encode64","234462vvlVcs","Invalid public key: ","sha1","encrypt","message","publicKeyFromPem","712BBOxQW","4186850KmviDo","\n-----END PUBLIC KEY-----","10090jaKVxs","5Mdlpvn","1659648KHrbuc","6SSdyWb","hex","SHA-256","RSA encryption failed: ","construct","replace","RSA-OAEP","undefined","constructor","pki","sha256","Unsupported output encoding: ","padStart","2593241dNiizq","toString","util"];return(c=function(){return t})()}function u(t,e){t-=226;return S()[t]}var h,f,d,l,p,v,w,m;"function"==typeof SuppressedError&&SuppressedError,function(t){const e=a,n=t();for(;;)try{if(226901===-parseInt(e(499))/1*(parseInt(e(522))/2)+-parseInt(e(489))/3+parseInt(e(495))/4*(parseInt(e(498))/5)+-parseInt(e(501))/6*(-parseInt(e(514))/7)+-parseInt(e(500))/8+-parseInt(e(520))/9+parseInt(e(496))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(c),function(t){const e=u,n=t();for(;;)try{if(236838===-parseInt(e(239))/1+parseInt(e(233))/2+parseInt(e(232))/3*(-parseInt(e(241))/4)+-parseInt(e(243))/5+-parseInt(e(253))/6*(parseInt(e(242))/7)+parseInt(e(230))/8*(parseInt(e(263))/9)+parseInt(e(237))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(S);const{sm2:y,sm4:I}=n;function g(t){return i(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function E(t,e={}){const n=u,{allowLeadingZero:r=!1,type:i=n(251)}=e;if(!Number[n(236)](t))throw new Error(n(249));const o={number:"0123456789",alphanumeric:n(235)},s=o[i]||o[n(251)];let a="";r||i!==n(251)?a+=s[Math[n(247)](Math.random()*s.length)]:a+=s[Math[n(247)](9*Math[n(259)]()+1)];for(let e=1;e<t;e++)a+=s[Math.floor(Math.random()*s.length)];return a}class b{constructor(t,n={}){const r=u;h.set(this,""),f[r(238)](this,""),d[r(238)](this,""),l[r(238)](this,""),p[r(238)](this,!1),v[r(238)](this,""),w[r(238)](this,t=>{const e=r;var n,i,s,a,c;if(!t)return"";let u=null===(i=null===(n=I.decrypt(t,o(this,f,"f"),{mode:e(257)}))||void 0===n?void 0:n[e(226)])||void 0===i?void 0:i[e(240)](n);if(/^[0-9A-Fa-f]{64}$/.test(u))u=u[e(250)]();else{const t=null===(s=null==u?void 0:u[e(261)])||void 0===s?void 0:s[e(240)](u,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))u=null===(c=null===(a=t[1])||void 0===a?void 0:a[e(250)])||void 0===c?void 0:c[e(240)](a);else{const t=u.match(/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(u=t[1][e(250)]())}}return u}),m[r(238)](this,()=>i(this,void 0,void 0,function*(){const t=r;return o(this,d,"f")?o(this,d,"f"):o(this,p,"f")?(yield g(100),yield o(this,m,"f")[t(240)](this)):(s(this,p,!0,"f"),e[t(254)]().then(t=>t.get())[t(231)](e=>{const n=t;return s(this,p,!1,"f"),s(this,d,o(this,l,"f")+e[n(244)],"f"),o(this,d,"f")}))})),this[r(258)]=t=>{t&&s(this,v,o(this,w,"f").call(this,t),"f")},this[r(256)]=()=>i(this,void 0,void 0,function*(){const t=r;o(this,d,"f")||(yield o(this,m,"f").call(this));const e={d:o(this,d,"f"),n:E(32,{type:"alphanumeric"}),t:Date.now()[t(255)](),s:""},n=e.d+e.t+e.n;return e.s=I[t(228)](n,o(this,f,"f"),{mode:t(257)}),e}),this.getPublicHeaders=()=>i(this,void 0,void 0,function*(){const t=r;var e,n;if(o(this,d,"f")||(yield o(this,m,"f")[t(240)](this)),!o(this,v,"f"))return yield g(100),yield this[t(262)]();const i={"X-T":Date[t(248)]()[t(255)](),"X-N":E(32,{type:t(252)}),"X-DI":o(this,d,"f"),"X-S":""},s=o(this,f,"f")+o(this,d,"f")+i[t(245)]+i[t(229)];return i[t(246)]=null===(n=null===(e=y[t(234)](s,o(this,v,"f"),{hash:!0,der:!1,mode:0,userId:o(this,h,"f")}))||void 0===e?void 0:e.toUpperCase)||void 0===n?void 0:n[t(240)](e),i});const{uId:a=r(227),deviceId:c,deviceIdPrefix:b=""}=n;s(this,f,t,"f"),s(this,h,a,"f"),s(this,l,b,"f"),c?s(this,d,c,"f"):typeof window!==r(260)&&typeof document!==r(260)&&o(this,m,"f")[r(240)](this)}}h=new WeakMap,f=new WeakMap,d=new WeakMap,l=new WeakMap,p=new WeakMap,v=new WeakMap,w=new WeakMap,m=new WeakMap;const M=function(t){const e=a;let n=null;const r=new Proxy(t,{construct(t,e){const r=a;return n||(n=typeof Reflect!==r(508)&&Reflect.construct?Reflect[r(505)](t,e):new t(...e),n)}});return r[e(519)][e(509)]=r,r}(b);function S(){const t=["undefined","match","getPublicHeaders","9RhyptE","trim","1234567812345678","encrypt","X-T","1728352BxgLBQ","then","3TbwOvA","17748uDKjzD","doSignature","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","9399090kWlwFZ","set","127951SJMnfq","call","1312072yqIhsh","42kAJrRU","795570loeSmu","visitorId","X-N","X-S","floor","now","长度必须是整数","toUpperCase","number","alphanumeric","312906gQpoUr","load","toString","getRegisterBody","ecb","setAccessToken","random"];return(S=function(){return t})()}return t.BaseOmUtils=b,t.OmUtils=M,t.default=M,t.rsaOaepEncrypt=function(t,e,n={}){const i=a,{outputEncoding:o="hex",oaepHash:s=i(503),mgf1Hash:c=s}=n,u=function(t){const e=a;return t[e(506)](/-----BEGIN PUBLIC KEY-----/,"")[e(506)](/-----END PUBLIC KEY-----/,"")[e(506)](/\s/g,"")}(e);let h;try{h=r[i(510)][i(494)](u)}catch(t){try{const t="-----BEGIN PUBLIC KEY-----\n"+u+i(497);h=r[i(510)][i(494)](t)}catch(t){throw new Error(i(490)+(t instanceof Error?t[i(493)]:String(t)))}}const f=s===i(503)?r.md[i(511)][i(521)]():r.md.sha1[i(521)](),d=c===i(503)?r.md[i(511)][i(521)]():r.md[i(491)][i(521)]();let l;try{const e=h[i(492)](t,i(507),{md:f,mgf1Md:d});l=new Uint8Array(e)}catch(t){throw new Error(i(504)+(t instanceof Error?t[i(493)]:String(t)))}if("hex"===o)return function(t){const e=a;return Array[e(517)](t).map(t=>t[e(515)](16)[e(513)](2,"0")).join("")}(l);if(o===i(518))return r[i(516)][i(523)](l);throw new Error(i(512)+o)},Object.defineProperty(t,"__esModule",{value:!0}),t}({},FingerprintJS,SMCrypto,forge);
1
+ var omUtils=function(t,e,n,r){"use strict";function i(t,e,n,r){return new(n||(n=Promise))(function(i,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}c((r=r.apply(t,e||[])).next())})}function s(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function o(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function a(t,e){t-=123;return c()[t]}function c(){const t=["hex","encrypt","935496LctVkQ","RSA-OAEP","\n-----END PUBLIC KEY-----","map","constructor","toString","util","10UzCWjI","22kZxKlr","44cmyfWJ","-----BEGIN PUBLIC KEY-----\n","base64","7tcNzWQ","join","2385630AwuBgV","RSA encryption failed: ","sha256","Invalid public key: ","from","Unsupported output encoding: ","1565764WNHger","738605MnwaRa","3DGqRPk","1100832nFOiUT","replace","SHA-256","construct","publicKeyFromPem","sha1","2384104uIlxKk","pki","8696HdvCfp","create","message"];return(c=function(){return t})()}function f(){const t=["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","match","3PqZmwO","144VXKZwT","207384BAYvfw","then","test","toUpperCase","encrypt","4065855fuXFFh","X-N","1063VuiXoJ","visitorId","undefined","trim","toString","4887076fAncCv","40942100snVxUr","152817MdNYJn","getPublicHeaders","1686IhBcrj","call","X-T","load","doSignature","setAccessToken","alphanumeric","random","length","getRegisterBody","cbc","number","9544974wKvIMY","floor","now","set"];return(f=function(){return t})()}function u(t,e){t-=392;return f()[t]}var h,d,p,l,w,m,v,y;"function"==typeof SuppressedError&&SuppressedError,function(t){const e=a,n=t();for(;;)try{if(216427===-parseInt(e(151))/1*(parseInt(e(138))/2)+parseInt(e(129))/3*(-parseInt(e(127))/4)+parseInt(e(128))/5+parseInt(e(143))/6+-parseInt(e(155))/7*(-parseInt(e(136))/8)+-parseInt(e(157))/9*(parseInt(e(150))/10)+parseInt(e(152))/11*(parseInt(e(130))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(c),function(t){const e=u,n=t();for(;;)try{if(864267===-parseInt(e(421))/1*(-parseInt(e(393))/2)+-parseInt(e(412))/3*(-parseInt(e(426))/4)+parseInt(e(419))/5+parseInt(e(405))/6+parseInt(e(428))/7+-parseInt(e(414))/8*(-parseInt(e(413))/9)+-parseInt(e(427))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(f);const{sm2:I,sm4:g}=n;function E(t){return i(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function b(t,e={}){const n=u,{allowLeadingZero:r=!1,type:i="number"}=e;if(!Number[n(410)](t))throw new Error("长度必须是整数");const s={number:"0123456789",alphanumeric:n(409)},o=s[i]||s[n(404)];let a="";r||i!==n(404)?a+=o[Math[n(406)](Math.random()*o[n(401)])]:a+=o[Math[n(406)](9*Math[n(400)]()+1)];for(let e=1;e<t;e++)a+=o[Math[n(406)](Math[n(400)]()*o[n(401)])];return a}class M{constructor(t,n={}){const r=u;h[r(408)](this,""),d[r(408)](this,""),p.set(this,""),l[r(408)](this,""),w[r(408)](this,!1),m.set(this,""),v[r(408)](this,t=>{const e=r;var n,i,o,a,c;if(!t)return"";let f=null===(i=null===(n=g.decrypt(t,s(this,d,"f"),{mode:e(403)}))||void 0===n?void 0:n[e(424)])||void 0===i?void 0:i[e(394)](n);if(/^[0-9A-Fa-f]{64}$/[e(416)](f))f=f[e(417)]();else{const t=null===(o=null==f?void 0:f.match)||void 0===o?void 0:o[e(394)](f,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))f=null===(c=null===(a=t[1])||void 0===a?void 0:a[e(417)])||void 0===c?void 0:c[e(394)](a);else{const t=f[e(411)](/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(f=t[1].toUpperCase())}}return f}),y.set(this,()=>i(this,void 0,void 0,function*(){const t=r;return s(this,p,"f")?s(this,p,"f"):s(this,w,"f")?(yield E(100),yield s(this,y,"f").call(this)):(o(this,w,!0,"f"),e[t(396)]()[t(415)](t=>t.get()).then(e=>{const n=t;return o(this,w,!1,"f"),o(this,p,s(this,l,"f")+e[n(422)],"f"),s(this,p,"f")}))})),this[r(398)]=t=>{const e=r;t&&o(this,m,s(this,v,"f")[e(394)](this,t),"f")},this[r(402)]=()=>i(this,void 0,void 0,function*(){const t=r;s(this,p,"f")||(yield s(this,y,"f")[t(394)](this));const e={d:s(this,p,"f"),n:b(32,{type:"alphanumeric"}),t:Date.now()[t(425)](),s:""},n=e.d+e.t+e.n;return e.s=g[t(418)](n,s(this,d,"f"),{mode:"cbc"}),e}),this[r(392)]=()=>i(this,void 0,void 0,function*(){const t=r;var e,n;if(s(this,p,"f")||(yield s(this,y,"f").call(this)),!s(this,m,"f"))return yield E(100),yield this[t(392)]();const i={"X-T":Date[t(407)]()[t(425)](),"X-N":b(32,{type:t(399)}),"X-DI":s(this,p,"f"),"X-S":""},o=s(this,d,"f")+s(this,p,"f")+i[t(420)]+i[t(395)];return i["X-S"]=null===(n=null===(e=I[t(397)](o,s(this,m,"f"),{hash:!0,der:!1,mode:0,userId:s(this,h,"f")}))||void 0===e?void 0:e[t(417)])||void 0===n?void 0:n[t(394)](e),i});const{uId:a="1234567812345678",deviceId:c,deviceIdPrefix:f=""}=n;o(this,d,t,"f"),o(this,h,a,"f"),o(this,l,f,"f"),c?o(this,p,c,"f"):typeof window!==r(423)&&typeof document!==r(423)&&s(this,y,"f")[r(394)](this)}}h=new WeakMap,d=new WeakMap,p=new WeakMap,l=new WeakMap,w=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap;const P=function(t){const e=a;let n=null;const r=new Proxy(t,{construct(t,e){const r=a;return n||(n="undefined"!=typeof Reflect&&Reflect[r(133)]?Reflect[r(133)](t,e):new t(...e),n)}});return r.prototype[e(147)]=r,r}(M);return t.BaseOmUtils=M,t.OmUtils=P,t.default=P,t.rsaOaepEncrypt=function(t,e,n={}){const i=a,{outputEncoding:s="hex",oaepHash:o=i(132),mgf1Hash:c=o}=n,f=function(t){const e=a;return t[e(131)](/-----BEGIN PUBLIC KEY-----/,"")[e(131)](/-----END PUBLIC KEY-----/,"").replace(/\s/g,"")}(e);let u;try{u=r[i(137)].publicKeyFromPem(f)}catch(t){try{const t=i(153)+f+i(145);u=r[i(137)][i(134)](t)}catch(t){throw new Error(i(124)+(t instanceof Error?t[i(140)]:String(t)))}}const h=o===i(132)?r.md[i(123)][i(139)]():r.md.sha1[i(139)](),d=c===i(132)?r.md.sha256[i(139)]():r.md[i(135)][i(139)]();let p;try{p=u[i(142)](t,i(144),{md:h,mgf1Md:d})}catch(t){throw new Error(i(158)+(t instanceof Error?t.message:String(t)))}if(s===i(141))return r[i(149)].bytesToHex(p);if("base64"===s)return r[i(149)].encode64(p);throw new Error(i(126)+s)},Object.defineProperty(t,"__esModule",{value:!0}),t}({},FingerprintJS,SMCrypto,forge);
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@fingerprintjs/fingerprintjs"),require("sm-crypto"),require("node-forge")):"function"==typeof define&&define.amd?define(["exports","@fingerprintjs/fingerprintjs","sm-crypto","node-forge"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).omUtils={},t.FingerprintJS,t.SMCrypto,t.forge)}(this,function(t,e,n,r){"use strict";function i(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})}function o(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function s(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function a(t,e){t-=489;return c()[t]}function c(){const t=["from","base64","prototype","3473424vDHWyC","create","99962cwrhaQ","encode64","234462vvlVcs","Invalid public key: ","sha1","encrypt","message","publicKeyFromPem","712BBOxQW","4186850KmviDo","\n-----END PUBLIC KEY-----","10090jaKVxs","5Mdlpvn","1659648KHrbuc","6SSdyWb","hex","SHA-256","RSA encryption failed: ","construct","replace","RSA-OAEP","undefined","constructor","pki","sha256","Unsupported output encoding: ","padStart","2593241dNiizq","toString","util"];return(c=function(){return t})()}function f(t,e){t-=226;return S()[t]}var u,h,d,p,l,y,m,w;"function"==typeof SuppressedError&&SuppressedError,function(t){const e=a,n=t();for(;;)try{if(226901===-parseInt(e(499))/1*(parseInt(e(522))/2)+-parseInt(e(489))/3+parseInt(e(495))/4*(parseInt(e(498))/5)+-parseInt(e(501))/6*(-parseInt(e(514))/7)+-parseInt(e(500))/8+-parseInt(e(520))/9+parseInt(e(496))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(c),function(t){const e=f,n=t();for(;;)try{if(236838===-parseInt(e(239))/1+parseInt(e(233))/2+parseInt(e(232))/3*(-parseInt(e(241))/4)+-parseInt(e(243))/5+-parseInt(e(253))/6*(parseInt(e(242))/7)+parseInt(e(230))/8*(parseInt(e(263))/9)+parseInt(e(237))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(S);const{sm2:v,sm4:I}=n;function g(t){return i(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function E(t,e={}){const n=f,{allowLeadingZero:r=!1,type:i=n(251)}=e;if(!Number[n(236)](t))throw new Error(n(249));const o={number:"0123456789",alphanumeric:n(235)},s=o[i]||o[n(251)];let a="";r||i!==n(251)?a+=s[Math[n(247)](Math.random()*s.length)]:a+=s[Math[n(247)](9*Math[n(259)]()+1)];for(let e=1;e<t;e++)a+=s[Math.floor(Math.random()*s.length)];return a}class b{constructor(t,n={}){const r=f;u.set(this,""),h[r(238)](this,""),d[r(238)](this,""),p[r(238)](this,""),l[r(238)](this,!1),y[r(238)](this,""),m[r(238)](this,t=>{const e=r;var n,i,s,a,c;if(!t)return"";let f=null===(i=null===(n=I.decrypt(t,o(this,h,"f"),{mode:e(257)}))||void 0===n?void 0:n[e(226)])||void 0===i?void 0:i[e(240)](n);if(/^[0-9A-Fa-f]{64}$/.test(f))f=f[e(250)]();else{const t=null===(s=null==f?void 0:f[e(261)])||void 0===s?void 0:s[e(240)](f,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))f=null===(c=null===(a=t[1])||void 0===a?void 0:a[e(250)])||void 0===c?void 0:c[e(240)](a);else{const t=f.match(/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(f=t[1][e(250)]())}}return f}),w[r(238)](this,()=>i(this,void 0,void 0,function*(){const t=r;return o(this,d,"f")?o(this,d,"f"):o(this,l,"f")?(yield g(100),yield o(this,w,"f")[t(240)](this)):(s(this,l,!0,"f"),e[t(254)]().then(t=>t.get())[t(231)](e=>{const n=t;return s(this,l,!1,"f"),s(this,d,o(this,p,"f")+e[n(244)],"f"),o(this,d,"f")}))})),this[r(258)]=t=>{t&&s(this,y,o(this,m,"f").call(this,t),"f")},this[r(256)]=()=>i(this,void 0,void 0,function*(){const t=r;o(this,d,"f")||(yield o(this,w,"f").call(this));const e={d:o(this,d,"f"),n:E(32,{type:"alphanumeric"}),t:Date.now()[t(255)](),s:""},n=e.d+e.t+e.n;return e.s=I[t(228)](n,o(this,h,"f"),{mode:t(257)}),e}),this.getPublicHeaders=()=>i(this,void 0,void 0,function*(){const t=r;var e,n;if(o(this,d,"f")||(yield o(this,w,"f")[t(240)](this)),!o(this,y,"f"))return yield g(100),yield this[t(262)]();const i={"X-T":Date[t(248)]()[t(255)](),"X-N":E(32,{type:t(252)}),"X-DI":o(this,d,"f"),"X-S":""},s=o(this,h,"f")+o(this,d,"f")+i[t(245)]+i[t(229)];return i[t(246)]=null===(n=null===(e=v[t(234)](s,o(this,y,"f"),{hash:!0,der:!1,mode:0,userId:o(this,u,"f")}))||void 0===e?void 0:e.toUpperCase)||void 0===n?void 0:n[t(240)](e),i});const{uId:a=r(227),deviceId:c,deviceIdPrefix:b=""}=n;s(this,h,t,"f"),s(this,u,a,"f"),s(this,p,b,"f"),c?s(this,d,c,"f"):typeof window!==r(260)&&typeof document!==r(260)&&o(this,w,"f")[r(240)](this)}}u=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,l=new WeakMap,y=new WeakMap,m=new WeakMap,w=new WeakMap;const M=function(t){const e=a;let n=null;const r=new Proxy(t,{construct(t,e){const r=a;return n||(n=typeof Reflect!==r(508)&&Reflect.construct?Reflect[r(505)](t,e):new t(...e),n)}});return r[e(519)][e(509)]=r,r}(b);function S(){const t=["undefined","match","getPublicHeaders","9RhyptE","trim","1234567812345678","encrypt","X-T","1728352BxgLBQ","then","3TbwOvA","17748uDKjzD","doSignature","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","9399090kWlwFZ","set","127951SJMnfq","call","1312072yqIhsh","42kAJrRU","795570loeSmu","visitorId","X-N","X-S","floor","now","长度必须是整数","toUpperCase","number","alphanumeric","312906gQpoUr","load","toString","getRegisterBody","ecb","setAccessToken","random"];return(S=function(){return t})()}t.BaseOmUtils=b,t.OmUtils=M,t.default=M,t.rsaOaepEncrypt=function(t,e,n={}){const i=a,{outputEncoding:o="hex",oaepHash:s=i(503),mgf1Hash:c=s}=n,f=function(t){const e=a;return t[e(506)](/-----BEGIN PUBLIC KEY-----/,"")[e(506)](/-----END PUBLIC KEY-----/,"")[e(506)](/\s/g,"")}(e);let u;try{u=r[i(510)][i(494)](f)}catch(t){try{const t="-----BEGIN PUBLIC KEY-----\n"+f+i(497);u=r[i(510)][i(494)](t)}catch(t){throw new Error(i(490)+(t instanceof Error?t[i(493)]:String(t)))}}const h=s===i(503)?r.md[i(511)][i(521)]():r.md.sha1[i(521)](),d=c===i(503)?r.md[i(511)][i(521)]():r.md[i(491)][i(521)]();let p;try{const e=u[i(492)](t,i(507),{md:h,mgf1Md:d});p=new Uint8Array(e)}catch(t){throw new Error(i(504)+(t instanceof Error?t[i(493)]:String(t)))}if("hex"===o)return function(t){const e=a;return Array[e(517)](t).map(t=>t[e(515)](16)[e(513)](2,"0")).join("")}(p);if(o===i(518))return r[i(516)][i(523)](p);throw new Error(i(512)+o)},Object.defineProperty(t,"__esModule",{value:!0})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@fingerprintjs/fingerprintjs"),require("sm-crypto"),require("node-forge")):"function"==typeof define&&define.amd?define(["exports","@fingerprintjs/fingerprintjs","sm-crypto","node-forge"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).omUtils={},t.FingerprintJS,t.SMCrypto,t.forge)}(this,function(t,e,n,r){"use strict";function i(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})}function o(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function s(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function a(t,e){t-=123;return c()[t]}function c(){const t=["hex","encrypt","935496LctVkQ","RSA-OAEP","\n-----END PUBLIC KEY-----","map","constructor","toString","util","10UzCWjI","22kZxKlr","44cmyfWJ","-----BEGIN PUBLIC KEY-----\n","base64","7tcNzWQ","join","2385630AwuBgV","RSA encryption failed: ","sha256","Invalid public key: ","from","Unsupported output encoding: ","1565764WNHger","738605MnwaRa","3DGqRPk","1100832nFOiUT","replace","SHA-256","construct","publicKeyFromPem","sha1","2384104uIlxKk","pki","8696HdvCfp","create","message"];return(c=function(){return t})()}function f(){const t=["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","isInteger","match","3PqZmwO","144VXKZwT","207384BAYvfw","then","test","toUpperCase","encrypt","4065855fuXFFh","X-N","1063VuiXoJ","visitorId","undefined","trim","toString","4887076fAncCv","40942100snVxUr","152817MdNYJn","getPublicHeaders","1686IhBcrj","call","X-T","load","doSignature","setAccessToken","alphanumeric","random","length","getRegisterBody","cbc","number","9544974wKvIMY","floor","now","set"];return(f=function(){return t})()}function u(t,e){t-=392;return f()[t]}var h,d,p,l,m,w,y,v;"function"==typeof SuppressedError&&SuppressedError,function(t){const e=a,n=t();for(;;)try{if(216427===-parseInt(e(151))/1*(parseInt(e(138))/2)+parseInt(e(129))/3*(-parseInt(e(127))/4)+parseInt(e(128))/5+parseInt(e(143))/6+-parseInt(e(155))/7*(-parseInt(e(136))/8)+-parseInt(e(157))/9*(parseInt(e(150))/10)+parseInt(e(152))/11*(parseInt(e(130))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(c),function(t){const e=u,n=t();for(;;)try{if(864267===-parseInt(e(421))/1*(-parseInt(e(393))/2)+-parseInt(e(412))/3*(-parseInt(e(426))/4)+parseInt(e(419))/5+parseInt(e(405))/6+parseInt(e(428))/7+-parseInt(e(414))/8*(-parseInt(e(413))/9)+-parseInt(e(427))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(f);const{sm2:I,sm4:g}=n;function b(t){return i(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function E(t,e={}){const n=u,{allowLeadingZero:r=!1,type:i="number"}=e;if(!Number[n(410)](t))throw new Error("长度必须是整数");const o={number:"0123456789",alphanumeric:n(409)},s=o[i]||o[n(404)];let a="";r||i!==n(404)?a+=s[Math[n(406)](Math.random()*s[n(401)])]:a+=s[Math[n(406)](9*Math[n(400)]()+1)];for(let e=1;e<t;e++)a+=s[Math[n(406)](Math[n(400)]()*s[n(401)])];return a}class M{constructor(t,n={}){const r=u;h[r(408)](this,""),d[r(408)](this,""),p.set(this,""),l[r(408)](this,""),m[r(408)](this,!1),w.set(this,""),y[r(408)](this,t=>{const e=r;var n,i,s,a,c;if(!t)return"";let f=null===(i=null===(n=g.decrypt(t,o(this,d,"f"),{mode:e(403)}))||void 0===n?void 0:n[e(424)])||void 0===i?void 0:i[e(394)](n);if(/^[0-9A-Fa-f]{64}$/[e(416)](f))f=f[e(417)]();else{const t=null===(s=null==f?void 0:f.match)||void 0===s?void 0:s[e(394)](f,/0201010420([0-9A-Fa-f]{64})/i);if(t&&(null==t?void 0:t[1]))f=null===(c=null===(a=t[1])||void 0===a?void 0:a[e(417)])||void 0===c?void 0:c[e(394)](a);else{const t=f[e(411)](/04([0-9A-Fa-f]{64})/i);t&&t[1]&&(f=t[1].toUpperCase())}}return f}),v.set(this,()=>i(this,void 0,void 0,function*(){const t=r;return o(this,p,"f")?o(this,p,"f"):o(this,m,"f")?(yield b(100),yield o(this,v,"f").call(this)):(s(this,m,!0,"f"),e[t(396)]()[t(415)](t=>t.get()).then(e=>{const n=t;return s(this,m,!1,"f"),s(this,p,o(this,l,"f")+e[n(422)],"f"),o(this,p,"f")}))})),this[r(398)]=t=>{const e=r;t&&s(this,w,o(this,y,"f")[e(394)](this,t),"f")},this[r(402)]=()=>i(this,void 0,void 0,function*(){const t=r;o(this,p,"f")||(yield o(this,v,"f")[t(394)](this));const e={d:o(this,p,"f"),n:E(32,{type:"alphanumeric"}),t:Date.now()[t(425)](),s:""},n=e.d+e.t+e.n;return e.s=g[t(418)](n,o(this,d,"f"),{mode:"cbc"}),e}),this[r(392)]=()=>i(this,void 0,void 0,function*(){const t=r;var e,n;if(o(this,p,"f")||(yield o(this,v,"f").call(this)),!o(this,w,"f"))return yield b(100),yield this[t(392)]();const i={"X-T":Date[t(407)]()[t(425)](),"X-N":E(32,{type:t(399)}),"X-DI":o(this,p,"f"),"X-S":""},s=o(this,d,"f")+o(this,p,"f")+i[t(420)]+i[t(395)];return i["X-S"]=null===(n=null===(e=I[t(397)](s,o(this,w,"f"),{hash:!0,der:!1,mode:0,userId:o(this,h,"f")}))||void 0===e?void 0:e[t(417)])||void 0===n?void 0:n[t(394)](e),i});const{uId:a="1234567812345678",deviceId:c,deviceIdPrefix:f=""}=n;s(this,d,t,"f"),s(this,h,a,"f"),s(this,l,f,"f"),c?s(this,p,c,"f"):typeof window!==r(423)&&typeof document!==r(423)&&o(this,v,"f")[r(394)](this)}}h=new WeakMap,d=new WeakMap,p=new WeakMap,l=new WeakMap,m=new WeakMap,w=new WeakMap,y=new WeakMap,v=new WeakMap;const P=function(t){const e=a;let n=null;const r=new Proxy(t,{construct(t,e){const r=a;return n||(n="undefined"!=typeof Reflect&&Reflect[r(133)]?Reflect[r(133)](t,e):new t(...e),n)}});return r.prototype[e(147)]=r,r}(M);t.BaseOmUtils=M,t.OmUtils=P,t.default=P,t.rsaOaepEncrypt=function(t,e,n={}){const i=a,{outputEncoding:o="hex",oaepHash:s=i(132),mgf1Hash:c=s}=n,f=function(t){const e=a;return t[e(131)](/-----BEGIN PUBLIC KEY-----/,"")[e(131)](/-----END PUBLIC KEY-----/,"").replace(/\s/g,"")}(e);let u;try{u=r[i(137)].publicKeyFromPem(f)}catch(t){try{const t=i(153)+f+i(145);u=r[i(137)][i(134)](t)}catch(t){throw new Error(i(124)+(t instanceof Error?t[i(140)]:String(t)))}}const h=s===i(132)?r.md[i(123)][i(139)]():r.md.sha1[i(139)](),d=c===i(132)?r.md.sha256[i(139)]():r.md[i(135)][i(139)]();let p;try{p=u[i(142)](t,i(144),{md:h,mgf1Md:d})}catch(t){throw new Error(i(158)+(t instanceof Error?t.message:String(t)))}if(o===i(141))return r[i(149)].bytesToHex(p);if("base64"===o)return r[i(149)].encode64(p);throw new Error(i(126)+o)},Object.defineProperty(t,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-drowned-fish/om-utils",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "一个用于处理设备指纹、加密签名和认证的工具库,专为 OM 系统设计。",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",