arisu.js 2.0.1-alpha.1 → 2.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/README.md +67 -66
- package/dist/arisu.commonjs.js +1 -1
- package/dist/arisu.esm.js +1 -1
- package/dist/arisu.umd.js +1 -1
- package/dist/types/index.d.ts +16 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/js/base.d.ts +1 -1
- package/dist/types/js/base.d.ts.map +1 -1
- package/dist/types/js/main.d.ts +5 -0
- package/dist/types/js/main.d.ts.map +1 -0
- package/dist/types/js/utils/AeLoader.d.ts +10 -0
- package/dist/types/js/utils/AeLoader.d.ts.map +1 -0
- package/dist/types/js/utils/BtnEf.d.ts +9 -0
- package/dist/types/js/utils/BtnEf.d.ts.map +1 -0
- package/dist/types/js/utils/Flash.d.ts +34 -0
- package/dist/types/js/utils/Flash.d.ts.map +1 -0
- package/dist/types/js/utils/HoverDir.d.ts +29 -0
- package/dist/types/js/utils/HoverDir.d.ts.map +1 -0
- package/dist/types/js/utils/IList.d.ts +12 -0
- package/dist/types/js/utils/IList.d.ts.map +1 -0
- package/dist/types/js/utils/ILoader.d.ts +24 -0
- package/dist/types/js/utils/ILoader.d.ts.map +1 -0
- package/dist/types/js/utils/IPagination.d.ts +15 -0
- package/dist/types/js/utils/IPagination.d.ts.map +1 -0
- package/dist/types/js/utils/ItemCount.d.ts +11 -0
- package/dist/types/js/utils/ItemCount.d.ts.map +1 -0
- package/dist/types/js/utils/LineEffect.d.ts +43 -0
- package/dist/types/js/utils/LineEffect.d.ts.map +1 -0
- package/dist/types/js/utils/NiceSelect.d.ts +14 -0
- package/dist/types/js/utils/NiceSelect.d.ts.map +1 -0
- package/dist/types/js/utils/PopoverSearch.d.ts +16 -0
- package/dist/types/js/utils/PopoverSearch.d.ts.map +1 -0
- package/dist/types/js/utils/SubmitFlag.d.ts +12 -0
- package/dist/types/js/utils/SubmitFlag.d.ts.map +1 -0
- package/package.json +14 -5
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
## 项目名称
|
|
2
|
-
常用JS
|
|
2
|
+
常用JS方法工具合集,版本:2.0.1
|
|
3
3
|
|
|
4
4
|
### 简介
|
|
5
5
|
包含了基础工具类,以及一些普通网站管理平台上可能需要的组件,按钮状态设置、返回顶部、局部loading、数据增删改查列表等等..,API文档访问:https://www.arisu.cn/springmvc/api/0
|
|
@@ -112,7 +112,6 @@
|
|
|
112
112
|
b('body').loading();
|
|
113
113
|
b("body").loading("complete");
|
|
114
114
|
|
|
115
|
-
|
|
116
115
|
// 2. 静态方法
|
|
117
116
|
// 2.1 基础静态方法
|
|
118
117
|
// 参数继承覆盖
|
|
@@ -174,7 +173,6 @@
|
|
|
174
173
|
// 包含搜索按钮删除按钮的搜索框
|
|
175
174
|
b.search(function(txt) { if (txt) console.log(txt); });// 输入框文本
|
|
176
175
|
|
|
177
|
-
|
|
178
176
|
// 3. 其他常用方法、原生JS方法重写等
|
|
179
177
|
// 时间格式化
|
|
180
178
|
new Date().format("yyyy-MM-dd hh:mm:ss")//'2024-06-10 10:47:06'
|
|
@@ -185,74 +183,71 @@
|
|
|
185
183
|
```
|
|
186
184
|
二、常用JS插件组件
|
|
187
185
|
```bash
|
|
188
|
-
|
|
189
|
-
import b,
|
|
190
|
-
|
|
191
|
-
or
|
|
192
|
-
import b, { SubmitFlag } from 'ilib/utils'
|
|
193
|
-
let sf = new SubmitFlag(".e2")
|
|
186
|
+
//utils.ts使用范例
|
|
187
|
+
import b, { SubmitFlag } from 'arisu.js'
|
|
188
|
+
const sf = new SubmitFlag(".e2")
|
|
194
189
|
|
|
195
|
-
1. SubmitFlag防用户多次点击:new
|
|
196
|
-
2. 底部按钮快速移动到顶部:new
|
|
197
|
-
3. 数字增加减少,购物数量控制:new
|
|
198
|
-
4. niceSelect自定义下拉框:new
|
|
199
|
-
5. 按钮动画:new
|
|
200
|
-
6. 局部loading动画:new
|
|
201
|
-
7. 分页:new
|
|
202
|
-
8. 列表查询分页封装插件:const ilist = new
|
|
203
|
-
9. 手风琴导航菜单:new
|
|
204
|
-
10. 弹框搜索面板:new
|
|
205
|
-
11. 文字切换动画特效:new
|
|
206
|
-
12. 绘制点线背景动画:new
|
|
207
|
-
13. JS、CSS页面引入,多次引入只保留一个:const iloader = new
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
//使用范例
|
|
212
|
-
import { b, u, m } from 'ilib/main'
|
|
213
|
-
|
|
190
|
+
1. SubmitFlag防用户多次点击:new SubmitFlag(".e2")
|
|
191
|
+
2. 底部按钮快速移动到顶部:new GoTop({
|
|
192
|
+
3. 数字增加减少,购物数量控制:new ItemCount({
|
|
193
|
+
4. niceSelect自定义下拉框:new NiceSelect('#ns2')
|
|
194
|
+
5. 按钮动画:new BtnEf(".bn-btn-5")
|
|
195
|
+
6. 局部loading动画:new AeLoader()...
|
|
196
|
+
7. 分页:new IPagination({ target: '#ipagination'...
|
|
197
|
+
8. 列表查询分页封装插件:const ilist = new IList({ target: '#test-list' ..
|
|
198
|
+
9. 手风琴导航菜单:new IAccordion({ speed: 300, showCount: true });
|
|
199
|
+
10. 弹框搜索面板:new PopoverSearch('#ipopover', {
|
|
200
|
+
11. 文字切换动画特效:new Flash("#ce-flash", {
|
|
201
|
+
12. 绘制点线背景动画:new LineEffect("#canvas-warp", {
|
|
202
|
+
13. JS、CSS页面引入,多次引入只保留一个:const iloader = new ILoader();
|
|
203
|
+
|
|
204
|
+
//main.ts使用范例
|
|
214
205
|
1. Main类,用户常用登录登出token设置获取等操作
|
|
206
|
+
包含:getUser,getToken,setToken,login,logout方法
|
|
215
207
|
2. handlebars模板判断表达式支持,不依赖其他框架:b.handlebars(Handlebars);
|
|
216
208
|
3. bootstrap 文本提示框,依赖bootstrap
|
|
217
209
|
<a href="#" class="me-1 js-detail"><i class="bi bi-search"></i></a>
|
|
218
210
|
import { Tooltip } from 'glib/bootstrap';
|
|
219
211
|
b.tip(Tooltip);
|
|
220
|
-
4.
|
|
221
|
-
5.
|
|
222
|
-
<div id="carousel-image" class="owl-carousel owl-theme">
|
|
223
|
-
<div class="item thumbnail"><img src="//arisu.cn/file/images/res/anime/anime1470402086147.jpg"></img></div>
|
|
224
|
-
<div class="item thumbnail">....
|
|
225
|
-
b.owl($("#carousel-image"), {});
|
|
226
|
-
6. 消息弹框,依赖jQuery:b.al("你好,世界", 'success');
|
|
227
|
-
7. 确定框,依赖jQuery:
|
|
212
|
+
4. 消息弹框,依赖jQuery:b.al("你好,世界", 'success');
|
|
213
|
+
5. 确定框,依赖jQuery:
|
|
228
214
|
b.cf("是否确定删除该记录!", "删除", () => {
|
|
229
215
|
b.al("删除成功!", "success");
|
|
230
216
|
}, 2, "ice");
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
11. air-datepicker时间控件,不依赖其他框架
|
|
235
|
-
12. niceScroll滚动条,依赖jQuery
|
|
236
|
-
13. validationEngine表单验证,依赖jQuery
|
|
237
|
-
14. validate确认是否验证通过
|
|
217
|
+
6. air-datepicker时间控件,不依赖其他框架:b.datepicker(AirDatepicker, localeZh)
|
|
218
|
+
7. validationEngine表单验证,依赖jQuery:b.validationEngine($("#form-1, #form-2"));
|
|
219
|
+
8. validate确认是否验证通过:const isSuccessed = b.validate($("#form-2"));
|
|
238
220
|
```
|
|
221
|
+
三、实际开发常用方法及模块插件扩展或初始化
|
|
239
222
|
### 安装
|
|
240
223
|
```bash
|
|
241
224
|
npm i arisu.js
|
|
225
|
+
import b, { SubmitFlag } from 'arisu.js'
|
|
226
|
+
|
|
242
227
|
or
|
|
243
|
-
<script src="/arisu.
|
|
228
|
+
<script src="/arisu.umd.js"></script>
|
|
244
229
|
```
|
|
245
230
|
#### 使用:
|
|
246
231
|
npm安装使用:
|
|
247
232
|
```bash
|
|
248
|
-
import b,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
233
|
+
import b, {
|
|
234
|
+
SubmitFlag,
|
|
235
|
+
GoTop,
|
|
236
|
+
ItemCount,
|
|
237
|
+
NiceSelect,
|
|
238
|
+
BtnEf,
|
|
239
|
+
AeLoader,
|
|
240
|
+
IPagination,
|
|
241
|
+
IList,
|
|
242
|
+
IAccordion,
|
|
243
|
+
PopoverSearch,
|
|
244
|
+
Flash,
|
|
245
|
+
LineEffect,
|
|
246
|
+
HoverDir,
|
|
247
|
+
ILoader,
|
|
248
|
+
} from 'arisu.js';
|
|
249
|
+
// b基础类,其他常用工具类,调用如:
|
|
254
250
|
let sf = new SubmitFlag("#id")
|
|
255
|
-
|
|
256
251
|
b(#btn").click((e) => {
|
|
257
252
|
// sf.request();
|
|
258
253
|
// 或者
|
|
@@ -266,12 +261,15 @@
|
|
|
266
261
|
|
|
267
262
|
// ilist类演示
|
|
268
263
|
import 'istyle/dist/arisu.css'
|
|
269
|
-
import
|
|
264
|
+
import b, { IList } from 'arisu.js'
|
|
270
265
|
import '../css/bootstrap-icons.css'
|
|
271
266
|
import Handlebars from 'glib/handlebars'
|
|
272
267
|
import { Tooltip } from 'glib/bootstrap';
|
|
268
|
+
// or
|
|
269
|
+
//import * as bootstrap from 'glib/bootstrap';
|
|
270
|
+
//const tooltipInstance = new bootstrap.Tooltip(elementRef.current, options);
|
|
273
271
|
|
|
274
|
-
const ilist = new
|
|
272
|
+
const ilist = new IList('#test-list', {
|
|
275
273
|
url: "./springmvc/news/findNews.action",
|
|
276
274
|
param: {},
|
|
277
275
|
method: "get",
|
|
@@ -312,13 +310,16 @@
|
|
|
312
310
|
```
|
|
313
311
|
页面中直接引入:
|
|
314
312
|
```bash
|
|
315
|
-
<script src="/arisu.
|
|
313
|
+
<script src="/arisu.umd.js"></script>
|
|
316
314
|
<script>
|
|
317
|
-
|
|
318
|
-
|
|
315
|
+
const b = arisu.default;
|
|
316
|
+
const { GoTop, IList } = arisu;
|
|
317
|
+
|
|
318
|
+
b.l('打印测试')//常用方法:打印
|
|
319
|
+
b('.myclass').addClass('newtest')//常用方法:新增class
|
|
319
320
|
|
|
320
321
|
let sf = new a.SubmitFlag(".e2")//SubmitFlag防用户多次点击组件
|
|
321
|
-
|
|
322
|
+
b(".e2").click((e) => {
|
|
322
323
|
// sf.request();
|
|
323
324
|
// 或者
|
|
324
325
|
sf.toggle();
|
|
@@ -333,9 +334,9 @@
|
|
|
333
334
|
// ilist类页面使用演示,样式还需要bootstrap-icons.css、arisu.css
|
|
334
335
|
<script src="/js/bootstrap.bundle.js"></script>
|
|
335
336
|
<script src="/js/handlebars.min.js"></script>
|
|
336
|
-
<script src="/arisu.js"></script>
|
|
337
|
+
<script src="/arisu.umd.js"></script>
|
|
337
338
|
<script>
|
|
338
|
-
const ilist = new
|
|
339
|
+
const ilist = new IList('#test-list', {
|
|
339
340
|
url: "./springmvc/news/findNews.action",
|
|
340
341
|
param: {},
|
|
341
342
|
method: "get",
|
|
@@ -345,19 +346,19 @@
|
|
|
345
346
|
handlebars: Handlebars,
|
|
346
347
|
headerMap: { 'token': 'abc123' },
|
|
347
348
|
onSuccess: function(data) {
|
|
348
|
-
|
|
349
|
-
const tplEl =
|
|
349
|
+
b.handlebars(Handlebars);
|
|
350
|
+
const tplEl = b("#tp-data-news");
|
|
350
351
|
const html = Handlebars.compile(tplEl.html())({
|
|
351
352
|
items: data.rows,
|
|
352
353
|
isInit: data.isInit
|
|
353
354
|
});
|
|
354
355
|
|
|
355
356
|
if (data.isInit)
|
|
356
|
-
|
|
357
|
+
b(".be-list-data", "#test-list").html(html);
|
|
357
358
|
else
|
|
358
|
-
|
|
359
|
+
b(".be-list-data-body", "#test-list").html(html);
|
|
359
360
|
|
|
360
|
-
|
|
361
|
+
b.tip(bootstrap.Tooltip);
|
|
361
362
|
// 测试获取列ID
|
|
362
363
|
// b(".ip").click(function() {
|
|
363
364
|
// alert("该列数据id为" + b(this).data("id"));
|
|
@@ -368,9 +369,9 @@
|
|
|
368
369
|
}
|
|
369
370
|
});
|
|
370
371
|
|
|
371
|
-
|
|
372
|
+
b('#be-search').click(() => {
|
|
372
373
|
ilist.reload({
|
|
373
|
-
'title':
|
|
374
|
+
'title': b('#be-input-2').val()
|
|
374
375
|
})
|
|
375
376
|
});
|
|
376
377
|
</script>
|
package/dist/arisu.commonjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Base:()=>n,GoTop:()=>o,IAccordion:()=>l,default:()=>r});class n{constructor(e,t){if(this.elements=[],this.length=0,t=t instanceof n?t.elements[0]:t||document,"string"==typeof e)if(t&&"string"==typeof t&&(t=document.querySelector(t)),n.isEqSelector(e)){const s=e.split(":")[0],i=e.match(/:eq\((\d+)\)/);if(i){const e=parseInt(i[1]),l=n.contextQuerySelector(">"+s,t);l.length>0?this.elements=[l[e]]:this.elements=[]}else this.elements=[]}else this.elements=n.contextQuerySelector(e,t);else e instanceof NodeList||e instanceof HTMLElement?this.elements=e instanceof NodeList?Array.from(e):[e]:e instanceof Window?this.elements=[window]:null!==e&&"object"==typeof e&&"documentElement"in e?this.elements=[t]:Array.isArray(e)?this.elements=e:this.elements=[];this.length=this.elements.length}each(e){return this.elements.forEach(((t,n)=>{e(t,n)})),this}hasClass(e){let t=!1;return this.each((n=>{t=n.classList.contains(e)})),t}addClass(e){return this.each((t=>{if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.add(n[e])}else e&&t.classList.add(e)}))}removeClass(e){return this.each((t=>{if(void 0===e)t.className="";else if(e||0!==e.length)if(/\s/.test(e)){const n=e.split(" ");for(let e=0;e<n.length;e++)n[e]&&t.classList.remove(n[e].trim())}else t.classList.remove(e.trim())}))}toggleClass(e){return this.each((t=>{if(t.classList)t.classList.toggle(e);else{let n=t.className.split(/\s+/),s=n.indexOf(e);s>=0?n.splice(s,1):n.push(e),t.className=n.join(" ")}}))}not(e){let t=e instanceof n?e.elements:Array.from(document.querySelectorAll(e));return this.elements=Array.from(this.elements).filter((e=>!t.includes(e))),this}is(e){var t;let n=this.elements[0];if(":visible"===e){if("none"===n.style.display||"hidden"===n.style.visibility||"0"===getComputedStyle(n).opacity)return!1}else{if(":first-child"===e)return(null===(t=n.parentNode)||void 0===t?void 0:t.firstChild)===n;if(":last-child"!==e)return n.matches(e);{const e=n.parentNode;if(e){const t=e.children;return t[t.length-1]===n}}}return!1}closest(e){let t=this.elements[0];if(!t)return n.build([]);const s=t.matches||t.webkitMatchesSelector;if(s.call(t,e))return this.constructor===n?n.build(this.elements):this;let i=t.parentElement;for(;i;){if(s.call(i,e))return n.build(i);i=i.parentElement}return n.build([])}next(){if(1===this.elements.length){const e=this.elements[0].nextElementSibling;return e instanceof Element?n.build(e):n.build([])}if(this.elements.length>1){const e=[],t=this.elements[0].nextElementSibling;t instanceof Element&&e.push(t);for(let t=1;t<this.elements.length-1;t++)this.elements[t]instanceof Element&&e.push(this.elements[t]);const s=this.elements[this.elements.length-1].nextElementSibling;return s instanceof Element&&e.push(s),n.build(e)}return null}nextAll(e){const t=[];let n=this.elements[0],s=n.nextSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.nextSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}prev(){if(1===this.elements.length)return n.build(this.elements[0].previousElementSibling);if(this.elements.length>1){let e=n.build(this.elements[0].previousElementSibling);return this.each(((t,n)=>{n>1&&(e.elements.push(t),n===this.elements.length-1&&e.elements.push(t.previousElementSibling))})),e}return null}prevAll(e){const t=[];let n=this.elements[this.elements.length-1],s=n.previousSibling,i=n.parentElement;for(;s&&(1===s.nodeType&&(e&&!s.matches(e)||t.unshift(s)),s=s.previousSibling,null!==s||0!==t.length||(null==i?void 0:i.firstChild)!==n););return this.elements=t,this.length=this.elements.length,this}first(){return new n([this.elements[0]])}find(e){if(e&&"option:selected"===e.trim()){const e=[];return this.each((t=>{("select-one"===t.type||"select-multiple"===t.type)&&t.selectedIndex>=0&&e.push(t.options[t.selectedIndex])})),new n(e)}{const t=[];return this.elements.forEach((n=>{n instanceof HTMLElement&&n.querySelectorAll(e).forEach((e=>t.push(e)))})),new n(t)}}parent(){let e=this.elements[0];return e?new n(e.parentNode):new n}parents(e){const t=[];let s=this.elements[0].parentElement;for(;s&&s!==document.documentElement;)e&&!s.matches(e)||t.push(s),s=s.parentElement;return new n(t)}siblings(){let e=this.elements[0];if(e&&1===e.nodeType){let t=e.parentNode;if(t){let s=[];for(let n=0;n<t.childNodes.length;n++){let i=t.childNodes[n];1===i.nodeType&&i!==e&&s.push(i)}return new n(s)}return new n}return new n}children(){let e=[];return this.each((t=>{e.push(...Array.from(t.children))})),new n(e)}index(){var e;const t=this.elements[0],n=null===(e=t.parentNode)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}size(){return this.elements?this.elements.length:0}on(e,t){return this.each((function(n){n.addEventListener(e,t)}))}off(e,t){return this.each((function(n){n.removeEventListener&&t&&n.removeEventListener(e,t)}))}click(e){return"function"==typeof e?this.on("click",e):this.each((e=>{const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)})),this}focus(e){return"function"==typeof e&&this.on("focus",e),this}change(e){return e&&this.each((t=>{t.addEventListener("change",e,!1)})),this}trigger(e,t){return this.each((function(n){let s;try{s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(n){s=document.createEvent("CustomEvent"),s.initCustomEvent(e,!0,!0,t)}n.dispatchEvent(s)})),this}remove(){return this.each((e=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}))}data(e,t){if(void 0===e)throw new Error("读取的或设置的键值不能为空");let s=this.elements[0];if(void 0!==t){let i=n.elementData.get(s);return i||(i=new Map,n.elementData.set(s,i)),i.set(n.camelCase(e),t),this}{const t=n.elementData.get(s);return t?t.get(n.camelCase(e)):n.dataAttr(s,e)}}removeData(e){let t=this.elements[0],s=n.elementData.get(t);s&&s.set(n.camelCase(e),void 0)}attr(e,t){if(0===this.elements.length)return void 0===t?"":this;const n=this.elements[0];return void 0===t?(null==n?void 0:n.getAttribute(e))||"":this.each((n=>n.setAttribute(e,t)))}removeAttr(e){return this.each((t=>{"function"==typeof t.removeAttribute&&t.removeAttribute(e)}))}offset(){let e=this.elements[0].getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,n=window.pageXOffset||document.documentElement.scrollLeft;return{top:e.top+t,left:e.left+n}}scrollTop(){return this.elements[0]instanceof Window?void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop:document.documentElement.scrollTop}height(){const e=this.elements[0];return e===window?window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight:e.offsetHeight}width(){const e=this.elements[0];return e===window?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:e.offsetWidth}val(e){let t=this.elements[0];if("select-multiple"===t.type){if(void 0!==e){for(let n=t.options.length-1;n>=0;n--)t.options[n].selected=t.options[n].value===e;return this}{let e=[];for(let n=0;n<t.options.length;n++)t.options[n].selected&&e.push(t.options[n].value);return e}}return void 0!==e?(t.value=e,this):t.value}css(e,t){if(0===this.elements.length)return this;if(void 0===t){if("object"==typeof e){const t=e;for(const e in t)if(t.hasOwnProperty(e)){const n=t[e];this.each((t=>{t.style[e]=n}))}return this}return this.elements[0].style[e]||""}return this.each((n=>{n.style[e]=t}))}text(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t.textContent||"":this.each((t=>{t.textContent=e}))}html(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t&&1===t.nodeType?t.innerHTML:"":this.each((t=>{t&&1===t.nodeType&&(t.innerHTML=e)}))}after(e){return this.each((t=>{t.insertAdjacentHTML("afterend",e)}))}append(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.appendChild(n.firstChild);return t}))}prepend(e){return this.each((t=>{let n=document.createElement("div");if("string"==typeof e)n.innerHTML=e;else if(e instanceof Node)n.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)n.appendChild(e[t]);for(;n.firstChild;)t.insertBefore(n.firstChild,t.firstChild);return t}))}hide(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="none",t&&"function"==typeof t&&t(n)}),e):(n.style.display="none",t&&"function"==typeof t&&t(n))}))}show(e,t){return this.each((n=>{n.style.display="block",e?setTimeout((()=>{n.style.display="block",t&&"function"==typeof t&&t(n)}),e):(n.style.display="block",t&&"function"==typeof t&&t(n))}))}slideUp(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{e.style.height=e.scrollHeight+"px",e.style.overflow="hidden",e.style.transition=`height ${s.duration}ms ease-in-out`,setTimeout((()=>{e.style.height="0px"}),s.duration/100),setTimeout((()=>{e.style.display="none",e.style.overflow="",e.style.transition="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration-s.duration/100)}))}slideDown(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{let t=e.offsetHeight;"none"===e.style.display&&(e.style.display="",t=0),e.style.height=t+"px",e.style.transition=`height ${s.duration}ms ease-in-out`,e.offsetHeight,e.style.height=e.scrollHeight+"px",e.style.display="block",setTimeout((()=>{e.style.overflow="",e.style.transition="",e.style.display="",e.style.height="",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}slideToggle(e,t){const s=n.extend({duration:e,callback:t},{duration:500,callback:null});let i=!0;return this.each((e=>{"none"===e.style.display&&(i=!1)})),i?this.slideUp(s.duration,s.callback):this.slideDown(s.duration,s.callback),this}fadeOut(e,t){const s=n.extend({duration:e,callback:t},{duration:300,callback:null});return this.each((e=>{e.style.transition=`opacity ${s.duration}ms ease-in-out`,e.style.opacity="0",setTimeout((()=>{e.style.display="none",s.callback&&"function"==typeof s.callback&&s.callback(e)}),s.duration)}))}checkAll(e){const t=n.extend({checkboxes:e},{checkboxes:".be-check"});return this.each((e=>{let n=document.querySelectorAll(t.checkboxes);e.addEventListener("change",(function(){n.forEach((function(t){t.checked=e.checked}))}))}))}checkReverse(e){const t=n.extend({checkboxes:e},{checkboxes:".be-check"});return this.each((e=>{let n=document.querySelectorAll(t.checkboxes);e.addEventListener("click",(function(){n.forEach((function(e){e.checked=!e.checked}))}))}))}numStep(e){return e=n.extend(e,{start:0,end:100,duration:1500,callback:!1}),this.each((t=>{let s=null;requestAnimationFrame((function i(l){null===s&&(s=l);const o=Math.min((l-s)/e.duration,1),r=Math.floor(o*(e.end-e.start)+e.start);n.build(t).text(r.toString()),o<1?requestAnimationFrame(i):"function"==typeof e.callback&&e.callback()}))}))}scrollBG(e){return e=n.extend(e,{speed:0}),this.each((t=>{n.build(t).css("background-position","50% 0px"),n.build(window).on("scroll",(()=>{const s=n.build(t),i=s.offset().top,l=s.height(),o=s.scrollTop(),r=s.height();if(r+o>i&&r+o<i+r+l){const t=(i+l-o)/e.speed;s.css("background-position","50% -"+t+"px")}}))}))}setActive(e){const{className:t="active"}=e||{};n.build(this.elements).click((e=>{const s=n.build(e.currentTarget);s.hasClass(t)?s.removeClass(t):(n.build(this.elements).removeClass(t),s.addClass(t))}))}loading(e){let t=!1;return void 0!==e&&"object"!=typeof e&&(t=!0,e={}),e=n.extend(e,{isFull:!0,loadingTarget:"#do-preloader",template:'<div id="do-preloader" class="do-preloader"><span class="do-pr-loader"><span class="do-pr-lr"></span></span></div>'}),this.each((s=>{const i=e,l=i.loadingTarget,o=i.template;if(t)n.build("> *",s).removeClass("be-blur-2"),n.build(l).addClass("oy-0"),setTimeout((()=>{n.build("> *",s).removeClass("be-ts"),n.build(l).remove()}),300);else{n.build("> *",s).addClass("be-ts").addClass("be-blur-2"),n.build(s).prepend(o);const e=n.build(l);e.length&&e.css("position","fixed").css("height","100vh").css("width","100vw")}}))}static extend(e,t){if(!t)return e;{let n;for(n in e)if(null==e?void 0:e.hasOwnProperty(n)){const s=e[n];null==t[n]&&(t[n]=s)}}return t}static camelCase(e){let t=e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}));return t=t.replace(/\./g,""),t}static l(...e){window.console&&e&&console.log(...e)}static toRound(e,t){let n=parseFloat(String(e));return n=n?Math.round(e*Math.pow(10,t))/Math.pow(10,t):0,n}static isNull(e){let t=!0;return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(t=!1),t}static setDefault(e,t){return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(e=t),e}static isObject(e){return!!e&&e&&"object"==typeof e&&!Array.isArray(e)&&!0}static same(e,t){return e.filter((function(e){return-1!==t.indexOf(e)}))}static different(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)||-1===t.indexOf(n)}))}static contrast(e,t){return e.concat(t).filter((function(n){return-1===e.indexOf(n)&&-1!==t.indexOf(n)}))}static isHtmlTag(e){return/^<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>$|^<([a-z][a-z0-9]*)\b[^>]*\/>$/i.test(e)}static plugin(e,t){n.fn[e]=function(){t()}}static createElement(e){let t=document.createElement("div");t.innerHTML=e.trim();let n=t.firstChild;if((null==n?void 0:n.nodeType)===Node.TEXT_NODE){n=n.nextSibling;let e=document.createDocumentFragment();for(;n;)e.appendChild(n),n=n.nextSibling;return e}return n}static ajax(e){var t;if("get"===(null===(t=null==(e=n.extend(e,{url:"",method:"GET",async:!0,headerMap:{},cache:"default",dataType:"json",data:null,success:function(){},error:function(){}}))?void 0:e.method)||void 0===t?void 0:t.toLowerCase())){if(!e.url.includes("?")){let t=new URLSearchParams;for(let n in e.data)e.data.hasOwnProperty(n)&&t.append(n,e.data[n]);e.url=e.url+"?"+t.toString()}e.data=null}if(fetch)fetch(e.url,{method:e.method,headers:new Headers(e.headerMap),cache:e.cache,body:e.data?JSON.stringify(e.data):null}).then((function(t){return t.ok?"json"===e.dataType?t.json():t.text():Promise.reject(new Error("Failed to fetch resource"))})).then((function(t){e.success&&e.success(t)})).catch((function(t){e.error&&e.error(t)}));else{let t=new XMLHttpRequest;t.onload=function(){if(t.status>=200&&t.status<300){let n;switch(e.dataType){case"json":try{n=JSON.parse(t.responseText)}catch(t){return void(e.error&&e.error(t))}break;case"text":n=t.responseText;break;default:n=t.responseText||t.response}e.success&&e.success(n,t.status,t)}else{let n=new Error("Request failed. Status: "+t.status);e.error&&e.error(n)}},t.onerror=function(){e.error&&e.error(new Error("Network Error"))},t.open((null==e?void 0:e.method)||"get",e.url,e.async||!1);for(let n in e.headerMap)e.headerMap.hasOwnProperty(n)&&t.setRequestHeader(n,e.headerMap[n]);e.data?t.send(e.data):t.send()}}static getParam(e){let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?unescape(n[2]):null}static move(e){const t=document.querySelector(e);if(t){let e=new n(t).offset();window.scrollTo(e.left,e.top)}}static strValidation(e,t,n){let s=0;return e.length<=t||e.length>=n?s=1:/^[0-9]{0,32}$/.test(e)?s=2:/^[a-zA-z]{0,32}$/.test(e)?s=3:/^[0-9a-zA-z]{0,32}$/.test(e)?s=4:/^[^\u4e00-\u9fa5a-zA-Z\d,.,。]{0,32}$/.test(e)?s=5:/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]*$/.test(e)&&(s=8),s}static hotkey(e,t){document.addEventListener("keydown",(function(n){e===n.key&&t()}))}static setCookie(e,t,n={}){let s="",i=n.path||"/",l=n.domain,o=n.secure?"; Secure":"";if(n.expires){let e;"number"==typeof n.expires?(e=new Date,e.setTime(e.getTime()+24*n.expires*60*60*1e3)):e=n.expires,s=`; expires=${e.toUTCString()}`}document.cookie=`${e}=${encodeURIComponent(t)}${s}; path=${i}; domain=${l||""}${o}`}static getCookie(e){let t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null}static removeCookie(e,t={}){this.setCookie(e,"",Object.assign(Object.assign({},t),{expires:-1}))}static menu(e,t){const n=function(e,s,i){let l="";++s;for(let o=0;o<e.length;o++){const r=e[o];let a="#";if(r.link&&(a=r.link),r.pId||0!==s){if(r.pId===i){let t="";r.isParent&&(t=n(e,s,r.id),t&&(t="<ul class='sub'>"+t+"</ul>"));let i="";1===s&&(i=`<i class='${r.icon}'></i>`);let o=r.hash?` data-hash='${r.hash}' `:" ",c=r.actionId?` id='${r.actionId}' `:" ";l+=`<li class='sub-menu'><a${r.isParent?" class='mu-js-a' ":" "}${o}${r.tid?` data-tid='${r.tid}' `:" "}${c}href='${a}'>`+i+`<span>${r.name}</span></a>`+t+"</li>"}}else if(t)l=n(e,s,r.id);else{let t=n(e,s,r.id);t&&(t="<ul class='sub'>"+t+"</ul>"),l+=`<li class='sub-menu'><a${r.hash?` data-hash='${r.hash}' `:" "}${r.actionId?` id='${r.actionId}' `:" "}href='${a}'><span>${r.name}</span></a>`+t+"</li>"}}return l};let s="";return e&&(s=n(e,-1,0)),""+s}static menu2Tree(e,t,s){let i=[];return e.forEach((function(l){l.pId===t&&(l.isactive=`a${l.id}`===s,i.push(l),l.isParent&&(l.children=n.menu2Tree(e,l.id)))})),i}static search(e){var t;const s=n.build(".fm-search"),i=n.build("input",s),l=n.build("span:eq(0)",s),o=n.build("span:eq(1)",s);i.on("change",(e=>{var t,s;const i=n.build(e.currentTarget);""!==i.val()?null===(t=i.next())||void 0===t||t.css("opacity","1").css("visibility","visible"):null===(s=i.next())||void 0===s||s.css("opacity","0").css("visibility","hidden")})),""!==i.val()&&(null===(t=i.next())||void 0===t||t.css("opacity","1").css("visibility","visible")),o.on("click",(e=>{var t;const s=n.build(e.currentTarget);s.css("opacity","0").css("visibility","hidden"),null===(t=s.prev())||void 0===t||t.val("")})),l.on("click",(t=>{var s;const i=n.build(t.currentTarget);e&&e(null===(s=i.next())||void 0===s?void 0:s.val())}))}static shuffleArray(e){if(!Array.isArray(e))return e;const t=[...e];for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}static defaultConstructor(e,t,s,i){"string"==typeof t?e.elements=document.querySelectorAll(t):t instanceof NodeList?e.elements=t:t instanceof HTMLElement?e.elements=Array.of(t):e.elements=[],e.options=n.extend(s,e.options),i(e)}static contextQuerySelector(e,t){if(e.startsWith(">"))return Array.from(t.querySelectorAll(e.substring(1))).filter((function(e){return e.parentNode===t}));{const n=t.querySelectorAll(e);return 0===n.length?Array.from(document.querySelectorAll(e)):Array.from(n)}}static isEqSelector(e){const t=e.match(/^[\w-]+:eq\((\d+)\)$/);return null!==t&&void 0!==t[1]}static build(e,t){return new(this||n)(e,t)}}n.keys={esc:"Escape",backspace:"Backspace",space:" ",enter:"Enter",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},n.dataAttr=function(e,t){var n;let s="data-"+t;return null!==(n=e.getAttribute(s))&&void 0!==n?n:void 0},n.expando="base"+(""+Math.random()).replace(/\D/g,""),n.elementData=new Map,n.cache={},n.build.extend=n.extend,n.build.camelCase=n.camelCase,n.build.l=n.l,n.build.getParam=n.getParam,n.build.toRound=n.toRound,n.build.isNull=n.isNull,n.build.setDefault=n.setDefault,n.build.same=n.same,n.build.different=n.different,n.build.contrast=n.contrast,n.build.strValidation=n.strValidation,n.build.move=n.move,n.build.keys=n.keys,n.build.hotkey=n.hotkey,n.build.isHtmlTag=n.isHtmlTag,n.build.isObject=n.isObject,n.build.plugin=n.plugin,n.build.ajax=n.ajax,n.build.setCookie=n.setCookie,n.build.getCookie=n.getCookie,n.build.removeCookie=n.removeCookie,n.build.menu=n.menu,n.build.menu2Tree=n.menu2Tree,n.build.search=n.search,n.build.shuffleArray=n.shuffleArray,n.build.defaultConstructor=n.defaultConstructor;const s=n.build;Date.prototype.format=function(e){let t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(let n in t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e},Array.prototype.remove=function(e,t){let n=this.slice((t||e)+1||this.length);return this.length=e<0?this.length+e:e,this.push.apply(this,n)},Array.prototype.unique=function(){let e=[];this.sort();for(let t=0;t<this.length;t++)this[t]!==this[t+1]&&(e[e.length]=this[t]);return e};const i=s;class l{constructor(e,t){this.options={classParent:"ia-parent",classActive:"active",classArrow:"ia-icon",classCount:"ia-count",autoExpand:!1,classExpand:"ia-current-parent",autoClose:!0,speed:300,saveState:!0,disableLink:!0,showCount:!1,cookie:"ia-cookie",smallClass:"ce-accordion-small"},this.selector=e,n.defaultConstructor(this,e,t,(e=>{e.elements.forEach((n=>{let s=i(n);s.data("be.iaccordion")||s.data("be.iaccordion",e),e.init(n,t)}))}))}init(e,t){const n=this,s=i("li > a",e),l=i("li > ul",e),o=(t=i.extend(t,n.options)).classActive;this.setUpAccordion(e,s,l,t),!0===t.saveState&&n.checkCookie(t.cookie,e,o),!0===t.autoExpand&&i("li."+t.classExpand+" > a").addClass(o),s.click((s=>{const l=i(s.currentTarget),r=l.parent(),a=n.isSmall(s,e,t.smallClass);!0===t.disableLink&&l.siblings().length>0&&s.preventDefault(),!0===t.autoClose&&n.autoCloseAccordion(e,l,a,t),0===i("> ul",r).length?i("> a",r).addClass(o):"none"!==i("> ul",r).css("display")?(n.slideUp(i("ul",r),a,t),i("a",r).removeClass(o)):("none"===i(s.currentTarget).siblings().css("display")?n.slideDown(i(s.currentTarget).siblings().css("overflow","hidden"),a,t):n.slideUp(i(s.currentTarget).siblings(),a,t),i("> a",r).addClass(o)),!0===t.saveState&&n.createCookie(t.cookie,e,o)}))}setUpAccordion(e,t,n,s){const l='<span class="'+s.classArrow+'"></span>',o=s.classParent+"-li";n.show(),i("li",e).each((e=>{i("> ul",e).length>0&&(i(e).addClass(o),i("> a",e).addClass(s.classParent).append(l))})),n.hide(),!0===s.showCount&&i("ul",e).each((e=>{i("> a",i(e).parent()).append(' <span class="'+s.classCount+'">('+e.children.length+")</span>")}))}autoCloseAccordion(e,t,n,s){const l=this;i("ul",e).each((e=>{let o=!1;t.parents("ul").each((t=>{t===e&&(o=!0)})),o||t.siblings().elements[0]===e||"none"===e.style.display||l.slideUp(i(e),n,s)})),i("a",e).removeClass(s.classActive),t.parents("li").each((e=>{i("> a",e).addClass(s.classActive)}))}checkCookie(e,t,n){const s=this,l=i.getCookie(e);if(null!==l&&""!==l){const e=l.split(",");s.setActiveMenu(t,e,0,n)}}setActiveMenu(e,t,n,s){const l=i("li:eq("+t[n]+")",e),o=i("> a",l),r=o.siblings();o.addClass(s),r.css("display",""),t.length>n+1&&this.setActiveMenu(r,t,++n,s)}createCookie(e,t,n){let s=[];i("li a."+n,t).each((e=>{const t=i(e).parent().index();s.push(t.toString())})),i.setCookie(e,s.join(","))}isSmall(e,t,n){return!(!i(t).hasClass(n)||0===i(e.currentTarget).siblings().length||(e.preventDefault(),0))}slideDown(e,t,n){t||e.slideDown(n.speed)}slideUp(e,t,n){t||e.slideUp(n.speed)}}class o{constructor(e,t){this.options={position:{bottom:"15px",right:"15px"},showEffect:" animate__zoomIn ",hideEffect:" animate__zoomOut ",type:"fixed",offsetTop:400},this.selector=e,n.defaultConstructor(this,e,t,(e=>{e.elements.forEach((n=>{let s=i(n);s.data("be.gotop")||s.data("be.gotop",e),e.init(n,t)}))}))}init(e,t){const n=i(e),s=(t=i.extend(t,this.options)).type||"fixed",l=t.showEffect||" animate__zoomIn ",o=t.position,r=void 0!==t.offsetTop?Number(t.offsetTop):400,a=t.hideEffect||" animate__zoomOut ";n.addClass("animate__animated").css({display:"inline-block",position:s,opacity:0}),"fixed"!==s&&"absolute"!==s||n.css(o),n.on("click",(e=>{e.preventDefault(),window.scrollTo(0,0)})),r&&!n.hasClass("animated-running")&&n.offset().top<=i(window).height()&&n.addClass("animated-running "+l).css({opacity:""}),i(window).on("scroll",(()=>{if(r)i(window).scrollTop()>=r&&!n.hasClass("animated-running")?(n.addClass("animated-running "+l).css({opacity:""}),n.removeClass(a)):i(window).scrollTop()<=r&&n.hasClass("animated-running")&&(n.removeClass("animated-running "+l).css({opacity:0}),n.addClass(a));else{let e=n.offset().top;n.hasClass("animated-running")||i(window).scrollTop()>=e-i(window).height()&&(n.addClass("animated-running "+l).css({opacity:""}),n.removeClass(a))}})),i(window).trigger("scroll")}}const r=i;module.exports.b=t})();
|
|
1
|
+
(()=>{"use strict";var e={d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{AeLoader:()=>u,Base:()=>s,BtnEf:()=>m,Flash:()=>v,GoTop:()=>c,HoverDir:()=>P,IAccordion:()=>g,IList:()=>f,ILoader:()=>S,IPagination:()=>p,ItemCount:()=>d,LineEffect:()=>w,NiceSelect:()=>h,PopoverSearch:()=>b,SubmitFlag:()=>l,default:()=>A});class s{constructor(e,t){if(this.elements=[],this.length=0,t=t instanceof s?t.elements[0]:t||document,"string"==typeof e)if(t&&"string"==typeof t&&(t=document.querySelector(t)),s.isEqSelector(e)){const i=e.split(":")[0],n=e.match(/:eq\((\d+)\)/);if(n){const e=parseInt(n[1]),o=s.contextQuerySelector(">"+i,t);o.length>0?this.elements=[o[e]]:this.elements=[]}else this.elements=[]}else this.elements=s.contextQuerySelector(e,t);else e instanceof NodeList||e instanceof HTMLElement?this.elements=e instanceof NodeList?Array.from(e):[e]:e instanceof Window?this.elements=[window]:null!==e&&"object"==typeof e&&"documentElement"in e?this.elements=[t]:Array.isArray(e)?this.elements=e:this.elements=[];this.length=this.elements.length}each(e){return this.elements.forEach((t,s)=>{e(t,s)}),this}hasClass(e){let t=!1;return this.each(s=>{t=s.classList.contains(e)}),t}addClass(e){return this.each(t=>{if(/\s/.test(e)){const s=e.split(" ");for(let e=0;e<s.length;e++)s[e]&&t.classList.add(s[e])}else e&&t.classList.add(e)})}removeClass(e){return this.each(t=>{if(void 0===e)t.className="";else if(e||0!==e.length)if(/\s/.test(e)){const s=e.split(" ");for(let e=0;e<s.length;e++)s[e]&&t.classList.remove(s[e].trim())}else t.classList.remove(e.trim())})}toggleClass(e){return this.each(t=>{if(t.classList)t.classList.toggle(e);else{let s=t.className.split(/\s+/),i=s.indexOf(e);i>=0?s.splice(i,1):s.push(e),t.className=s.join(" ")}})}not(e){let t=e instanceof s?e.elements:Array.from(document.querySelectorAll(e));return this.elements=Array.from(this.elements).filter(e=>!t.includes(e)),this}is(e){var t;let s=this.elements[0];if(":visible"===e){if("none"===s.style.display||"hidden"===s.style.visibility||"0"===getComputedStyle(s).opacity)return!1}else{if(":first-child"===e)return(null===(t=s.parentNode)||void 0===t?void 0:t.firstChild)===s;if(":last-child"!==e)return s.matches(e);{const e=s.parentNode;if(e){const t=e.children;return t[t.length-1]===s}}}return!1}closest(e){let t=this.elements[0];if(!t)return s.build([]);const i=t.matches||t.webkitMatchesSelector;if(i.call(t,e))return this.constructor===s?s.build(this.elements):this;let n=t.parentElement;for(;n;){if(i.call(n,e))return s.build(n);n=n.parentElement}return s.build([])}next(){if(1===this.elements.length){const e=this.elements[0].nextElementSibling;return e instanceof Element?s.build(e):s.build([])}if(this.elements.length>1){const e=[],t=this.elements[0].nextElementSibling;t instanceof Element&&e.push(t);for(let t=1;t<this.elements.length-1;t++)this.elements[t]instanceof Element&&e.push(this.elements[t]);const i=this.elements[this.elements.length-1].nextElementSibling;return i instanceof Element&&e.push(i),s.build(e)}return null}nextAll(e){const t=[];let s=this.elements[0],i=s.nextSibling,n=s.parentElement;for(;i&&(1===i.nodeType&&(e&&!i.matches(e)||t.unshift(i)),i=i.nextSibling,null!==i||0!==t.length||(null==n?void 0:n.firstChild)!==s););return this.elements=t,this.length=this.elements.length,this}prev(){if(1===this.elements.length)return s.build(this.elements[0].previousElementSibling);if(this.elements.length>1){let e=s.build(this.elements[0].previousElementSibling);return this.each((t,s)=>{s>1&&(e.elements.push(t),s===this.elements.length-1&&e.elements.push(t.previousElementSibling))}),e}return null}prevAll(e){const t=[];let s=this.elements[this.elements.length-1],i=s.previousSibling,n=s.parentElement;for(;i&&(1===i.nodeType&&(e&&!i.matches(e)||t.unshift(i)),i=i.previousSibling,null!==i||0!==t.length||(null==n?void 0:n.firstChild)!==s););return this.elements=t,this.length=this.elements.length,this}first(){return new s([this.elements[0]])}find(e){if(e&&"option:selected"===e.trim()){const e=[];return this.each(t=>{("select-one"===t.type||"select-multiple"===t.type)&&t.selectedIndex>=0&&e.push(t.options[t.selectedIndex])}),new s(e)}{const t=[];return this.elements.forEach(s=>{s instanceof HTMLElement&&s.querySelectorAll(e).forEach(e=>t.push(e))}),new s(t)}}parent(){let e=this.elements[0];return e?new s(e.parentNode):new s}parents(e){const t=[];let i=this.elements[0].parentElement;for(;i&&i!==document.documentElement;)e&&!i.matches(e)||t.push(i),i=i.parentElement;return new s(t)}siblings(){let e=this.elements[0];if(e&&1===e.nodeType){let t=e.parentNode;if(t){let i=[];for(let s=0;s<t.childNodes.length;s++){let n=t.childNodes[s];1===n.nodeType&&n!==e&&i.push(n)}return new s(i)}return new s}return new s}children(){let e=[];return this.each(t=>{e.push(...Array.from(t.children))}),new s(e)}index(){var e;const t=this.elements[0],s=null===(e=t.parentNode)||void 0===e?void 0:e.children;if(s)for(let e=0;e<s.length;e++)if(s[e]===t)return e;return-1}size(){return this.elements?this.elements.length:0}on(e,t){return this.each(function(s){s.addEventListener(e,t)})}off(e,t){return this.each(function(s){s.removeEventListener&&t&&s.removeEventListener(e,t)})}click(e){return"function"==typeof e?this.on("click",e):this.each(e=>{const t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)}),this}focus(e){return"function"==typeof e&&this.on("focus",e),this}change(e){return e&&this.each(t=>{t.addEventListener("change",e,!1)}),this}trigger(e,t){return this.each(function(s){let i;try{i=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(s){i=document.createEvent("CustomEvent"),i.initCustomEvent(e,!0,!0,t)}s.dispatchEvent(i)}),this}remove(){return this.each(e=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})}data(e,t){if(void 0===e)throw new Error("读取的或设置的键值不能为空");let i=this.elements[0];if(void 0!==t){let n=s.elementData.get(i);return n||(n=new Map,s.elementData.set(i,n)),n.set(s.camelCase(e),t),this}{const t=s.elementData.get(i);return t?t.get(s.camelCase(e)):s.dataAttr(i,e)}}removeData(e){let t=this.elements[0],i=s.elementData.get(t);i&&i.set(s.camelCase(e),void 0)}attr(e,t){if(0===this.elements.length)return void 0===t?"":this;const s=this.elements[0];return void 0===t?(null==s?void 0:s.getAttribute(e))||"":this.each(s=>s.setAttribute(e,t))}removeAttr(e){return this.each(t=>{"function"==typeof t.removeAttribute&&t.removeAttribute(e)})}offset(){let e=this.elements[0].getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;return{top:e.top+t,left:e.left+s}}scrollTop(){return this.elements[0]instanceof Window?void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop:document.documentElement.scrollTop}height(){const e=this.elements[0];return e?e===window?window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight:e.offsetHeight:(console.warn("目标元素不存在或未正确绑定!"),0)}width(){const e=this.elements[0];return e?e===window?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:e.offsetWidth:(console.warn("目标元素不存在或未正确绑定!"),0)}val(e){let t=this.elements[0];if("select-multiple"===t.type){if(void 0!==e){for(let s=t.options.length-1;s>=0;s--)t.options[s].selected=t.options[s].value===e;return this}{let e=[];for(let s=0;s<t.options.length;s++)t.options[s].selected&&e.push(t.options[s].value);return e}}return void 0!==e?(t.value=e,this):t.value}css(e,t){if(0===this.elements.length)return this;if(void 0===t){if("object"==typeof e){const t=e;for(const e in t)if(t.hasOwnProperty(e)){const s=t[e];this.each(t=>{t.style[e]=s})}return this}return this.elements[0].style[e]||""}return this.each(s=>{s.style[e]=t})}text(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t.textContent||"":this.each(t=>{t.textContent=e})}html(e){if(0===this.elements.length)return void 0===e?"":this;const t=this.elements[0];return void 0===e?t&&1===t.nodeType?t.innerHTML:"":this.each(t=>{t&&1===t.nodeType&&(t.innerHTML=e)})}after(e){return this.each(t=>{t.insertAdjacentHTML("afterend",e)})}append(e){return this.each(t=>{let s=document.createElement("div");if("string"==typeof e)s.innerHTML=e;else if(e instanceof Node)s.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)s.appendChild(e[t]);for(;s.firstChild;)t.appendChild(s.firstChild);return t})}prepend(e){return this.each(t=>{let s=document.createElement("div");if("string"==typeof e)s.innerHTML=e;else if(e instanceof Node)s.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)s.appendChild(e[t]);for(;s.firstChild;)t.insertBefore(s.firstChild,t.firstChild);return t})}hide(e,t){return this.each(s=>{s.style.display="block",e?setTimeout(()=>{s.style.display="none",t&&"function"==typeof t&&t(s)},e):(s.style.display="none",t&&"function"==typeof t&&t(s))})}show(e,t){return this.each(s=>{s.style.display="block",e?setTimeout(()=>{s.style.display="block",t&&"function"==typeof t&&t(s)},e):(s.style.display="block",t&&"function"==typeof t&&t(s))})}slideUp(e,t){const i=s.extend({duration:e,callback:t},{duration:300,callback:null});return this.each(e=>{e.style.height=e.scrollHeight+"px",e.style.overflow="hidden",e.style.transition=`height ${i.duration}ms ease-in-out`,setTimeout(()=>{e.style.height="0px"},i.duration/100),setTimeout(()=>{e.style.display="none",e.style.overflow="",e.style.transition="",e.style.height="",i.callback&&"function"==typeof i.callback&&i.callback(e)},i.duration-i.duration/100)})}slideDown(e,t){const i=s.extend({duration:e,callback:t},{duration:300,callback:null});return this.each(e=>{let t=e.offsetHeight;"none"===e.style.display&&(e.style.display="",t=0),e.style.height=t+"px",e.style.transition=`height ${i.duration}ms ease-in-out`,e.offsetHeight,e.style.height=e.scrollHeight+"px",e.style.display="block",setTimeout(()=>{e.style.overflow="",e.style.transition="",e.style.display="",e.style.height="",i.callback&&"function"==typeof i.callback&&i.callback(e)},i.duration)})}slideToggle(e,t){const i=s.extend({duration:e,callback:t},{duration:500,callback:null});let n=!0;return this.each(e=>{"none"===e.style.display&&(n=!1)}),n?this.slideUp(i.duration,i.callback):this.slideDown(i.duration,i.callback),this}fadeOut(e,t){const i=s.extend({duration:e,callback:t},{duration:300,callback:null});return this.each(e=>{e.style.transition=`opacity ${i.duration}ms ease-in-out`,e.style.opacity="0",setTimeout(()=>{e.style.display="none",i.callback&&"function"==typeof i.callback&&i.callback(e)},i.duration)})}checkAll(e){const t=s.extend({checkboxes:e},{checkboxes:".be-check"});return this.each(e=>{let s=document.querySelectorAll(t.checkboxes);e.addEventListener("change",function(){s.forEach(function(t){t.checked=e.checked})})})}checkReverse(e){const t=s.extend({checkboxes:e},{checkboxes:".be-check"});return this.each(e=>{let s=document.querySelectorAll(t.checkboxes);e.addEventListener("click",function(){s.forEach(function(e){e.checked=!e.checked})})})}numStep(e){return e=s.extend(e,{start:0,end:100,duration:1500,callback:!1}),this.each(t=>{let i=null;requestAnimationFrame(function n(o){null===i&&(i=o);const a=Math.min((o-i)/e.duration,1),r=Math.floor(a*(e.end-e.start)+e.start);s.build(t).text(r.toString()),a<1?requestAnimationFrame(n):"function"==typeof e.callback&&e.callback()})})}scrollBG(e){return e=s.extend(e,{speed:0}),this.each(t=>{s.build(t).css("background-position","50% 0px"),s.build(window).on("scroll",()=>{const i=s.build(t),n=i.offset().top,o=i.height(),a=i.scrollTop(),r=i.height();if(r+a>n&&r+a<n+r+o){const t=(n+o-a)/e.speed;i.css("background-position","50% -"+t+"px")}})})}setActive(e){const{className:t="active"}=e||{};s.build(this.elements).click(e=>{const i=s.build(e.currentTarget);i.hasClass(t)?i.removeClass(t):(s.build(this.elements).removeClass(t),i.addClass(t))})}loading(e){let t=!1;return void 0!==e&&"object"!=typeof e&&(t=!0,e={}),e=s.extend(e,{isFull:!0,loadingTarget:"#do-preloader",template:'<div id="do-preloader" class="do-preloader"><span class="do-pr-loader"><span class="do-pr-lr"></span></span></div>'}),this.each(i=>{const n=e,o=n.loadingTarget,a=n.template;if(t)s.build("> *",i).removeClass("be-blur-2"),s.build(o).addClass("oy-0"),setTimeout(()=>{s.build("> *",i).removeClass("be-ts"),s.build(o).remove()},300);else{s.build("> *",i).addClass("be-ts").addClass("be-blur-2"),s.build(i).prepend(a);const e=s.build(o);e.length&&e.css("position","fixed").css("height","100vh").css("width","100vw")}})}static extend(e,t){if(!e)return t;{let s;for(s in t)if(null==t?void 0:t.hasOwnProperty(s)){const i=t[s];null==e[s]&&(e[s]=i)}}return e}static camelCase(e){let t=e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});return t=t.replace(/\./g,""),t}static l(...e){window.console&&e&&console.log(...e)}static toRound(e,t){let s=parseFloat(String(e));return s=s?Math.round(e*Math.pow(10,t))/Math.pow(10,t):0,s}static isNull(e){let t=!0;return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(t=!1),t}static setDefault(e,t){return null!=e&&""!==e&&"undefined"!==e&&"null"!==e||(e=t),e}static isObject(e){return!!e&&e&&"object"==typeof e&&!Array.isArray(e)&&!0}static same(e,t){return e.filter(function(e){return-1!==t.indexOf(e)})}static different(e,t){return e.concat(t).filter(function(s){return-1===e.indexOf(s)||-1===t.indexOf(s)})}static contrast(e,t){return e.concat(t).filter(function(s){return-1===e.indexOf(s)&&-1!==t.indexOf(s)})}static isHtmlTag(e){return/^<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>$|^<([a-z][a-z0-9]*)\b[^>]*\/>$/i.test(e)}static plugin(e,t){s.fn[e]=function(){t()}}static createElement(e){let t=document.createElement("div");t.innerHTML=e.trim();let s=t.firstChild;if((null==s?void 0:s.nodeType)===Node.TEXT_NODE){s=s.nextSibling;let e=document.createDocumentFragment();for(;s;)e.appendChild(s),s=s.nextSibling;return e}return s}static ajax(e){var t;if("get"===(null===(t=null==(e=s.extend(e,{url:"",method:"GET",async:!0,headerMap:{},cache:"default",dataType:"json",data:null,success:function(){},error:function(){}}))?void 0:e.method)||void 0===t?void 0:t.toLowerCase())){if(!e.url.includes("?")){let t=new URLSearchParams;for(let s in e.data)e.data.hasOwnProperty(s)&&t.append(s,e.data[s]);e.url=e.url+"?"+t.toString()}e.data=null}if(fetch)fetch(e.url,{method:e.method,headers:new Headers(e.headerMap),cache:e.cache,body:e.data?JSON.stringify(e.data):null}).then(function(t){return t.ok?"json"===e.dataType?t.json():t.text():Promise.reject(new Error("Failed to fetch resource"))}).then(function(t){e.success&&e.success(t)}).catch(function(t){e.error&&e.error(t)});else{let t=new XMLHttpRequest;t.onload=function(){if(t.status>=200&&t.status<300){let s;switch(e.dataType){case"json":try{s=JSON.parse(t.responseText)}catch(t){return void(e.error&&e.error(t))}break;case"text":s=t.responseText;break;default:s=t.responseText||t.response}e.success&&e.success(s,t.status,t)}else{let s=new Error("Request failed. Status: "+t.status);e.error&&e.error(s)}},t.onerror=function(){e.error&&e.error(new Error("Network Error"))},t.open((null==e?void 0:e.method)||"get",e.url,e.async||!1);for(let s in e.headerMap)e.headerMap.hasOwnProperty(s)&&t.setRequestHeader(s,e.headerMap[s]);e.data?t.send(e.data):t.send()}}static getParam(e){let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),s=window.location.search.substr(1).match(t);return null!=s?unescape(s[2]):null}static move(e){const t=document.querySelector(e);if(t){let e=new s(t).offset();window.scrollTo(e.left,e.top)}}static strValidation(e,t,s){let i=0;return e.length<=t||e.length>=s?i=1:/^[0-9]{0,32}$/.test(e)?i=2:/^[a-zA-z]{0,32}$/.test(e)?i=3:/^[0-9a-zA-z]{0,32}$/.test(e)?i=4:/^[^\u4e00-\u9fa5a-zA-Z\d,.,。]{0,32}$/.test(e)?i=5:/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]*$/.test(e)&&(i=8),i}static hotkey(e,t){document.addEventListener("keydown",function(s){e===s.key&&t()})}static setCookie(e,t,s={}){let i="",n=s.path||"/",o=s.domain,a=s.secure?"; Secure":"";if(s.expires){let e;"number"==typeof s.expires?(e=new Date,e.setTime(e.getTime()+24*s.expires*60*60*1e3)):e=s.expires,i=`; expires=${e.toUTCString()}`}document.cookie=`${e}=${encodeURIComponent(t)}${i}; path=${n}; domain=${o||""}${a}`}static getCookie(e){let t=`${e}=`,s=document.cookie.split(";");for(let e=0;e<s.length;e++){let i=s[e];for(;" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}return null}static removeCookie(e,t={}){this.setCookie(e,"",Object.assign(Object.assign({},t),{expires:-1}))}static menu(e,t){const s=function(e,i,n){let o="";++i;for(let a=0;a<e.length;a++){const r=e[a];let l="#";if(r.link&&(l=r.link),r.pId||0!==i){if(r.pId===n){let t="";r.isParent&&(t=s(e,i,r.id),t&&(t="<ul class='sub'>"+t+"</ul>"));let n="";1===i&&(n=`<i class='${r.icon}'></i>`);let a=r.hash?` data-hash='${r.hash}' `:" ",c=r.actionId?` id='${r.actionId}' `:" ";o+=`<li class='sub-menu'><a${r.isParent?" class='mu-js-a' ":" "}${a}${r.tid?` data-tid='${r.tid}' `:" "}${c}href='${l}'>`+n+`<span>${r.name}</span></a>`+t+"</li>"}}else if(t)o=s(e,i,r.id);else{let t=s(e,i,r.id);t&&(t="<ul class='sub'>"+t+"</ul>"),o+=`<li class='sub-menu'><a${r.hash?` data-hash='${r.hash}' `:" "}${r.actionId?` id='${r.actionId}' `:" "}href='${l}'><span>${r.name}</span></a>`+t+"</li>"}}return o};let i="";return e&&(i=s(e,-1,0)),""+i}static menu2Tree(e,t,i){let n=[];return e.forEach(function(o){o.pId===t&&(o.isactive=`a${o.id}`===i,n.push(o),o.isParent&&(o.children=s.menu2Tree(e,o.id)))}),n}static search(e){var t;const i=s.build(".fm-search"),n=s.build("input",i),o=s.build("span:eq(0)",i),a=s.build("span:eq(1)",i);n.on("change",e=>{var t,i;const n=s.build(e.currentTarget);""!==n.val()?null===(t=n.next())||void 0===t||t.css("opacity","1").css("visibility","visible"):null===(i=n.next())||void 0===i||i.css("opacity","0").css("visibility","hidden")}),""!==n.val()&&(null===(t=n.next())||void 0===t||t.css("opacity","1").css("visibility","visible")),a.on("click",e=>{var t;const i=s.build(e.currentTarget);i.css("opacity","0").css("visibility","hidden"),null===(t=i.prev())||void 0===t||t.val("")}),o.on("click",t=>{var i;const n=s.build(t.currentTarget);e&&e(null===(i=n.next())||void 0===i?void 0:i.val())})}static shuffleArray(e){if(!Array.isArray(e))return e;const t=[...e];for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}return t}static defaultConstructor(e,t,i,n){"string"==typeof t?e.elements=document.querySelectorAll(t):t instanceof NodeList?e.elements=t:t instanceof HTMLElement?e.elements=Array.of(t):e.elements=[],e.options=s.extend(i,e.options),n(e)}static contextQuerySelector(e,t){if(!t||"function"!=typeof t.querySelectorAll)return console.warn("contextQuerySelector: 无效的上下文环境 (context is null/undefined or invalid)",e),[];if(e.startsWith(">"))return Array.from(t.querySelectorAll(e.substring(1))).filter(function(e){return e.parentNode===t});{const s=t.querySelectorAll(e);return 0===s.length?Array.from(document.querySelectorAll(e)):Array.from(s)}}static isEqSelector(e){const t=e.match(/^[\w-]+:eq\((\d+)\)$/);return null!==t&&void 0!==t[1]}static build(e,t){return new(this||s)(e,t)}}s.keys={esc:"Escape",backspace:"Backspace",space:" ",enter:"Enter",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},s.dataAttr=function(e,t){var s;let i="data-"+t;return null!==(s=e.getAttribute(i))&&void 0!==s?s:void 0},s.expando="base"+(""+Math.random()).replace(/\D/g,""),s.elementData=new Map,s.cache={},s.build.extend=s.extend,s.build.camelCase=s.camelCase,s.build.l=s.l,s.build.getParam=s.getParam,s.build.toRound=s.toRound,s.build.isNull=s.isNull,s.build.setDefault=s.setDefault,s.build.same=s.same,s.build.different=s.different,s.build.contrast=s.contrast,s.build.strValidation=s.strValidation,s.build.move=s.move,s.build.keys=s.keys,s.build.hotkey=s.hotkey,s.build.isHtmlTag=s.isHtmlTag,s.build.isObject=s.isObject,s.build.plugin=s.plugin,s.build.ajax=s.ajax,s.build.setCookie=s.setCookie,s.build.getCookie=s.getCookie,s.build.removeCookie=s.removeCookie,s.build.menu=s.menu,s.build.menu2Tree=s.menu2Tree,s.build.search=s.search,s.build.shuffleArray=s.shuffleArray,s.build.defaultConstructor=s.defaultConstructor;const i=s.build;Date.prototype.format=function(e){let t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in t)new RegExp("("+s+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?t[s]:("00"+t[s]).substr((""+t[s]).length)));return e},Array.prototype.remove=function(e,t){let s=this.slice((t||e)+1||this.length);return this.length=e<0?this.length+e:e,this.push.apply(this,s)},Array.prototype.unique=function(){let e=[];this.sort();for(let t=0;t<this.length;t++)this[t]!==this[t+1]&&(e[e.length]=this[t]);return e};const n=i;function o(e="info",t=3,s="ice"){let i;if("number"==typeof s)switch(s){case 1:i="flat";break;case 2:i="future";break;case 3:i="block";break;case 4:i="air";break;default:i="ice"}else i=s;const o=n.extend({type:e,classes:t,theme:i},{type:"info",classes:3,theme:"ice"});let a;switch(o.classes){case 1:a=`messenger-fixed messenger-theme-${o.theme} messenger-on-top messenger-on-left`;break;case 2:default:a=`messenger-fixed messenger-theme-${o.theme} messenger-on-top`;break;case 3:a=`messenger-fixed messenger-theme-${o.theme} messenger-on-top messenger-on-right`;break;case 4:a=`messenger-fixed messenger-theme-${o.theme} messenger-on-bottom messenger-on-right`;break;case 5:a=`messenger-fixed messenger-theme-${o.theme} messenger-on-bottom`;break;case 6:a=`messenger-fixed messenger-theme-${o.theme} messenger-on-bottom messenger-on-left`}window.Messenger.options={extraClasses:a,theme:o.theme}}n.handlebars=function(e){void 0!==e&&(e.registerHelper("if",function(e,t,s){return e===t?s.fn(this):s.inverse(this)}),e.registerHelper("lt",function(e,t,s){return e<t?s.fn(this):s.inverse(this)}),e.registerHelper("rt",function(e,t,s){return e>t?s.fn(this):s.inverse(this)}),e.registerHelper("lte",function(e,t,s){return e<=t?s.fn(this):s.inverse(this)}),e.registerHelper("rte",function(e,t,s){return e>=t?s.fn(this):s.inverse(this)}))},n.tip=function(e,t,s){t.forEach((e,t)=>{n(e).attr("data-bs-title",s[t]).attr("data-bs-toggle","tooltip").attr("data-bs-custom-class","be-tooltip")}),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map(t=>new e(t))},n.al=function(e,t="info",s=3,i="ice"){o(t,s,i),window.Messenger().post({message:e,type:t,hideAfter:5,showCloseButton:!0})},n.cf=function(e,t,s,i=3,n="ice"){window.Messenger().hideAll(),o("info",i,n),window.Messenger().post({message:e,actions:{retry:{label:t,phrase:"",auto:!1,delay:10,action:function(){window.Messenger().hideAll(),s()}},cancel:{label:"取消",action:function(){return window.Messenger().hideAll(),!1}}}})},n.datepicker=function(e,t,s){const i={target:"#airDatepicker",classes:"fm-datepicker",autoClose:!0,inline:!1,timepicker:!0,buttons:["today","clear"],locale:t,dateFormat:e=>e.format("yyyy年MM月dd日 hh:mm:ss")};return new e((s=n.extend(s||{},i)).target,s)},n.validationEngine=function(e,t){t=n.extend(t||{},{focusFirstField:!1,validationEventTrigger:"click",promptPosition:"topRight"}),e.validationEngine(t)},n.validate=function(e,t="validate",s){const i=n.extend({command:t,options:s},{command:"validate",options:s});return e.validationEngine(i.command,i.options)};const a=new class{login(e){const t={id:e.id,name:e.name,menus:e.menu};localStorage.setItem("user",JSON.stringify(t)),localStorage.setItem("token",e.token)}logout(){return new Promise(e=>{localStorage.removeItem("user"),localStorage.removeItem("token"),e()})}getUser(){const e=localStorage.getItem("user");return e?JSON.parse(e):null}getToken(){return localStorage.getItem("token")}setToken(e){localStorage.setItem("token",e)}};n.getUser=a.getUser.bind(a),n.getToken=a.getToken.bind(a),n.setToken=a.setToken.bind(a),n.login=a.login.bind(a),n.logout=a.logout.bind(a);const r=n;class l{constructor(e,t){this.options={text:"处理中..",useText:!0},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.submitflag")||i.data("be.submitflag",e),e.init(s,t)})})}init(e,t){const s=this;t&&(s.options=n.extend(t,s.options)),n(e).click(e=>{s.request(e.currentTarget)})}request(e){const t=n(e);e.setAttribute("data-original-text",t.text()),t.addClass("submit-flag-request").attr("disabled","disabled"),this.options.useText&&t.text(this.options.text)}complete(e){let t;t=n(e||this.selector),t.removeClass("submit-flag-request").removeAttr("disabled"),this.options.useText&&t.each(e=>{const t=e.getAttribute("data-original-text");null!==t&&""!==t&&(n(e).text(t),e.removeAttribute("data-original-text"))})}destroy(){n(this.selector).removeData("be.submitflag"),n(this.selector).each(e=>{e.removeAttribute("data-original-text")})}}class c{constructor(e,t){this.options={position:{bottom:"15px",right:"15px"},showEffect:" animate__zoomIn ",hideEffect:" animate__zoomOut ",type:"fixed",offsetTop:400},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.gotop")||i.data("be.gotop",e),e.init(s,t)})})}init(e,t){const s=n(e),i=(t=n.extend(t,this.options)).type||"fixed",o=t.showEffect||" animate__zoomIn ",a=t.position,r=void 0!==t.offsetTop?Number(t.offsetTop):400,l=t.hideEffect||" animate__zoomOut ";s.addClass("animate__animated").css({display:"inline-block",position:i,opacity:0}),"fixed"!==i&&"absolute"!==i||s.css(a),s.on("click",e=>{e.preventDefault(),window.scrollTo(0,0)}),r&&!s.hasClass("animated-running")&&s.offset().top<=n(window).height()&&s.addClass("animated-running "+o).css({opacity:""}),n(window).on("scroll",()=>{if(r)n(window).scrollTop()>=r&&!s.hasClass("animated-running")?(s.addClass("animated-running "+o).css({opacity:""}),s.removeClass(l)):n(window).scrollTop()<=r&&s.hasClass("animated-running")&&(s.removeClass("animated-running "+o).css({opacity:0}),s.addClass(l));else{let e=s.offset().top;s.hasClass("animated-running")||n(window).scrollTop()>=e-n(window).height()&&(s.addClass("animated-running "+o).css({opacity:""}),s.removeClass(l))}}),n(window).trigger("scroll")}}class d{constructor(e,t){this.options={num:1},this.value=0,this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.itemcount")||i.data("be.itemcount",e),e.init(s,t)})})}init(e,t){const s=this;t&&(s.options=n.extend(t,s.options));const i=n(e),o=i.find(".fm-plus"),a=i.find(".fm-minus"),r=i.find(".fm-result");let l=parseInt(String(r.val()));s.value=isNaN(l)?0:l,o.on("click",function(e){e.preventDefault(),l+=s.options.num,r.val(String(l)),s.value=l}),a.on("click",function(e){if(e.preventDefault(),!(l-s.options.num>=0))return!1;l-=s.options.num,r.val(String(l)),s.value=l})}getValue(){return this.value}}class h{constructor(e,t){this.options={width:"auto"},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.niceselect")||i.data("be.niceselect",e),e.init(s,t)})})}create(e,t){var s,i;const o=this,a=n(e),r=a.after("<div></div>").next().addClass("ce-nice-select").addClass(a.attr("class")||"").addClass(a.attr("disabled")?"disabled":"").attr("tabindex",a.attr("disabled")?"":"0").css("width",null!==(s=o.options.width)&&void 0!==s?s:"auto").html('<span class="current"></span><ul class="list"></ul>'),l=a.find("option"),c=e,d=n(c.options[c.selectedIndex]);o.text=d.data("display")||d.text(),r.find(".current").html(null!==(i=o.text)&&void 0!==i?i:""),l.each(function(e){const t=n(e),s=t.data("display"),i=null!=s?String(s):"",o=d.text()===t.text()?"selected":"";r.find("ul").append(`<li data-value="${t.val()}" data-display="${i}" class="option ${o}">${t.text()}</li>`)})}init(e,t){const s=this,i=n(s.selector),o=n(e);t&&(s.options=n.extend(t,s.options)),o.hide(),s.create(e,s.options);const a=i.next();return a.on("click",function(){const e=o.next();e.toggleClass("open"),e.hasClass("open")?(e.find(".option"),e.find(".focus").removeClass("focus"),e.find(".selected").addClass("focus")):e.focus()}),n(".option",a).on("click",function(e){const t=n(e.currentTarget),i=a;i.find(".selected").removeClass("selected"),t.addClass("selected"),s.text=t.data("display")||t.text(),i.find(".current").text(String(s.text)),s.value=t.data("value"),i.prev().trigger("change").val(String(s.value))}),this}getText(){return this.text}getValue(){return this.value}}class u{constructor(e,t){this.options={time:1e3},this.selector=e||"",n.isObject(e)?(this.options=n.extend(e,this.options),this.selector=""):(e&&(this.selector=e),this.options=n.extend(t,this.options)),n("[data-ae-load]").addClass("ae-load")}start(e){const t=e||this.selector,s=t?`${t}[data-ae-load]`:"[data-ae-load]";n(s).addClass("ae-load").removeClass("ae-tt-complete ae-tt-done ae-tt-loading").addClass("ae-tt-complete"),setTimeout(()=>{n(s).removeClass("ae-load ae-tt-complete")},this.options.time)}loading(e){const t=e||this.selector,s=t?`${t}[data-ae-load]`:"[data-ae-load]";n("[data-ae-load]").addClass("ae-load"),n(s).each(e=>{const t=n(e),s=t.data("al-mw"),i=t.data("al-mh");s&&t.css("min-width",s),i&&t.css("min-height",i),t.removeClass("ae-tt-complete ae-tt-done ae-tt-loading").addClass("ae-tt-loading")})}done(e){const t=e||this.selector,s=t?`${t}[data-ae-load]`:"[data-ae-load]";n(s).removeClass("ae-tt-done").addClass("ae-tt-done"),setTimeout(()=>{n(s).removeClass("ae-load ae-tt-loading ae-tt-done")},this.options.time)}}class m{constructor(e,t){this.options={},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.btnef")||i.data("be.btnef",e),e.init(s,t)})})}init(e,t){const s=n(e);s.append("<b></b>"),s.on("mouseenter",e=>{const t=n(e.currentTarget),s=t.offset(),i=e.pageX-s.left,o=e.pageY-s.top;t.find("b").css({top:o+"px",left:i+"px"})}).on("mouseout",e=>{const t=n(e.currentTarget),s=t.offset(),i=e.pageX-s.left,o=e.pageY-s.top;t.find("b").css({top:o+"px",left:i+"px"})})}}class p{constructor(e,t){this.options={targetWarp:"#be-pw",totalItems:0,itemsPerPage:0,visiblePages:5,prev:"上一页",next:"下一页",first:"首页",last:"尾页",onButtonClick:()=>{}},this.currentPage=1,this.totalPages=0,this.selector=e,s.defaultConstructor(this,e,t,e=>{let s=this;e.elements.forEach(i=>{let o=n(i);o.data("be.ipagination")||o.data("be.ipagination",e),s.currentPage=1,s.totalPages=Math.ceil(s.options.totalItems/s.options.itemsPerPage),e.init(t)})})}init(e){const t=this;let s=t.options;e&&(s=n.extend(e,t.options)),n(this.selector).html(""),this.addPageButton(s.first,1,()=>this.goToPage(1)),this.addPageButton(s.prev,this.currentPage-1,()=>this.goToPrevPage());let i=Math.max(1,this.currentPage-Math.floor(s.visiblePages/2)),o=Math.min(this.totalPages,i+s.visiblePages-1);o-i<s.visiblePages-1&&(i=Math.max(1,o-s.visiblePages+1));for(let e=i;e<=o;e++)this.addPageButton(e,e,()=>this.goToPage(e));this.addPageButton(s.next,this.currentPage+1,()=>this.goToNextPage()),this.addPageButton(s.last,this.totalPages,()=>this.goToPage(this.totalPages));const a=s.itemsPerPage*(t.currentPage-1)+1,r=Math.min(a+s.itemsPerPage-1,s.totalItems);n("p",s.targetWarp).html(`显示 ${a} 至 ${r} 条,共有 ${s.totalItems} 条`)}addPageButton(e,t,s){const i=document.createElement("li");i.classList.add("page-item"),"number"==typeof e&&Number.isFinite(e)||!isNaN(Number(e))&&Number.isFinite(Number(e))?i.classList.add("pi-t2"):i.classList.add("pi-t1");const o=document.createElement("button");i.append(o),o.innerHTML=String(e),o.onclick=s,t!==this.currentPage&&0!==t&&t!==this.totalPages+1||(i.classList.add("active"),i.classList.add("disabled")),n(this.selector).append(i)}goToPrevPage(){this.currentPage>1&&(this.currentPage--,this.init(),this.options.onButtonClick(this.currentPage))}goToNextPage(){this.currentPage<this.totalPages&&(this.currentPage++,this.init(),this.options.onButtonClick(this.currentPage))}goToPage(e){e>=1&&e<=this.totalPages&&(this.currentPage=e,this.init(),this.options.onButtonClick(this.currentPage))}}class f{constructor(e,t){this.options={rp:"10",visiblePages:7,sortname:"id",sortorder:"desc",method:"post",dataType:"json",param:{},handlebars:null,url:"",loadColor:"#0a0a0a",lang:"cn",template:"#tp-list",headerMap:{},cache:"default",ipWarp:"#ilist-ip-warp",prev:"上一页",next:"下一页",first:"首页",last:"尾页",onSuccess:!1,onError:!1},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.ilist")||i.data("be.ilist",e),void 0!==window.Handlebars&&null===(null==t?void 0:t.handlebars)&&(t.handlebars=window.Handlebars),e.init(s,t||e.options)})})}init(e,t){let s=n(e),i=s.data("be.ilist.html");if(s.data("be.ilist.flag",!0),i)n(".be-list-data-body",e).html("");else{const e=n(t.template);if(!t.handlebars)return void console.error("Handlebars is required for IList but not provided.");const i=t.handlebars.compile(e.html())({});s.html(i),s.data("be.ilist.html",i)}let o=n.extend({page:1,rp:t.rp,sortname:t.sortname,sortorder:t.sortorder},t.param);t.isInit=!0,n(e).data("be.ilist.event",!0),this.getData(e,t,o)}getData(e,t,s){let i=this,o=n(e);n(".be-list-data-body",e).html(""),n(".be-list-loading",e).addClass("opacity-100"),n(".be-list-nofound",e).removeClass("opacity-100"),n(".be-list-page",e).removeClass("opacity-100"),n.ajax({method:t.method,url:t.url,headerMap:t.headerMap,data:s,cache:t.cache,dataType:t.dataType,success:a=>{n(".be-list-loading",e).removeClass("opacity-100").addClass("opacity-0"),n(".be-list-data",e).removeClass("opacity-0"),n(".be-list-data-body",e).css("display","table-row-group"),a.isInit=t.isInit,t.onSuccess&&t.onSuccess(a),a.total?(i.page(e,t,s,a.total),n(".ilist-check-all").checkAll(".ilist-check"),n("table > tbody tr",e).click(e=>{let t=n(e.target);t.is("input")||t.is("i")||t.is("a")||n(".ilist-check",e.currentTarget).click()}),o.data("be.ilist.event")&&(o.data("be.ilist.event",!1),n(".ilist-check",e).change(e=>{n(e.currentTarget).is(":checked")?n(e.currentTarget).parents("tr").addClass("active"):n(e.currentTarget).parents("tr").removeClass("active")})),n("table > thead tr td",e).click(a=>{const r=n(a.currentTarget).data("sortname");if(r){const l=o.data("be.ilist.param");if(l&&(s=n.extend(l,s)),s.sortname=r,!n(a.currentTarget).hasClass("is-check")&&s.sortname){let r=n(a.currentTarget).attr("data-sort-order");n("table > thead tr td",e).removeAttr("data-sort-order"),r?(n(a.currentTarget).attr("data-sort-order","desc"===r?"asc":"desc"),s.sortorder="desc"===r?"asc":"desc"):(n(a.currentTarget).attr("data-sort-order","desc"),s.sortorder="desc"),o.data("be.ilist.flag",!0),s.page="1",t.isInit=!1,i.getData(e,t,s)}}}),n(".be-list-page",e).addClass("opacity-100")):(n(".be-list-nofound",e).addClass("opacity-100"),n(".be-list-page",e).removeClass("opacity-100"))},error:e=>{try{t.onError&&t.onError(e)}catch(e){}}})}page(e,t,s,i){let o=this,a=n(e);a.data("be.ilist.flag")&&new p("#ipagination",{targetWarp:t.ipWarp,totalItems:i,itemsPerPage:Number(t.rp),visiblePages:t.visiblePages,prev:t.prev,next:t.next,first:t.first,last:t.last,onButtonClick:i=>{const n=document.querySelector(".ilist-check-all");n&&(n.checked=!1),s.page=i,t.isInit=!1,o.getData(e,t,s)}}),a.data("be.ilist.flag",!1)}reload(e){let t=n(this.selector);const s=t.data("be.ilist"),i=n.extend(e,{page:1,rp:s.options.rp,sortname:s.options.sortname,sortorder:s.options.sortorder});s.options.isInit=!1,t.data("be.ilist.flag",!0),t.data("be.ilist.param",i),n("table > thead tr td",t).attr("data-sort-order",""),s.getData(s.selector,s.options,i)}}class g{constructor(e,t){this.options={classParent:"ia-parent",classActive:"active",classArrow:"ia-icon",classCount:"ia-count",autoExpand:!1,classExpand:"ia-current-parent",autoClose:!0,speed:300,saveState:!0,disableLink:!0,showCount:!1,cookie:"ia-cookie",smallClass:"ce-accordion-small"},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.iaccordion")||i.data("be.iaccordion",e),e.init(s,t)})})}init(e,t){const s=this,i=n("li > a",e),o=n("li > ul",e),a=(t=n.extend(t,s.options)).classActive;this.setUpAccordion(e,i,o,t),!0===t.saveState&&s.checkCookie(t.cookie,e,a),!0===t.autoExpand&&n("li."+t.classExpand+" > a").addClass(a),i.click(i=>{const o=n(i.currentTarget),r=o.parent(),l=s.isSmall(i,e,t.smallClass);!0===t.disableLink&&o.siblings().length>0&&i.preventDefault(),!0===t.autoClose&&s.autoCloseAccordion(e,o,l,t),0===n("> ul",r).length?n("> a",r).addClass(a):"none"!==n("> ul",r).css("display")?(s.slideUp(n("ul",r),l,t),n("a",r).removeClass(a)):("none"===n(i.currentTarget).siblings().css("display")?s.slideDown(n(i.currentTarget).siblings().css("overflow","hidden"),l,t):s.slideUp(n(i.currentTarget).siblings(),l,t),n("> a",r).addClass(a)),!0===t.saveState&&s.createCookie(t.cookie,e,a)})}setUpAccordion(e,t,s,i){const o='<span class="'+i.classArrow+'"></span>',a=i.classParent+"-li";s.show(),n("li",e).each(e=>{n("> ul",e).length>0&&(n(e).addClass(a),n("> a",e).addClass(i.classParent).append(o))}),s.hide(),!0===i.showCount&&n("ul",e).each(e=>{n("> a",n(e).parent()).append(' <span class="'+i.classCount+'">('+e.children.length+")</span>")})}autoCloseAccordion(e,t,s,i){const o=this;n("ul",e).each(e=>{let a=!1;t.parents("ul").each(t=>{t===e&&(a=!0)}),a||t.siblings().elements[0]===e||"none"===e.style.display||o.slideUp(n(e),s,i)}),n("a",e).removeClass(i.classActive),t.parents("li").each(e=>{n("> a",e).addClass(i.classActive)})}checkCookie(e,t,s){const i=this,o=n.getCookie(e);if(null!==o&&""!==o){const e=o.split(",");i.setActiveMenu(t,e,0,s)}}setActiveMenu(e,t,s,i){const o=n("li:eq("+t[s]+")",e),a=n("> a",o),r=a.siblings();a.addClass(i),r.css("display",""),t.length>s+1&&this.setActiveMenu(r,t,++s,i)}createCookie(e,t,s){let i=[];n("li a."+s,t).each(e=>{const t=n(e).parent().index();i.push(t.toString())}),n.setCookie(e,i.join(","))}isSmall(e,t,s){return!(!n(t).hasClass(s)||0===n(e.currentTarget).siblings().length||(e.preventDefault(),0))}slideDown(e,t,s){t||e.slideDown(s.speed)}slideUp(e,t,s){t||e.slideUp(s.speed)}}class b{constructor(e,t){this.options={handlebars:null,bootstrap:null,airDatepicker:null,localeZh:null,template:"#tp-popover",templateItems:"#tp-popover-items",html:!0,title:"详细搜索",trigger:"click",toggle:"popover",placement:"auto",onSerach:!1,items:[],timepicker:!0,format:"yyyy-MM-dd hh:mm:ss"},this.itemsHtml="",this.itemsValue=[],this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.popoversearch")||i.data("be.popoversearch",e),void 0===window.Handlebars||(null==t?void 0:t.handlebars)||(t.handlebars=window.Handlebars),void 0===window.bootstrap||(null==t?void 0:t.bootstrap)||(t.bootstrap=window.bootstrap),void 0===window.AirDatepicker||(null==t?void 0:t.airDatepicker)||(t.airDatepicker=window.AirDatepicker),void 0===window.localeZh||(null==t?void 0:t.localeZh)||(t.localeZh=window.localeZh),e.init(s,t||e.options)})})}init(e,t){const s=this;this.itemsHtml="",this.itemsValue=[];const i=t.handlebars.compile(n(t.template).html())({}),o=new t.bootstrap.Popover(e,{html:t.html,title:t.title,trigger:t.trigger,toggle:t.toggle,placement:t.placement,template:i,animation:!0,content:""});e.addEventListener("inserted.bs.popover",()=>{s.addItem(t)}),e.addEventListener("shown.bs.popover",()=>{s.search(s,t),s.close(o),s.clear()}),e.addEventListener("hide.bs.popover",()=>{s.itemsHtml=n(".popover-content-items").html()||"",s.itemsValue=[],n(".popover-form-item").each(e=>{s.itemsValue.push(String(n(e).val()))})})}addItem(e){const t=this,s=n(".ce-popover > .popover-content .popover-content-items");if(t.itemsHtml)s.html(t.itemsHtml);else{const t=e.handlebars.compile(n(e.templateItems).html())({items:e.items});s.html(t)}n(".popover-form-item").each((s,i)=>{const o=n(s);if(void 0!==t.itemsValue[i]&&o.val(String(t.itemsValue[i])),o.hasClass("popover-form-date"))try{new e.airDatepicker(`.ce-popover input[name='${o.attr("name")}']`,{classes:"fm-datepicker",autoClose:!0,inline:!1,timepicker:e.timepicker,buttons:["today","clear"],locale:e.localeZh,dateFormat:t=>t.format(e.format)})}catch(e){n(`.ce-popover input[name='${o.attr("name")}']`).attr("type","date")}})}close(e){n(".ce-popover-cancel",".ce-popover").off("click").on("click",()=>{e.hide()})}clear(){n(".ce-popover-clear",".ce-popover").off("click").on("click",()=>{n(".popover-form-item",".ce-popover").each(e=>{n(e).val("")})})}getParam(){const e={};return n(".popover-form-item").each(function(t){const s=n(t),i=s.attr("name"),o=s.val();i&&o&&(e[i]=o)}),e}search(e,t){n(".ce-popover-ok",".ce-popover").off("click").on("click",()=>{t.onSerach&&t.onSerach({param:e.getParam()})})}}class v{constructor(e,t){this.options={animationDelay:5e3,lettersDelay:50,type:void 0},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.flash")||i.data("be.flash",e),e.init(s,t||e.options)})})}init(e,t){1===t.type&&n(e).addClass("letters"),this.singleLetters(e),this.animateHeadline(e,t)}singleLetters(e){const t=this;n(e).find("b").each(function(e){const s=n(e),i=s.text().split(""),o=s.hasClass("is-visible");for(const e in i)i.hasOwnProperty(e)&&(s.parents(t.selector).length>0&&(i[e]=`<em>${i[e]}</em>`),i[e]=o?`<i class='in'>${i[e]}</i>`:`<i>${i[e]}</i>`);const a=i.join("");s.html(a).css("opacity","1")})}animateHeadline(e,t){const s=this,i=t.animationDelay;n(e).each(function(e){const t=n(e);setTimeout(()=>{s.hideWord(t.find(".is-visible").first())},i)})}hideWord(e){const t=this,s=t.takeNext(e),i=e.children().length>=s.children().length;t.hideLetter(e.find("i").first(),e,i,t.options.lettersDelay),t.showLetter(s.find("i").first(),s,i,t.options.lettersDelay)}takeNext(e){return 0===e.length||e.is(":last-child")?e.parent().children().first():e.next()}hideLetter(e,t,s,i){const n=this;e.removeClass("in").addClass("out"),0===e.length||e.is(":last-child")?s&&setTimeout(()=>{n.hideWord(n.takeNext(t))},n.options.animationDelay):setTimeout(()=>{n.hideLetter(e.next(),t,s,i)},i)}showLetter(e,t,s,i){const n=this;e.addClass("in").removeClass("out"),0===e.length||e.is(":last-child")?s||setTimeout(()=>{n.hideWord(t)},n.options.animationDelay):setTimeout(()=>{n.showLetter(e.next(),t,s,i)},i)}}class y{constructor(e,t,s){this.active=!0,this.pos=t,this.radius=s,this.options=e}draw(e){this.active&&(e.beginPath(),e.arc(this.pos.x,this.pos.y,this.radius,0,2*Math.PI,!1),e.fillStyle=`rgba(${this.options.pointColor},${this.active?.6:0})`,e.fill())}}class w{constructor(e,t){this.options={gsap:null,canvasId:"targetCanvas",animateHeader:!0,width:window.innerWidth,height:window.innerHeight,isWindowWidth:!1,isWindowHeight:!1,num:20,pointColor:"156,217,249",lineColor:"156,217,249"},this.animationFrameId=0,this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.lineeffect")||i.data("be.lineeffect",e),e.init(s,t||e.options)})})}init(e,t){if(!t.gsap||"function"!=typeof t.gsap.to)return void console.error('[LineEffect] Missing or invalid "gsap" dependency in options.');let s,i;s="number"==typeof t.width?t.width:"string"==typeof t.width?this.resolveDimension(t.width,"width"):window.innerWidth,i="number"==typeof t.height?t.height:"string"==typeof t.height?this.resolveDimension(t.height,"height"):window.innerHeight;const n={x:s/2,y:i/2},o=document.getElementById(t.canvasId);if(!o)return void console.error(`[LineEffect] Canvas with id "${t.canvasId}" not found.`);o.width=s,o.height=i;const a=o.getContext("2d"),r=[];for(let e=0;e<s;e+=s/t.num)for(let n=0;n<i;n+=i/t.num){let o=e+Math.random()*s/t.num,a=n+Math.random()*i/t.num,l={x:o,originX:o,y:a,originY:a,active:0,closest:[],circle:null};r.push(l)}for(let e=0;e<r.length;e++){const t=[],s=r[e];for(let e=0;e<r.length;e++){let i=r[e];if(s!==i){let e=!1;for(let s=0;s<5;s++)e||void 0===t[s]&&(t[s]=i,e=!0);for(let n=0;n<5;n++)e||this.getDistance(s,i)<this.getDistance(s,t[n])&&(t[n]=i,e=!0)}}s.closest=t}for(let e in r)r.hasOwnProperty(e)&&(r[e].circle=new y(t,r[e],2+2*Math.random()));t.points=r,this.initAnimation(t,a,n,s,i),this.addListeners(t,n,o)}resolveDimension(e,t){if(e.endsWith("%")){const s=parseFloat(e);return"width"===t?s/100*window.innerWidth:s/100*window.innerHeight}if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("vw"))return parseFloat(e)/100*window.innerWidth;if(e.endsWith("vh"))return parseFloat(e)/100*window.innerHeight;if(e.endsWith("rem")||e.endsWith("em")){const t=document.createElement("div");t.style.position="absolute",t.style.visibility="hidden",t.style.fontSize=e,document.body.appendChild(t);const s=parseFloat(getComputedStyle(document.documentElement).fontSize);if(document.body.removeChild(t),e.endsWith("rem"))return parseFloat(e)*s;if(e.endsWith("em"))return parseFloat(e)*s}return parseFloat(e)||0}getDistance(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}initAnimation(e,t,s,i,n){this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.animate(e,t,s,i,n);for(let t in e.points)e.points.hasOwnProperty(t)&&this.shiftPoint(e.points[t])}animate(e,t,s,i,n){if(e.animateHeader){const o=e.points;t.clearRect(0,0,i,n);for(let i in o)if(o.hasOwnProperty(i)){const n=Math.abs(this.getDistance(s,o[i]));n<4e3?(o[i].active=.3,o[i].circle.active=!0):n<2e4?(o[i].active=.1,o[i].circle.active=!0):n<4e4?(o[i].active=.02,o[i].circle.active=!0):(o[i].active=0,o[i].circle.active=!1),this.drawLines(e,o[i],t),o[i].circle.draw(t)}}this.animationFrameId=requestAnimationFrame(()=>this.animate(e,t,s,i,n))}shiftPoint(e){this.options.gsap.to(e,{duration:1+Math.random(),x:e.originX-50+100*Math.random(),y:e.originY-50+100*Math.random(),ease:"circ.inOut",onComplete:()=>this.shiftPoint(e)})}drawLines(e,t,s){var i;if(t.active)for(let n in t.closest)(null===(i=t.closest)||void 0===i?void 0:i.hasOwnProperty(n))&&(s.beginPath(),s.moveTo(t.x,t.y),s.lineTo(t.closest[n].x,t.closest[n].y),s.strokeStyle=`rgba(${e.lineColor},${t.active})`,s.stroke())}addListeners(e,t,s){this.removeListeners(),this.boundMouseMove=e=>this.mouseMove(e,t),this.boundScroll=()=>this.scrollCheck(e),this.boundResize=()=>this.resize(e,s),document.getElementById(this.options.canvasId)?("ontouchstart"in window||window.addEventListener("mousemove",this.boundMouseMove),window.addEventListener("scroll",this.boundScroll),window.addEventListener("resize",this.boundResize)):("ontouchstart"in window||window.removeEventListener("mousemove",this.boundMouseMove),window.removeEventListener("scroll",this.boundScroll),window.removeEventListener("resize",this.boundResize))}removeListeners(){this.boundMouseMove&&window.removeEventListener("mousemove",this.boundMouseMove),this.boundScroll&&window.removeEventListener("scroll",this.boundScroll),this.boundResize&&window.removeEventListener("resize",this.boundResize)}mouseMove(e,t){const s=document.getElementById(this.options.canvasId);if(s){const i=s.getBoundingClientRect(),n=window.pageYOffset||document.documentElement.scrollTop,o=window.pageXOffset||document.documentElement.scrollLeft,a=i.top+n,r=i.left+o;let l=0,c=0;e.pageX||e.pageY?(l=e.pageX,c=e.pageY):(e.clientX||e.clientY)&&(l=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c=e.clientY+document.body.scrollTop+document.documentElement.scrollTop),t.x=l-r,t.y=c-a}}scrollCheck(e){e.animateHeader=document.body.scrollTop<=("number"==typeof e.height?e.height:window.innerHeight)}resize(e,t){var s,i;if(e.isWindowWidth)if("string"==typeof e.width){const s=this.resolveDimension(e.width,"width");t.width=s}else t.width=null!==(s=e.width)&&void 0!==s?s:window.innerWidth;if(e.isWindowHeight)if("string"==typeof e.height){const s=this.resolveDimension(e.height,"height");t.height=s}else t.height=null!==(i=e.height)&&void 0!==i?i:window.innerHeight}destroy(){this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.removeListeners()}}const C="ce-slideFromTop",x="ce-slideFromRight",k="ce-slideFromBottom",E="ce-slideFromLeft",T="ce-slideTop",L="ce-slideLeft";class P{constructor(e,t){this.options={reverse:!1},this.selector=e,s.defaultConstructor(this,e,t,e=>{e.elements.forEach(s=>{let i=n(s);i.data("be.hoverdir")||i.data("be.hoverdir",e),e.init(s,t||e.options)})})}init(e,t){const s=n(e);s.on("mouseenter",e=>this.mouseEvent(e,t)),s.on("mouseleave",e=>this.mouseEvent(e,t))}mouseEvent(e,t){const s=n(e.currentTarget),i=e.type,o=s.find("div"),a=this.getDir(s,{x:e.pageX,y:e.pageY}),r=this.getClasses(a,t);o.removeClass(),"mouseenter"===i?setTimeout(()=>{o.css("display","none").addClass(r.from),o.show(15,e=>{n(e).addClass(r.to)})},15):o.addClass(r.from)}getDir(e,t){const s=e.width(),i=e.height(),n=(t.x-e.offset().left-s/2)*(s>i?i/s:1),o=(t.y-e.offset().top-i/2)*(i>s?s/i:1);return Math.round((Math.atan2(o,n)*(180/Math.PI)+180)/90+3)%4}getClasses(e,t){let s,i;switch(e){case 0:s=t.reverse?k:C,i=T;break;case 1:s=t.reverse?E:x,i=L;break;case 2:s=t.reverse?C:k,i=T;break;case 3:s=t.reverse?x:E,i=L;break;default:s="",i=""}return{from:s,to:i}}}class S{constructor(e){this.options={times:20,time:1e3},this.jsLoaded=[],this.cssLoaded=[],this.options=Object.assign(Object.assign({},this.options),e)}loadScript(e){const t=this;return new Promise((s,i)=>{if(t.jsLoaded.find(t=>t.url===e)){let i,n=0;const o=setInterval(()=>{i=t.jsLoaded.find(t=>t.url===e);try{if(!(null==i?void 0:i.isLoaded)&&n>t.options.times)return t.jsLoaded=t.jsLoaded.filter(t=>t.url!==e),i&&i.script.parentNode===document.body&&document.body.removeChild(i.script),void clearInterval(o);if(null==i?void 0:i.isLoaded)return clearInterval(o),void s(i.script);n++}catch(e){console.error(e)}},t.options.time)}else{const n=document.createElement("script");let o=!1,a=0;t.jsLoaded=[...t.jsLoaded,{script:n,url:e,isLoaded:!1,count:0}],n.src=e,n.onload=()=>{t.jsLoaded=t.jsLoaded.map(t=>t.url===e?Object.assign(Object.assign({},t),{isLoaded:!0}):t),o=!0,s(n)},n.onerror=()=>{t.jsLoaded=t.jsLoaded.filter(t=>t.url!==e),i(new Error("Script load error for "+e))},document.body.appendChild(n);const r=setInterval(()=>{if(!o)return a>t.options.times?(n.parentNode===document.body&&document.body.removeChild(n),void clearInterval(r)):void a++;clearInterval(r)},100)}})}loadStyle(e){const t=this;return new Promise((s,i)=>{const n=document.getElementsByTagName("link");for(let t=0;t<n.length;t++)if(n[t].getAttribute("href")===e)return void s(n[t]);const o=document.createElement("link");o.href=e,o.rel="stylesheet",o.type="text/css",o.onload=()=>s(o),o.onerror=()=>i(new Error("Style load error for "+e)),document.head.appendChild(o),t.cssLoaded.push(o)})}destroy(){this.jsLoaded.forEach(e=>{e.script&&e.script.parentNode===document.body&&document.body.removeChild(e.script)}),this.cssLoaded.forEach(e=>{e.parentNode===document.head&&document.head.removeChild(e)}),this.jsLoaded=[],this.cssLoaded=[]}}const A=r;module.exports.arisu=t})();
|