first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";exports.AbortablePromise=class{constructor(t){this._reject=null,this.promise=new Promise(((e,r)=>{t(e,r),this._reject=r}))}abort(t){this._reject&&this._reject(t)}then(t,e){return this.promise.then(t,e)}catch(t){return this.promise.catch(t)}};

View File

@@ -0,0 +1 @@
"use strict";const e=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],t=e=>e.replace(/[+/]/g,(e=>"+"===e?"-":"_")).replace(/=+\$/m,""),n="function"==typeof btoa?e=>btoa(e):n=>{if(n.charCodeAt(0)>255)throw new RangeError("The string contains invalid characters.");return((n,r=!1)=>{let o="";for(let t=0,c=n.length;t<c;t+=3){const[r,c,a]=[n[t],n[t+1],n[t+2]],i=r<<16|c<<8|a;o+=e[i>>>18],o+=e[i>>>12&63],o+=void 0!==c?e[i>>>6&63]:"=",o+=void 0!==a?e[63&i]:"="}return r?t(o):o})(Uint8Array.from(n,(e=>e.charCodeAt(0))))};exports.encode=function(e,r=!1){const o=n((e=>unescape(encodeURIComponent(e)))(e));return r?t(o):o};

View File

@@ -0,0 +1 @@
"use strict";

View File

@@ -0,0 +1 @@
"use strict";const e=require("./util.js");function t(){}exports.callInterceptor=function(c,{args:n=[],done:r,canceled:s,error:o}){if(c){const i=c.apply(null,n);e.isPromise(i)?i.then((e=>{e?r():s&&s()})).catch(o||t):i?r():s&&s()}else r()};

View File

@@ -0,0 +1 @@
"use strict";const e=[Number,String],r=e=>({type:String,default:e}),t={customStyle:r(""),customClass:r("")};exports.baseProps=t,exports.makeArrayProp=()=>({type:Array,default:()=>[]}),exports.makeBooleanProp=e=>({type:Boolean,default:e}),exports.makeNumberProp=e=>({type:Number,default:e}),exports.makeNumericProp=r=>({type:e,default:r}),exports.makeRequiredProp=e=>({type:e,required:!0}),exports.makeStringProp=r,exports.numericProp=e;

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../common/vendor.js"),e=require("./AbortablePromise.js");function r(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)||"object"==typeof t}function o(t){const e=Object.prototype.toString.call(t).match(/\[object (\w+)\]/);return e&&e.length?e[1].toLowerCase():""}const i=t=>null!=t;function s(t,e,r){const n=(t<<16|e<<8|r).toString(16);return"#"+"0".repeat(Math.max(0,6-n.length))+n}function u(t){const e=[];for(let r=1;r<7;r+=2)e.push(parseInt("0x"+t.slice(r,r+2),16));return e}function c(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function a(t){return"function"===o(t)||"asyncfunction"===o(t)}function p(t){return"string"===o(t)}function l(t,e=new Map){if(null===t||"object"!=typeof t)return t;if(f(t))return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(t instanceof Error){const e=new Error(t.message);return e.stack=t.stack,e}if(e.has(t))return e.get(t);const r=Array.isArray(t)?[]:{};e.set(t,r);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=l(t[n],e));return r}const f=t=>"[object Date]"===Object.prototype.toString.call(t)&&!Number.isNaN(t.getTime());const g=(()=>!1)();exports.addUnit=function(t){return Number.isNaN(Number(t))?`${t}`:`${t}px`},exports.camelCase=function(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))},exports.context={id:1e3},exports.debounce=function(t,e,r={}){let n,o,s,u=null;const c=!!i(r.leading)&&r.leading,a=!i(r.trailing)||r.trailing;function p(){void 0!==n&&(s=t.apply(o,n),n=void 0)}function l(){u=setTimeout((()=>{u=null,a&&p()}),e)}return function(...t){return n=t,o=this,null===u?(c&&p(),l()):a&&(null!==u&&(clearTimeout(u),u=null),l()),s}},exports.deepAssign=function t(e,r){return Object.keys(r).forEach((o=>{const i=e[o],s=r[o];n(i)&&n(s)?t(i,s):e[o]=s})),e},exports.deepClone=l,exports.deepMerge=function(t,e){if("object"!=typeof(t=l(t))||"object"!=typeof e)throw new Error("Both target and source must be objects.");for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},exports.defaultDisplayFormat=function(t,e){const r=(null==e?void 0:e.labelKey)||"value";return Array.isArray(t)?t.map((t=>t[r])).join(", "):t[r]},exports.getPropByPath=(t,e)=>{const r=e.split(".");try{return r.reduce(((t,e)=>null!=t?t[e]:void 0),t)}catch(n){return}},exports.getRect=function(e,r,n,o){return new Promise(((i,s)=>{let u=null;u=n?t.index.createSelectorQuery().in(n):t.index.createSelectorQuery();const a=r?"selectAll":"select",p=t=>{r&&c(t)&&t.length>0||!r&&t?i(t):s(new Error("No nodes found"))};o?u[a](e).fields({size:!0,node:!0},p).exec():u[a](e).boundingClientRect(p).exec()}))},exports.getType=o,exports.gradient=(t,e,r=2)=>{const n=u(t),o=u(e),i=(o[0]-n[0])/r,c=(o[1]-n[1])/r,a=(o[2]-n[2])/r,p=[];for(let u=0;u<r;u++)p.push(s(parseInt(String(i*u+n[0])),parseInt(String(c*u+n[1])),parseInt(String(a*u+n[2]))));return p},exports.isArray=c,exports.isDef=i,exports.isEqual=(t,e)=>{if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0},exports.isFunction=a,exports.isH5=g,exports.isImageUrl=function(t){return/\.(xbm|tif|pjp|apng|svgz|jpeg|jpg|heif|ico|tiff|heic|pjpeg|avif|gif|png|svg|webp|jfif|bmp|dpg|image)(?=$|[?#])/i.test(t)},exports.isNumber=function(t){return"number"===o(t)},exports.isObj=n,exports.isPromise=function(t){return!(!n(t)||!i(t))&&(a(t.then)&&a(t.catch))},exports.isString=p,exports.isUndefined=function(t){return void 0===t},exports.isVideoUrl=function(t){return/\.(ogm|webm|ogv|asx|m4v|mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|video)(?=$|[?#])/i.test(t)},exports.objToStyle=function t(e){if(c(e)){const r=e.filter((function(t){return null!=t&&""!==t})).map((function(e){return t(e)})).join(";");return r?r.endsWith(";")?r:r+";":""}if(p(e))return e?e.endsWith(";")?e:e+";":"";if(n(e)){const t=Object.keys(e).filter((function(t){return null!=e[t]&&""!==e[t]})).map((function(t){return[(r=t,r.replace(/[A-Z]/g,(function(t){return"-"+t})).toLowerCase()),e[t]].join(":");var r})).join(";");return t?t.endsWith(";")?t:t+";":""}return""},exports.omitBy=function(t,e){const r=l(t);return Object.keys(r).forEach((t=>e(r[t],t)&&delete r[t])),r},exports.padZero=(t,e=2)=>{let r=t.toString();for(;r.length<e;)r="0"+r;return r},exports.pause=(t=1e3/30)=>new e.AbortablePromise((e=>{const r=setTimeout((()=>{clearTimeout(r),e(!0)}),t)})),exports.range=(t,e,r)=>Math.min(Math.max(t,e),r),exports.uuid=function(){return r()+r()+r()+r()+r()+r()+r()+r()};