@wp1001/ui 2.9.13 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@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/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
|
+
function a81_0x42ef(_0xf23c59,_0x1e9004){const _0x3f3a50=a81_0x3f3a();return a81_0x42ef=function(_0x42ef00,_0x56c9fa){_0x42ef00=_0x42ef00-0x8d;let _0x478ba3=_0x3f3a50[_0x42ef00];return _0x478ba3;},a81_0x42ef(_0xf23c59,_0x1e9004);}const a81_0x3097af=a81_0x42ef;(function(_0x536415,_0x10b4c3){const _0x55cb44=a81_0x42ef,_0x18e1f2=_0x536415();while(!![]){try{const _0x27613c=-parseInt(_0x55cb44(0x8f))/0x1+parseInt(_0x55cb44(0x8e))/0x2*(parseInt(_0x55cb44(0xb3))/0x3)+parseInt(_0x55cb44(0x8d))/0x4*(-parseInt(_0x55cb44(0xbf))/0x5)+parseInt(_0x55cb44(0xcc))/0x6+-parseInt(_0x55cb44(0x9b))/0x7*(-parseInt(_0x55cb44(0x9a))/0x8)+-parseInt(_0x55cb44(0xaf))/0x9*(-parseInt(_0x55cb44(0xc7))/0xa)+parseInt(_0x55cb44(0xa4))/0xb*(-parseInt(_0x55cb44(0xa9))/0xc);if(_0x27613c===_0x10b4c3)break;else _0x18e1f2['push'](_0x18e1f2['shift']());}catch(_0x17afd8){_0x18e1f2['push'](_0x18e1f2['shift']());}}}(a81_0x3f3a,0xb1d05));import a81_0x2fc4ef from'node:path';import a81_0x424155 from'chalk';import{fsUtils}from'@stardust_js/node';const importFile=async _0x51c6ac=>{return new Promise(_0x5ba966=>{const _0x2971a2=a81_0x42ef;import(_0x51c6ac)[_0x2971a2(0x9d)](_0x5ba966);});},viewOnlyFields=[a81_0x3097af(0xba),a81_0x3097af(0xcb),'created_at',a81_0x3097af(0xa6),a81_0x3097af(0xc3)],operatorFields=[a81_0x3097af(0xba),'updater_id'],getModel=async(_0x462d4b,_0x176a22)=>{const _0x12be42=a81_0x3097af,_0x50d3c8=a81_0x2fc4ef[_0x12be42(0x99)](_0x462d4b['backenderPath'],_0x12be42(0xb4),_0x176a22['database'],_0x12be42(0xc8));if(!await fsUtils[_0x12be42(0xd1)](_0x50d3c8)){const _0x466ac3=a81_0x424155[_0x12be42(0xd0)](_0x50d3c8+'\x20not\x20found');throw _0x466ac3;}const _0x3477d8=a81_0x2fc4ef[_0x12be42(0x99)](_0x462d4b[_0x12be42(0xa7)],_0x12be42(0x9f)),_0x16cba4=a81_0x2fc4ef[_0x12be42(0x99)](_0x462d4b[_0x12be42(0xa7)],_0x12be42(0xa2)),_0x691427=(await importFile(_0x3477d8))[_0x12be42(0xc5)],_0x2e1675=(await importFile(_0x50d3c8))[_0x12be42(0xc5)],_0x2f6226=_0x691427[_0x12be42(0x91)]['find'](_0x291dca=>_0x291dca['database']===_0x176a22['database']),{connect:_0x443bfd}=await importFile(_0x16cba4),_0x307b51=_0x443bfd(_0x691427,_0x2f6226),_0x501d5d=Object[_0x12be42(0xc6)](_0x2e1675(_0x307b51,![])),_0x3c5052=_0x501d5d[_0x12be42(0x94)](_0xca395f=>_0xca395f['tableName'][_0x12be42(0xa0)]()===_0x176a22[_0x12be42(0xbe)]);return _0x3c5052;},getSequeliezeDataType=_0x5d58fc=>{const _0x14b5cb=a81_0x3097af,_0x11fc6a=_0x5d58fc['type']||_0x5d58fc,_0x1835ec={'name':_0x11fc6a[_0x14b5cb(0xb8)]||_0x11fc6a[_0x14b5cb(0x96)]};return _0x11fc6a['_length']&&(_0x1835ec[_0x14b5cb(0x95)]=_0x11fc6a[_0x14b5cb(0x95)]),_0x1835ec;},makeFields=_0x59f92f=>{const _0x7978e9=a81_0x3097af,_0x2dc6bc=Object[_0x7978e9(0x92)](_0x59f92f[_0x7978e9(0xb7)])['map'](_0x241d96=>{const _0xefbce=_0x7978e9,[_0x4fd964,_0x497a04]=_0x241d96,_0x1065e7=getSequeliezeDataType(_0x497a04);let _0xf88fff=_0x497a04[_0xefbce(0xa5)]||_0x497a04[_0xefbce(0xaa)]||_0x4fd964;_0xf88fff=_0xf88fff['replaceAll']('\x27','\x22');const _0x2c91c8={'label':_0xf88fff,'prop':_0x4fd964,'tableAttrs':{...calcColumnWidth(_0x1065e7)},'formAttrs':{}};fillFieldType(_0x2c91c8,_0x1065e7),fillFieldForeign(_0x2c91c8,_0x59f92f,_0x4fd964);const {autoIncrement:_0x2c794d,_autoGenerated:_0x4e101c}=_0x497a04;return(_0x2c794d||_0x4e101c||viewOnlyFields[_0xefbce(0xab)](_0x4fd964))&&(_0x2c91c8[_0xefbce(0xb0)]=![],_0x2c91c8[_0xefbce(0x98)]=!![],delete _0x2c91c8['comp'],delete _0x2c91c8['formAttrs']),_0x2c91c8;});return _0x2dc6bc;},calcColumnWidth=_0xa2fe0e=>{const _0x4b4567=a81_0x3097af;switch(_0xa2fe0e[_0x4b4567(0x96)]){case _0x4b4567(0x90):{return _0xa2fe0e[_0x4b4567(0x95)]>0x14?{'minWidth':0x96}:{'width':0x19+_0xa2fe0e[_0x4b4567(0x95)]*0xc};};case _0x4b4567(0x9e):{return{'minWidth':0xc8};}case _0x4b4567(0xbb):{return{'width':0xaf};};default:{return{'width':0x64};}}},fillFieldType=(_0x339456,_0x547317)=>{const _0x507896=a81_0x3097af,{formAttrs:_0x66d88e}=_0x339456;switch(_0x547317[_0x507896(0x96)]){case _0x507896(0xb1):{_0x339456[_0x507896(0xc4)]=_0x507896(0xcd),_0x66d88e[_0x507896(0xac)]=0x1;break;}case _0x507896(0xc2):{_0x339456[_0x507896(0xc4)]=_0x507896(0xcd);break;}case _0x507896(0xce):{_0x339456[_0x507896(0xae)]=_0x507896(0xa1),_0x339456['options']=_0x507896(0xad);break;}case'STRING':{_0x66d88e[_0x507896(0xcf)]=_0x547317[_0x507896(0x95)];break;}case _0x507896(0x9e):{_0x339456[_0x507896(0xc4)]=_0x507896(0xca);break;}case _0x507896(0xbb):{_0x339456['comp']=_0x507896(0x93),_0x66d88e[_0x507896(0xa3)]=_0x507896(0xbc);break;}}},fillFieldForeign=(_0x17b0e8,_0x10d355,_0x2ee90b)=>{const _0xeb9f4=a81_0x3097af,_0x1de509=Object['values'](_0x10d355[_0xeb9f4(0xc9)]),_0xfd598c=_0x1de509[_0xeb9f4(0xb5)](_0x4d0585=>_0x4d0585[_0xeb9f4(0xc0)]),_0x586e47=_0x10d355['sequelize'][_0xeb9f4(0xc1)][_0xeb9f4(0xb6)];if(_0xfd598c['includes'](_0x2ee90b)){const _0x5ab7f5=_0x1de509[_0xeb9f4(0x94)](_0x320018=>_0x320018['foreignKey']===_0x2ee90b);delete _0x17b0e8[_0xeb9f4(0xbd)]['precision'],delete _0x17b0e8['type'],_0x17b0e8[_0xeb9f4(0x9c)]=[],_0x17b0e8[_0xeb9f4(0xae)]=_0xeb9f4(0xa1);const _0x2e0495=_0x5ab7f5[_0xeb9f4(0xb2)][_0xeb9f4(0xa8)]||'';Object[_0xeb9f4(0xb9)](_0x17b0e8[_0xeb9f4(0xbd)],{'modelName':_0x586e47+'.'+_0x5ab7f5[_0xeb9f4(0xb2)][_0xeb9f4(0x9c)][_0xeb9f4(0x97)],'text':_0x2e0495,'value':_0x2e0495});}else viewOnlyFields[_0xeb9f4(0xab)](_0x2ee90b)&&(delete _0x17b0e8[_0xeb9f4(0xbd)][_0xeb9f4(0xac)],delete _0x17b0e8['type'],operatorFields[_0xeb9f4(0xab)](_0x2ee90b)&&(_0x17b0e8[_0xeb9f4(0xb0)]=![]));};function a81_0x3f3a(){const _0x5ec5db=['database','tableAttributes','key','assign','creator_id','DATE','calendar','formAttrs','table','30cjPIis','foreignKey','config','FLOAT','deleted_at','type','default','values','7450JCDybk','init-models.js','associations','textarea','updater_id','311646RqPhoN','number','BOOLEAN','maxlength','red','exists','74852YftYNJ','14306BJRhmA','238591XOlggT','STRING','datasources','entries','ElDatePicker','find','_length','name','tableName','canView','join','168xeoBjZ','283549UCxNlS','options','then','TEXT','config.js','toLowerCase','x-select','.stardust/db.js','prefixIcon','143mTrOiC','label','updated_at','backenderPath','primaryKeyField','1199724jXuOzM','comment','includes','precision','$$\x20store.dictionaries.yesNo\x20$$','comp','3663tWRTtZ','visible','INTEGER','target','492brhrue','models','map'];a81_0x3f3a=function(){return _0x5ec5db;};return a81_0x3f3a();}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(_0x54aa62,_0x1a53de){const _0x393d8f=a82_0x32bf,_0x42cb2b=_0x54aa62();while(!![]){try{const _0x2f55b5=-parseInt(_0x393d8f(0x1f2))/0x1+parseInt(_0x393d8f(0x1e1))/0x2+parseInt(_0x393d8f(0x1df))/0x3+-parseInt(_0x393d8f(0x1e5))/0x4*(-parseInt(_0x393d8f(0x1e7))/0x5)+-parseInt(_0x393d8f(0x1f5))/0x6+-parseInt(_0x393d8f(0x1ed))/0x7*(parseInt(_0x393d8f(0x1f8))/0x8)+parseInt(_0x393d8f(0x1ec))/0x9*(parseInt(_0x393d8f(0x1f1))/0xa);if(_0x2f55b5===_0x1a53de)break;else _0x42cb2b['push'](_0x42cb2b['shift']());}catch(_0x51fb23){_0x42cb2b['push'](_0x42cb2b['shift']());}}}(a82_0x566b,0x63057));import a82_0x679bd7 from'node:path';import a82_0x3543d9 from'node-plop/src/generator-runner.js';function a82_0x566b(){const _0x2719ed=['replaceAll','map','indexOf','runGeneratorActions','351GFLKUb','378gbeoqf','请输入\x20','请输入','input','190250RZnknH','441523moHZDe','assign','\x27$$\x20','4614462vYuljy','validate','runGeneratorPrompts','40904bzIbei','join','getPlopfilePath','928836mGDhvU','test','1133528qXcQze','slice','resolve','stringify','57672vYgBJs','split','95dAapLa'];a82_0x566b=function(){return _0x2719ed;};return a82_0x566b();}function a82_0x32bf(_0x29374e,_0x5df44d){const _0x566be6=a82_0x566b();return a82_0x32bf=function(_0x32bff6,_0x16c71e){_0x32bff6=_0x32bff6-0x1df;let _0x30ff6e=_0x566be6[_0x32bff6];return _0x30ff6e;},a82_0x32bf(_0x29374e,_0x5df44d);}const getGenerator=(_0x481ba3,_0x3fb047,_0xf90dd1)=>{const _0x1290af=a82_0x32bf,_0x348e2e=a82_0x3543d9(_0x481ba3,_0xf90dd1),_0x42b190=_0x481ba3['getGenerator'](_0x3fb047);return Object[_0x1290af(0x1f3)](_0x42b190,{'runActions':(_0x3472f2,_0x5e9920)=>_0x348e2e[_0x1290af(0x1eb)](_0x42b190,_0x3472f2,_0x5e9920),'runPrompts':(_0x3154e6=[])=>_0x348e2e[_0x1290af(0x1f7)](_0x42b190,_0x3154e6)}),_0x42b190;},absPath=(_0x4affa9,_0xe3f424)=>{const _0x547e48=a82_0x32bf;return a82_0x679bd7[_0x547e48(0x1e3)](_0x4affa9[_0x547e48(0x1fa)](),_0xe3f424);},addValidator=(_0x53f6cc,_0x302526)=>{const _0x1176a7=a82_0x32bf;_0x53f6cc[_0x1176a7(0x1f6)]=_0x2da8fb=>{const _0x348542=_0x1176a7;return/.+/[_0x348542(0x1e0)](_0x2da8fb)?!![]:_0x348542(0x1ef)+_0x302526;};},makeInputPrompt=(_0x42d16a,_0x48d223,_0x23cc69=!![])=>{const _0x21c2f6=a82_0x32bf,_0x35f58f={'type':_0x21c2f6(0x1f0),'name':_0x42d16a,'message':_0x21c2f6(0x1ee)+_0x48d223+'('+(_0x23cc69?'必填':'选填')+')'};return _0x23cc69&&addValidator(_0x35f58f,_0x42d16a),_0x35f58f;},makeConfirmPrompt=(_0x1d7a4e,_0x52a242,_0x5682eb)=>{const _0x5b16e6={'type':'confirm','name':_0x1d7a4e,'message':_0x52a242,'default':_0x5682eb};return _0x5b16e6;},makeSelectPrompt=(_0x14d4d0,_0x3e85f3,_0x31e05d,_0x1c2b65)=>{const _0x58c56f={'type':'list','name':_0x14d4d0,'choices':_0x3e85f3,'message':_0x31e05d,'default':_0x1c2b65};return _0x58c56f;},makePartial=_0x464ce7=>{const _0x1e3e6e=a82_0x32bf,_0x5b3fbd=JSON[_0x1e3e6e(0x1e4)](_0x464ce7,null,0x2)[_0x1e3e6e(0x1e6)]('\x0a')[_0x1e3e6e(0x1e2)](0x1,-0x1)[_0x1e3e6e(0x1e9)]((_0x42672a,_0x552bb0)=>{const _0x202135=_0x1e3e6e;_0x42672a=_0x42672a['slice'](0x2);let _0x1c4298=_0x42672a[_0x202135(0x1e6)](':');return _0x1c4298[0x0][_0x202135(0x1ea)]('-')>=0x0?_0x1c4298[0x0]=_0x1c4298[0x0][_0x202135(0x1e8)]('\x22','\x27'):_0x1c4298[0x0]=_0x1c4298[0x0][_0x202135(0x1e8)]('\x22',''),_0x1c4298=_0x1c4298['map']((_0x160d1f,_0x14e0d2)=>{return _0x14e0d2===0x0?_0x160d1f:_0x160d1f['replaceAll']('\x22','\x27');}),_0x1c4298[_0x202135(0x1f9)](':');});let _0x52e200=_0x5b3fbd[_0x1e3e6e(0x1f9)]('\x0a')+'\x0a';return _0x52e200=_0x52e200['replaceAll'](_0x1e3e6e(0x1f4),'')['replaceAll']('\x20$$\x27',''),_0x52e200;},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 a83_0x55e7(){const _0x4eed03=['3MMHNPQ','2447532nJbXYL','823239lKJfqS','split','1586798fvksXj','1176Riomlq','4828465VOwrie','7025928ZSCeyx','2572868RfMHJs','1729eQYxUK','reverse','map','join','fromCharCode','charCodeAt'];a83_0x55e7=function(){return _0x4eed03;};return a83_0x55e7();}(function(_0x2b05f4,_0x37fd25){const _0x300fea=a83_0x5a37,_0x1f237a=_0x2b05f4();while(!![]){try{const _0x41be6c=parseInt(_0x300fea(0xc0))/0x1+parseInt(_0x300fea(0xc2))/0x2+-parseInt(_0x300fea(0xbe))/0x3*(parseInt(_0x300fea(0xc6))/0x4)+parseInt(_0x300fea(0xc4))/0x5+parseInt(_0x300fea(0xc3))/0x6*(-parseInt(_0x300fea(0xc7))/0x7)+-parseInt(_0x300fea(0xc5))/0x8+-parseInt(_0x300fea(0xbf))/0x9;if(_0x41be6c===_0x37fd25)break;else _0x1f237a['push'](_0x1f237a['shift']());}catch(_0x39470e){_0x1f237a['push'](_0x1f237a['shift']());}}}(a83_0x55e7,0xb4ca1));const simple={'encrypt'(_0x5f3c31){const _0x5bdb95=a83_0x5a37;return _0x5f3c31=encodeURIComponent(_0x5f3c31),_0x5f3c31=btoa(_0x5f3c31),_0x5f3c31=_0x5f3c31[_0x5bdb95(0xc1)](''),_0x5f3c31=_0x5f3c31[_0x5bdb95(0xba)](_0x44c7c7=>String[_0x5bdb95(0xbc)](_0x44c7c7[_0x5bdb95(0xbd)](0x0)+0x6)),_0x5f3c31[_0x5bdb95(0xb9)](),_0x5f3c31=_0x5f3c31['join'](''),_0x5f3c31;},'decrypt'(_0x1ef598){const _0x2c38f5=a83_0x5a37;return _0x1ef598=_0x1ef598[_0x2c38f5(0xc1)](''),_0x1ef598[_0x2c38f5(0xb9)](),_0x1ef598=_0x1ef598['map'](_0x53f005=>String[_0x2c38f5(0xbc)](_0x53f005[_0x2c38f5(0xbd)](0x0)-0x6)),_0x1ef598=_0x1ef598[_0x2c38f5(0xbb)](''),_0x1ef598=atob(_0x1ef598),_0x1ef598=decodeURIComponent(_0x1ef598),_0x1ef598;}};function a83_0x5a37(_0x38fa02,_0x533e5f){const _0x55e778=a83_0x55e7();return a83_0x5a37=function(_0x5a3747,_0x2af2da){_0x5a3747=_0x5a3747-0xb9;let _0x438ce2=_0x55e778[_0x5a3747];return _0x438ce2;},a83_0x5a37(_0x38fa02,_0x533e5f);}export{simple};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(_0x427e58,_0x117b98){const _0x4ea6fa=a84_0x385e,_0x1dae0d=_0x427e58();while(!![]){try{const _0x510400=parseInt(_0x4ea6fa(0x120))/0x1*(parseInt(_0x4ea6fa(0x125))/0x2)+parseInt(_0x4ea6fa(0x121))/0x3+parseInt(_0x4ea6fa(0x123))/0x4+parseInt(_0x4ea6fa(0x129))/0x5*(parseInt(_0x4ea6fa(0x122))/0x6)+parseInt(_0x4ea6fa(0x12b))/0x7+-parseInt(_0x4ea6fa(0x11a))/0x8*(parseInt(_0x4ea6fa(0x11c))/0x9)+parseInt(_0x4ea6fa(0x117))/0xa*(-parseInt(_0x4ea6fa(0x118))/0xb);if(_0x510400===_0x117b98)break;else _0x1dae0d['push'](_0x1dae0d['shift']());}catch(_0x2ad904){_0x1dae0d['push'](_0x1dae0d['shift']());}}}(a84_0x3e43,0x5e91f));function a84_0x385e(_0x3bd51d,_0x126f7b){const _0x3e437f=a84_0x3e43();return a84_0x385e=function(_0x385edc,_0x439e93){_0x385edc=_0x385edc-0x117;let _0x33ae5e=_0x3e437f[_0x385edc];return _0x33ae5e;},a84_0x385e(_0x3bd51d,_0x126f7b);}const {highdict}=StardustJs,_checkOk=(_0x1ac075,_0x5c8424)=>{const _0x545e73=a84_0x385e;let _0x210628=_0x5c8424;if(typeof _0x5c8424===_0x545e73(0x124))_0x210628=highdict[_0x545e73(0x127)](_0x1ac075,_0x5c8424);else typeof _0x5c8424===_0x545e73(0x128)&&(_0x210628=_0x5c8424(_0x1ac075));return!!_0x210628;};export const when=_0x18add9=>{return(_0x78c0fe,{name:_0x2bb9c9,addInitializer:_0x26fd68,..._0x167ed8})=>{_0x26fd68(function(){const _0x4e9d99=this,_0x1f7536=_0x4e9d99[_0x2bb9c9];_0x4e9d99[_0x2bb9c9]=function(..._0xc718e5){const _0x310254=a84_0x385e;if(!_checkOk(_0x4e9d99,_0x18add9))return;return _0x1f7536[_0x310254(0x126)](_0x4e9d99,_0xc718e5);};});};};export const not=_0x353fde=>{return(_0x20bab1,{name:_0x14b120,addInitializer:_0x2e8ec5,..._0x7b496c})=>{_0x2e8ec5(function(){const _0x4803e1=this,_0x461ac3=_0x4803e1[_0x14b120];_0x4803e1[_0x14b120]=function(..._0x5e78b5){const _0x2b730a=a84_0x385e;if(_checkOk(_0x4803e1,_0x353fde))return;return _0x461ac3[_0x2b730a(0x126)](_0x4803e1,_0x5e78b5);};});};};function a84_0x3e43(){const _0x50978f=['dialog','invalid\x20params\x20for\x20@loading','then','2059CvOvDC','12318HGSFvR','107814KQnTuD','178352miDfId','string','284ntPPwa','apply','get','function','80dWZwNz','table.loading','5360929iPlByM','170EAbbxn','464574DGpoqm','set','330384kIaysR','table','63IwgCBY'];a84_0x3e43=function(){return _0x50978f;};return a84_0x3e43();}export const loading=_0x59362b=>{return(_0x50f8f6,{name:_0x522d64,addInitializer:_0x431cd3,..._0x8f6891})=>{_0x431cd3(function(){const _0x34a1ff=a84_0x385e,_0x3106dc=this,_0x3cd112=_0x3106dc[_0x522d64];_0x59362b??=_0x3106dc[_0x34a1ff(0x11b)]&&_0x34a1ff(0x12a)||_0x3106dc['model']&&'model.loading'||_0x3106dc[_0x34a1ff(0x11d)]&&'dialog.loading'||'loading',_0x3106dc[_0x522d64]=function(..._0x22a1a5){const _0x1c09ad=_0x34a1ff;if(!_0x59362b)throw _0x1c09ad(0x11e);if(highdict[_0x1c09ad(0x127)](_0x3106dc,_0x59362b))return;highdict[_0x1c09ad(0x119)](_0x3106dc,_0x59362b,!![]);const _0x342247=_0x3cd112[_0x1c09ad(0x126)](_0x3106dc,_0x22a1a5);if(_0x342247 instanceof Promise)return _0x342247[_0x1c09ad(0x11f)]((..._0x45e1ec)=>{const _0x214c69=_0x1c09ad;return highdict[_0x214c69(0x119)](_0x3106dc,_0x59362b,![]),_0x45e1ec;});return highdict['set'](_0x3106dc,_0x59362b,![]),_0x342247;};});};};export default{'when':when,'not':not,'loading':loading};
|
|
@@ -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 a85_0x396d(_0x21b819,_0x3de9e4){const _0x4f1944=a85_0x4f19();return a85_0x396d=function(_0x396d4c,_0x553e96){_0x396d4c=_0x396d4c-0x7e;let _0x42c461=_0x4f1944[_0x396d4c];return _0x42c461;},a85_0x396d(_0x21b819,_0x3de9e4);}(function(_0x1dff63,_0x1cb4da){const _0xcd8198=a85_0x396d,_0x33b575=_0x1dff63();while(!![]){try{const _0x36b9bb=-parseInt(_0xcd8198(0xa5))/0x1*(parseInt(_0xcd8198(0x80))/0x2)+-parseInt(_0xcd8198(0x85))/0x3+-parseInt(_0xcd8198(0x8e))/0x4*(-parseInt(_0xcd8198(0x9a))/0x5)+parseInt(_0xcd8198(0x88))/0x6+parseInt(_0xcd8198(0x90))/0x7*(parseInt(_0xcd8198(0x8a))/0x8)+-parseInt(_0xcd8198(0x7e))/0x9+parseInt(_0xcd8198(0x84))/0xa;if(_0x36b9bb===_0x1cb4da)break;else _0x33b575['push'](_0x33b575['shift']());}catch(_0x226136){_0x33b575['push'](_0x33b575['shift']());}}}(a85_0x4f19,0xcbabb));function a85_0x4f19(){const _0xb9cf4b=['clear','4157289NldVfG','contextmenu','184DgREzM','eval','parse','innerHTML','2552340oUfKAa','2411649JiBwKM','includes','VITE_PROD_DEBUGGERABLE_DOMAINS','9645252DYvCMQ','addEventListener','303896DLZkmZ','PICTURE','code','hostname','5288YmycJa','altKey','77JSjgGJ','INPUT','VIDEO','PROD','pushState','ctrlKey','KeyI','metaKey','VITE_DEV_DEBUGGERABLE_DOMAINS','shiftKey','95yZWDEk','KeyC','href','toString','TEXTAREA','indexOf','preventDefault','documentElement','target','name','IMG','2236CJtKPc'];a85_0x4f19=function(){return _0xb9cf4b;};return a85_0x4f19();}import a85_0x47cc7f from'../assets/devtools-detector.js';const {addListener,launch}=a85_0x47cc7f,disallowDevtools=(_0x43c057={},_0x267cd9)=>{const _0x23b773=a85_0x396d,_0x42179b=_0x524431=>{const _0x1cb05d=a85_0x396d;_0x524431&&(document[_0x1cb05d(0xa1)][_0x1cb05d(0x83)]=decodeURIComponent(atob('JUU0JUI4JUJBJUU0JUJBJTg2JUU3JUJEJTkxJUU3JUFCJTk5JUU3JTlBJTg0JUU1JUFFJTg5JUU1JTg1JUE4JUVGJUJDJThDJUU3JUE2JTgxJUU2JUFEJUEyJUU4JUIwJTgzJUU4JUFGJTk1')),window['location'][_0x1cb05d(0x9c)]=decodeURIComponent(atob('YWJvdXQlM0FibGFuaw==')));};addListener(_0x42179b),(!window[_0x23b773(0x81)][_0x23b773(0xa3)]||!console[_0x23b773(0xa6)][_0x23b773(0xa3)]||!RegExp[_0x23b773(0x9d)]['toString']()[_0x23b773(0x86)](_0x23b773(0x9d))||!history[_0x23b773(0x94)][_0x23b773(0x9d)][_0x23b773(0x9d)]()[_0x23b773(0x86)](_0x23b773(0x9d)))&&_0x42179b(!![]),!(_0x267cd9||JSON[_0x23b773(0x82)](_0x43c057[_0x23b773(0x93)]?_0x43c057[_0x23b773(0x87)]:_0x43c057[_0x23b773(0x98)]))[_0x23b773(0x86)](window['location'][_0x23b773(0x8d)])&&(launch(),window[_0x23b773(0x89)](_0x23b773(0x7f),_0x1422c9=>{const _0x474fc4=_0x23b773;!(_0x1422c9[_0x474fc4(0xa2)]instanceof SVGElement)&&![_0x474fc4(0xa4),'CANVAS','AUDIO',_0x474fc4(0x92),_0x474fc4(0x8b),_0x474fc4(0x91),_0x474fc4(0x9e)][_0x474fc4(0x86)](_0x1422c9[_0x474fc4(0xa2)]['nodeName'])&&_0x1422c9[_0x474fc4(0xa0)]();},!![]),window[_0x23b773(0x89)]('keydown',_0x8f4173=>{const _0x128493=_0x23b773;(_0x8f4173[_0x128493(0x8c)]==='F12'||(_0x8f4173[_0x128493(0x97)]||_0x8f4173[_0x128493(0x95)])&&(_0x8f4173[_0x128493(0x8f)]||_0x8f4173[_0x128493(0x99)])&&['KeyU',_0x128493(0x96),'KeyJ',_0x128493(0x9b)][_0x128493(0x9f)](_0x8f4173[_0x128493(0x8c)])>=0x0)&&_0x8f4173['preventDefault']();},!![]));};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
|
+
function a86_0x5e2a(){const _0x2d4a8e=['random','3687705idodjQ','82046zSfgbm','51bCDzyr','measureText','max','getContext','11LAfjYg','addColorStop','270580uXiTjO','pageX','pageY','width','min','detectWall','innerHeight','floor','421183GkWzya','px\x20Arial','fill','72TLWJLU','getBoundingClientRect','update','arc','map','ctx','addEventListener','beginPath','fillRect','now','5199480RPHGfa','5794956vTRxXw','17243390OTxZiW','mousemove','clearRect','rgba(250,\x20220,\x2020,\x200.5)','canvas','mouseover','height','font','color','createLinearGradient','rgba(','innerWidth','radius','26FHOnMV'];a86_0x5e2a=function(){return _0x2d4a8e;};return a86_0x5e2a();}const a86_0x55c0f7=a86_0x9ded;(function(_0x159afa,_0x3045c4){const _0x507cda=a86_0x9ded,_0x381f47=_0x159afa();while(!![]){try{const _0x3bb49=-parseInt(_0x507cda(0xc4))/0x1*(-parseInt(_0x507cda(0xc1))/0x2)+parseInt(_0x507cda(0xc5))/0x3*(-parseInt(_0x507cda(0x9d))/0x4)+-parseInt(_0x507cda(0xb2))/0x5+-parseInt(_0x507cda(0xb3))/0x6+parseInt(_0x507cda(0xa5))/0x7*(parseInt(_0x507cda(0xa8))/0x8)+parseInt(_0x507cda(0xc3))/0x9+-parseInt(_0x507cda(0xb4))/0xa*(-parseInt(_0x507cda(0xc9))/0xb);if(_0x3bb49===_0x3045c4)break;else _0x381f47['push'](_0x381f47['shift']());}catch(_0x33552f){_0x381f47['push'](_0x381f47['shift']());}}}(a86_0x5e2a,0x8f314));function a86_0x9ded(_0x2dd5f1,_0x57b0c7){const _0x5e2a15=a86_0x5e2a();return a86_0x9ded=function(_0x9ded80,_0x3b7666){_0x9ded80=_0x9ded80-0x9d;let _0x358c48=_0x5e2a15[_0x9ded80];return _0x358c48;},a86_0x9ded(_0x2dd5f1,_0x57b0c7);}export const pop=_0x4f323d=>{const _0x383ffd=a86_0x9ded,{width:_0x7e5a27,height:_0x1dc410}=_0x4f323d[_0x383ffd(0xa9)]();_0x4f323d[_0x383ffd(0xa0)]=_0x7e5a27,_0x4f323d[_0x383ffd(0xba)]=_0x1dc410;const _0x42995b=_0x4f323d[_0x383ffd(0xc8)]('2d');class _0x48c458{constructor(_0x309070,_0x1d7efb,_0x1dade0,_0x388fac,_0x3c3b69,_0x1ceedf,_0x2e1436){const _0x238f10=_0x383ffd;this['x']=_0x309070,this['y']=_0x1d7efb,this[_0x238f10(0xc0)]=_0x1dade0,this[_0x238f10(0xbc)]=_0x388fac,this['vx']=_0x3c3b69,this['vy']=_0x1ceedf,this[_0x238f10(0xad)]=_0x2e1436;}[_0x383ffd(0xaa)](){const _0x26d552=_0x383ffd;this['x']+=this['vx'],this['y']+=this['vy'],this['ctx'][_0x26d552(0xaf)](),this[_0x26d552(0xad)]['fillStyle']=this[_0x26d552(0xbc)],this['ctx'][_0x26d552(0xab)](this['x'],this['y'],this[_0x26d552(0xc0)],0x0,Math['PI']*0x2),this[_0x26d552(0xad)][_0x26d552(0xa7)](),this[_0x26d552(0xa2)]();}[_0x383ffd(0xa2)](){const _0x301a7d=_0x383ffd;if(this['x']<this[_0x301a7d(0xc0)])this['x']=this[_0x301a7d(0xc0)],this['vx']=-this['vx'];else this['x']+this[_0x301a7d(0xc0)]>_0x7e5a27&&(this['x']=_0x7e5a27-this[_0x301a7d(0xc0)],this['vx']=-this['vx']);if(this['y']<this['radius'])this['y']=this[_0x301a7d(0xc0)],this['vy']=-this['vy'];else this['y']+this['radius']>_0x1dc410&&(this['y']=_0x1dc410-this[_0x301a7d(0xc0)],this['vy']=-this['vy']);}}const _0x11986f=()=>_0x42995b[_0x383ffd(0xb6)](0x0,0x0,_0x7e5a27,_0x1dc410),_0xc70fb7=_0x2623b1=>Math['floor'](Math[_0x383ffd(0xc2)]()*_0x2623b1);let _0x3676d4=0x0,_0x35deec=0.01,_0x3dbf32=0x0;const _0x2fb08c=()=>{const _0xa1b9bf=_0x383ffd,_0x597048=_0x42995b[_0xa1b9bf(0xbd)](0x0,0x0,_0x7e5a27*1.5,_0x1dc410*1.5);!_0x3dbf32?(_0x3676d4+=_0x35deec,_0x3676d4<=0x0&&(_0x3676d4=0x0,_0x35deec=-_0x35deec,_0x3dbf32=_0xa94f1a*0x1e),_0x3676d4>=0x1&&(_0x3676d4=0x1,_0x35deec=-_0x35deec,_0x3dbf32=_0xa94f1a*0x1e)):_0x3dbf32--,_0x597048[_0xa1b9bf(0xca)](0x0,_0xa1b9bf(0xb7)),_0x597048[_0xa1b9bf(0xca)](_0x3676d4,'rgba(20,\x2020,\x2020,\x200.5)'),_0x42995b['fillStyle']=_0x597048,_0x42995b[_0xa1b9bf(0xb0)](0x0,0x0,_0x7e5a27,_0x1dc410);},_0x371f00=Math[_0x383ffd(0xa4)](_0x7e5a27/0x64),_0x2f9774=Math[_0x383ffd(0xa4)](_0x1dc410/0x64),_0xa94f1a=0x14,_0x44f348=Math['round'](0x3e8/_0xa94f1a),_0x5c4667=Array['from']({'length':0x34})[_0x383ffd(0xac)](()=>{const _0x2dd591=_0x383ffd,_0x457159=Math[_0x2dd591(0xa4)](_0xc70fb7(_0x371f00+_0x2f9774)*1.5+_0xc70fb7(0x5));let _0x31ba73=_0xc70fb7(_0x7e5a27),_0x273bad=_0xc70fb7(_0x1dc410);_0x31ba73=Math[_0x2dd591(0xa1)](Math[_0x2dd591(0xc7)](_0x457159,_0x31ba73),_0x7e5a27-_0x457159),_0x273bad=Math[_0x2dd591(0xa1)](Math[_0x2dd591(0xc7)](_0x457159,_0x273bad),_0x1dc410-_0x457159);let _0x55eca5=_0xc70fb7(0x2)?(_0xc70fb7(0x2)+0x2)*_0x371f00:(_0xc70fb7(-0x1)-0x2)*_0x371f00,_0x214d68=_0xc70fb7(0x2)?(_0xc70fb7(0x2)+0x2)*_0x2f9774:(_0xc70fb7(-0x1)-0x2)*_0x2f9774;return _0x55eca5=Math[_0x2dd591(0xa4)](_0x55eca5/_0xa94f1a),_0x214d68=Math[_0x2dd591(0xa4)](_0x214d68/_0xa94f1a),new _0x48c458(_0x31ba73,_0x273bad,_0x457159,_0x2dd591(0xbe)+_0xc70fb7(0x100)+',\x20'+_0xc70fb7(0x100)+',\x20'+_0xc70fb7(0x100)+',\x20'+(_0xc70fb7(0x5)+0x5)/0xa+')',_0x55eca5,_0x214d68,_0x42995b);});let _0x56a425,_0x44e925;_0x4f323d[_0x383ffd(0xae)](_0x383ffd(0xb9),_0x111aca=>{const _0x322c13=_0x383ffd;_0x56a425=_0x111aca[_0x322c13(0x9e)],_0x44e925=_0x111aca[_0x322c13(0x9f)];}),_0x4f323d[_0x383ffd(0xae)](_0x383ffd(0xb5),_0x4776f8=>{const _0x53ad57=_0x383ffd;if(_0x56a425===undefined){_0x56a425=_0x4776f8[_0x53ad57(0x9e)],_0x44e925=_0x4776f8[_0x53ad57(0x9f)];return;}const _0x20ea48=_0x4776f8[_0x53ad57(0x9e)]-_0x56a425,_0x7c1c05=_0x4776f8[_0x53ad57(0x9f)]-_0x44e925;_0x5c4667['forEach'](_0x53a088=>{_0x53a088['x']+=_0x20ea48/_0xa94f1a,_0x53a088['y']+=_0x7c1c05/_0xa94f1a;}),_0x56a425=_0x4776f8[_0x53ad57(0x9e)],_0x44e925=_0x4776f8[_0x53ad57(0x9f)];});let _0x130f11=Date[_0x383ffd(0xb1)](),_0x35b294=null;const _0x112cb9=()=>{const _0x3d01b4=_0x383ffd;Date['now']()-_0x130f11>=_0x44f348&&(_0x11986f(),_0x2fb08c(),_0x5c4667['forEach'](_0x2cb317=>_0x2cb317[_0x3d01b4(0xaa)]()),_0x130f11=Date[_0x3d01b4(0xb1)]()),_0x35b294=requestAnimationFrame(_0x112cb9);};return _0x35b294=requestAnimationFrame(_0x112cb9),()=>cancelAnimationFrame(_0x35b294);};export const createWatermark=({text:_0x38ac8d,gap:_0x31a2b1,fontSize:_0x3fff03,color:_0x25e57a,width:width=window[a86_0x55c0f7(0xbf)],height:height=window[a86_0x55c0f7(0xa3)],drawMode:drawMode=a86_0x55c0f7(0xa7)})=>{const _0x3a038a=a86_0x55c0f7,_0x169f06=document['createElement'](_0x3a038a(0xb8));_0x169f06[_0x3a038a(0xa0)]=width,_0x169f06[_0x3a038a(0xba)]=height;const _0x12ff20=_0x169f06[_0x3a038a(0xc8)]('2d');_0x12ff20[_0x3a038a(0xbb)]=_0x3fff03+_0x3a038a(0xa6),_0x12ff20[drawMode+'Style']=_0x25e57a;const _0x2541bc=_0x12ff20[_0x3a038a(0xc6)](_0x38ac8d)[_0x3a038a(0xa0)],_0x1708d9=_0x2541bc+_0x31a2b1,_0x527ff1=_0x3fff03+_0x31a2b1;for(let _0x141b8c=_0x31a2b1/0x2;_0x141b8c<height;_0x141b8c+=_0x527ff1){for(let _0x1eb311=_0x31a2b1/0x2;_0x1eb311<width;_0x1eb311+=_0x1708d9){_0x12ff20[drawMode+'Text'](_0x38ac8d,_0x1eb311,_0x141b8c);}}return _0x169f06;};export default{'pop':pop,'createWatermark':createWatermark};
|