@gsc-basic/utils 1.4.5 → 1.4.6

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.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
2
  import { titleCase } from "title-case";
3
- import { compile as regexpToPath, pathToRegexp } from "path-to-regexp";
4
3
  import ResizeObserver from "resize-observer-polyfill";
5
4
  import { Config } from "dompurify";
6
5
  import { MarkedExtension, MarkedOptions } from "marked";
6
+ import { compile as regexpToPath, pathToRegexp } from "path-to-regexp";
7
7
  export declare function pascalCase(value: string): string;
8
8
  /**
9
9
  * 在大多数情况下使用 lodash 的 `kebabCase`,
package/dist/index.js CHANGED
@@ -7,11 +7,11 @@ You shall not disclose such Confidential Information and shall use it only in
7
7
  accordance with the terms of the license agreement.
8
8
 
9
9
  --- Build Info ---
10
- Version: 1.4.4
11
- Build Time: 2026/11/5 17:06:46
12
- Build Commit: 1f6854bb7b2928dff3308e709c1b8302e447f0d5
10
+ Version: 1.4.6
11
+ Build Time: 2026/11/26 15:29:22
12
+ Build Commit: 50f0151313db2d80b4ab32035fd512e247c889e7
13
13
  */
14
- import{titleCase as e}from"title-case";import{camelCase as t,intersectionWith as n,isArray as r,isEqual as i,isFunction as a,isNil as o,isPlainObject as s,kebabCase as c,mergeWith as l,round as u,unionWith as d,upperFirst as f}from"lodash-es";import{compile as p,pathToRegexp as ee}from"path-to-regexp";import{hmac as m}from"@noble/hashes/hmac.js";import{sha256 as h,sha512 as g}from"@noble/hashes/sha2.js";import{bytesToHex as _,utf8ToBytes as v}from"@noble/hashes/utils.js";import y from"resize-observer-polyfill";import b from"dompurify";import{Marked as x}from"marked";import{markedHighlight as S}from"marked-highlight";import{gfmHeadingId as te}from"marked-gfm-heading-id";import ne from"marked-alert";import{markedSmartypants as re}from"marked-smartypants";import C from"highlight.js/lib/core";import ie from"highlight.js/lib/languages/bash";import ae from"highlight.js/lib/languages/c";import oe from"highlight.js/lib/languages/cpp";import se from"highlight.js/lib/languages/css";import ce from"highlight.js/lib/languages/go";import le from"highlight.js/lib/languages/java";import ue from"highlight.js/lib/languages/javascript";import de from"highlight.js/lib/languages/json";import fe from"highlight.js/lib/languages/markdown";import pe from"highlight.js/lib/languages/php";import me from"highlight.js/lib/languages/plaintext";import he from"highlight.js/lib/languages/python";import ge from"highlight.js/lib/languages/rust";import _e from"highlight.js/lib/languages/scss";import ve from"highlight.js/lib/languages/sql";import ye from"highlight.js/lib/languages/typescript";import w from"highlight.js/lib/languages/xml";import be from"highlight.js/lib/languages/yaml";import{v4 as T}from"uuid";function xe(e){return f(t(e))}function Se(e){if(!e)return``;let t=c(e),n=e.replace(/[^A-Z0-9]/gi,``);if(n.length===t.replace(/-/g,``).length){let e=0,r=``;for(let i=0;i<t.length;i+=1){let a=t[i];if(a===`-`){let o=t[i-1],s=t[i+1],c=n[e],l=c&&c.toUpperCase()===c&&c.toLowerCase()!==c,u=i+1===t.length-1;if(o&&s&&/[a-z0-9]/.test(o)&&/[a-z0-9]/.test(s)&&(!/\d/.test(o)&&/\d/.test(s)||/\d/.test(o)&&!/\d/.test(s)&&!l||/\d/.test(o)&&!/\d/.test(s)&&l&&u))continue;r+=a}else r+=a,e+=1}t=r}return t}const E={mobile:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,tel:/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,numAndLetter:/^[A-Z0-9]+$/i,password:/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,email:/^[A-Z0-9_\u4E00-\u9FA5]+[A-Z0-9_.+%\u4E00-\u9FA5\-]*@[A-Z0-9_.\-]+(\.[A-Z0-9_\-]+)+$/i,postalCode:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,identityCard:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,ip:/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,url:/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,httpsUrl:/^https:\/\//,domain:/^([0-9a-z-]+\.)+([a-z]{2,})$/i,plateNumber:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,md5:/^[a-f0-9]{32}$/i,base64:/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,uuid:/^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,version:/^\d+(?:\.\d+){2}$/,videoUrl:/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,imageUrl:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,chinese:/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,itcode:/^[a-z]+\d*$/i,numeric:/^\d+$/},Ce=Object.prototype.toString;function D(e,t){return Ce.call(e)===`[object ${t}]`}function O(e){return e!==null&&D(e,`Object`)}function we(e){return E.url.test(e)}function k(e){return Array.isArray(e)&&e.length>0}function Te(e){return Number.isInteger(e)&&e>=0}function Ee(e){return E.numeric.test(e)}const A=typeof window>`u`,j=!A,M=j&&window.navigator.userAgent.toLowerCase().includes(`chrome`),N=j&&window.navigator.userAgent.toLowerCase().includes(`safari`),P=typeof window<`u`&&typeof document<`u`,De=P&&`webkitLineClamp`in document.body.style,Oe=P&&typeof ResizeObserver<`u`,ke=e=>E.chinese.test(e),Ae=()=>`startViewTransition`in document&&window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches;function je(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Me(e,t){if(e==null)return{};var n,r,i=je(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function F(e){"@babel/helpers - typeof";return F=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},F(e)}function Ne(e,t){if(F(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(F(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pe(e){var t=Ne(e,`string`);return F(t)==`symbol`?t:t+``}function I(e,t,n){return(t=Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Fe(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ie=[`matched`],Le=(e,t)=>{let n=e;return n.install=r=>{r.component(n.name||n.displayName,e),t&&(r.config.globalProperties[t]=e)},e};function Re(e){if(!e)return e;let{matched:t}=e;return L(L({},Me(e,Ie)),{},{matched:t?t.map(e=>({meta:e.meta,name:e.name,path:e.path})):void 0})}function ze(e,t={}){let{target:n=`__blank`,noopener:r=!0,noreferrer:i=!0}=t||{},a=[];r&&a.push(`noopener=yes`),i&&a.push(`noreferrer=yes`),window.open(e,n,a.join(`,`))}function Be(e,t,a=`replace`){return t?e?l(e,t,(e,t)=>{if(r(t)&&r(e))switch(a){case`union`:return d(e,t,i);case`intersection`:return n(e,t,i);case`concat`:return e.concat(t);case`replace`:return t;default:throw Error(`Unknown merge array strategy: ${a}`)}if(O(t)&&O(e))return Be(e,t,a)}):t:e}function Ve(e,t){if(!k(Object.keys(t)))return e;let n=``;for(let e in t){let r=t[e];n+=Array.isArray(r)?`${e}=${encodeURIComponent(r.join(`,`))}&`:`${e}=${encodeURIComponent(r)}&`}return n=n.replace(/&$/,``),/\?$/.test(e)?e+n:e.replace(/\/?$/,`?`)+n}function He(e){s(e)&&Object.keys(e).forEach(t=>{Reflect.deleteProperty(e,t)})}function Ue(e){return[`$`,`(`,`)`,`*`,`+`,`.`,`[`,`]`,`?`,`\\`,`^`,`{`,`}`,`|`].includes(e)?`\\${e}`:e}function We(e){let t=[``,...[...e].map(e=>Ue(e)),``].join(`.*`);return new RegExp(t,`i`)}function Ge(e=``,t={}){let{size:n=14,family:r=getComputedStyle(document.documentElement).getPropertyValue(`--vxe-font-family`)||`sans-serif`}=t,i=document.createElement(`canvas`).getContext(`2d`);i.font=`${n}px ${r}`;let a=i.measureText(e),o=Math.abs(a.actualBoundingBoxLeft)+Math.abs(a.actualBoundingBoxRight);return Math.ceil(Math.max(a.width,o))}function R(e,t){return t?typeof t==`string`?` ${e}--${t}`:Array.isArray(t)?t.reduce((t,n)=>t+R(e,n),``):Object.keys(t).reduce((n,r)=>n+(t[r]?R(e,r):``),``):``}function z(e){return(t,n)=>(t&&typeof t!=`string`&&(n=t,t=``),t=t?`${e}__${t}`:e,`${t}${R(t,n)}`)}function Ke(e,t=``){return[z(`${t}-${e}`)]}function qe(e,t=``){let n=`${t}-${e}`;return[n,z(n)]}function B(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function V(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){B(a,r,i,o,s,`next`,e)}function s(e){B(a,r,i,o,s,`throw`,e)}o(void 0)})}}const H=new TextEncoder,Je=new TextDecoder;function U(){var e;if(!((e=window.crypto)!=null&&e.subtle))throw Error(`Web Crypto API is not available in the current environment.`);return window.crypto}function W(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}function Ye(e){let t=atob(e);return Uint8Array.from(t,e=>e.charCodeAt(0))}function Xe(e){return W(H.encode(e))}function Ze(e){return Je.decode(Ye(e))}function Qe(e){return _(h(v(e)))}function $e(e){return _(g(v(e)))}function et(e,t){return _(m(h,v(t),v(e)))}function tt(e=32){if(!Number.isSafeInteger(e)||e<=0||e>65536)throw Error(`The key byte length must be an integer between 1 and 65536.`);return W(U().getRandomValues(new Uint8Array(e)))}function nt(e){return G.apply(this,arguments)}function G(){return G=V(function*({password:e,salt:t,iterations:n=6e5,keyLength:r=32}){if(!Number.isSafeInteger(n)||n<=0)throw Error(`PBKDF2 iterations must be a positive integer.`);if(!Number.isSafeInteger(r)||r<=0)throw Error(`The derived key length must be a positive integer.`);let i=U(),a=yield i.subtle.importKey(`raw`,H.encode(e),`PBKDF2`,!1,[`deriveBits`]),o=yield i.subtle.deriveBits({name:`PBKDF2`,hash:`SHA-256`,salt:H.encode(t),iterations:n},a,r*8);return W(new Uint8Array(o))}),G.apply(this,arguments)}var rt=class{constructor({key:e,additionalData:t}){I(this,`key`,void 0),I(this,`additionalData`,void 0),this.key=e,this.additionalData=t?H.encode(t):void 0}encrypt(e){var t=this;return V(function*(){let n=U(),r=n.getRandomValues(/* @__PURE__ */ new Uint8Array(12)),i=yield n.subtle.encrypt(L({name:`AES-GCM`,iv:r},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),H.encode(e)),a=new Uint8Array(i),o=new Uint8Array(12+a.length);return o.set(r),o.set(a,12),W(o)})()}decrypt(e){var t=this;return V(function*(){let n=Ye(e);if(n.length<=12)throw Error(`The AES-GCM payload is invalid.`);let r=yield U().subtle.decrypt(L({name:`AES-GCM`,iv:n.slice(0,12)},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),n.slice(12));return Je.decode(r)})()}getKey(){var e=this;return V(function*(){return U().subtle.importKey(`raw`,h(v(e.key)),`AES-GCM`,!1,[`encrypt`,`decrypt`])})()}};const it=()=>document.documentElement;function at(e){return!e||!e.getBoundingClientRect?0:e.getBoundingClientRect()}function ot(e){return(e||``).replace(/^\s+|\s+$/g,``)}function K(e,t){if(!e||!t)return!1;if(t.includes(` `))throw Error(`className should not contain space.`);return e.classList?e.classList.contains(t):` ${e.className} `.includes(` ${t} `)}function st(e,t,n){return n||(n=it()),n.style.setProperty(e,t),{prop:t}}function ct(e,t){if(!e)return;let n=e.className,r=(t||``).split(` `);for(let t=0,i=r.length;t<i;t++){let i=r[t];i&&(e.classList?e.classList.add(i):K(e,i)||(n+=` ${i}`))}e.classList||(e.className=n)}function lt(e,t){if(!e||!t)return;let n=t.split(` `),r=` ${e.className} `;for(let t=0,i=n.length;t<i;t++){let i=n[t];i&&(e.classList?e.classList.remove(i):K(e,i)&&(r=r.replace(` ${i} `,` `)))}e.classList||(e.className=ot(r))}function ut(e){let t=document.documentElement,n=t.scrollLeft,r=t.scrollTop,i=t.clientLeft,a=t.clientTop,o=window.scrollX,s=window.scrollY,c=at(e);if(!c)return{};let{left:l,top:u,width:d,height:f}=c,p=(o||n)-(i||0),ee=(s||r)-(a||0),m=l+o,h=u+s,g=m-p,_=h-ee,v=window.document.documentElement.clientWidth,y=window.document.documentElement.clientHeight;return{left:g,top:_,right:v-d-g,bottom:y-f-_,rightIncludeBody:v-g,bottomIncludeBody:y-_}}function dt(e,t){let n=[`webkit`,`Moz`,`ms`,`OT`],r={};return n.forEach(n=>{r[`${n}${f(e)}`]=t}),L(L({},r),{},{[e]:t})}function ft(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}function pt(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}function mt(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}
14
+ import{titleCase as e}from"title-case";import{camelCase as t,intersectionWith as n,isArray as r,isEqual as i,isFunction as a,isNil as o,isPlainObject as s,kebabCase as c,mergeWith as l,round as u,unionWith as d,upperFirst as f}from"lodash-es";import{compile as p,pathToRegexp as ee}from"path-to-regexp";import{hmac as m}from"@noble/hashes/hmac.js";import{sha256 as h,sha512 as g}from"@noble/hashes/sha2.js";import{bytesToHex as _,utf8ToBytes as v}from"@noble/hashes/utils.js";import y from"resize-observer-polyfill";import b from"dompurify";import{Marked as x}from"marked";import{markedHighlight as S}from"marked-highlight";import{gfmHeadingId as te}from"marked-gfm-heading-id";import ne from"marked-alert";import{markedSmartypants as re}from"marked-smartypants";import C from"highlight.js/lib/core";import ie from"highlight.js/lib/languages/bash";import ae from"highlight.js/lib/languages/c";import oe from"highlight.js/lib/languages/cpp";import se from"highlight.js/lib/languages/css";import ce from"highlight.js/lib/languages/go";import le from"highlight.js/lib/languages/java";import ue from"highlight.js/lib/languages/javascript";import de from"highlight.js/lib/languages/json";import fe from"highlight.js/lib/languages/markdown";import pe from"highlight.js/lib/languages/php";import me from"highlight.js/lib/languages/plaintext";import he from"highlight.js/lib/languages/python";import ge from"highlight.js/lib/languages/rust";import _e from"highlight.js/lib/languages/scss";import ve from"highlight.js/lib/languages/sql";import ye from"highlight.js/lib/languages/typescript";import w from"highlight.js/lib/languages/xml";import be from"highlight.js/lib/languages/yaml";import{v4 as T}from"uuid";function xe(e){return f(t(e))}function Se(e){if(!e)return``;let t=c(e),n=e.replace(/[^A-Z0-9]/gi,``);if(n.length===t.replace(/-/g,``).length){let e=0,r=``;for(let i=0;i<t.length;i+=1){let a=t[i];if(a===`-`){let o=t[i-1],s=t[i+1],c=n[e],l=c&&c.toUpperCase()===c&&c.toLowerCase()!==c,u=i+1===t.length-1;if(o&&s&&/[a-z0-9]/.test(o)&&/[a-z0-9]/.test(s)&&(!/\d/.test(o)&&/\d/.test(s)||/\d/.test(o)&&!/\d/.test(s)&&!l||/\d/.test(o)&&!/\d/.test(s)&&l&&u))continue;r+=a}else r+=a,e+=1}t=r}return t}const E={mobile:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,tel:/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,numAndLetter:/^[A-Z0-9]+$/i,password:/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,email:/^[A-Z0-9_\u4E00-\u9FA5]+[A-Z0-9_.+%\u4E00-\u9FA5\-]*@[A-Z0-9_.\-]+(\.[A-Z0-9_\-]+)+$/i,postalCode:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,identityCard:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,ip:/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,url:/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,httpsUrl:/^https:\/\//,domain:/^([0-9a-z-]+\.)+([a-z]{2,})$/i,plateNumber:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,md5:/^[a-f0-9]{32}$/i,base64:/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,uuid:/^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,version:/^\d+(?:\.\d+){2}$/,videoUrl:/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,imageUrl:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,chinese:/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,itcode:/^[a-z]+\d*$/i,numeric:/^\d+$/},Ce=Object.prototype.toString;function D(e,t){return Ce.call(e)===`[object ${t}]`}function O(e){return e!==null&&D(e,`Object`)}function we(e){return E.url.test(e)}function k(e){return Array.isArray(e)&&e.length>0}function Te(e){return Number.isInteger(e)&&e>=0}function Ee(e){return E.numeric.test(e)}const A=typeof window>`u`,j=!A,M=j&&window.navigator.userAgent.toLowerCase().includes(`chrome`),N=j&&window.navigator.userAgent.toLowerCase().includes(`safari`),P=typeof window<`u`&&typeof document<`u`,De=P&&`webkitLineClamp`in document.body.style,Oe=P&&typeof ResizeObserver<`u`,ke=e=>E.chinese.test(e),Ae=()=>`startViewTransition`in document&&window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches;function je(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Me(e,t){if(e==null)return{};var n,r,i=je(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function F(e){"@babel/helpers - typeof";return F=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},F(e)}function Ne(e,t){if(F(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(F(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pe(e){var t=Ne(e,`string`);return F(t)==`symbol`?t:t+``}function I(e,t,n){return(t=Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Fe(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ie=[`matched`],Le=(e,t)=>{let n=e;return n.install=r=>{r.component(n.name||n.displayName,e),t&&(r.config.globalProperties[t]=e)},e};function Re(e){if(!e)return e;let{matched:t}=e;return L(L({},Me(e,Ie)),{},{matched:t?t.map(e=>({meta:e.meta,name:e.name,path:e.path})):void 0})}function ze(e,t={}){let{target:n=`__blank`,noopener:r=!0,noreferrer:i=!0}=t||{},a=[];r&&a.push(`noopener=yes`),i&&a.push(`noreferrer=yes`),window.open(e,n,a.join(`,`))}function Be(e,t,a=`replace`){return t?e?l(e,t,(e,t)=>{if(r(t)&&r(e))switch(a){case`union`:return d(e,t,i);case`intersection`:return n(e,t,i);case`concat`:return e.concat(t);case`replace`:return t;default:throw Error(`Unknown merge array strategy: ${a}`)}if(O(t)&&O(e))return Be(e,t,a)}):t:e}function Ve(e,t){if(!k(Object.keys(t)))return e;let n=``;for(let e in t){let r=t[e];n+=Array.isArray(r)?`${e}=${encodeURIComponent(r.join(`,`))}&`:`${e}=${encodeURIComponent(r)}&`}return n=n.replace(/&$/,``),/\?$/.test(e)?e+n:e.replace(/\/?$/,`?`)+n}function He(e){s(e)&&Object.keys(e).forEach(t=>{Reflect.deleteProperty(e,t)})}function Ue(e){return[`$`,`(`,`)`,`*`,`+`,`.`,`[`,`]`,`?`,`\\`,`^`,`{`,`}`,`|`].includes(e)?`\\${e}`:e}function We(e){let t=[``,...[...e].map(e=>Ue(e)),``].join(`.*`);return new RegExp(t,`i`)}function Ge(e=``,t={}){let{size:n=14,family:r=getComputedStyle(document.documentElement).getPropertyValue(`--vxe-font-family`)||`sans-serif`}=t,i=document.createElement(`canvas`).getContext(`2d`);i.font=`${n}px ${r}`;let a=i.measureText(e),o=Math.abs(a.actualBoundingBoxLeft)+Math.abs(a.actualBoundingBoxRight);return Math.ceil(Math.max(a.width,o))}function R(e,t){return t?typeof t==`string`?` ${e}--${t}`:Array.isArray(t)?t.reduce((t,n)=>t+R(e,n),``):Object.keys(t).reduce((n,r)=>n+(t[r]?R(e,r):``),``):``}function z(e){return(t,n)=>(t&&typeof t!=`string`&&(n=t,t=``),t=t?`${e}__${t}`:e,`${t}${R(t,n)}`)}function Ke(e,t=``){return[z(`${t}-${e}`)]}function qe(e,t=``){let n=`${t}-${e}`;return[n,z(n)]}function B(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function V(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){B(a,r,i,o,s,`next`,e)}function s(e){B(a,r,i,o,s,`throw`,e)}o(void 0)})}}const H=new TextEncoder,Je=new TextDecoder;function U(){var e;if(!((e=window.crypto)!=null&&e.subtle))throw Error(`Web Crypto API is not available in the current environment.`);return window.crypto}function W(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}function Ye(e){let t=atob(e);return Uint8Array.from(t,e=>e.charCodeAt(0))}function Xe(e){return W(H.encode(e))}function Ze(e){return Je.decode(Ye(e))}function Qe(e){return _(h(v(e)))}function $e(e){return _(g(v(e)))}function et(e,t){return _(m(h,v(t),v(e)))}function tt(e=32){if(!Number.isSafeInteger(e)||e<=0||e>65536)throw Error(`The key byte length must be an integer between 1 and 65536.`);return W(U().getRandomValues(new Uint8Array(e)))}function nt(e){return G.apply(this,arguments)}function G(){return G=V(function*({password:e,salt:t,iterations:n=6e5,keyLength:r=32}){if(!Number.isSafeInteger(n)||n<=0)throw Error(`PBKDF2 iterations must be a positive integer.`);if(!Number.isSafeInteger(r)||r<=0)throw Error(`The derived key length must be a positive integer.`);let i=U(),a=yield i.subtle.importKey(`raw`,H.encode(e),`PBKDF2`,!1,[`deriveBits`]),o=yield i.subtle.deriveBits({name:`PBKDF2`,hash:`SHA-256`,salt:H.encode(t),iterations:n},a,r*8);return W(new Uint8Array(o))}),G.apply(this,arguments)}var rt=class{constructor({key:e,additionalData:t}){I(this,`key`,void 0),I(this,`additionalData`,void 0),this.key=e,this.additionalData=t?H.encode(t):void 0}encrypt(e){var t=this;return V(function*(){let n=U(),r=n.getRandomValues(/* @__PURE__ */ new Uint8Array(12)),i=yield n.subtle.encrypt(L({name:`AES-GCM`,iv:r},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),H.encode(e)),a=new Uint8Array(i),o=new Uint8Array(12+a.length);return o.set(r),o.set(a,12),W(o)})()}decrypt(e){var t=this;return V(function*(){let n=Ye(e);if(n.length<=12)throw Error(`The AES-GCM payload is invalid.`);let r=yield U().subtle.decrypt(L({name:`AES-GCM`,iv:n.slice(0,12)},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),n.slice(12));return Je.decode(r)})()}getKey(){var e=this;return V(function*(){return U().subtle.importKey(`raw`,h(v(e.key)),`AES-GCM`,!1,[`encrypt`,`decrypt`])})()}};const it=()=>document.documentElement;function at(e){return!e||!e.getBoundingClientRect?0:e.getBoundingClientRect()}function ot(e){return(e||``).replace(/^\s+|\s+$/g,``)}function K(e,t){if(!e||!t)return!1;if(t.includes(` `))throw Error(`className should not contain space.`);return e.classList?e.classList.contains(t):` ${e.className} `.includes(` ${t} `)}function st(e,t,n){return n||(n=it()),n.style.setProperty(e,t),{prop:t}}function ct(e,t){if(!e)return;let n=e.className,r=(t||``).split(` `);for(let t=0,i=r.length;t<i;t++){let i=r[t];i&&(e.classList?e.classList.add(i):K(e,i)||(n+=` ${i}`))}e.classList||(e.className=n)}function lt(e,t){if(!e||!t)return;let n=t.split(` `),r=` ${e.className} `;for(let t=0,i=n.length;t<i;t++){let i=n[t];i&&(e.classList?e.classList.remove(i):K(e,i)&&(r=r.replace(` ${i} `,` `)))}e.classList||(e.className=ot(r))}function ut(e){let t=document.documentElement,n=t.scrollLeft,r=t.scrollTop,i=t.clientLeft,a=t.clientTop,o=window.scrollX,s=window.scrollY,c=at(e);if(!c)return{};let{left:l,top:u,width:d,height:f}=c,p=(o||n)-(i||0),ee=(s||r)-(a||0),m=l+o,h=u+s,g=m-p,_=h-ee,v=window.document.documentElement.clientWidth,y=window.document.documentElement.clientHeight;return{left:g,top:_,right:v-d-g,bottom:y-f-_,rightIncludeBody:v-g,bottomIncludeBody:y-_}}function dt(e,t){let n=[`webkit`,`Moz`,`ms`,`OT`],r={};return n.forEach(n=>{r[`${n}${f(e)}`]=t}),L(L({},r),{},{[e]:t})}function ft(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}function pt(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}function mt(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}
15
15
  /* istanbul ignore next */
16
16
  function ht(e){for(let t of e){let e=t.target.__resizeListeners__||[];e.length&&e.forEach(e=>{e()})}}
17
17
  /* istanbul ignore next */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gsc-basic/utils",
3
3
  "type": "module",
4
- "version": "1.4.5",
4
+ "version": "1.4.6",
5
5
  "description": "Web Dev Utils for GSC Basic Team",
6
6
  "author": "Lenovo SSG BASD <-GSC_Scaffolding_Support@lenovo.com>",
7
7
  "license": "LicenseRef-Proprietary",
@@ -39,9 +39,9 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@noble/hashes": "^2.4.0",
42
- "dompurify": "^3.4.17",
42
+ "dompurify": "^3.5.0",
43
43
  "highlight.js": "^11.12.0",
44
- "marked": "^18.1.3",
44
+ "marked": "^18.3.0",
45
45
  "marked-alert": "^2.1.2",
46
46
  "marked-gfm-heading-id": "^4.1.4",
47
47
  "marked-highlight": "^2.2.4",