@wp1001/ui 2.9.13 → 3.0.1
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/@vant-D4fmGxs6.js +1 -3891
- package/index.html +28 -0
- package/index.js +1 -8419
- package/lib/tinymce/zh_CN.js +1 -0
- package/package.json +1 -1
- package/packages/assets/devtools-detector.js +1 -2
- package/packages/components/xarray/index.js +1 -64
- package/packages/components/xautorows/index.js +1 -35
- package/packages/components/xbutton/mobile.js +1 -3
- package/packages/components/xbutton/pc.js +1 -3
- package/packages/components/xbuttons/mobile.js +1 -51
- package/packages/components/xbuttons/pc.js +1 -51
- package/packages/components/xchart/constants.js +1 -58
- package/packages/components/xchart/index.js +1 -263
- package/packages/components/xchart/utils.js +1 -121
- package/packages/components/xcheckboxs/mobile.js +1 -58
- package/packages/components/xcheckboxs/pc.js +1 -49
- package/packages/components/xcol/mobile.js +1 -10
- package/packages/components/xcol/pc.js +1 -10
- package/packages/components/xdatepicker/mobile.js +1 -71
- package/packages/components/xdatepicker/pc.js +1 -9
- package/packages/components/xdialog/mobile.js +1 -60
- package/packages/components/xdialog/pc.js +1 -64
- package/packages/components/xdict/index.js +1 -47
- package/packages/components/xdistrictselect/mobile.js +1 -79
- package/packages/components/xdistrictselect/pc.js +1 -127
- package/packages/components/xform/mobile.js +1 -29
- package/packages/components/xform/pc.js +1 -42
- package/packages/components/xform/utils.js +1 -95
- package/packages/components/xformitem/mobile.js +1 -56
- package/packages/components/xformitem/pc.js +1 -72
- package/packages/components/xicon/mobile.js +1 -35
- package/packages/components/xicon/pc.js +1 -35
- package/packages/components/xinfo/index.js +1 -100
- package/packages/components/xlooper/index.js +1 -7
- package/packages/components/xpagination/mobile.js +1 -21
- package/packages/components/xpagination/pc.js +1 -21
- package/packages/components/xpicker/index.js +1 -38
- package/packages/components/xradios/mobile.js +1 -40
- package/packages/components/xradios/pc.js +1 -53
- package/packages/components/xrow/mobile.js +1 -9
- package/packages/components/xrow/pc.js +1 -9
- package/packages/components/xscan/mobile.js +1 -24
- package/packages/components/xscan/pc.js +1 -20
- package/packages/components/xsearcher/index.js +1 -198
- package/packages/components/xselect/mobile.js +1 -86
- package/packages/components/xselect/pc.js +1 -114
- package/packages/components/xselect/util.js +1 -66
- package/packages/components/xselectv2/index.js +1 -91
- package/packages/components/xtable/mobile.js +1 -108
- package/packages/components/xtable/pc.js +1 -143
- package/packages/components/xtable/searcher.js +1 -477
- package/packages/components/xtable/settings.js +1 -80
- package/packages/components/xtable/utils.js +1 -692
- package/packages/components/xtabletools/mobile.js +1 -25
- package/packages/components/xtabletools/pc.js +1 -18
- package/packages/components/xtablev2/index.js +1 -53
- package/packages/components/xtags/mobile.js +1 -17
- package/packages/components/xtags/pc.js +1 -17
- package/packages/components/xtinymce/index.js +1 -71
- package/packages/components/xuploader/xfileuploader.js +1 -48
- package/packages/components/xuploader/ximageuploader.js +1 -53
- package/packages/comps.js +1 -108
- package/packages/controllers/BaseController.js +1 -125
- package/packages/controllers/CrudController.js +1 -907
- package/packages/controllers/TempCrudController.js +1 -32
- package/packages/controllers/index.js +1 -15
- package/packages/directives/el-table-infinite-scroll.js +1 -55
- package/packages/directives/index.js +1 -5
- package/packages/index.js +1 -81
- package/packages/layout/breadcrumb/index.js +1 -41
- package/packages/layout/header/inner.js +1 -11
- package/packages/layout/pc.vue +1 -1
- package/packages/layout/screenlock/index.js +1 -129
- package/packages/layout/sidebar/item.js +1 -16
- package/packages/layout/sidebar/menu.js +1 -72
- package/packages/layout/tagsview/ScrollPane.js +1 -65
- package/packages/layout/tagsview/index.js +1 -169
- package/packages/plop/actions/make-fill-admin-partials-action.js +1 -95
- package/packages/plop/generators/make-admin-page.js +1 -39
- package/packages/plop/generators/make-database-admin-pages.js +1 -84
- package/packages/plop/generators/make-page-generator.js +1 -52
- package/packages/plop/generators/make-simple-page.js +1 -20
- package/packages/plop/plopfile.js +1 -24
- package/packages/plop/utils/index.js +1 -168
- package/packages/plop/utils/plop-utils.js +1 -86
- package/packages/utils/crypt.js +1 -24
- package/packages/utils/decorators.js +1 -67
- package/packages/utils/disallowDevtools.js +1 -53
- package/packages/utils/effects.js +1 -173
- package/packages/utils/funcs.js +1 -78
- package/packages/utils/index.js +1 -95
- package/packages/utils/message.js +1 -110
- package/packages/utils/middlewares.js +1 -86
- package/packages/utils/model.js +1 -71
- package/packages/utils/modelUtils.js +1 -203
- package/packages/utils/request.js +1 -57
- package/packages/utils/site.js +1 -33
- package/packages/vite-plugins.js +1 -141
- package/src/App.vue +134 -0
- package/src/main.js +1 -0
- package/src/request.js +1 -0
- package/style.css +1 -0
- package/vite.config.js +1 -0
- package/vite.lib.config.js +1 -0
- package/.env +0 -6
|
@@ -1,168 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import chalk from 'chalk'
|
|
3
|
-
import { fsUtils } from '@stardust_js/node'
|
|
4
|
-
|
|
5
|
-
const importFile = async (filePath) => {
|
|
6
|
-
return new Promise(resolve => {
|
|
7
|
-
import(filePath).then(resolve)
|
|
8
|
-
})
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const viewOnlyFields = [
|
|
12
|
-
'creator_id',
|
|
13
|
-
'updater_id',
|
|
14
|
-
'created_at',
|
|
15
|
-
'updated_at',
|
|
16
|
-
'deleted_at'
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
const operatorFields = [
|
|
20
|
-
'creator_id',
|
|
21
|
-
'updater_id'
|
|
22
|
-
]
|
|
23
|
-
|
|
24
|
-
const getModel = async (plop, data) => {
|
|
25
|
-
const initModelsPath = path.join(plop.backenderPath, 'models', data.database, 'init-models.js')
|
|
26
|
-
if (!await fsUtils.exists(initModelsPath)) {
|
|
27
|
-
const err = chalk.red(`${initModelsPath} not found`)
|
|
28
|
-
throw err
|
|
29
|
-
}
|
|
30
|
-
const configPath = path.join(plop.backenderPath, 'config.js')
|
|
31
|
-
const dbPath = path.join(plop.backenderPath, '.stardust/db.js')
|
|
32
|
-
const config = (await importFile(configPath)).default
|
|
33
|
-
const initModelFunc = (await importFile(initModelsPath)).default
|
|
34
|
-
const source = config.datasources.find(ele => ele.database === data.database)
|
|
35
|
-
const { connect } = (await importFile(dbPath))
|
|
36
|
-
const sequelize = connect(config, source)
|
|
37
|
-
const models = Object.values(initModelFunc(sequelize, false))
|
|
38
|
-
const model = models.find(m => m.tableName.toLowerCase() === data.table)
|
|
39
|
-
return model
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const getSequeliezeDataType = (options) => {
|
|
43
|
-
const type = options.type || options
|
|
44
|
-
const dataType = {
|
|
45
|
-
name: type.key || type.name
|
|
46
|
-
}
|
|
47
|
-
if (type._length) {
|
|
48
|
-
dataType._length = type._length
|
|
49
|
-
}
|
|
50
|
-
return dataType
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const makeFields = (model) => {
|
|
54
|
-
const fields = Object.entries(model.tableAttributes).map((ele) => {
|
|
55
|
-
const [prop, options] = ele
|
|
56
|
-
const type = getSequeliezeDataType(options)
|
|
57
|
-
|
|
58
|
-
let label = options.label || options.comment || prop
|
|
59
|
-
label = label.replaceAll("'", '"')
|
|
60
|
-
const field = {
|
|
61
|
-
label,
|
|
62
|
-
prop,
|
|
63
|
-
tableAttrs: {
|
|
64
|
-
...calcColumnWidth(type)
|
|
65
|
-
},
|
|
66
|
-
formAttrs: {}
|
|
67
|
-
}
|
|
68
|
-
fillFieldType(field, type)
|
|
69
|
-
fillFieldForeign(field, model, prop)
|
|
70
|
-
const { autoIncrement, _autoGenerated } = options
|
|
71
|
-
if (autoIncrement || _autoGenerated || viewOnlyFields.includes(prop)) {
|
|
72
|
-
field.visible = false
|
|
73
|
-
field.canView = true
|
|
74
|
-
delete field.comp
|
|
75
|
-
delete field.formAttrs
|
|
76
|
-
}
|
|
77
|
-
return field
|
|
78
|
-
})
|
|
79
|
-
return fields
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const calcColumnWidth = (type) => {
|
|
83
|
-
switch (type.name) {
|
|
84
|
-
case 'STRING': {
|
|
85
|
-
if (type._length > 20) {
|
|
86
|
-
return { minWidth: 150 }
|
|
87
|
-
} else {
|
|
88
|
-
return { width: 25 + type._length * 12 }
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
case 'TEXT': {
|
|
92
|
-
return { minWidth: 200 }
|
|
93
|
-
}
|
|
94
|
-
case 'DATE': {
|
|
95
|
-
return { width: 175 }
|
|
96
|
-
};
|
|
97
|
-
default: {
|
|
98
|
-
return { width: 100 }
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const fillFieldType = (field, type) => {
|
|
104
|
-
const { formAttrs } = field
|
|
105
|
-
switch (type.name) {
|
|
106
|
-
case 'INTEGER': {
|
|
107
|
-
field.type = 'number'
|
|
108
|
-
formAttrs.precision = 1
|
|
109
|
-
break
|
|
110
|
-
}
|
|
111
|
-
case 'FLOAT': {
|
|
112
|
-
field.type = 'number'
|
|
113
|
-
break
|
|
114
|
-
}
|
|
115
|
-
case 'BOOLEAN': {
|
|
116
|
-
field.comp = 'x-select'
|
|
117
|
-
field.options = '$$ store.dictionaries.yesNo $$'
|
|
118
|
-
break
|
|
119
|
-
}
|
|
120
|
-
case 'STRING': {
|
|
121
|
-
formAttrs.maxlength = type._length
|
|
122
|
-
break
|
|
123
|
-
}
|
|
124
|
-
case 'TEXT': {
|
|
125
|
-
field.type = 'textarea'
|
|
126
|
-
break
|
|
127
|
-
}
|
|
128
|
-
case 'DATE': {
|
|
129
|
-
field.comp = 'ElDatePicker'
|
|
130
|
-
formAttrs.prefixIcon = 'calendar'
|
|
131
|
-
break
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const fillFieldForeign = (field, model, prop) => {
|
|
137
|
-
const foreigns = Object.values(model.associations)
|
|
138
|
-
const foreignAttrs = foreigns.map(ele => ele.foreignKey)
|
|
139
|
-
const database = model.sequelize.config.database
|
|
140
|
-
|
|
141
|
-
if (foreignAttrs.includes(prop)) {
|
|
142
|
-
const foreign = foreigns.find(ele => ele.foreignKey === prop)
|
|
143
|
-
delete field.formAttrs.precision
|
|
144
|
-
delete field.type
|
|
145
|
-
field.options = []
|
|
146
|
-
field.comp = 'x-select'
|
|
147
|
-
const idField = foreign.target.primaryKeyField || ''
|
|
148
|
-
Object.assign(field.formAttrs, {
|
|
149
|
-
modelName: database + '.' + foreign.target.options.tableName,
|
|
150
|
-
text: idField,
|
|
151
|
-
value: idField
|
|
152
|
-
})
|
|
153
|
-
} else if (viewOnlyFields.includes(prop)) {
|
|
154
|
-
delete field.formAttrs.precision
|
|
155
|
-
delete field.type
|
|
156
|
-
if (operatorFields.includes(prop)) {
|
|
157
|
-
field.visible = false
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export {
|
|
163
|
-
importFile,
|
|
164
|
-
getModel,
|
|
165
|
-
getSequeliezeDataType,
|
|
166
|
-
makeFields,
|
|
167
|
-
calcColumnWidth
|
|
168
|
-
}
|
|
1
|
+
const a81_0x5e7fc4=a81_0xe97a;(function(_0x19cfcf,_0x362796){const _0x1351f0=a81_0xe97a,_0x406a53=_0x19cfcf();while(!![]){try{const _0x1b21e8=parseInt(_0x1351f0(0x19a))/0x1+-parseInt(_0x1351f0(0x181))/0x2+-parseInt(_0x1351f0(0x18c))/0x3*(-parseInt(_0x1351f0(0x19d))/0x4)+parseInt(_0x1351f0(0x18b))/0x5+parseInt(_0x1351f0(0x197))/0x6+-parseInt(_0x1351f0(0x19e))/0x7+parseInt(_0x1351f0(0x183))/0x8;if(_0x1b21e8===_0x362796)break;else _0x406a53['push'](_0x406a53['shift']());}catch(_0x38e10e){_0x406a53['push'](_0x406a53['shift']());}}}(a81_0x5827,0x87679));import a81_0x709be0 from'node:path';import a81_0x15e33f from'chalk';import{fsUtils}from'@stardust_js/node';function a81_0xe97a(_0x520b21,_0x30a1da){const _0x582701=a81_0x5827();return a81_0xe97a=function(_0xe97aa0,_0x2afaa2){_0xe97aa0=_0xe97aa0-0x180;let _0xa97814=_0x582701[_0xe97aa0];return _0xa97814;},a81_0xe97a(_0x520b21,_0x30a1da);}function a81_0x5827(){const _0x42fb8e=['$$\x20store.dictionaries.yesNo\x20$$','type','backenderPath','_length','associations','updated_at','label','TEXT','INTEGER','default','number','maxlength','then','options','target','creator_id','visible','replaceAll','name','810738oMGPaC','values','296536NJmCtN','assign','prefixIcon','x-select','formAttrs','find','tableAttributes','calendar','3642005TflkKE','3072bIayBG','red','map','datasources','precision','STRING','textarea','init-models.js','config','join','sequelize','3896340HDYESX','tableName','foreignKey','58704PPGNjr','models','updater_id','1044qCrfzv','5465880mhpgBC','entries','\x20not\x20found','database','comment','created_at','includes','DATE','canView','comp'];a81_0x5827=function(){return _0x42fb8e;};return a81_0x5827();}const importFile=async _0x52e6d4=>{return new Promise(_0x29d1c1=>{const _0xc9ada9=a81_0xe97a;import(_0x52e6d4)[_0xc9ada9(0x1b4)](_0x29d1c1);});},viewOnlyFields=[a81_0x5e7fc4(0x1b7),'updater_id',a81_0x5e7fc4(0x1a3),a81_0x5e7fc4(0x1ad),'deleted_at'],operatorFields=['creator_id',a81_0x5e7fc4(0x19c)],getModel=async(_0x42b3a2,_0x5457f8)=>{const _0x2ce29a=a81_0x5e7fc4,_0x3a4135=a81_0x709be0[_0x2ce29a(0x195)](_0x42b3a2[_0x2ce29a(0x1aa)],_0x2ce29a(0x19b),_0x5457f8[_0x2ce29a(0x1a1)],_0x2ce29a(0x193));if(!await fsUtils['exists'](_0x3a4135)){const _0x550fc0=a81_0x15e33f[_0x2ce29a(0x18d)](_0x3a4135+_0x2ce29a(0x1a0));throw _0x550fc0;}const _0x16dd7a=a81_0x709be0[_0x2ce29a(0x195)](_0x42b3a2[_0x2ce29a(0x1aa)],'config.js'),_0xbb0955=a81_0x709be0[_0x2ce29a(0x195)](_0x42b3a2[_0x2ce29a(0x1aa)],'.stardust/db.js'),_0x27be80=(await importFile(_0x16dd7a))[_0x2ce29a(0x1b1)],_0x536509=(await importFile(_0x3a4135))['default'],_0x4e664c=_0x27be80[_0x2ce29a(0x18f)][_0x2ce29a(0x188)](_0x52b85c=>_0x52b85c[_0x2ce29a(0x1a1)]===_0x5457f8[_0x2ce29a(0x1a1)]),{connect:_0x3432a2}=await importFile(_0xbb0955),_0x375464=_0x3432a2(_0x27be80,_0x4e664c),_0x164d27=Object[_0x2ce29a(0x182)](_0x536509(_0x375464,![])),_0x25db2e=_0x164d27[_0x2ce29a(0x188)](_0x5268b5=>_0x5268b5[_0x2ce29a(0x198)]['toLowerCase']()===_0x5457f8['table']);return _0x25db2e;},getSequeliezeDataType=_0x244929=>{const _0x53f09b=a81_0x5e7fc4,_0x507bc2=_0x244929[_0x53f09b(0x1a9)]||_0x244929,_0x10820f={'name':_0x507bc2['key']||_0x507bc2[_0x53f09b(0x180)]};return _0x507bc2[_0x53f09b(0x1ab)]&&(_0x10820f['_length']=_0x507bc2[_0x53f09b(0x1ab)]),_0x10820f;},makeFields=_0x410c0e=>{const _0x498e2=a81_0x5e7fc4,_0x41d1d0=Object[_0x498e2(0x19f)](_0x410c0e[_0x498e2(0x189)])['map'](_0x45daa7=>{const _0x46b2f6=_0x498e2,[_0x382fac,_0x18d800]=_0x45daa7,_0x46ba1=getSequeliezeDataType(_0x18d800);let _0x5a3104=_0x18d800[_0x46b2f6(0x1ae)]||_0x18d800[_0x46b2f6(0x1a2)]||_0x382fac;_0x5a3104=_0x5a3104[_0x46b2f6(0x1b9)]('\x27','\x22');const _0x472e5b={'label':_0x5a3104,'prop':_0x382fac,'tableAttrs':{...calcColumnWidth(_0x46ba1)},'formAttrs':{}};fillFieldType(_0x472e5b,_0x46ba1),fillFieldForeign(_0x472e5b,_0x410c0e,_0x382fac);const {autoIncrement:_0xcd5495,_autoGenerated:_0x3d86e7}=_0x18d800;return(_0xcd5495||_0x3d86e7||viewOnlyFields[_0x46b2f6(0x1a4)](_0x382fac))&&(_0x472e5b[_0x46b2f6(0x1b8)]=![],_0x472e5b[_0x46b2f6(0x1a6)]=!![],delete _0x472e5b[_0x46b2f6(0x1a7)],delete _0x472e5b[_0x46b2f6(0x187)]),_0x472e5b;});return _0x41d1d0;},calcColumnWidth=_0x313a22=>{const _0x1c39fd=a81_0x5e7fc4;switch(_0x313a22[_0x1c39fd(0x180)]){case _0x1c39fd(0x191):{return _0x313a22[_0x1c39fd(0x1ab)]>0x14?{'minWidth':0x96}:{'width':0x19+_0x313a22[_0x1c39fd(0x1ab)]*0xc};};case'TEXT':{return{'minWidth':0xc8};}case _0x1c39fd(0x1a5):{return{'width':0xaf};};default:{return{'width':0x64};}}},fillFieldType=(_0x3fc140,_0x522440)=>{const _0xec186=a81_0x5e7fc4,{formAttrs:_0x4ab2f5}=_0x3fc140;switch(_0x522440['name']){case _0xec186(0x1b0):{_0x3fc140['type']='number',_0x4ab2f5[_0xec186(0x190)]=0x1;break;}case'FLOAT':{_0x3fc140[_0xec186(0x1a9)]=_0xec186(0x1b2);break;}case'BOOLEAN':{_0x3fc140['comp']=_0xec186(0x186),_0x3fc140[_0xec186(0x1b5)]=_0xec186(0x1a8);break;}case _0xec186(0x191):{_0x4ab2f5[_0xec186(0x1b3)]=_0x522440[_0xec186(0x1ab)];break;}case _0xec186(0x1af):{_0x3fc140[_0xec186(0x1a9)]=_0xec186(0x192);break;}case _0xec186(0x1a5):{_0x3fc140[_0xec186(0x1a7)]='ElDatePicker',_0x4ab2f5[_0xec186(0x185)]=_0xec186(0x18a);break;}}},fillFieldForeign=(_0x4c75df,_0x185390,_0x48d19c)=>{const _0x4ebbe0=a81_0x5e7fc4,_0x455b5c=Object['values'](_0x185390[_0x4ebbe0(0x1ac)]),_0x385dcf=_0x455b5c[_0x4ebbe0(0x18e)](_0x587316=>_0x587316[_0x4ebbe0(0x199)]),_0x292eb3=_0x185390[_0x4ebbe0(0x196)][_0x4ebbe0(0x194)][_0x4ebbe0(0x1a1)];if(_0x385dcf[_0x4ebbe0(0x1a4)](_0x48d19c)){const _0x3006bd=_0x455b5c[_0x4ebbe0(0x188)](_0x40dc17=>_0x40dc17[_0x4ebbe0(0x199)]===_0x48d19c);delete _0x4c75df[_0x4ebbe0(0x187)][_0x4ebbe0(0x190)],delete _0x4c75df[_0x4ebbe0(0x1a9)],_0x4c75df[_0x4ebbe0(0x1b5)]=[],_0x4c75df[_0x4ebbe0(0x1a7)]=_0x4ebbe0(0x186);const _0x288f3a=_0x3006bd[_0x4ebbe0(0x1b6)]['primaryKeyField']||'';Object[_0x4ebbe0(0x184)](_0x4c75df[_0x4ebbe0(0x187)],{'modelName':_0x292eb3+'.'+_0x3006bd[_0x4ebbe0(0x1b6)][_0x4ebbe0(0x1b5)][_0x4ebbe0(0x198)],'text':_0x288f3a,'value':_0x288f3a});}else viewOnlyFields[_0x4ebbe0(0x1a4)](_0x48d19c)&&(delete _0x4c75df[_0x4ebbe0(0x187)][_0x4ebbe0(0x190)],delete _0x4c75df[_0x4ebbe0(0x1a9)],operatorFields[_0x4ebbe0(0x1a4)](_0x48d19c)&&(_0x4c75df[_0x4ebbe0(0x1b8)]=![]));};export{importFile,getModel,getSequeliezeDataType,makeFields,calcColumnWidth};
|
|
@@ -1,86 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import generatorRunner from 'node-plop/src/generator-runner.js'
|
|
3
|
-
|
|
4
|
-
const getGenerator = (plop, name, options) => {
|
|
5
|
-
const runner = generatorRunner(plop, options)
|
|
6
|
-
const generator = plop.getGenerator(name)
|
|
7
|
-
Object.assign(generator, {
|
|
8
|
-
runActions: (data, hooks) => runner.runGeneratorActions(generator, data, hooks),
|
|
9
|
-
runPrompts: (bypassArr = []) => runner.runGeneratorPrompts(generator, bypassArr)
|
|
10
|
-
})
|
|
11
|
-
return generator
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const absPath = (plop, p) => {
|
|
15
|
-
return path.resolve(plop.getPlopfilePath(), p)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const addValidator = (prompt, name) => {
|
|
19
|
-
prompt.validate = (value) => {
|
|
20
|
-
return /.+/.test(value) ? true : `请输入${name}`
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const makeInputPrompt = (name, label, validate = true) => {
|
|
25
|
-
const prompt = {
|
|
26
|
-
type: 'input',
|
|
27
|
-
name,
|
|
28
|
-
message: `请输入 ${label}(${validate ? '必填' : '选填'})`
|
|
29
|
-
}
|
|
30
|
-
if (validate) {
|
|
31
|
-
addValidator(prompt, name)
|
|
32
|
-
}
|
|
33
|
-
return prompt
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const makeConfirmPrompt = (name, message, value) => {
|
|
37
|
-
const prompt = {
|
|
38
|
-
type: 'confirm',
|
|
39
|
-
name,
|
|
40
|
-
message,
|
|
41
|
-
default: value
|
|
42
|
-
}
|
|
43
|
-
return prompt
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const makeSelectPrompt = (name, choices, message, value) => {
|
|
47
|
-
const prompt = {
|
|
48
|
-
type: 'list',
|
|
49
|
-
name,
|
|
50
|
-
choices,
|
|
51
|
-
message,
|
|
52
|
-
default: value
|
|
53
|
-
}
|
|
54
|
-
return prompt
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const makePartial = (obj) => {
|
|
58
|
-
const lines = JSON.stringify(obj, null, 2).split('\n').slice(1, -1).map((line, i) => {
|
|
59
|
-
line = line.slice(2)
|
|
60
|
-
let parts = line.split(':')
|
|
61
|
-
if (parts[0].indexOf('-') >= 0) {
|
|
62
|
-
parts[0] = parts[0].replaceAll('"', '\'')
|
|
63
|
-
} else {
|
|
64
|
-
parts[0] = parts[0].replaceAll('"', '')
|
|
65
|
-
}
|
|
66
|
-
parts = parts.map((part, index) => {
|
|
67
|
-
return index === 0 ? part : part.replaceAll('"', '\'')
|
|
68
|
-
})
|
|
69
|
-
return parts.join(':')
|
|
70
|
-
})
|
|
71
|
-
let code = lines.join('\n') + '\n'
|
|
72
|
-
code = code.replaceAll('\'$$ ', '').replaceAll(' $$\'', '')
|
|
73
|
-
return code
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const plopUtils = {
|
|
77
|
-
getGenerator,
|
|
78
|
-
absPath,
|
|
79
|
-
addValidator,
|
|
80
|
-
makeInputPrompt,
|
|
81
|
-
makeConfirmPrompt,
|
|
82
|
-
makeSelectPrompt,
|
|
83
|
-
makePartial
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export default plopUtils
|
|
1
|
+
function a82_0x5bf5(){const _0x2f7c73=['1791qofUni','2MlYaGv','24336983crrfdu','validate','input','7240373senbrm','slice','38200RMghZs','test','314747HHjGkH','join','runGeneratorActions','replaceAll','\x20$$\x27','indexOf','map','请输入','getPlopfilePath','split','45QJECZk','assign','66280hCpDJw','getGenerator','2321715RygeEJ','6csnhCn','5597980LovnRX','请输入\x20'];a82_0x5bf5=function(){return _0x2f7c73;};return a82_0x5bf5();}function a82_0x83ab(_0x54e9ce,_0x4ff331){const _0x5bf571=a82_0x5bf5();return a82_0x83ab=function(_0x83ab43,_0x4c876f){_0x83ab43=_0x83ab43-0x1db;let _0x5d2865=_0x5bf571[_0x83ab43];return _0x5d2865;},a82_0x83ab(_0x54e9ce,_0x4ff331);}(function(_0x387f76,_0x20c2eb){const _0x4273e8=a82_0x83ab,_0x3ddc54=_0x387f76();while(!![]){try{const _0x477fcb=-parseInt(_0x4273e8(0x1f3))/0x1*(-parseInt(_0x4273e8(0x1eb))/0x2)+-parseInt(_0x4273e8(0x1e2))/0x3*(parseInt(_0x4273e8(0x1e4))/0x4)+parseInt(_0x4273e8(0x1e6))/0x5+-parseInt(_0x4273e8(0x1e7))/0x6*(-parseInt(_0x4273e8(0x1ef))/0x7)+-parseInt(_0x4273e8(0x1f1))/0x8*(-parseInt(_0x4273e8(0x1ea))/0x9)+parseInt(_0x4273e8(0x1e8))/0xa+-parseInt(_0x4273e8(0x1ec))/0xb;if(_0x477fcb===_0x20c2eb)break;else _0x3ddc54['push'](_0x3ddc54['shift']());}catch(_0x4c7efb){_0x3ddc54['push'](_0x3ddc54['shift']());}}}(a82_0x5bf5,0xd28f1));import a82_0x36a127 from'node:path';import a82_0x3135c1 from'node-plop/src/generator-runner.js';const getGenerator=(_0x1ccd2e,_0x1ec6a4,_0x5398ab)=>{const _0x31115d=a82_0x83ab,_0x207ffc=a82_0x3135c1(_0x1ccd2e,_0x5398ab),_0x340b9a=_0x1ccd2e[_0x31115d(0x1e5)](_0x1ec6a4);return Object[_0x31115d(0x1e3)](_0x340b9a,{'runActions':(_0x19b315,_0x50fbee)=>_0x207ffc[_0x31115d(0x1f5)](_0x340b9a,_0x19b315,_0x50fbee),'runPrompts':(_0x19cb33=[])=>_0x207ffc['runGeneratorPrompts'](_0x340b9a,_0x19cb33)}),_0x340b9a;},absPath=(_0x268880,_0x24e147)=>{const _0xabb2a3=a82_0x83ab;return a82_0x36a127['resolve'](_0x268880[_0xabb2a3(0x1e0)](),_0x24e147);},addValidator=(_0x279984,_0x2a53e0)=>{const _0x3750de=a82_0x83ab;_0x279984[_0x3750de(0x1ed)]=_0xc57504=>{const _0x1a2c1f=_0x3750de;return/.+/[_0x1a2c1f(0x1f2)](_0xc57504)?!![]:_0x1a2c1f(0x1df)+_0x2a53e0;};},makeInputPrompt=(_0x591847,_0x327ee5,_0x1d465f=!![])=>{const _0x2c98f8=a82_0x83ab,_0x2c7196={'type':_0x2c98f8(0x1ee),'name':_0x591847,'message':_0x2c98f8(0x1e9)+_0x327ee5+'('+(_0x1d465f?'必填':'选填')+')'};return _0x1d465f&&addValidator(_0x2c7196,_0x591847),_0x2c7196;},makeConfirmPrompt=(_0x40db83,_0x5c6c42,_0x43d3c8)=>{const _0x2ce401={'type':'confirm','name':_0x40db83,'message':_0x5c6c42,'default':_0x43d3c8};return _0x2ce401;},makeSelectPrompt=(_0x2065b6,_0x30862b,_0x42df6d,_0x2fa23b)=>{const _0x1fc811={'type':'list','name':_0x2065b6,'choices':_0x30862b,'message':_0x42df6d,'default':_0x2fa23b};return _0x1fc811;},makePartial=_0x30d683=>{const _0x103973=a82_0x83ab,_0x17572a=JSON['stringify'](_0x30d683,null,0x2)[_0x103973(0x1e1)]('\x0a')['slice'](0x1,-0x1)['map']((_0x10b821,_0x585c00)=>{const _0x1595a1=_0x103973;_0x10b821=_0x10b821[_0x1595a1(0x1f0)](0x2);let _0xf43871=_0x10b821[_0x1595a1(0x1e1)](':');return _0xf43871[0x0][_0x1595a1(0x1dd)]('-')>=0x0?_0xf43871[0x0]=_0xf43871[0x0][_0x1595a1(0x1db)]('\x22','\x27'):_0xf43871[0x0]=_0xf43871[0x0][_0x1595a1(0x1db)]('\x22',''),_0xf43871=_0xf43871[_0x1595a1(0x1de)]((_0x33ed85,_0x43708b)=>{return _0x43708b===0x0?_0x33ed85:_0x33ed85['replaceAll']('\x22','\x27');}),_0xf43871['join'](':');});let _0x419f23=_0x17572a[_0x103973(0x1f4)]('\x0a')+'\x0a';return _0x419f23=_0x419f23[_0x103973(0x1db)]('\x27$$\x20','')[_0x103973(0x1db)](_0x103973(0x1dc),''),_0x419f23;},plopUtils={'getGenerator':getGenerator,'absPath':absPath,'addValidator':addValidator,'makeInputPrompt':makeInputPrompt,'makeConfirmPrompt':makeConfirmPrompt,'makeSelectPrompt':makeSelectPrompt,'makePartial':makePartial};export default plopUtils;
|
package/packages/utils/crypt.js
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
const simple = {
|
|
2
|
-
encrypt (text) {
|
|
3
|
-
text = encodeURIComponent(text)
|
|
4
|
-
text = btoa(text)
|
|
5
|
-
text = text.split('')
|
|
6
|
-
text = text.map(c => String.fromCharCode(c.charCodeAt(0) + 6))
|
|
7
|
-
text.reverse()
|
|
8
|
-
text = text.join('')
|
|
9
|
-
return text
|
|
10
|
-
},
|
|
11
|
-
decrypt (text) {
|
|
12
|
-
text = text.split('')
|
|
13
|
-
text.reverse()
|
|
14
|
-
text = text.map(c => String.fromCharCode(c.charCodeAt(0) - 6))
|
|
15
|
-
text = text.join('')
|
|
16
|
-
text = atob(text)
|
|
17
|
-
text = decodeURIComponent(text)
|
|
18
|
-
return text
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { simple }
|
|
23
|
-
|
|
24
|
-
export default { simple }
|
|
1
|
+
(function(_0x1652dd,_0x1194d5){const _0x4e5901=a83_0x2ffb,_0x4b433c=_0x1652dd();while(!![]){try{const _0xe6d28c=-parseInt(_0x4e5901(0x166))/0x1*(-parseInt(_0x4e5901(0x165))/0x2)+parseInt(_0x4e5901(0x16f))/0x3*(parseInt(_0x4e5901(0x16a))/0x4)+parseInt(_0x4e5901(0x170))/0x5+parseInt(_0x4e5901(0x16b))/0x6+-parseInt(_0x4e5901(0x164))/0x7+-parseInt(_0x4e5901(0x168))/0x8+-parseInt(_0x4e5901(0x16d))/0x9;if(_0xe6d28c===_0x1194d5)break;else _0x4b433c['push'](_0x4b433c['shift']());}catch(_0x2e0c58){_0x4b433c['push'](_0x4b433c['shift']());}}}(a83_0x193b,0x6e2e4));const simple={'encrypt'(_0x7723b6){const _0x30d533=a83_0x2ffb;return _0x7723b6=encodeURIComponent(_0x7723b6),_0x7723b6=btoa(_0x7723b6),_0x7723b6=_0x7723b6[_0x30d533(0x171)](''),_0x7723b6=_0x7723b6['map'](_0x1f5c91=>String[_0x30d533(0x16e)](_0x1f5c91['charCodeAt'](0x0)+0x6)),_0x7723b6[_0x30d533(0x163)](),_0x7723b6=_0x7723b6['join'](''),_0x7723b6;},'decrypt'(_0x4bec34){const _0x2db052=a83_0x2ffb;return _0x4bec34=_0x4bec34[_0x2db052(0x171)](''),_0x4bec34[_0x2db052(0x163)](),_0x4bec34=_0x4bec34[_0x2db052(0x169)](_0xeb985c=>String[_0x2db052(0x16e)](_0xeb985c[_0x2db052(0x16c)](0x0)-0x6)),_0x4bec34=_0x4bec34[_0x2db052(0x167)](''),_0x4bec34=atob(_0x4bec34),_0x4bec34=decodeURIComponent(_0x4bec34),_0x4bec34;}};export{simple};function a83_0x2ffb(_0x2694da,_0x33a0e1){const _0x193b0d=a83_0x193b();return a83_0x2ffb=function(_0x2ffb3c,_0x383e53){_0x2ffb3c=_0x2ffb3c-0x163;let _0x2f7f03=_0x193b0d[_0x2ffb3c];return _0x2f7f03;},a83_0x2ffb(_0x2694da,_0x33a0e1);}function a83_0x193b(){const _0x4f4cf8=['1uhrKaB','join','6792632NWcoJJ','map','72QGsxQO','3408756wyoWbv','charCodeAt','8122734DqwiHF','fromCharCode','3684sjokgC','4456645WnNcow','split','reverse','299754wOqBjF','1528336YXvsbq'];a83_0x193b=function(){return _0x4f4cf8;};return a83_0x193b();}export default{'simple':simple};
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
const { highdict } =
|
|
2
|
-
|
|
3
|
-
const _checkOk = (self, key) => {
|
|
4
|
-
let ok = key
|
|
5
|
-
if (typeof key === 'string') {
|
|
6
|
-
ok = highdict.get(self, key)
|
|
7
|
-
} else if (typeof key === 'function') {
|
|
8
|
-
ok = key(self)
|
|
9
|
-
}
|
|
10
|
-
return !!ok
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const when = (key) => {
|
|
14
|
-
return (value, { name, addInitializer, ...others }) => {
|
|
15
|
-
addInitializer(function () {
|
|
16
|
-
const self = this
|
|
17
|
-
const func = self[name]
|
|
18
|
-
self[name] = function (...props) {
|
|
19
|
-
if (!_checkOk(self, key)) return
|
|
20
|
-
return func.apply(self, props)
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const not = (key) => {
|
|
27
|
-
return (value, { name, addInitializer, ...others }) => {
|
|
28
|
-
addInitializer(function () {
|
|
29
|
-
const self = this
|
|
30
|
-
const func = self[name]
|
|
31
|
-
self[name] = function (...props) {
|
|
32
|
-
if (_checkOk(self, key)) return
|
|
33
|
-
return func.apply(self, props)
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const loading = (key) => {
|
|
40
|
-
return (value, { name, addInitializer, ...others }) => {
|
|
41
|
-
addInitializer(function () {
|
|
42
|
-
const self = this
|
|
43
|
-
const func = self[name]
|
|
44
|
-
key ??= self.table && 'table.loading' || self.model && 'model.loading' || self.dialog && 'dialog.loading' || 'loading'
|
|
45
|
-
self[name] = function (...props) {
|
|
46
|
-
if (!key) throw 'invalid params for @loading'
|
|
47
|
-
if (highdict.get(self, key)) return
|
|
48
|
-
highdict.set(self, key, true)
|
|
49
|
-
const result = func.apply(self, props)
|
|
50
|
-
if (result instanceof Promise) {
|
|
51
|
-
return result.then((...res) => {
|
|
52
|
-
highdict.set(self, key, false)
|
|
53
|
-
return res
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
highdict.set(self, key, false)
|
|
57
|
-
return result
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export default {
|
|
64
|
-
when,
|
|
65
|
-
not,
|
|
66
|
-
loading
|
|
67
|
-
}
|
|
1
|
+
(function(_0x8c849f,_0x499d7c){const _0x56c5e6=a84_0x3b6e,_0x5e8b8a=_0x8c849f();while(!![]){try{const _0xc8c629=parseInt(_0x56c5e6(0x11b))/0x1*(parseInt(_0x56c5e6(0x120))/0x2)+-parseInt(_0x56c5e6(0x10d))/0x3*(parseInt(_0x56c5e6(0x11e))/0x4)+parseInt(_0x56c5e6(0x119))/0x5*(parseInt(_0x56c5e6(0x112))/0x6)+-parseInt(_0x56c5e6(0x11a))/0x7*(parseInt(_0x56c5e6(0x115))/0x8)+parseInt(_0x56c5e6(0x10a))/0x9+-parseInt(_0x56c5e6(0x11c))/0xa+parseInt(_0x56c5e6(0x10f))/0xb;if(_0xc8c629===_0x499d7c)break;else _0x5e8b8a['push'](_0x5e8b8a['shift']());}catch(_0x416b8b){_0x5e8b8a['push'](_0x5e8b8a['shift']());}}}(a84_0x2f85,0x4da19));function a84_0x3b6e(_0x55bc59,_0x3815a5){const _0x2f85c8=a84_0x2f85();return a84_0x3b6e=function(_0x3b6eb9,_0x5b5e81){_0x3b6eb9=_0x3b6eb9-0x10a;let _0x5ab67e=_0x2f85c8[_0x3b6eb9];return _0x5ab67e;},a84_0x3b6e(_0x55bc59,_0x3815a5);}const {highdict}=StardustJs,_checkOk=(_0x762b11,_0x5aefd9)=>{const _0x41ca98=a84_0x3b6e;let _0x178254=_0x5aefd9;if(typeof _0x5aefd9==='string')_0x178254=highdict[_0x41ca98(0x10e)](_0x762b11,_0x5aefd9);else typeof _0x5aefd9===_0x41ca98(0x10c)&&(_0x178254=_0x5aefd9(_0x762b11));return!!_0x178254;};export const when=_0x53ec48=>{return(_0x44e360,{name:_0x135ad4,addInitializer:_0x40e89b,..._0x14e207})=>{_0x40e89b(function(){const _0x359bea=this,_0x20fd1f=_0x359bea[_0x135ad4];_0x359bea[_0x135ad4]=function(..._0x2d299c){const _0x40865f=a84_0x3b6e;if(!_checkOk(_0x359bea,_0x53ec48))return;return _0x20fd1f[_0x40865f(0x118)](_0x359bea,_0x2d299c);};});};};export const not=_0x299637=>{return(_0x2b5f63,{name:_0x5159d9,addInitializer:_0xab0e1a,..._0x398f89})=>{_0xab0e1a(function(){const _0x6f392a=this,_0x430095=_0x6f392a[_0x5159d9];_0x6f392a[_0x5159d9]=function(..._0x270679){const _0x8d007=a84_0x3b6e;if(_checkOk(_0x6f392a,_0x299637))return;return _0x430095[_0x8d007(0x118)](_0x6f392a,_0x270679);};});};};export const loading=_0x23d317=>{return(_0x42e462,{name:_0x457ad4,addInitializer:_0x371772,..._0x41c87a})=>{_0x371772(function(){const _0x2c77ee=a84_0x3b6e,_0x58c446=this,_0x19f479=_0x58c446[_0x457ad4];_0x23d317??=_0x58c446[_0x2c77ee(0x111)]&&'table.loading'||_0x58c446[_0x2c77ee(0x11d)]&&_0x2c77ee(0x11f)||_0x58c446[_0x2c77ee(0x117)]&&_0x2c77ee(0x110)||_0x2c77ee(0x10b),_0x58c446[_0x457ad4]=function(..._0x58800d){const _0x3d8512=_0x2c77ee;if(!_0x23d317)throw _0x3d8512(0x114);if(highdict['get'](_0x58c446,_0x23d317))return;highdict[_0x3d8512(0x116)](_0x58c446,_0x23d317,!![]);const _0x316b0e=_0x19f479[_0x3d8512(0x118)](_0x58c446,_0x58800d);if(_0x316b0e instanceof Promise)return _0x316b0e[_0x3d8512(0x113)]((..._0x37121e)=>{return highdict['set'](_0x58c446,_0x23d317,![]),_0x37121e;});return highdict[_0x3d8512(0x116)](_0x58c446,_0x23d317,![]),_0x316b0e;};});};};export default{'when':when,'not':not,'loading':loading};function a84_0x2f85(){const _0x34ca6b=['table','24cluVYs','then','invalid\x20params\x20for\x20@loading','16712cHUbkF','set','dialog','apply','208435DpQbfG','21yovYyY','52014vplWGZ','3698500wPRSlN','model','964MVxBaC','model.loading','6JasAtC','1739709xdLcHm','loading','function','7563kCQWRR','get','8641204iuSYkm','dialog.loading'];a84_0x2f85=function(){return _0x34ca6b;};return a84_0x2f85();}
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const { addListener, launch } = devtoolsDetector
|
|
4
|
-
|
|
5
|
-
const disallowDevtools = (env = {}, whiteList) => {
|
|
6
|
-
const onDevtools = isOpen => {
|
|
7
|
-
if (isOpen) {
|
|
8
|
-
// sessionStorage.clear()
|
|
9
|
-
// localStorage.clear()
|
|
10
|
-
// document.documentElement.innerHTML = '为了网站的安全,禁止调试'
|
|
11
|
-
document.documentElement.innerHTML = decodeURIComponent(atob('JUU0JUI4JUJBJUU0JUJBJTg2JUU3JUJEJTkxJUU3JUFCJTk5JUU3JTlBJTg0JUU1JUFFJTg5JUU1JTg1JUE4JUVGJUJDJThDJUU3JUE2JTgxJUU2JUFEJUEyJUU4JUIwJTgzJUU4JUFGJTk1'))
|
|
12
|
-
window.location.href = decodeURIComponent(atob('YWJvdXQlM0FibGFuaw=='))
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
addListener(onDevtools)
|
|
16
|
-
if (
|
|
17
|
-
!window.eval.name
|
|
18
|
-
|| !console.clear.name
|
|
19
|
-
|| !RegExp.toString.toString().includes('toString')
|
|
20
|
-
|| !history.pushState.toString.toString().includes('toString')
|
|
21
|
-
) {
|
|
22
|
-
onDevtools(true)
|
|
23
|
-
}
|
|
24
|
-
if (
|
|
25
|
-
!(
|
|
26
|
-
whiteList || JSON.parse(
|
|
27
|
-
env.PROD
|
|
28
|
-
? env.VITE_PROD_DEBUGGERABLE_DOMAINS
|
|
29
|
-
: env.VITE_DEV_DEBUGGERABLE_DOMAINS
|
|
30
|
-
)
|
|
31
|
-
).includes(window.location.hostname)
|
|
32
|
-
) {
|
|
33
|
-
launch()
|
|
34
|
-
window.addEventListener('contextmenu', (e) => {
|
|
35
|
-
if (
|
|
36
|
-
!(e.target instanceof SVGElement)
|
|
37
|
-
&& !['IMG', 'CANVAS', 'AUDIO', 'VIDEO', 'PICTURE', 'INPUT', 'TEXTAREA'].includes(e.target.nodeName)
|
|
38
|
-
) {
|
|
39
|
-
e.preventDefault()
|
|
40
|
-
}
|
|
41
|
-
}, true)
|
|
42
|
-
window.addEventListener('keydown', (e) => {
|
|
43
|
-
if (
|
|
44
|
-
e.code === 'F12'
|
|
45
|
-
|| (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey) && ['KeyU', 'KeyI', 'KeyJ', 'KeyC'].indexOf(e.code) >= 0
|
|
46
|
-
) {
|
|
47
|
-
e.preventDefault()
|
|
48
|
-
}
|
|
49
|
-
}, true)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default disallowDevtools
|
|
1
|
+
(function(_0x231760,_0x362c75){const _0x1b1307=a85_0x3a2b,_0x159007=_0x231760();while(!![]){try{const _0x318b7d=-parseInt(_0x1b1307(0x1e3))/0x1*(parseInt(_0x1b1307(0x1e8))/0x2)+-parseInt(_0x1b1307(0x201))/0x3+-parseInt(_0x1b1307(0x1e4))/0x4+-parseInt(_0x1b1307(0x1f2))/0x5*(-parseInt(_0x1b1307(0x1e1))/0x6)+-parseInt(_0x1b1307(0x1ee))/0x7+-parseInt(_0x1b1307(0x204))/0x8*(parseInt(_0x1b1307(0x1ed))/0x9)+parseInt(_0x1b1307(0x205))/0xa*(parseInt(_0x1b1307(0x1f4))/0xb);if(_0x318b7d===_0x362c75)break;else _0x159007['push'](_0x159007['shift']());}catch(_0x41c2c0){_0x159007['push'](_0x159007['shift']());}}}(a85_0x914b,0xe17df));function a85_0x914b(){const _0x580afd=['CANVAS','contextmenu','13775iUMMpP','preventDefault','129041TAShPv','KeyC','hostname','IMG','parse','JUU0JUI4JUJBJUU0JUJBJTg2JUU3JUJEJTkxJUU3JUFCJTk5JUU3JTlBJTg0JUU1JUFFJTg5JUU1JTg1JUE4JUVGJUJDJThDJUU3JUE2JTgxJUU2JUFEJUEyJUU4JUIwJTgzJUU4JUFGJTk1','code','shiftKey','name','AUDIO','clear','pushState','innerHTML','3344580QKhqTA','KeyI','includes','953128dKNcRC','5080qHIqzR','ctrlKey','location','target','toString','altKey','PROD','1044wXRzPE','KeyJ','23HgXmVC','4617504CarVwx','YWJvdXQlM0FibGFuaw==','href','addEventListener','63702qRxDtw','nodeName','F12','keydown','VITE_DEV_DEBUGGERABLE_DOMAINS','99Eefrav','8419201lJymgK','KeyU'];a85_0x914b=function(){return _0x580afd;};return a85_0x914b();}import a85_0x3a5e9c from'../assets/devtools-detector.js';function a85_0x3a2b(_0x26b023,_0x112580){const _0x914b64=a85_0x914b();return a85_0x3a2b=function(_0x3a2baa,_0x15faa2){_0x3a2baa=_0x3a2baa-0x1e0;let _0x9a467f=_0x914b64[_0x3a2baa];return _0x9a467f;},a85_0x3a2b(_0x26b023,_0x112580);}const {addListener,launch}=a85_0x3a5e9c,disallowDevtools=(_0x113b8c={},_0xc34280)=>{const _0x502763=a85_0x3a2b,_0x5872b4=_0x2ce9e5=>{const _0x142443=a85_0x3a2b;_0x2ce9e5&&(document['documentElement'][_0x142443(0x200)]=decodeURIComponent(atob(_0x142443(0x1f9))),window[_0x142443(0x207)][_0x142443(0x1e6)]=decodeURIComponent(atob(_0x142443(0x1e5))));};addListener(_0x5872b4),(!window['eval'][_0x502763(0x1fc)]||!console[_0x502763(0x1fe)]['name']||!RegExp[_0x502763(0x209)][_0x502763(0x209)]()[_0x502763(0x203)](_0x502763(0x209))||!history[_0x502763(0x1ff)][_0x502763(0x209)][_0x502763(0x209)]()['includes'](_0x502763(0x209)))&&_0x5872b4(!![]),!(_0xc34280||JSON[_0x502763(0x1f8)](_0x113b8c[_0x502763(0x1e0)]?_0x113b8c['VITE_PROD_DEBUGGERABLE_DOMAINS']:_0x113b8c[_0x502763(0x1ec)]))[_0x502763(0x203)](window['location'][_0x502763(0x1f6)])&&(launch(),window[_0x502763(0x1e7)](_0x502763(0x1f1),_0x2b6870=>{const _0x24c922=_0x502763;!(_0x2b6870[_0x24c922(0x208)]instanceof SVGElement)&&![_0x24c922(0x1f7),_0x24c922(0x1f0),_0x24c922(0x1fd),'VIDEO','PICTURE','INPUT','TEXTAREA'][_0x24c922(0x203)](_0x2b6870['target'][_0x24c922(0x1e9)])&&_0x2b6870[_0x24c922(0x1f3)]();},!![]),window[_0x502763(0x1e7)](_0x502763(0x1eb),_0x357236=>{const _0x3e8283=_0x502763;(_0x357236[_0x3e8283(0x1fa)]===_0x3e8283(0x1ea)||(_0x357236['metaKey']||_0x357236[_0x3e8283(0x206)])&&(_0x357236[_0x3e8283(0x20a)]||_0x357236[_0x3e8283(0x1fb)])&&[_0x3e8283(0x1ef),_0x3e8283(0x202),_0x3e8283(0x1e2),_0x3e8283(0x1f5)]['indexOf'](_0x357236['code'])>=0x0)&&_0x357236[_0x3e8283(0x1f3)]();},!![]));};export default disallowDevtools;
|
|
@@ -1,173 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export const pop = (canvas) => {
|
|
3
|
-
const { width, height } = canvas.getBoundingClientRect()
|
|
4
|
-
canvas.width = width
|
|
5
|
-
canvas.height = height
|
|
6
|
-
const ctx = canvas.getContext('2d')
|
|
7
|
-
|
|
8
|
-
class Circle {
|
|
9
|
-
constructor (x, y, radius, color, vx, vy, ctx) {
|
|
10
|
-
this.x = x
|
|
11
|
-
this.y = y
|
|
12
|
-
this.radius = radius
|
|
13
|
-
this.color = color
|
|
14
|
-
this.vx = vx
|
|
15
|
-
this.vy = vy
|
|
16
|
-
this.ctx = ctx
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
update () {
|
|
20
|
-
this.x += this.vx
|
|
21
|
-
this.y += this.vy
|
|
22
|
-
this.ctx.beginPath()
|
|
23
|
-
this.ctx.fillStyle = this.color
|
|
24
|
-
this.ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2)
|
|
25
|
-
this.ctx.fill()
|
|
26
|
-
this.detectWall()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
detectWall () {
|
|
30
|
-
if (this.x < this.radius) {
|
|
31
|
-
this.x = this.radius
|
|
32
|
-
this.vx = -this.vx
|
|
33
|
-
} else if (this.x + this.radius > width) {
|
|
34
|
-
this.x = width - this.radius
|
|
35
|
-
this.vx = -this.vx
|
|
36
|
-
}
|
|
37
|
-
if (this.y < this.radius) {
|
|
38
|
-
this.y = this.radius
|
|
39
|
-
this.vy = -this.vy
|
|
40
|
-
} else if (this.y + this.radius > height) {
|
|
41
|
-
this.y = height - this.radius
|
|
42
|
-
this.vy = -this.vy
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const clear = () => ctx.clearRect(0, 0, width, height)
|
|
48
|
-
const randint = max => Math.floor(Math.random() * max)
|
|
49
|
-
|
|
50
|
-
let stop = 0
|
|
51
|
-
let stopStep = 0.01
|
|
52
|
-
let sleep = 0
|
|
53
|
-
const drawBackground = () => {
|
|
54
|
-
const gradient = ctx.createLinearGradient(0, 0, width * 1.5, height * 1.5)
|
|
55
|
-
if (!sleep) {
|
|
56
|
-
stop += stopStep
|
|
57
|
-
if (stop <= 0) {
|
|
58
|
-
stop = 0
|
|
59
|
-
stopStep = -stopStep
|
|
60
|
-
sleep = fps * 30
|
|
61
|
-
}
|
|
62
|
-
if (stop >= 1) {
|
|
63
|
-
stop = 1
|
|
64
|
-
stopStep = -stopStep
|
|
65
|
-
sleep = fps * 30
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
sleep --
|
|
69
|
-
}
|
|
70
|
-
gradient.addColorStop(0, 'rgba(250, 220, 20, 0.5)')
|
|
71
|
-
gradient.addColorStop(stop, 'rgba(20, 20, 20, 0.5)')
|
|
72
|
-
ctx.fillStyle = gradient
|
|
73
|
-
ctx.fillRect(0, 0, width, height)
|
|
74
|
-
}
|
|
75
|
-
const vw = Math.floor(width / 100)
|
|
76
|
-
const vh = Math.floor(height / 100)
|
|
77
|
-
|
|
78
|
-
const fps = 20
|
|
79
|
-
const frameGap = Math.round(1000 / fps)
|
|
80
|
-
|
|
81
|
-
const circles = Array.from({ length: 52 }).map(() => {
|
|
82
|
-
const radius = Math.floor(randint(vw + vh) * 1.5 + randint(5))
|
|
83
|
-
let x = randint(width)
|
|
84
|
-
let y = randint(height)
|
|
85
|
-
x = Math.min(Math.max(radius, x), width - radius)
|
|
86
|
-
y = Math.min(Math.max(radius, y), height - radius)
|
|
87
|
-
let vx = randint(2) ? (randint(2) + 2) * vw : (randint(-1) - 2) * vw
|
|
88
|
-
let vy = randint(2) ? (randint(2) + 2) * vh : (randint(-1) - 2) * vh
|
|
89
|
-
vx = Math.floor(vx / fps)
|
|
90
|
-
vy = Math.floor(vy / fps)
|
|
91
|
-
return new Circle(
|
|
92
|
-
x,
|
|
93
|
-
y,
|
|
94
|
-
radius,
|
|
95
|
-
`rgba(${randint(256)}, ${randint(256)}, ${randint(256)}, ${(randint(5) + 5) / 10})`,
|
|
96
|
-
vx,
|
|
97
|
-
vy,
|
|
98
|
-
ctx
|
|
99
|
-
)
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
let lastX, lastY
|
|
103
|
-
canvas.addEventListener('mouseover', e => {
|
|
104
|
-
lastX = e.pageX
|
|
105
|
-
lastY = e.pageY
|
|
106
|
-
})
|
|
107
|
-
canvas.addEventListener('mousemove', e => {
|
|
108
|
-
if (lastX === undefined) {
|
|
109
|
-
lastX = e.pageX
|
|
110
|
-
lastY = e.pageY
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
const diffX = e.pageX - lastX
|
|
114
|
-
const diffY = e.pageY - lastY
|
|
115
|
-
circles.forEach(c => {
|
|
116
|
-
c.x += diffX / fps
|
|
117
|
-
c.y += diffY / fps
|
|
118
|
-
})
|
|
119
|
-
lastX = e.pageX
|
|
120
|
-
lastY = e.pageY
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
let lastTime = Date.now()
|
|
124
|
-
let anim = null
|
|
125
|
-
|
|
126
|
-
const update = () => {
|
|
127
|
-
if (Date.now() - lastTime >= frameGap) {
|
|
128
|
-
clear()
|
|
129
|
-
drawBackground()
|
|
130
|
-
circles.forEach(circle => circle.update())
|
|
131
|
-
lastTime = Date.now()
|
|
132
|
-
}
|
|
133
|
-
anim = requestAnimationFrame(update)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
anim = requestAnimationFrame(update)
|
|
137
|
-
|
|
138
|
-
return () => cancelAnimationFrame(anim)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export const createWatermark = ({
|
|
142
|
-
text,
|
|
143
|
-
gap,
|
|
144
|
-
fontSize,
|
|
145
|
-
color,
|
|
146
|
-
width = window.innerWidth,
|
|
147
|
-
height = window.innerHeight,
|
|
148
|
-
drawMode = 'fill'
|
|
149
|
-
}) => {
|
|
150
|
-
const canvas = document.createElement('canvas')
|
|
151
|
-
canvas.width = width
|
|
152
|
-
canvas.height = height
|
|
153
|
-
|
|
154
|
-
const ctx = canvas.getContext('2d')
|
|
155
|
-
ctx.font = `${fontSize}px Arial`
|
|
156
|
-
ctx[drawMode + 'Style'] = color
|
|
157
|
-
|
|
158
|
-
const textWidth = ctx.measureText(text).width
|
|
159
|
-
const perWidth = textWidth + gap
|
|
160
|
-
const perHeight = fontSize + gap
|
|
161
|
-
for (let y = gap / 2; y < height; y += perHeight) {
|
|
162
|
-
for (let x = gap / 2; x < width; x += perWidth) {
|
|
163
|
-
ctx[drawMode + 'Text'](text, x, y)
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return canvas
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export default {
|
|
171
|
-
pop,
|
|
172
|
-
createWatermark
|
|
173
|
-
}
|
|
1
|
+
const a86_0x3f8f6a=a86_0x3ced;function a86_0x3ced(_0x5730e3,_0x47c6f5){const _0x35bb18=a86_0x35bb();return a86_0x3ced=function(_0x3ced1e,_0x175661){_0x3ced1e=_0x3ced1e-0xef;let _0x3492ef=_0x35bb18[_0x3ced1e];return _0x3492ef;},a86_0x3ced(_0x5730e3,_0x47c6f5);}(function(_0x5b369e,_0x5b89b8){const _0x185bea=a86_0x3ced,_0x49bad9=_0x5b369e();while(!![]){try{const _0x109c90=parseInt(_0x185bea(0xf4))/0x1*(-parseInt(_0x185bea(0x10b))/0x2)+-parseInt(_0x185bea(0x109))/0x3+-parseInt(_0x185bea(0x119))/0x4+parseInt(_0x185bea(0xf7))/0x5+parseInt(_0x185bea(0x115))/0x6+-parseInt(_0x185bea(0xff))/0x7+parseInt(_0x185bea(0xfa))/0x8;if(_0x109c90===_0x5b89b8)break;else _0x49bad9['push'](_0x49bad9['shift']());}catch(_0x7e1e89){_0x49bad9['push'](_0x49bad9['shift']());}}}(a86_0x35bb,0x3cca6));export const pop=_0x493193=>{const _0x3fb3d2=a86_0x3ced,{width:_0x3681ef,height:_0x1be916}=_0x493193['getBoundingClientRect']();_0x493193[_0x3fb3d2(0x111)]=_0x3681ef,_0x493193[_0x3fb3d2(0x10e)]=_0x1be916;const _0x23a3ed=_0x493193[_0x3fb3d2(0x11b)]('2d');class _0x524939{constructor(_0x55c84d,_0x32be48,_0x616dd8,_0xddcb3f,_0x12fa46,_0x3a2255,_0x513f2e){const _0x638f8e=_0x3fb3d2;this['x']=_0x55c84d,this['y']=_0x32be48,this[_0x638f8e(0x101)]=_0x616dd8,this[_0x638f8e(0x117)]=_0xddcb3f,this['vx']=_0x12fa46,this['vy']=_0x3a2255,this[_0x638f8e(0xf9)]=_0x513f2e;}[_0x3fb3d2(0x100)](){const _0x20d569=_0x3fb3d2;this['x']+=this['vx'],this['y']+=this['vy'],this['ctx'][_0x20d569(0x116)](),this[_0x20d569(0xf9)][_0x20d569(0xf5)]=this[_0x20d569(0x117)],this[_0x20d569(0xf9)][_0x20d569(0x104)](this['x'],this['y'],this[_0x20d569(0x101)],0x0,Math['PI']*0x2),this[_0x20d569(0xf9)]['fill'](),this['detectWall']();}[_0x3fb3d2(0x10d)](){const _0x3df9aa=_0x3fb3d2;if(this['x']<this[_0x3df9aa(0x101)])this['x']=this['radius'],this['vx']=-this['vx'];else this['x']+this[_0x3df9aa(0x101)]>_0x3681ef&&(this['x']=_0x3681ef-this[_0x3df9aa(0x101)],this['vx']=-this['vx']);if(this['y']<this[_0x3df9aa(0x101)])this['y']=this[_0x3df9aa(0x101)],this['vy']=-this['vy'];else this['y']+this[_0x3df9aa(0x101)]>_0x1be916&&(this['y']=_0x1be916-this[_0x3df9aa(0x101)],this['vy']=-this['vy']);}}const _0x7807d=()=>_0x23a3ed['clearRect'](0x0,0x0,_0x3681ef,_0x1be916),_0x44ead2=_0x1582ca=>Math[_0x3fb3d2(0xf3)](Math[_0x3fb3d2(0x103)]()*_0x1582ca);let _0x583bde=0x0,_0x42df16=0.01,_0x1461e4=0x0;const _0x53e477=()=>{const _0x1925ce=_0x3fb3d2,_0x23dd52=_0x23a3ed[_0x1925ce(0xf1)](0x0,0x0,_0x3681ef*1.5,_0x1be916*1.5);!_0x1461e4?(_0x583bde+=_0x42df16,_0x583bde<=0x0&&(_0x583bde=0x0,_0x42df16=-_0x42df16,_0x1461e4=_0x14f83b*0x1e),_0x583bde>=0x1&&(_0x583bde=0x1,_0x42df16=-_0x42df16,_0x1461e4=_0x14f83b*0x1e)):_0x1461e4--,_0x23dd52[_0x1925ce(0xef)](0x0,_0x1925ce(0x110)),_0x23dd52['addColorStop'](_0x583bde,_0x1925ce(0xfe)),_0x23a3ed[_0x1925ce(0xf5)]=_0x23dd52,_0x23a3ed['fillRect'](0x0,0x0,_0x3681ef,_0x1be916);},_0x3027c0=Math['floor'](_0x3681ef/0x64),_0x5bebfa=Math[_0x3fb3d2(0xf3)](_0x1be916/0x64),_0x14f83b=0x14,_0x10af72=Math['round'](0x3e8/_0x14f83b),_0x52a0b5=Array[_0x3fb3d2(0x108)]({'length':0x34})[_0x3fb3d2(0xf6)](()=>{const _0x5de77c=_0x3fb3d2,_0x358268=Math[_0x5de77c(0xf3)](_0x44ead2(_0x3027c0+_0x5bebfa)*1.5+_0x44ead2(0x5));let _0x2187f2=_0x44ead2(_0x3681ef),_0x5c64ab=_0x44ead2(_0x1be916);_0x2187f2=Math[_0x5de77c(0x113)](Math[_0x5de77c(0x105)](_0x358268,_0x2187f2),_0x3681ef-_0x358268),_0x5c64ab=Math['min'](Math[_0x5de77c(0x105)](_0x358268,_0x5c64ab),_0x1be916-_0x358268);let _0x322c40=_0x44ead2(0x2)?(_0x44ead2(0x2)+0x2)*_0x3027c0:(_0x44ead2(-0x1)-0x2)*_0x3027c0,_0x394772=_0x44ead2(0x2)?(_0x44ead2(0x2)+0x2)*_0x5bebfa:(_0x44ead2(-0x1)-0x2)*_0x5bebfa;return _0x322c40=Math[_0x5de77c(0xf3)](_0x322c40/_0x14f83b),_0x394772=Math[_0x5de77c(0xf3)](_0x394772/_0x14f83b),new _0x524939(_0x2187f2,_0x5c64ab,_0x358268,_0x5de77c(0x10c)+_0x44ead2(0x100)+',\x20'+_0x44ead2(0x100)+',\x20'+_0x44ead2(0x100)+',\x20'+(_0x44ead2(0x5)+0x5)/0xa+')',_0x322c40,_0x394772,_0x23a3ed);});let _0x36ef75,_0x5e0485;_0x493193[_0x3fb3d2(0xf2)](_0x3fb3d2(0x112),_0x29abd9=>{const _0x23221d=_0x3fb3d2;_0x36ef75=_0x29abd9[_0x23221d(0xfc)],_0x5e0485=_0x29abd9['pageY'];}),_0x493193[_0x3fb3d2(0xf2)](_0x3fb3d2(0xf8),_0x5042ce=>{const _0x264402=_0x3fb3d2;if(_0x36ef75===undefined){_0x36ef75=_0x5042ce[_0x264402(0xfc)],_0x5e0485=_0x5042ce[_0x264402(0xfb)];return;}const _0x5ba65a=_0x5042ce[_0x264402(0xfc)]-_0x36ef75,_0x358922=_0x5042ce[_0x264402(0xfb)]-_0x5e0485;_0x52a0b5[_0x264402(0x102)](_0x409e0d=>{_0x409e0d['x']+=_0x5ba65a/_0x14f83b,_0x409e0d['y']+=_0x358922/_0x14f83b;}),_0x36ef75=_0x5042ce[_0x264402(0xfc)],_0x5e0485=_0x5042ce[_0x264402(0xfb)];});let _0x3ab36a=Date['now'](),_0x5dbd3d=null;const _0x3f9a00=()=>{const _0x13fb8f=_0x3fb3d2;Date['now']()-_0x3ab36a>=_0x10af72&&(_0x7807d(),_0x53e477(),_0x52a0b5[_0x13fb8f(0x102)](_0x156458=>_0x156458['update']()),_0x3ab36a=Date[_0x13fb8f(0x107)]()),_0x5dbd3d=requestAnimationFrame(_0x3f9a00);};return _0x5dbd3d=requestAnimationFrame(_0x3f9a00),()=>cancelAnimationFrame(_0x5dbd3d);};export const createWatermark=({text:_0x28a176,gap:_0x4c91cc,fontSize:_0x2e0d18,color:_0x5dccf1,width:width=window['innerWidth'],height:height=window[a86_0x3f8f6a(0x118)],drawMode:drawMode=a86_0x3f8f6a(0xfd)})=>{const _0x389811=a86_0x3f8f6a,_0x21efd4=document[_0x389811(0x114)](_0x389811(0xf0));_0x21efd4[_0x389811(0x111)]=width,_0x21efd4[_0x389811(0x10e)]=height;const _0x41319a=_0x21efd4[_0x389811(0x11b)]('2d');_0x41319a[_0x389811(0x10a)]=_0x2e0d18+'px\x20Arial',_0x41319a[drawMode+_0x389811(0x11a)]=_0x5dccf1;const _0x338507=_0x41319a[_0x389811(0x10f)](_0x28a176)[_0x389811(0x111)],_0x40b2ad=_0x338507+_0x4c91cc,_0x2eb6cb=_0x2e0d18+_0x4c91cc;for(let _0x4c6b1d=_0x4c91cc/0x2;_0x4c6b1d<height;_0x4c6b1d+=_0x2eb6cb){for(let _0x2c6214=_0x4c91cc/0x2;_0x2c6214<width;_0x2c6214+=_0x40b2ad){_0x41319a[drawMode+_0x389811(0x106)](_0x28a176,_0x2c6214,_0x4c6b1d);}}return _0x21efd4;};export default{'pop':pop,'createWatermark':createWatermark};function a86_0x35bb(){const _0x580a76=['rgba(250,\x20220,\x2020,\x200.5)','width','mouseover','min','createElement','2269926vlIzGf','beginPath','color','innerHeight','587600EQNugh','Style','getContext','addColorStop','canvas','createLinearGradient','addEventListener','floor','14TmBxzL','fillStyle','map','1481775iQsZcQ','mousemove','ctx','8343832LbVdXa','pageY','pageX','fill','rgba(20,\x2020,\x2020,\x200.5)','3421355tQBJcV','update','radius','forEach','random','arc','max','Text','now','from','1376862fFahRz','font','53434sNZUtQ','rgba(','detectWall','height','measureText'];a86_0x35bb=function(){return _0x580a76;};return a86_0x35bb();}
|