From f3fcfe45dacbcd4cef3cb1aa573a8501df606ffb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Sep 2026 22:53:33 +0800 Subject: [PATCH] feat(submit): add user media library --- .gitignore | 1 + assets/css/frontend/pages/submit.css | 226 +++++ assets/js/front-submit-editor.js | 769 +++++++++--------- assets/js/front-submit-pay-download.js | 51 +- assets/js/front-submit.js | 174 ++-- assets/js/mini-upload.js | 328 -------- assets/js/runtime/gutenberg-extend.js | 4 +- assets/js/runtime/gutenberg-extend.min.js | 2 +- assets/js/runtime/main.js | 11 - assets/js/runtime/main.min.js | 2 +- inc/helpers/aksrt-pay.php | 53 -- src/Core/DomainModel.php | 12 +- src/Core/FrontSubmit.php | 60 +- src/Core/FrontSubmitFeatured.php | 26 + src/Core/FrontSubmitMedia.php | 294 +++++++ src/Core/FrontSubmitPay.php | 10 +- templates/pages/page-submit.php | 66 +- templates/parts/submit/context.php | 10 +- templates/parts/submit/sidebar-pay.php | 3 +- .../front-submit-attachment-contract.test.cjs | 158 ++++ .../front-submit-editor-contract.test.cjs | 2 +- .../post-editor-reference-contract.test.cjs | 2 +- .../runtime-action-hard-cut-contract.test.cjs | 2 + 23 files changed, 1321 insertions(+), 945 deletions(-) delete mode 100644 assets/js/mini-upload.js create mode 100644 src/Core/FrontSubmitMedia.php create mode 100644 tests/widget-system/front-submit-attachment-contract.test.cjs diff --git a/.gitignore b/.gitignore index 7c389571..d4deae2c 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ !/tests/widget-system/financial-flow-contract.test.cjs !/tests/widget-system/pay-orders-filter-contract.test.cjs !/tests/widget-system/front-submit-editor-contract.test.cjs +!/tests/widget-system/front-submit-attachment-contract.test.cjs !/tests/widget-system/comment-smilies-removal-contract.test.cjs !/tests/widget-system/comment-children-list-reset-contract.test.cjs !/tests/widget-system/comment-image-upload-contract.test.cjs diff --git a/assets/css/frontend/pages/submit.css b/assets/css/frontend/pages/submit.css index b5c36710..9b234123 100644 --- a/assets/css/frontend/pages/submit.css +++ b/assets/css/frontend/pages/submit.css @@ -289,6 +289,200 @@ body.aksrt-editor-media-open { overflow: hidden; } +.aksrt-editor-media__search { + display: flex; + gap: 8px; + margin-bottom: 12px; +} + +.aksrt-editor-media__search .form-control { + min-width: 0; + flex: 1 1 auto; +} + +.aksrt-editor-media__search .but { + flex: 0 0 auto; +} + +.aksrt-editor-media__status { + min-height: 20px; + margin: 4px 0 10px; + color: var(--muted-color, #777); + font-size: 13px; + text-align: center; +} + +.aksrt-editor-media__status.is-loading { + color: var(--muted-color, #777); +} + +.aksrt-editor-media__status.is-error { + color: var(--danger-color, #e05252); +} + +.aksrt-editor-media__status.is-empty { + padding: 28px 10px; + color: var(--muted-2-color, #999); +} + +.aksrt-editor-media__list { + display: grid; + max-height: min(390px, 48vh); + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 10px; + overflow-y: auto; + padding: 2px; +} + +.aksrt-editor-media__item { + position: relative; + min-width: 0; + padding: 0; + overflow: hidden; + border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.1)); + border-radius: var(--main-radius, 8px); + background: var(--muted-bg-color, rgba(50, 50, 50, 0.03)); + color: var(--main-color, #333); + text-align: left; + cursor: pointer; + transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s; +} + +.aksrt-editor-media__item:hover, +.aksrt-editor-media__item:focus-visible { + border-color: var(--focus-color, #f04494); + outline: 0; + box-shadow: 0 0 0 2px var(--focus-shadow-color, rgba(240, 68, 148, 0.15)); +} + +.aksrt-editor-media__item.is-selected { + border-color: var(--focus-color, #f04494); + box-shadow: inset 0 0 0 2px var(--focus-color, #f04494); +} + +.aksrt-editor-media__item:disabled { + opacity: 0.4; + cursor: not-allowed; +} + +.aksrt-editor-media__check { + position: absolute; + z-index: 1; + top: 6px; + left: 6px; + display: flex; + width: 22px; + height: 22px; + align-items: center; + justify-content: center; + border-radius: 50%; + background: rgba(0, 0, 0, 0.58); + color: #fff; + opacity: 0; + font-size: 11px; + line-height: 1; + transition: opacity 0.2s; +} + +.aksrt-editor-media__item.is-selected .aksrt-editor-media__check { + background: var(--focus-color, #f04494); + opacity: 1; +} + +.aksrt-editor-media__thumb { + display: flex; + width: 100%; + height: 104px; + align-items: center; + justify-content: center; + overflow: hidden; + background: var(--muted-border-color, rgba(50, 50, 50, 0.06)); +} + +.aksrt-editor-media__thumb img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; +} + +.aksrt-editor-media__file-icon { + color: var(--focus-color, #f04494); + font-size: 30px; +} + +.aksrt-editor-media__meta { + display: block; + min-height: 34px; + padding: 7px 8px; + overflow: hidden; + font-size: 12px; + line-height: 1.4; + text-overflow: ellipsis; + white-space: nowrap; +} + +.aksrt-editor-media__mine-actions { + display: flex; + justify-content: flex-end; + gap: 8px; + margin-top: 12px; +} + +.aksrt-editor-media__mine-actions .but { + margin: 0; +} + +.aksrt-editor-media__load-more { + display: block; + min-width: 110px; + margin: 12px 0 0; +} + +.aksrt-editor-media__load-more[hidden], +.aksrt-editor-media__confirm[hidden] { + display: none !important; +} + +.aksrt-editor-media__confirm { + margin: 12px 0 0 auto; +} + +.aksrt-editor-media__selection { + min-height: 20px; + margin-top: 10px; + color: var(--muted-color, #777); + font-size: 13px; +} + +.aksrt-editor-media__progress { + position: relative; + min-height: 34px; + margin-top: 10px; + padding: 9px 10px; + overflow: hidden; + border-radius: 4px; + background: var(--muted-border-color, rgba(50, 50, 50, 0.08)); + color: var(--muted-color, #777); + font-size: 12px; +} + +.aksrt-editor-media__progress::before { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 3px; + width: var(--aksrt-upload-progress, 0%); + background: var(--focus-color, #f04494); + content: ''; + transition: width 0.2s; +} + +.aksrt-editor-media__submit:disabled { + cursor: not-allowed; + opacity: 0.55; +} .featured-edit { position: relative; overflow: hidden; @@ -548,6 +742,38 @@ body.aksrt-editor-media-open { border-radius: 12px 12px 0 0; } + .aksrt-editor-media__list { + max-height: 42vh; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 8px; + } + + .aksrt-editor-media__thumb { + height: 92px; + } + + .aksrt-editor-media__tabs { + gap: 14px; + overflow-x: auto; + white-space: nowrap; + } + + .aksrt-editor-media__panel { + padding: 15px; + } + + .aksrt-editor-media__mine-actions { + flex-wrap: wrap; + } + + .aksrt-editor-media__mine-actions .aksrt-editor-media__load-more { + margin-right: auto; + } + + .aksrt-editor-media__search .but { + padding-right: 10px; + padding-left: 10px; + } .aksrt-editor-media__drop { min-height: 150px; } diff --git a/assets/js/front-submit-editor.js b/assets/js/front-submit-editor.js index aa49e30f..059f2ae7 100644 --- a/assets/js/front-submit-editor.js +++ b/assets/js/front-submit-editor.js @@ -6,10 +6,6 @@ (function (window, document) { 'use strict'; - if (!window.tinymce || !window.tinymce.PluginManager) { - return; - } - var cfg = window.aksrtSubmitData || {}; var editorCfg = cfg.editor || {}; var i18n = cfg.i18n || {}; @@ -47,14 +43,16 @@ } } - function imageMarkup(url, attachmentId, alt) { + function imageMarkup(url, attachmentId, alt, fullUrl) { var safeUrl = validHttpUrl(url); + var safeFullUrl = validHttpUrl(fullUrl || url); if (!safeUrl) { return ''; } var idAttr = attachmentId ? ' data-edit-file-id="' + Number(attachmentId) + '"' : ''; var altAttr = alt ? ' alt="' + escapeAttr(alt) + '"' : ' alt=""'; - return '

'; + var fullAttr = safeFullUrl ? ' data-full-url="' + escapeAttr(safeFullUrl) + '"' : ''; + return '

'; } function videoMarkup(url, attachmentId, name) { @@ -74,7 +72,7 @@ return ''; } var filename = String(name || safeUrl.split('/').pop() || i18n.attachment || '附件'); - var idAttr = attachmentId ? ' data-download-file="' + Number(attachmentId) + '"' : ''; + var idAttr = attachmentId ? ' data-aksrt-file-id="' + Number(attachmentId) + '"' : ''; return '
' + '
' + '
' + @@ -99,334 +97,278 @@ '
'; } - function closeMediaModal() { - if (!activeModal) { - return; + function mediaUrl(type) { + var configured = cfg.media && cfg.media[type] && cfg.media[type].url; + if (configured) { + return String(configured).indexOf('{type}') !== -1 + ? String(configured).replace('{type}', encodeURIComponent(type)) + : String(configured); } - document.removeEventListener('keydown', activeModal.onKeydown); - activeModal.root.remove(); - activeModal = null; - document.body.classList.remove('aksrt-editor-media-open'); + var base = cfg.mediaUrl || ''; + if (String(base).indexOf('{type}') !== -1) return String(base).replace('{type}', encodeURIComponent(type)); + if (base) return String(base).replace(/\/$/, '') + '/' + encodeURIComponent(type); + return cfg.restUrl ? cfg.restUrl.replace(/\/$/, '') + '/front-submit/media/' + encodeURIComponent(type) : ''; } + + function currentPostId() { + var field = document.querySelector('#aksrt-submit-form input[name="posts_id"]'); + return Number((field && field.value) || cfg.postId || 0) || 0; } function acceptsFile(file, type) { - if (!file) { - return false; - } - if (type === 'image') { - return /^image\//.test(file.type || ''); - } - if (type === 'video') { - return /^video\//.test(file.type || ''); - } + if (!file) return false; + if (type === 'image') return /^image\//.test(file.type || ''); + if (type === 'video') return /^video\//.test(file.type || ''); return true; } function uploadMedia(file, type) { var uploadKey = type === 'file' ? 'resource' : type; var upload = (cfg.uploads || {})[uploadKey] || null; - if (!upload || !upload.url) { - return Promise.reject(new Error(i18n.uploadUnavailable || '当前账号不能上传此类文件')); - } - if (!acceptsFile(file, type)) { - return Promise.reject(new Error(i18n.invalidFile || '请选择有效文件')); - } - if (upload.maxSize && file.size > upload.maxSize) { - return Promise.reject(new Error(i18n.fileTooLarge || '文件大小超过限制')); - } - + if (!upload || !upload.url) return Promise.reject(new Error(i18n.uploadUnavailable || '当前账号不能上传此类文件')); + if (!acceptsFile(file, type)) return Promise.reject(new Error(i18n.invalidFile || '请选择有效文件')); + if (upload.maxSize && file.size > upload.maxSize) return Promise.reject(new Error(i18n.fileTooLarge || '文件大小超过限制')); var body = new FormData(); body.append('file', file); - return fetch(upload.url, { - method: 'POST', - credentials: 'same-origin', - headers: { 'X-WP-Nonce': cfg.restNonce || '' }, - body: body, - }).then(function (response) { - return response.json().catch(function () { - return {}; - }).then(function (payload) { - if (!response.ok || !payload || !payload.success || !payload.url) { - throw new Error((payload && payload.message) || i18n.error || '文件上传失败'); - } - return payload; + var uploadUrl = String(upload.url); + if (currentPostId()) { + uploadUrl += (uploadUrl.indexOf('?') === -1 ? '?' : '&') + 'post_id=' + encodeURIComponent(String(currentPostId())); + } + return fetch(uploadUrl, { method: 'POST', credentials: 'same-origin', headers: { 'X-WP-Nonce': cfg.restNonce || '' }, body: body }) + .then(function (response) { + return response.json().catch(function () { return {}; }).then(function (payload) { + if (!response.ok || !payload || !payload.success || !payload.url) { + throw new Error((payload && (payload.message || (payload.data && payload.data.message))) || i18n.error || '文件上传失败'); + } + return payload; + }); }); - }); } function mediaDefinition(type) { - if (type === 'video') { - return { - title: i18n.insertVideo || '插入视频', - uploadTab: i18n.uploadVideo || '上传视频', - externalTab: i18n.externalVideo || '外链视频', - embedTab: i18n.embedVideo || '嵌入视频', - accept: 'video/*', - multiple: false, - canUpload: !!editorCfg.canUploadVideo && !!((cfg.uploads || {}).video), - canEmbed: !!editorCfg.canEmbedVideo, - select: i18n.selectVideo || '选择或拖入视频', - hint: i18n.videoUploadHint || '上传完成后自动插入正文', - externalHint: i18n.externalVideoHint || '请填写视频文件地址:', - }; - } - if (type === 'file') { - return { - title: i18n.insertFile || '上传附件', - uploadTab: i18n.uploadFile || '上传附件', - externalTab: i18n.externalFile || '输入地址', - accept: '*/*', - multiple: false, - canUpload: !!editorCfg.canUploadFile && !!((cfg.uploads || {}).resource), - canEmbed: false, - select: i18n.selectFile || '选择或拖入附件', - hint: i18n.fileUploadHint || '上传完成后自动插入正文', - externalHint: i18n.externalFileHint || '请填写附件地址:', - }; - } + if (type === 'video') return { + title: i18n.insertVideo || '插入视频', mineTab: i18n.mineVideo || '我的视频', uploadTab: i18n.uploadVideo || '上传视频', + externalTab: i18n.externalVideo || '外链视频', embedTab: i18n.embedVideo || '嵌入视频', accept: 'video/*', multiple: false, maxItems: 1, + canUpload: !!editorCfg.canUploadVideo && !!((cfg.uploads || {}).video), canEmbed: !!editorCfg.canEmbedVideo, + select: i18n.selectVideo || '选择或拖入视频', hint: i18n.videoUploadHint || '上传完成后自动插入正文', externalHint: i18n.externalVideoHint || '请填写视频文件地址:', + }; + if (type === 'file') return { + title: i18n.insertFile || '上传附件', mineTab: i18n.mineFile || '我的文件', uploadTab: i18n.uploadFile || '上传附件', externalTab: i18n.externalFile || '输入地址', + accept: '*/*', multiple: false, maxItems: 1, canUpload: !!editorCfg.canUploadFile && !!((cfg.uploads || {}).resource), canEmbed: false, + select: i18n.selectFile || '选择或拖入附件', hint: i18n.fileUploadHint || '上传完成后自动插入正文', externalHint: i18n.externalFileHint || '请填写附件地址:', + }; return { - title: i18n.insertImage || '插入图片', - uploadTab: i18n.uploadImage || '上传图片', - externalTab: i18n.externalImage || '外链图片', - accept: 'image/gif,image/jpeg,image/png,image/webp', - multiple: true, - canUpload: !!editorCfg.canUploadImage && !!((cfg.uploads || {}).image), - canEmbed: false, - select: i18n.selectImages || '选择或拖入图片', - hint: i18n.imageUploadHint || '可批量选择,上传完成后自动插入正文', - externalHint: i18n.externalImageHint || '每行填写一个图片地址:', + title: i18n.insertImage || '插入图片', mineTab: i18n.mineImage || '我的图片', uploadTab: i18n.uploadImage || '上传图片', externalTab: i18n.externalImage || '外链图片', + accept: 'image/gif,image/jpeg,image/png,image/webp', multiple: true, maxItems: 100, canUpload: !!editorCfg.canUploadImage && !!((cfg.uploads || {}).image), canEmbed: false, + select: i18n.selectImages || '选择或拖入图片', hint: i18n.imageUploadHint || '可批量选择,上传完成后自动插入正文', externalHint: i18n.externalImageHint || '每行填写一个图片地址:', }; } function mediaMarkup(type, item) { - if (type === 'video') { - return videoMarkup(item.url, item.attachment_id, item.filename || item.name || ''); - } - if (type === 'file') { - return fileMarkup(item.url, item.attachment_id, item.filename || item.name || ''); - } - return imageMarkup(item.url, item.attachment_id, item.name || ''); + var id = item.attachment_id || item.id; + if (type === 'video') return videoMarkup(item.url, id, item.filename || item.name || ''); + if (type === 'file') return fileMarkup(item.url, id, item.filename || item.name || ''); + return imageMarkup(item.large_url || item.url, id, item.name || item.title || '', item.url); } - function createMediaModal(editor, type) { - closeMediaModal(); + function formatBytes(value) { + var size = Number(value) || 0, units = ['B', 'KB', 'MB', 'GB'], index = 0; + if (!size) return ''; + while (size >= 1024 && index < units.length - 1) { size /= 1024; index += 1; } + return (index ? size.toFixed(size >= 10 ? 0 : 1) : String(Math.round(size))) + ' ' + units[index]; + } - var definition = mediaDefinition(type); - var canUpload = definition.canUpload; - var firstTab = canUpload ? 'upload' : 'external'; + function extension(item) { + var name = String(item.filename || item.name || item.url || ''), match = name.match(/\.([a-z0-9]{1,8})(?:[?#].*)?$/i); + return match ? match[1].toUpperCase() : String(item.subtype || item.type || '').toUpperCase(); + } + + function closeMediaModal(force) { + if (!activeModal) return; + if (activeModal.uploading && !force) { notify(i18n.uploadingClose || '上传中,请稍候再关闭', 'warning'); return; } + document.removeEventListener('keydown', activeModal.onKeydown); + if (activeModal.searchTimer) window.clearTimeout(activeModal.searchTimer); + activeModal.root.remove(); + if (activeModal.previousFocus && typeof activeModal.previousFocus.focus === 'function') activeModal.previousFocus.focus(); + activeModal = null; + document.body.classList.remove('aksrt-editor-media-open'); + } + + function openMediaModal(options) { + options = options || {}; + if (activeModal) { + closeMediaModal(); + if (activeModal) return; + } + var type = ['image', 'video', 'file'].indexOf(options.type) === -1 ? 'image' : options.type; + var definition = mediaDefinition(type), multiple = options.multiple === undefined ? definition.multiple : !!options.multiple; + var maxItems = Math.max(1, Number(options.maxItems || (multiple ? definition.maxItems : 1)) || 1); + if (!multiple) maxItems = 1; + var allowExternal = options.allowExternal !== false; + var allowEmbed = definition.canEmbed && options.allowEmbed !== false; + var canUpload = definition.canUpload && options.canUpload !== false; var root = document.createElement('div'); root.className = 'aksrt-editor-media'; root.setAttribute('data-editor-media-type', type); - root.setAttribute('role', 'dialog'); - root.setAttribute('aria-modal', 'true'); - root.setAttribute('aria-labelledby', 'aksrt-editor-media-title'); + root.setAttribute('role', 'dialog'); root.setAttribute('aria-modal', 'true'); root.setAttribute('aria-labelledby', 'aksrt-editor-media-title'); root.innerHTML = - '' + - '
' + - '' + - '

' + - escapeAttr(definition.title) + '

' + - '
' + - (canUpload - ? '' - : '') + - '' + - (definition.canEmbed - ? '' - : '') + - '
' + - '
' + - (canUpload - ? '
' + - '' + - '
' + - '' + - '
' - : '') + - '
' + - '

' + escapeAttr(definition.externalHint) + '

' + - '' + - '' + - '
' + - (definition.canEmbed - ? '
' + - '

' + escapeAttr(i18n.embedVideoHint || '请输入嵌入地址或者直接粘贴 iframe 嵌入代码:') + '

' + - '' + - '' + - '
' - : '') + - '
' + - '
'; + '' + + '
' + + '

' + escapeAttr(options.title || definition.title) + '

' + + '
' + + (canUpload ? '' : '') + + (allowExternal ? '' : '') + + (allowEmbed && type === 'video' ? '' : '') + '
' + + '
' + + '' + + '
' + + (canUpload ? '
' : '') + + (allowExternal ? '

' + escapeAttr(definition.externalHint) + '

' : '') + + (allowEmbed && type === 'video' ? '

' + escapeAttr(i18n.embedVideoHint || '请输入嵌入地址或者直接粘贴 iframe 嵌入代码:') + '

' : '') + '
'; + document.body.appendChild(root); document.body.classList.add('aksrt-editor-media-open'); - document.body.appendChild(root); - document.body.classList.add('aksrt-editor-media-open'); - - var fileInput = root.querySelector('[data-editor-media-files]'); - var uploadButton = root.querySelector('[data-editor-media-upload]'); - var selection = root.querySelector('[data-editor-media-selection]'); - var drop = root.querySelector('.aksrt-editor-media__drop'); - var files = []; - - function showSelection() { - if (!selection || !uploadButton) { - return; + var state = { root: root, uploading: false, loading: false, requestId: 0, searchTimer: null, previousFocus: document.activeElement, page: 0, totalPages: 0, search: '', items: [], pinned: [], selected: [], exclude: [] }; + var list = root.querySelector('[data-editor-media-list]'), status = root.querySelector('[data-editor-media-status]'), more = root.querySelector('[data-editor-media-more]'); + var confirm = root.querySelector('[data-editor-media-confirm]'); + var search = root.querySelector('[data-editor-media-search]'), fileInput = root.querySelector('[data-editor-media-files]'), uploadButton = root.querySelector('[data-editor-media-upload]'); + var selection = root.querySelector('[data-editor-media-selection]'), progress = root.querySelector('[data-editor-media-progress]'), drop = root.querySelector('.aksrt-editor-media__drop'), files = []; + function statusText(text, cls) { if (!status) return; status.className = 'aksrt-editor-media__status' + (cls ? ' is-' + cls : ''); status.textContent = text || ''; } + function itemId(item) { return Number(item.attachment_id || item.id || 0); } + function selectedIndex(id) { return state.selected.findIndex(function (item) { return itemId(item) === id; }); } + function renderSelection() { if (selection) selection.textContent = files.length ? (multiple ? (i18n.selectedFiles || '已选择 %d 个文件').replace('%d', String(files.length)) : files[0].name) : ''; if (uploadButton) uploadButton.disabled = !files.length || state.uploading; } + function renderItem(item) { + var id = itemId(item), index = selectedIndex(id), chosen = index !== -1, disabled = !chosen && state.selected.length >= maxItems; + var label = escapeAttr(item.filename || item.name || item.title || item.url || ''); + var itemType = String(item.type || type); + var hasImagePreview = itemType === 'image' && (item.thumbnail_url || item.medium_url || item.url); + var thumb = hasImagePreview + ? '' + label + '' + : ''; + var meta = type === 'image' ? label : label + (extension(item) ? ' · ' + escapeAttr(extension(item)) : '') + (formatBytes(item.filesizeInBytes) ? ' · ' + escapeAttr(formatBytes(item.filesizeInBytes)) : ''); + return ''; + } + function renderList() { + if (!list) return; + list.innerHTML = state.items.length ? state.items.map(renderItem).join('') : ''; + if (more) more.hidden = state.loading || state.page >= state.totalPages || !state.items.length; + if (confirm) { + confirm.hidden = !multiple || !state.selected.length; + confirm.disabled = state.uploading; + confirm.textContent = (i18n.confirmSelected || '确认选择(%d)').replace('%d', String(state.selected.length)); } - selection.textContent = files.length - ? (definition.multiple - ? (i18n.selectedFiles || '已选择 %d 个文件').replace('%d', String(files.length)) - : files[0].name) - : ''; - uploadButton.disabled = files.length === 0; + } + function finish(value) { if (state.uploading) return; if (typeof options.onSelect === 'function') options.onSelect(multiple ? value.slice() : value[0]); closeMediaModal(true); } + function selectItem(item) { var id = itemId(item), index = selectedIndex(id); if (index !== -1) state.selected.splice(index, 1); else { if (!multiple) state.selected = []; if (state.selected.length >= maxItems) return; state.selected.push(item); } renderList(); if (!multiple && state.selected.length) finish(state.selected); } + function addItems(items) { (items || []).forEach(function (item) { var id = itemId(item); if (!id) return; if (state.exclude.indexOf(id) === -1) state.exclude.push(id); if (!state.items.some(function (old) { return itemId(old) === id; })) state.items.unshift(item); if (!state.pinned.some(function (old) { return itemId(old) === id; })) state.pinned.unshift(item); }); renderList(); } + function activateTab(name) { var tab = root.querySelector('[data-editor-media-tab="' + name + '"]'); if (tab) tab.click(); } + function request(page, replace) { + var url = mediaUrl(type); if (!url) { statusText(i18n.mediaUnavailable || '媒体库暂不可用', 'error'); return; } + if (replace) { state.items = state.search.length >= 2 ? [] : state.pinned.slice(); state.page = 0; } + state.loading = true; renderList(); statusText(i18n.loading || '加载中…', 'loading'); + var requestId = ++state.requestId; + var params = new URLSearchParams(); params.set('paged', String(page)); params.set('per_page', '48'); if (currentPostId()) params.set('post_id', String(currentPostId())); if (state.search.length >= 2) params.set('search', state.search); if (state.exclude.length) params.set('exclude', state.exclude.join(',')); + fetch(url + (url.indexOf('?') === -1 ? '?' : '&') + params.toString(), { credentials: 'same-origin', headers: { 'X-WP-Nonce': cfg.restNonce || '' } }).then(function (response) { return response.json().catch(function () { return {}; }).then(function (payload) { if (!response.ok) throw new Error((payload && (payload.message || (payload.data && payload.data.message))) || i18n.error || '加载失败'); return payload || {}; }); }).then(function (payload) { + if (requestId !== state.requestId) return; + var incoming = Array.isArray(payload.items) ? payload.items : []; if (replace) state.items = state.search.length >= 2 ? [] : state.pinned.slice(); incoming.forEach(function (item) { if (state.exclude.indexOf(itemId(item)) === -1) state.items.push(item); }); state.page = Number(payload.page || page); state.totalPages = Number(payload.total_pages || 0); state.loading = false; renderList(); statusText(state.items.length ? '' : (i18n.emptyMedia || '暂无媒体文件'), state.items.length ? '' : 'empty'); + }).catch(function (error) { if (requestId !== state.requestId) return; state.loading = false; renderList(); statusText(error.message || i18n.mediaError || '媒体加载失败', 'error'); }); } - function setFiles(nextFiles) { var candidates = Array.prototype.slice.call(nextFiles || []); + var uploadKey = type === 'file' ? 'resource' : type; + var upload = (cfg.uploads || {})[uploadKey] || {}; + var rejected = false; files = candidates.filter(function (file) { - return acceptsFile(file, type); + var valid = acceptsFile(file, type) && (!upload.maxSize || file.size <= upload.maxSize); + rejected = rejected || !valid; + return valid; }); - if (candidates.length && !files.length) { - notify(i18n.invalidFile || '请选择有效文件', 'warning'); + if (rejected) notify(i18n.invalidFile || i18n.fileTooLarge || '部分文件类型或大小不符合要求', 'warning'); + if (!multiple) files = files.slice(0, 1); + if (files.length > maxItems) { + files = files.slice(0, maxItems); + notify((i18n.maxMediaItems || '最多选择 %d 个文件').replace('%d', String(maxItems)), 'warning'); } - if (!definition.multiple && files.length > 1) { - files = files.slice(0, 1); - } - showSelection(); + renderSelection(); } + function uploadSelected() { + if (!files.length || state.uploading) return; + state.uploading = true; renderSelection(); renderList(); + if (uploadButton) uploadButton.textContent = i18n.uploading || '正在上传…'; + if (progress) { progress.hidden = false; progress.textContent = i18n.uploading || '正在上传…'; progress.style.setProperty('--aksrt-upload-progress', '0%'); } + var complete = 0, total = files.length, nextIndex = 0, results = []; + var toastId = 'aksrt-front-submit-editor-media-toast'; + notify(i18n.uploading || '正在上传…', 'load', '', toastId); + function worker() { + var index = nextIndex++; + if (index >= total) return Promise.resolve(); + return uploadMedia(files[index], type).then(function (item) { + results[index] = { item: item }; + }).catch(function (error) { + results[index] = { error: error }; + }).finally(function () { + complete += 1; + if (progress) progress.style.setProperty('--aksrt-upload-progress', Math.round((complete / total) * 100) + '%'); + }).then(worker); + } + var workers = Math.min(4, total); + Promise.all(Array.apply(null, Array(workers)).map(function () { return worker(); })).then(function () { + var items = results.map(function (result) { return result && result.item; }).filter(Boolean); + var failure = results.find(function (result) { return result && result.error; }); + addItems(items); + state.selected = items.slice(0, maxItems); + state.uploading = false; + renderList(); + files = []; + renderSelection(); + if (items.length) notify(i18n.uploaded || '上传成功', 'success', 5, toastId); + if (failure) notify(failure.error.message || i18n.error || '部分文件上传失败', 'danger', 5, toastId); + if (!items.length) return; + if (!multiple) finish(state.selected); + else activateTab('mine'); + }).finally(function () { + state.uploading = false; + renderList(); + if (uploadButton) { uploadButton.disabled = !files.length; uploadButton.textContent = i18n.confirmUpload || '确认上传'; } + if (progress) progress.hidden = true; + }); + } + function externalSelect() { var textarea = root.querySelector('[data-editor-media-urls]'), urls = String(textarea ? textarea.value : '').split(/\r?\n/).map(function (url) { var valid = validHttpUrl(url); return valid ? { url: valid } : null; }).filter(Boolean).slice(0, maxItems); if (!urls.length) { notify(i18n.invalidMediaUrl || '请填写有效地址', 'warning'); return; } finish(urls); } + function embedSelect() { var input = root.querySelector('[data-editor-media-embed]'), html = embedVideoMarkup(input ? input.value : ''); if (!html) { notify(i18n.invalidVideoUrl || '请填写有效的视频嵌入地址', 'warning'); return; } if (typeof options.onEmbed === 'function') options.onEmbed(html); else if (typeof options.onSelect === 'function') options.onSelect({ embed: html }); closeMediaModal(true); } root.addEventListener('click', function (event) { - var close = event.target.closest('[data-editor-media-close]'); - if (close) { - event.preventDefault(); - closeMediaModal(); - return; - } - - var tab = event.target.closest('[data-editor-media-tab]'); - if (tab) { - var name = tab.getAttribute('data-editor-media-tab'); - root.querySelectorAll('[data-editor-media-tab]').forEach(function (item) { - var active = item === tab; - item.classList.toggle('is-active', active); - item.setAttribute('aria-selected', active ? 'true' : 'false'); - }); - root.querySelectorAll('[data-editor-media-panel]').forEach(function (panel) { - panel.classList.toggle('is-active', panel.getAttribute('data-editor-media-panel') === name); - }); - return; - } - - if (event.target.closest('[data-editor-media-external]')) { - var textarea = root.querySelector('[data-editor-media-urls]'); - var urls = String(textarea ? textarea.value : '').split(/\r?\n/); - if (!definition.multiple) { - urls = urls.slice(0, 1); - } - var html = urls.map(function (url) { - return mediaMarkup(type, { url: url }); - }).join(''); - if (!html) { - notify(i18n.invalidMediaUrl || '请填写有效地址', 'warning'); - return; - } - editor.insertContent(html + '

'); - editor.nodeChanged(); - closeMediaModal(); - return; - } - - if (event.target.closest('[data-editor-media-embed-submit]')) { - var embedInput = root.querySelector('[data-editor-media-embed]'); - var embedHtml = embedVideoMarkup(embedInput ? embedInput.value : ''); - if (!embedHtml) { - notify(i18n.invalidVideoUrl || '请填写有效的视频嵌入地址', 'warning'); - return; - } - editor.insertContent(embedHtml + '

'); - editor.nodeChanged(); - closeMediaModal(); - return; - } - - if (event.target.closest('[data-editor-media-upload]')) { - if (!files.length || !uploadButton) { - return; - } - uploadButton.disabled = true; - uploadButton.textContent = i18n.uploading || '正在上传…'; - notify(i18n.uploading || '正在上传…', 'load', ''); - Promise.all(files.map(function (file) { - return uploadMedia(file, type); - })).then(function (items) { - var html = items.map(function (item) { - return mediaMarkup(type, item); - }).join(''); - if (!html) { - throw new Error(i18n.error || '文件上传失败'); - } - editor.insertContent(html + '

'); - editor.nodeChanged(); - notify(i18n.uploaded || '上传成功', 'success'); - closeMediaModal(); - }).catch(function (error) { - notify(error.message || i18n.error || '文件上传失败', 'danger'); - uploadButton.disabled = false; - uploadButton.textContent = i18n.confirmUpload || '确认上传'; - }); - } + var close = event.target.closest('[data-editor-media-close]'); if (close) { event.preventDefault(); closeMediaModal(); return; } + var tab = event.target.closest('[data-editor-media-tab]'); if (tab) { var name = tab.getAttribute('data-editor-media-tab'); root.querySelectorAll('[data-editor-media-tab]').forEach(function (button) { var active = button === tab; button.classList.toggle('is-active', active); button.setAttribute('aria-selected', active ? 'true' : 'false'); }); root.querySelectorAll('[data-editor-media-panel]').forEach(function (panel) { panel.classList.toggle('is-active', panel.getAttribute('data-editor-media-panel') === name); }); if (name === 'mine' && state.page === 0) request(1, true); return; } + var itemButton = event.target.closest('[data-editor-media-item]'); if (itemButton && !itemButton.disabled) { var item = state.items.find(function (entry) { return itemId(entry) === Number(itemButton.getAttribute('data-editor-media-item')); }); if (item) selectItem(item); return; } + if (event.target.closest('[data-editor-media-clear]')) { if (search) search.value = ''; window.clearTimeout(state.searchTimer); state.search = ''; request(1, true); return; } + if (event.target.closest('[data-editor-media-confirm]')) { if (state.selected.length) finish(state.selected); return; } + if (event.target.closest('[data-editor-media-more]')) { if (!state.loading) request(state.page + 1, false); return; } + if (event.target.closest('[data-editor-media-external]')) { externalSelect(); return; } + if (event.target.closest('[data-editor-media-embed-submit]')) { embedSelect(); return; } + if (event.target.closest('[data-editor-media-upload]')) uploadSelected(); }); - - if (fileInput) { - fileInput.addEventListener('change', function () { - setFiles(fileInput.files); - }); - } - - if (drop) { - ['dragenter', 'dragover'].forEach(function (name) { - drop.addEventListener(name, function (event) { - event.preventDefault(); - drop.classList.add('is-dragging'); - }); - }); - ['dragleave', 'drop'].forEach(function (name) { - drop.addEventListener(name, function (event) { - event.preventDefault(); - drop.classList.remove('is-dragging'); - }); - }); - drop.addEventListener('drop', function (event) { - setFiles(event.dataTransfer && event.dataTransfer.files); - }); - } - - var onKeydown = function (event) { - if (event.key === 'Escape') { - closeMediaModal(); - } - }; - activeModal = { root: root, onKeydown: onKeydown }; - document.addEventListener('keydown', onKeydown); - var focusTarget = root.querySelector('.aksrt-editor-media__dialog'); - if (focusTarget) { - focusTarget.focus({ preventScroll: true }); - } + if (search) search.addEventListener('input', function () { + state.search = String(search.value || '').trim(); + window.clearTimeout(state.searchTimer); + state.searchTimer = window.setTimeout(function () { + if (state.search.length === 1) { + state.items = []; + state.page = 0; + state.totalPages = 0; + state.loading = false; + renderList(); + statusText(i18n.searchMin || '请输入至少 2 个字符进行搜索', 'empty'); + return; + } + request(1, true); + }, 600); + }); + if (fileInput) fileInput.addEventListener('change', function () { setFiles(fileInput.files); }); + if (drop) { ['dragenter', 'dragover'].forEach(function (name) { drop.addEventListener(name, function (event) { event.preventDefault(); drop.classList.add('is-dragging'); }); }); ['dragleave', 'drop'].forEach(function (name) { drop.addEventListener(name, function (event) { event.preventDefault(); drop.classList.remove('is-dragging'); }); }); drop.addEventListener('drop', function (event) { setFiles(event.dataTransfer && event.dataTransfer.files); }); } + var onKeydown = function (event) { if (event.key === 'Escape') closeMediaModal(); }; state.onKeydown = onKeydown; activeModal = state; document.addEventListener('keydown', onKeydown); + var focusTarget = root.querySelector('.aksrt-editor-media__dialog'); if (focusTarget) focusTarget.focus({ preventScroll: true }); request(1, true); } + window.AksrtSubmitMedia = { open: openMediaModal, close: function () { closeMediaModal(); }, upload: uploadMedia }; + function selectedContent(editor) { var content = String(editor.selection.getContent() || '').trim(); return content ? '

' + content + '

' : '

' + escapeAttr(i18n.hiddenPlaceholder || '隐藏内容') + '

'; @@ -623,109 +565,154 @@ }); } - window.tinymce.PluginManager.add('aksrt_editor_tools', function (editor) { - bindCharacterCount(editor); - - if (editorCfg.canUploadImage) { - editor.addButton('aksrt_image', { - text: '', - icon: 'image', - tooltip: i18n.insertImage || '插入图片', - onclick: function () { - createMediaModal(editor, 'image'); - }, - }); + function registerEditorTools() { + if (!window.tinymce || !window.tinymce.PluginManager || window.aksrtSubmitEditorToolsRegistered) { + return false; } + window.aksrtSubmitEditorToolsRegistered = true; - editor.addButton('aksrt_video', { - text: '', - icon: 'media', - tooltip: i18n.insertVideo || '插入视频', - onclick: function () { - createMediaModal(editor, 'video'); - }, - }); + window.tinymce.PluginManager.add('aksrt_editor_tools', function (editor) { + bindCharacterCount(editor); - if (editorCfg.canUploadFile) { - editor.addButton('aksrt_file', { - text: '', - icon: 'upload', - tooltip: i18n.insertFile || '上传附件', - onclick: function () { - createMediaModal(editor, 'file'); - }, - }); - } - - editor.addButton('aksrt_quote', { - text: '', - icon: 'blockquote', - tooltip: i18n.quote || '引言', - type: 'menubutton', - stateSelector: '.quote_q', - menu: [ - { text: i18n.quoteGray || '灰色', onclick: function () { insertQuote(editor, ''); } }, - { text: i18n.quoteRed || '红色', onclick: function () { insertQuote(editor, 'qe_wzk_c-red'); } }, - { text: i18n.quoteBlue || '蓝色', onclick: function () { insertQuote(editor, 'qe_wzk_lan'); } }, - { text: i18n.quoteGreen || '绿色', onclick: function () { insertQuote(editor, 'qe_wzk_lv'); } }, - ], - }); - - editor.addButton('aksrt_precode', { - text: '', - icon: 'code', - tooltip: i18n.highlightCode || '高亮代码', - stateSelector: 'pre.enlighter-pre', - onclick: function () { - openCodeModal(editor); - }, - }); - - if (editorCfg.canHide) { - var menu = [ - { - text: i18n.replyVisible || '回复可见', - type: 'reply', - open: '[reply]', - close: '[/reply]', - }, - { - text: i18n.loginVisible || '登录可见', - type: 'login', - open: '[aksrt_hide mode="login"]', - close: '[/aksrt_hide]', - }, - { - text: i18n.vipVisible || 'VIP 可见', - type: 'vip', - open: '[vip]', - close: '[/vip]', - }, - ]; - if (editorCfg.canPay) { - menu.push({ - text: i18n.payVisible || '付费可见', - type: 'payshow', - open: '[payshow]', - close: '[/payshow]', + if (editorCfg.canUploadImage) { + editor.addButton('aksrt_image', { + text: '', + icon: 'image', + tooltip: i18n.insertImage || '插入图片', + onclick: function () { + window.AksrtSubmitMedia.open({ + type: 'image', multiple: true, maxItems: 100, + onSelect: function (items) { + editor.insertContent(items.map(function (item) { return mediaMarkup('image', item); }).join('') + '

'); + editor.nodeChanged(); + }, + }); + }, }); } - menu = menu.map(function (item) { - return { - text: item.text, - onclick: function () { - insertHiddenContent(editor, item); - }, - }; - }); - editor.addButton('aksrt_hide', { + + editor.addButton('aksrt_video', { text: '', - icon: 'preview', - tooltip: i18n.hiddenContent || '隐藏内容', - type: 'menubutton', - stateSelector: '.tinymce-hide', - menu: menu, + icon: 'media', + tooltip: i18n.insertVideo || '插入视频', + onclick: function () { + window.AksrtSubmitMedia.open({ + type: 'video', multiple: false, + onSelect: function (item) { + editor.insertContent(mediaMarkup('video', item) + '

'); + editor.nodeChanged(); + }, + onEmbed: function (html) { + editor.insertContent(html + '

'); + editor.nodeChanged(); + }, + }); + }, }); - } - }); + + if (editorCfg.canUploadFile) { + editor.addButton('aksrt_file', { + text: '', + icon: 'upload', + tooltip: i18n.insertFile || '上传附件', + onclick: function () { + window.AksrtSubmitMedia.open({ + type: 'file', multiple: false, + onSelect: function (item) { + editor.insertContent(mediaMarkup('file', item) + '

'); + editor.nodeChanged(); + }, + }); + }, + }); + } + + editor.addButton('aksrt_quote', { + text: '', + icon: 'blockquote', + tooltip: i18n.quote || '引言', + type: 'menubutton', + stateSelector: '.quote_q', + menu: [ + { text: i18n.quoteGray || '灰色', onclick: function () { insertQuote(editor, ''); } }, + { text: i18n.quoteRed || '红色', onclick: function () { insertQuote(editor, 'qe_wzk_c-red'); } }, + { text: i18n.quoteBlue || '蓝色', onclick: function () { insertQuote(editor, 'qe_wzk_lan'); } }, + { text: i18n.quoteGreen || '绿色', onclick: function () { insertQuote(editor, 'qe_wzk_lv'); } }, + ], + }); + + editor.addButton('aksrt_precode', { + text: '', + icon: 'code', + tooltip: i18n.highlightCode || '高亮代码', + stateSelector: 'pre.enlighter-pre', + onclick: function () { + openCodeModal(editor); + }, + }); + + if (editorCfg.canHide) { + var menu = [ + { + text: i18n.replyVisible || '回复可见', + type: 'reply', + open: '[reply]', + close: '[/reply]', + }, + { + text: i18n.loginVisible || '登录可见', + type: 'login', + open: '[aksrt_hide mode="login"]', + close: '[/aksrt_hide]', + }, + { + text: i18n.vipVisible || 'VIP 可见', + type: 'vip', + open: '[vip]', + close: '[/vip]', + }, + ]; + if (editorCfg.canPay) { + menu.push({ + text: i18n.payVisible || '付费可见', + type: 'payshow', + open: '[payshow]', + close: '[/payshow]', + }); + } + menu = menu.map(function (item) { + return { + text: item.text, + onclick: function () { + insertHiddenContent(editor, item); + }, + }; + }); + editor.addButton('aksrt_hide', { + text: '', + icon: 'preview', + tooltip: i18n.hiddenContent || '隐藏内容', + type: 'menubutton', + stateSelector: '.tinymce-hide', + menu: menu, + }); + } + }); + return true; + } + + registerEditorTools(); + if (!window.aksrtSubmitEditorToolsRegistered) { + var retryCount = 0; + var retryRegistration = function () { + if (registerEditorTools()) { + return; + } + retryCount += 1; + if (retryCount < 100) { + window.setTimeout(retryRegistration, 50); + } + }; + retryRegistration(); + } })(window, document); diff --git a/assets/js/front-submit-pay-download.js b/assets/js/front-submit-pay-download.js index e01793a8..ddc820b3 100644 --- a/assets/js/front-submit-pay-download.js +++ b/assets/js/front-submit-pay-download.js @@ -6,7 +6,7 @@ (function () { 'use strict'; - var fields = ['url', 'extract_code', 'copy_key', 'copy_val', 'label', 'class']; + var fields = ['url', 'attachment_id', 'extract_code', 'copy_key', 'copy_val', 'label', 'class']; var buttonClasses = [ '', 'c-red', 'c-yellow', 'c-cyan', 'c-blue', 'c-green', 'c-purple', @@ -96,6 +96,7 @@ '
' + '
' + escapeHtml(i18n.downloadUrl || '下载地址') + '
' + '
' + + '' + '
' + '
' + escapeHtml(i18n.pasteLinkHint || '支持直接粘贴网盘分享链接,并自动识别提取码') + '
' + '
' + escapeHtml(i18n.resourceNote || '资源备注') + '
' + @@ -243,7 +244,10 @@ } }); modal.querySelector('[data-pay-download-submit]').addEventListener('click', saveResource); - inputMap.url.addEventListener('input', syncActions); + inputMap.url.addEventListener('input', function () { + inputMap.attachment_id.value = ''; + syncActions(); + }); inputMap.url.addEventListener('paste', function (event) { var text = event.clipboardData ? event.clipboardData.getData('text') : ''; if (!text) { @@ -260,35 +264,30 @@ inputMap.copy_key.value = i18n.extractCode || '提取码'; inputMap.copy_val.value = codeMatch[1]; } + inputMap.attachment_id.value = ''; syncActions(); }); - var canUpload = !!((cfg.uploads || {}).resource && typeof options.pickUpload === 'function' && typeof options.uploadFile === 'function'); - uploadButton.hidden = !canUpload; - if (canUpload) { - uploadButton.addEventListener('click', function () { - var toastId = 'aksrt-front-submit-resource-upload-toast'; - options.pickUpload('resource', '*/*').then(function (file) { - if (!file) { - return null; - } - uploadButton.disabled = true; - notify(i18n.uploading || '正在上传附件…', 'load', '', toastId); - return options.uploadFile('resource', file); - }).then(function (file) { - if (!file) { - return; - } - inputMap.url.value = file.url || ''; + var canUseMediaPicker = !!(window.AksrtSubmitMedia && typeof window.AksrtSubmitMedia.open === 'function'); + uploadButton.hidden = false; + uploadButton.addEventListener('click', function () { + if (!canUseMediaPicker) { + notify(i18n.mediaPickerUnavailable || '媒体选择器加载失败,请刷新页面后重试', 'danger'); + return; + } + window.AksrtSubmitMedia.open({ + type: 'file', + multiple: false, + allowExternal: false, + onSelect: function (item) { + if (!item) return; + inputMap.url.value = item.url || ''; + inputMap.attachment_id.value = String(item.attachment_id || item.id || 0); syncActions(); - notify(i18n.uploaded || '附件上传成功', 'success', 5, toastId); - }).catch(function (error) { - notify(error.message || i18n.error || '附件上传失败', 'danger', 5, toastId); - }).finally(function () { - uploadButton.disabled = false; - }); + notify(i18n.uploaded || '附件上传成功', 'success', 5, 'aksrt-front-submit-resource-upload-toast'); + }, }); - } + }); document.addEventListener('keydown', function (event) { if (!modal.hidden && event.key === 'Escape') { diff --git a/assets/js/front-submit.js b/assets/js/front-submit.js index bfc2c8ee..70f14183 100644 --- a/assets/js/front-submit.js +++ b/assets/js/front-submit.js @@ -21,6 +21,15 @@ return Array.prototype.slice.call((root || document).querySelectorAll(sel)); } + function escapeHtml(value) { + return String(value || '') + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } + function getEditorContent() { if (window.tinymce) { var ed = window.tinymce.get('post_content'); @@ -82,9 +91,10 @@ init: function () { this.form = document.getElementById('aksrt-submit-form'); - if (!this.form) { + if (!this.form || this.form.getAttribute('data-aksrt-submit-ready') === '1') { return; } + this.form.setAttribute('data-aksrt-submit-ready', '1'); this.bindDirty(); this.bindAutoHeight(); this.bindSubmitButtons(); @@ -258,19 +268,27 @@ if (d.time) { var timeEl = qs('.aksrt-submit-modified-time'); if (timeEl) { - timeEl.innerHTML = - '' + (i18n.lastSaved || 'Last saved: ') + d.time + ''; + timeEl.textContent = ''; + var timeBadge = document.createElement('span'); + timeBadge.className = 'badg'; + timeBadge.textContent = (i18n.lastSaved || '最后保存:') + d.time; + timeEl.appendChild(timeBadge); } } if (d.url) { var view = qs('.aksrt-submit-view-btn'); if (view) { - view.innerHTML = - ' ' + - (i18n.preview || 'Preview') + - ''; + view.textContent = ''; + var previewLink = document.createElement('a'); + previewLink.className = 'but c-blue'; + previewLink.target = '_blank'; + previewLink.rel = 'noopener'; + previewLink.href = String(d.url); + var previewIcon = document.createElement('i'); + previewIcon.className = 'fa fas fa-file-alt'; + previewLink.appendChild(previewIcon); + previewLink.appendChild(document.createTextNode(' ' + (i18n.preview || 'Preview'))); + view.appendChild(previewLink); } } notyf( @@ -398,16 +416,16 @@ } var html = ''; if (t === 'image' && d.url) { - html = ''; + html = ''; } else if (t === 'slide' && Array.isArray(d) && d[0] && d[0].url) { html = ''; } else if (t === 'video') { html = (d.pic - ? '' + ? '' : '') + ''; } @@ -418,41 +436,13 @@ } }, - uploadFile: function (kind, file) { - var upload = (cfg.uploads || {})[kind] || null; - if (!upload || !upload.url || !file) { - return Promise.reject(new Error(i18n.error || 'Upload unavailable')); + openMediaPicker: function (options) { + if (!window.AksrtSubmitMedia || typeof window.AksrtSubmitMedia.open !== 'function') { + notyf(i18n.mediaPickerUnavailable || '媒体选择器加载失败,请刷新页面后重试', 'danger'); + return false; } - if (upload.maxSize && file.size > upload.maxSize) { - return Promise.reject(new Error(i18n.fileTooLarge || '文件大小超过限制')); - } - var body = new FormData(); - body.append('file', file); - return fetch(upload.url, { - method: 'POST', - credentials: 'same-origin', - headers: { 'X-WP-Nonce': cfg.restNonce || '' }, - body: body, - }).then(function (response) { - return response.json().catch(function () { return {}; }).then(function (payload) { - if (!response.ok || !payload || !payload.success) { - throw new Error((payload && payload.message) || i18n.error || 'Upload failed'); - } - return payload; - }); - }); - }, - - pickUpload: function (kind, accept) { - return new Promise(function (resolve) { - var input = document.createElement('input'); - input.type = 'file'; - input.accept = accept; - input.addEventListener('change', function () { - resolve(input.files && input.files[0] ? input.files[0] : null); - }, { once: true }); - input.click(); - }); + window.AksrtSubmitMedia.open(options); + return true; }, bindFeatured: function () { @@ -473,54 +463,64 @@ return; } if (act === 'image') { - var imageToastId = 'aksrt-front-submit-featured-upload-toast'; - self.pickUpload('image', 'image/*').then(function (file) { - if (!file) return null; - notyf(i18n.uploading || '正在上传封面…', 'load', '', imageToastId); - return self.uploadFile('image', file); - }).then(function (file) { - if (!file) return; - self.setFeatured('image', { url: file.url, id: file.attachment_id }); - notyf(i18n.uploaded || '封面上传成功', 'success', 5, imageToastId); - }).catch(function (error) { - notyf(error.message || i18n.error || '封面上传失败', 'danger', 5, imageToastId); + self.openMediaPicker({ + type: 'image', + multiple: false, + allowExternal: false, + onSelect: function (item) { + if (!item) return; + self.setFeatured('image', { url: item.url || '', id: item.attachment_id || item.id || 0 }); + }, }); return; } if (act === 'slide') { - var slideToastId = 'aksrt-front-submit-slide-upload-toast'; - self.pickUpload('image', 'image/*').then(function (file) { - if (!file) return null; - notyf(i18n.uploading || '正在上传幻灯片封面…', 'load', '', slideToastId); - return self.uploadFile('image', file); - }).then(function (file) { - if (!file) return; - self.setFeatured('slide', [{ url: file.url, id: file.attachment_id }]); - notyf(i18n.uploaded || '幻灯片封面上传成功', 'success', 5, slideToastId); - }).catch(function (error) { - notyf(error.message || i18n.error || '幻灯片封面上传失败', 'danger', 5, slideToastId); + self.openMediaPicker({ + type: 'image', + multiple: true, + maxItems: 30, + allowExternal: false, + onSelect: function (items) { + var slides = (Array.isArray(items) ? items : []).map(function (item) { + return { url: item.url || '', id: item.attachment_id || item.id || 0 }; + }).filter(function (item) { return item.url || item.id; }); + if (slides.length) self.setFeatured('slide', slides); + }, }); return; } if (act === 'video') { - var url = window.prompt(i18n.videoUrl || 'Video URL'); - if (!url) { - return; - } - var videoToastId = 'aksrt-front-submit-video-cover-toast'; - self.pickUpload('image', 'image/*').then(function (file) { - if (!file) { - self.setFeatured('video', { url: url, pic: '' }); - return null; - } - notyf(i18n.uploading || '正在上传视频封面…', 'load', '', videoToastId); - return self.uploadFile('image', file); - }).then(function (file) { - if (!file) return; - self.setFeatured('video', { url: url, pic: file.url }); - notyf(i18n.uploaded || '视频封面上传成功', 'success', 5, videoToastId); - }).catch(function (error) { - notyf(error.message || i18n.error || '视频封面上传失败', 'danger', 5, videoToastId); + self.openMediaPicker({ + type: 'video', + multiple: false, + allowExternal: true, + allowEmbed: false, + onSelect: function (item) { + if (!item || !item.url) return; + var video = { + url: item.url, + pic: '', + pic_id: 0, + id: item.attachment_id || item.id || 0, + }; + self.setFeatured('video', video); + window.setTimeout(function () { + self.openMediaPicker({ + type: 'image', + multiple: false, + allowExternal: false, + title: i18n.pickVideoCover || '选择视频封面(可选)', + onSelect: function (cover) { + self.setFeatured('video', { + url: video.url, + pic: cover && cover.url ? cover.url : '', + pic_id: cover ? (cover.attachment_id || cover.id || 0) : 0, + id: video.id, + }); + }, + }); + }, 0); + }, }); } }); @@ -572,8 +572,6 @@ window.aksrtSubmitPayDownloads.init({ root: box, - pickUpload: this.pickUpload.bind(this), - uploadFile: this.uploadFile.bind(this), notify: notyf, markDirty: function () { App.isDirty = true; diff --git a/assets/js/mini-upload.js b/assets/js/mini-upload.js deleted file mode 100644 index 5490f34a..00000000 --- a/assets/js/mini-upload.js +++ /dev/null @@ -1,328 +0,0 @@ -/** - * AKSRT Mini Upload — 小型文件上传器 - * - * 提供拖拽上传、进度显示、预览功能。 - * 用于前台投稿、商品编辑等需要文件上传的页面。 - * - * @package AKSRT - */ - -(function () { - 'use strict'; - - /** - * 初始化小型上传器 - * - * @param {HTMLElement} container 上传器容器 - * @param {Object} options 配置项 - */ - function MiniUpload(container, options) { - if (!container) return; - - this.options = Object.assign({ - maxFileSize: 5 * 1024 * 1024, // 5MB - allowedTypes: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'], - multiple: false, - uploadUrl: '', - fieldName: 'file', - nonce: '', - onSelect: null, - onSuccess: null, - onError: null, - }, options || {}); - - this.container = container; - this.files = []; - this.init(); - } - - MiniUpload.prototype.init = function () { - var self = this; - - // 创建文件输入 - this.input = document.createElement('input'); - this.input.type = 'file'; - this.input.accept = this.options.allowedTypes.join(','); - this.input.multiple = this.options.multiple; - this.input.style.display = 'none'; - this.container.appendChild(this.input); - - // 创建拖拽区域 - this.dropzone = document.createElement('div'); - this.dropzone.className = 'aksrt-mini-upload__dropzone'; - this.dropzone.innerHTML = - '
' + - '
点击或拖拽文件到此处上传
' + - '
支持 ' + this.options.allowedTypes.map(function (t) { - return t.split('/')[1].toUpperCase(); - }).join(', ') + ',最大 ' + Math.round(this.options.maxFileSize / 1024 / 1024) + 'MB
'; - this.container.appendChild(this.dropzone); - - // 创建预览区域 - this.preview = document.createElement('div'); - this.preview.className = 'aksrt-mini-upload__preview'; - this.container.appendChild(this.preview); - - // 事件绑定 - this.dropzone.addEventListener('click', function () { - self.input.click(); - }); - - this.dropzone.addEventListener('dragover', function (e) { - e.preventDefault(); - self.dropzone.classList.add('aksrt-mini-upload__dropzone--dragover'); - }); - - this.dropzone.addEventListener('dragleave', function () { - self.dropzone.classList.remove('aksrt-mini-upload__dropzone--dragover'); - }); - - this.dropzone.addEventListener('drop', function (e) { - e.preventDefault(); - self.dropzone.classList.remove('aksrt-mini-upload__dropzone--dragover'); - if (e.dataTransfer.files.length > 0) { - self.handleFiles(e.dataTransfer.files); - } - }); - - this.input.addEventListener('change', function () { - if (self.input.files.length > 0) { - self.handleFiles(self.input.files); - } - }); - }; - - MiniUpload.prototype.handleFiles = function (fileList) { - var self = this; - var files = Array.prototype.slice.call(fileList); - - files.forEach(function (file) { - // 验证文件类型 - if (self.options.allowedTypes.length > 0 && self.options.allowedTypes.indexOf(file.type) === -1) { - self.showError('不支持的文件类型: ' + file.type); - return; - } - - // 验证文件大小 - if (file.size > self.options.maxFileSize) { - self.showError('文件大小超过限制: ' + Math.round(file.size / 1024 / 1024) + 'MB'); - return; - } - - self.files.push(file); - self.addPreview(file); - - if (typeof self.options.onSelect === 'function') { - self.options.onSelect(file); - } - - // 如果有上传 URL,自动上传 - if (self.options.uploadUrl) { - self.uploadFile(file); - } - }); - }; - - MiniUpload.prototype.addPreview = function (file) { - var self = this; - var item = document.createElement('div'); - item.className = 'aksrt-mini-upload__item'; - - if (file.type.startsWith('image/')) { - var reader = new FileReader(); - reader.onload = function (e) { - item.innerHTML = - '' + - '
' + - '' + file.name + '' + - '' + self.formatSize(file.size) + '' + - '
' + - '' + - '
'; - self.bindRemove(item, file); - }; - reader.readAsDataURL(file); - } else { - item.innerHTML = - '
' + - '
' + - '' + file.name + '' + - '' + self.formatSize(file.size) + '' + - '
' + - '' + - '
'; - this.bindRemove(item, file); - } - - this.preview.appendChild(item); - }; - - MiniUpload.prototype.bindRemove = function (item, file) { - var self = this; - var removeBtn = item.querySelector('.aksrt-mini-upload__remove'); - if (removeBtn) { - removeBtn.addEventListener('click', function () { - var index = self.files.indexOf(file); - if (index > -1) self.files.splice(index, 1); - item.remove(); - }); - } - }; - - MiniUpload.prototype.uploadFile = function (file) { - var self = this; - var formData = new FormData(); - formData.append(this.options.fieldName, file); - - if (this.options.nonce) { - formData.append('_wpnonce', this.options.nonce); - } - - var xhr = new XMLHttpRequest(); - xhr.open('POST', this.options.uploadUrl, true); - - // 进度更新 - var item = this.preview.lastElementChild; - var progressBar = item ? item.querySelector('.aksrt-mini-upload__progress-bar') : null; - - xhr.upload.onprogress = function (e) { - if (e.lengthComputable && progressBar) { - var percent = Math.round((e.loaded / e.total) * 100); - progressBar.style.width = percent + '%'; - } - }; - - xhr.onload = function () { - if (xhr.status >= 200 && xhr.status < 300) { - try { - var response = JSON.parse(xhr.responseText); - if (typeof self.options.onSuccess === 'function') { - self.options.onSuccess(response, file); - } - if (item) item.classList.add('aksrt-mini-upload__item--success'); - } catch (e) { - self.showError('上传响应解析失败'); - } - } else { - self.showError('上传失败: HTTP ' + xhr.status); - } - }; - - xhr.onerror = function () { - self.showError('网络错误,上传失败'); - if (item) item.classList.add('aksrt-mini-upload__item--error'); - }; - - xhr.send(formData); - }; - - MiniUpload.prototype.showError = function (msg) { - if (typeof this.options.onError === 'function') { - this.options.onError(msg); - } - console.error('[AKSRT MiniUpload]', msg); - }; - - MiniUpload.prototype.formatSize = function (bytes) { - if (bytes < 1024) return bytes + ' B'; - if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB'; - return (bytes / (1024 * 1024)).toFixed(1) + ' MB'; - }; - - MiniUpload.prototype.getFiles = function () { - return this.files; - }; - - MiniUpload.prototype.clear = function () { - this.files = []; - this.preview.innerHTML = ''; - this.input.value = ''; - }; - - /** - * 分片上传大文件 - * @param {File} file - 要上传的文件 - * @param {Object} opts - { chunkSize, uploadUrl, fieldName, nonce, onProgress, onComplete, onError } - */ - MiniUpload.prototype.uploadChunked = function (file, opts) { - var chunkSize = (opts.chunkSize || 2) * 1024 * 1024; // default 2MB - var totalChunks = Math.ceil(file.size / chunkSize); - var currentChunk = 0; - var fileId = file.name + '-' + file.size + '-' + file.lastModified; - - function uploadNext() { - if (currentChunk >= totalChunks) { - if (opts.onComplete) opts.onComplete({ fileId: fileId, totalChunks: totalChunks }); - return; - } - - var start = currentChunk * chunkSize; - var end = Math.min(start + chunkSize, file.size); - var blob = file.slice(start, end); - - var formData = new FormData(); - formData.append(opts.fieldName || 'file', blob, file.name); - formData.append('chunk', currentChunk); - formData.append('total_chunks', totalChunks); - formData.append('file_id', fileId); - formData.append('file_name', file.name); - formData.append('file_size', file.size); - if (opts.nonce) formData.append('_ajax_nonce', opts.nonce); - - var xhr = new XMLHttpRequest(); - xhr.open('POST', opts.uploadUrl, true); - - xhr.upload.onprogress = function (e) { - if (e.lengthComputable && opts.onProgress) { - var chunkProgress = e.loaded / e.total; - var totalProgress = (currentChunk + chunkProgress) / totalChunks; - opts.onProgress(totalProgress, currentChunk, totalChunks); - } - }; - - xhr.onload = function () { - if (xhr.status >= 200 && xhr.status < 300) { - currentChunk++; - uploadNext(); - } else { - if (opts.onError) opts.onError('上传失败: HTTP ' + xhr.status); - } - }; - - xhr.onerror = function () { - if (opts.onError) opts.onError('网络错误'); - }; - - xhr.send(formData); - } - - uploadNext(); - }; - - /** - * 快速文件标识(替代 spark-md5,用文件名+大小+最后修改时间生成简易 hash) - */ - MiniUpload.prototype.getFileId = function (file) { - return file.name + '-' + file.size + '-' + file.lastModified; - }; - - // 自动初始化 - function autoInit() { - document.querySelectorAll('[data-aksrt-mini-upload]').forEach(function (el) { - if (el.dataset.miniUploadInit) return; - el.dataset.miniUploadInit = '1'; - - var options = {}; - try { - options = JSON.parse(el.dataset.aksrtMiniUpload || '{}'); - } catch (e) {} - - new MiniUpload(el, options); - }); - } - - jQuery(document).off('auto_fun.aksrt-mini-upload').on('auto_fun.aksrt-mini-upload', autoInit); - - // 暴露到全局 - window.AksrtMiniUpload = MiniUpload; -})(); diff --git a/assets/js/runtime/gutenberg-extend.js b/assets/js/runtime/gutenberg-extend.js index f34f27b2..ec93dd35 100644 --- a/assets/js/runtime/gutenberg-extend.js +++ b/assets/js/runtime/gutenberg-extend.js @@ -446,7 +446,7 @@ type: 'string', source: 'attribute', selector: '.file-download-btn', - attribute: 'data-download-file', + attribute: 'data-aksrt-file-id', default: 0, }, url: { @@ -921,7 +921,7 @@ href: url, }; if (file_id) { - a_attr['data-download-file'] = file_id; + a_attr['data-aksrt-file-id'] = file_id; } var desc_lists = desc.map(function (item) { diff --git a/assets/js/runtime/gutenberg-extend.min.js b/assets/js/runtime/gutenberg-extend.min.js index bf71ac34..e6a21602 100644 --- a/assets/js/runtime/gutenberg-extend.min.js +++ b/assets/js/runtime/gutenberg-extend.min.js @@ -1 +1 @@ -!function(e,t,a){e(document).ready(function(){console.log(Z("gutenberg_editor_enhanced"));var l=t.blocks,r=t.components,n=t.element,o=t.blockEditor?t.blockEditor:t.editor,i=t.richText.registerFormatType,s=t.data,c=s.dispatch,u=s.select,b=c("core/block-editor")?c("core/block-editor"):c("core/editor"),d=u("core/block-editor")?u("core/block-editor"):u("core/editor"),g=d.getBlockOrder,_=d.getBlock,p=b.insertBlock,m=b.removeBlock,v=b.updateBlockAttributes,h=n.createElement,f=l.registerBlockType,y=l.createBlock,k=o.InnerBlocks,N=o.RichTextToolbarButton,C=n.Component,w=t.dom.getRectangleFromRange,x=r.Popover,z=r.Button,q=o.RichText,M=o.PlainText,j=o.MediaUpload,A=n.Fragment,H=o.InspectorControls,V=r.PanelBody,S=r.ClipboardButton,L=r.TextControl,B=r.RadioControl,T=r.Toolbar,F=r.SelectControl,P=r.ToggleControl,R=r.RangeControl,I=r.DropdownMenu,O=o.BlockControls,E=o.AlignmentToolbar,D=a.lodash||a._,G=a.wpApiSettings,K=D.times,$=D.debounce;function Z(e){var t=a.aksrt_block_var&&a.aksrt_block_var.i18n;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e}function J(e){var t=Array.prototype.slice.call(arguments,1),a=Z(e),l=0;return a.replace(/%(\d+\$)?s/g,function(e,a){var r=a?parseInt(a,10)-1:l++;return void 0!==t[r]&&null!==t[r]?t[r]:e})}var Q={},U="#1fbc45",W=function(e){return{viewBox:e=e||"0 0 1024 1024",className:"svg-icon",xmlns:X}},X="http://www.w3.org/2000/svg";Q.legacy=h("svg",{width:"16px",height:"16px",viewBox:"0 0 80 90",className:"svg-icon mb10",xmlns:X,fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414"},h("g",{fillRule:"nonzero",transform:"scale(0.19785394)"},h("path",{d:"m 408.68862,333.8044 0.009,0.59315 0.004,0.29795 c 0.18694,71.91774 -59.58485,130.93907 -134.53126,132.29044 -0.85543,0.0154 -1.71097,0.0231 -2.56654,0.0231 H 21.034693 C 11.007191,467.00905 2.5761396,460.42672 0.14656613,451.50411 L 338.63176,215.013 c 45.60925,25.97569 68.96153,65.57282 70.05686,118.7914 z M 231.25625,0 C 278.01331,0 321.188,23.909861 344.73248,62.682399 L 0,303.53751 V 20.793975 C 0,9.3097796 9.6674353,0 21.592821,0 Z",fill:U}))),Q.productbox=h("svg",W(),h("path",{d:"M975.36 400.64A88.32 88.32 0 0 0 887.68 320h-57.6c0-176.64-142.72-320-318.08-320-175.36 0-318.08 143.36-318.08 320h-57.6c-45.44 0-83.2 34.56-87.68 80.64l-44.16 446.08c-4.48 45.44 10.24 90.88 40.96 124.8 30.08 33.28 72.96 52.48 118.4 52.48h696.32c45.44 0 88.96-19.2 119.04-53.12 30.08-33.92 45.44-79.36 40.96-124.8l-44.8-445.44zM512 64c140.16 0 254.08 114.56 254.08 256H257.92c0-141.44 113.92-256 254.08-256z m419.84 864c-18.56 20.48-44.16 32-71.68 32H163.84c-27.52 0-53.12-11.52-71.68-32-18.56-20.48-27.52-47.36-24.96-75.52l44.16-446.08c1.28-12.8 12.16-22.4 24.96-22.4h57.6v96c0 17.92 14.08 32 32 32 17.28 0 32-14.08 32-32V384h508.8v96c0 17.92 14.08 32 32 32 17.28 0 32-14.08 32-32V384h57.6c12.8 0 23.68 9.6 24.96 22.4l44.16 446.08c1.92 28.16-7.04 54.4-25.6 75.52z",fill:U}),h("path",{d:"M752 679.04a536.768 536.768 0 0 1-480 0 31.744 31.744 0 0 0-42.88 14.08c-7.68 16-1.28 35.2 14.08 42.88 83.84 42.24 176.64 63.36 268.8 63.36 92.16 0 184.32-21.12 268.8-63.36 16-7.68 21.76-26.88 14.08-42.88a31.744 31.744 0 0 0-42.88-14.08z",fill:U})),Q.video=h("svg",W(),h("path",{d:"M704 874.666667H128c-46.933333 0-85.333333-38.4-85.333333-85.333334V234.666667c0-46.933333 38.4-85.333333 85.333333-85.333334h576c46.933333 0 85.333333 38.4 85.333333 85.333334v554.666666c0 46.933333-38.4 85.333333-85.333333 85.333334zM128 213.333333c-12.8 0-21.333333 8.533333-21.333333 21.333334v554.666666c0 12.8 8.533333 21.333333 21.333333 21.333334h576c12.8 0 21.333333-8.533333 21.333333-21.333334V234.666667c0-12.8-8.533333-21.333333-21.333333-21.333334H128z",fill:U}),h("path",{d:"M277.333333 490.666667c-59.733333 0-106.666667-46.933333-106.666666-106.666667s46.933333-106.666667 106.666666-106.666667 106.666667 46.933333 106.666667 106.666667-46.933333 106.666667-106.666667 106.666667z m0-149.333334c-23.466667 0-42.666667 19.2-42.666666 42.666667s19.2 42.666667 42.666666 42.666667 42.666667-19.2 42.666667-42.666667-19.2-42.666667-42.666667-42.666667zM938.666667 800c-8.533333 0-14.933333-2.133333-21.333334-6.4L725.333333 682.666667V341.333333l192-110.933333c10.666667-6.4 21.333333-6.4 32-4.266667 10.666667 2.133333 21.333333 8.533333 25.6 19.2 4.266667 6.4 6.4 14.933333 6.4 21.333334v490.666666c0 23.466667-19.2 42.666667-42.666666 42.666667z m-149.333334-153.6l128 74.666667V302.933333l-128 74.666667v268.8z",fill:U})),Q.iframe=h("svg",W(),h("path",{d:"M885.76 52.053333h-364.8c-47.786667 0-86.186667 38.826667-86.186667 86.186667v82.346667H139.093333c-48.213333 0-87.466667 39.253333-87.466666 87.04v576.426666c0 48.213333 39.253333 87.466667 87.466666 87.466667h576.426667c48.213333 0 87.04-39.253333 87.04-87.466667v-294.826666h82.773333c47.786667 0 86.186667-38.826667 86.186667-86.186667V138.666667c0.426667-47.786667-37.973333-86.613333-85.76-86.613334z m-151.04 832.426667c0 10.666667-8.533333 19.2-19.2 19.2H139.093333c-10.666667 0-19.2-8.533333-19.2-19.2V308.053333c0-10.666667 8.533333-19.2 19.2-19.2h295.253334v214.186667c0 12.373333 2.56 24.32 7.68 34.986667L255.146667 725.333333v-68.693333c0-18.773333-15.36-34.133333-34.133334-34.133333s-34.133333 15.36-34.133333 34.133333v151.04a33.109333 33.109333 0 0 0 9.386667 23.466667c0.426667 0.426667 0.426667 0.426667 0.426666 0.853333 0.426667 0.426667 0.853333 0.426667 1.28 0.853333 2.986667 2.56 5.973333 5.12 9.813334 6.4 4.266667 1.706667 8.533333 2.56 13.226666 2.56h151.04c18.773333 0 34.133333-15.36 34.133334-34.133333s-15.36-34.133333-34.133334-34.133333H303.36l189.013333-189.013334c8.96 2.986667 18.346667 5.12 28.586667 5.12h213.76v294.826667z m168.96-381.013333c0 9.813333-8.106667 17.92-17.92 17.92h-364.8c-9.813333 0-17.92-8.106667-17.92-17.92V138.666667c0-9.813333 8.106667-17.92 17.92-17.92h364.8c9.813333 0 17.92 8.106667 17.92 17.92v364.8z",fill:U})),Q.iframeseries=h("svg",W(),h("path",{d:"m 662.88377,441.87421 a 42.666667,42.666667 0 0 1 -72.87235,-31.63569 l 7.28782,-180.63176 a 43.235556,43.235556 0 0 1 42.55618,-42.72389 42.666667,42.666667 0 0 1 42.72388,42.55617 l -7.2815,183.84988 a 40.96,40.96 0 0 1 -12.41403,28.58529 z",fill:U}),h("path",{d:"m 843.88852,434.27746 a 42.097778,42.097778 0 0 1 -28.53625,12.52636 l -181.00475,7.59675 a 42.666667,42.666667 0 0 1 -4.18877,-84.46761 l 180.60327,-7.19369 a 42.666667,42.666667 0 0 1 32.32355,72.34431 z",fill:U}),h("path",{d:"M 873.65726,230.27007 662.88377,441.87421 a 42.666668,42.666668 0 0 1 -60.45832,-60.221 L 813.19894,170.04908 a 42.666667,42.666667 0 0 1 60.45832,60.22099 z",fill:U}),h("path",{d:"m 922.2479,554.42362 0.64665,328.81714 a 42.097778,42.097778 0 0 1 -42.58268,42.75049 l -735.00302,1.44546 a 42.097778,42.097778 0 0 1 -42.75049,-42.58267 l -1.17919,-599.60773 a 42.666667,42.666667 0 0 1 42.58268,-42.75049 l 302.6483,-0.59519 a 42.666667,42.666667 0 1 1 0.16782,85.33316 l -259.98172,0.51129 1.00689,511.99901 649.66986,-1.27765 -0.55939,-284.44389 a 42.666667,42.666667 0 1 1 85.33317,-0.16782 z",fill:U}),h("path",{d:"m 705.18337,682.28186 a 42.097778,42.097778 0 0 1 -42.58268,42.75049 l -341.33267,0.67126 a 42.666667,42.666667 0 0 1 -0.16782,-85.33316 l 341.33268,-0.67127 a 42.666667,42.666667 0 0 1 42.75049,42.58268 z M 534.15231,497.16007 a 42.097778,42.097778 0 0 1 -42.58268,42.75049 L 320.9033,540.2462 a 42.666667,42.666667 0 1 1 -0.16782,-85.33317 l 170.66634,-0.33564 a 42.666667,42.666667 0 0 1 42.75049,42.58268 z",fill:U})),Q.feature=h("svg",W(),h("path",{d:"M833.176 606.564c37.737-60.688 59.927-131.977 59.927-208.47 0-218.921-178.605-397.021-398.09-397.021-219.534 0-398.178 178.1-398.178 397.021 0 87.873 29.126 168.877 77.787 234.72L30.118 883.48l156.358 11.582L275.333 1024l136.88-237.615c26.767 5.693 54.414 8.782 82.806 8.782 38.717 0 76.062-5.787 111.49-16.139L747.663 1024l88.858-128.938 156.314-11.582-159.659-276.916zM362.37 772.156L271.496 929.8l-57.172-83.017-100.66-7.458 95.25-165.296c0.79 0.832 1.719 1.474 2.509 2.307 9.742 9.86 19.876 19.33 30.555 28.111 2.364 1.917 4.918 3.581 7.283 5.448 8.902 6.966 18.004 13.636 27.45 19.872 3.641 2.401 7.384 4.463 11.07 6.72 9.104 5.542 18.353 10.794 27.9 15.603 3.002 1.57 6.05 2.995 9.154 4.414a397.407 397.407 0 0 0 34.93 14.575c0.885 0.342 1.72 0.782 2.605 1.078z m43.495-39.2a355.38 355.38 0 0 1-51.657-18.007 8.63 8.63 0 0 0-0.79-0.346c-15.4-6.822-30.112-14.916-44.236-23.843-1.62-1.035-3.344-1.967-4.92-2.995-13.377-8.731-26.027-18.592-38.076-29.146a321.702 321.702 0 0 1-7.632-6.916c-11.853-10.988-23.17-22.664-33.55-35.424-48.562-59.66-77.789-135.564-77.789-218.185 0-191.2 156.018-346.781 347.799-346.781 191.737 0 347.704 155.58 347.704 346.781 0 73.108-22.88 140.862-61.749 196.844-8.705 12.509-18.347 24.336-28.633 35.57-2.263 2.503-4.426 5.006-6.74 7.408-11.461 11.826-23.669 22.916-36.655 33.023-1.379 1.078-2.807 2.06-4.185 3.139-28.487 21.441-60.174 38.76-94.022 50.682-1.72 0.587-3.394 1.273-5.115 1.865l-8.611 2.995a347.098 347.098 0 0 1-101.994 15.307c-30.847 0-60.662-4.42-89.149-11.972z m402.807 113.826l-57.17 83.017-96.925-168.19c13.58-5.938 26.711-12.76 39.457-20.167 1.625-0.934 3.198-1.917 4.773-2.895 10.773-6.43 21.154-13.346 31.193-20.703a354.339 354.339 0 0 0 7.971-5.94c8.657-6.67 16.925-13.686 24.992-21.05 3.15-2.843 6.298-5.542 9.345-8.435 7.53-7.313 14.616-15.011 21.507-22.86 2.36-2.654 5.064-5.006 7.327-7.754L909.29 839.324l-100.617 7.458z",fill:U}),h("path",{d:"M654.672 637.872l-30.548-177.414 129.3-125.559-178.65-25.904-79.71-161.369-79.95 161.369-178.693 25.904 129.343 125.56-30.503 177.361 159.753-83.753 159.658 83.805z m-309.915-267.94l103.814-15.016 46.398-93.76 46.347 93.76 103.765 15.017L570 442.889l17.76 103.033-92.74-48.671-92.845 48.721 17.713-103.083-75.13-72.956z",fill:U})),Q.biaoti=h("svg",W(),h("path",{d:"M203.127 1023.991a143.334 143.334 0 0 1-109.74-49.27 154.98 154.98 0 0 1-38.073-100.782V160.854A165.73 165.73 0 0 1 225.074 0.052h573.783a165.73 165.73 0 0 1 169.76 160.802V873.94a139.302 139.302 0 0 1-6.718 44.792 137.063 137.063 0 0 1-91.823 92.27 154.532 154.532 0 0 1-143.334-25.978L583.857 873.49a89.584 89.584 0 0 0-105.261-4.479L290.023 997.564a158.115 158.115 0 0 1-86.896 26.427z m21.948-961.23a102.573 102.573 0 0 0-106.605 98.093V873.94a89.584 89.584 0 0 0 22.396 60.021 86.448 86.448 0 0 0 113.771 11.646L443.211 817.5a151.396 151.396 0 0 1 179.167 6.72L763.472 936.2a93.167 93.167 0 0 0 85.552 15.229 77.938 77.938 0 0 0 52.406-51.959 83.76 83.76 0 0 0 3.584-25.53V160.853A102.573 102.573 0 0 0 798.857 62.76zM377.367 152.344h268.75q44.792 0 44.792 44.792 0 44.791-44.792 44.791h-268.75q-44.792 0-44.792-44.791 0-44.792 44.792-44.792z",fill:U})),Q.postsbox=h("svg",W(),h("path",{d:"M544.256 887.97866668c-9.728 0-19.456-2.56-28.16-8.192-16.896-10.24-27.136-28.16-26.624-48.128V269.99466668c0-24.576 13.824-47.616 35.84-58.368 117.76-60.416 260.608-90.112 423.936-87.04 35.84 1.024 65.024 30.208 65.024 66.048V731.30666668c0 33.792-25.088 61.44-58.88 65.024l-20.992 2.56c-141.312 15.36-263.168 29.184-364.032 82.944-8.192 4.096-17.408 6.144-26.112 6.144zM928.768 175.78666668c-146.432 0-274.432 27.648-380.416 81.92-4.608 2.56-7.68 7.168-7.68 12.8v562.688c0 1.536 0.512 2.56 2.048 3.584s2.56 0.512 3.072 0h0.512c109.568-58.368 236.032-72.192 382.976-88.576l20.992-2.56c7.68-0.512 13.312-6.656 13.312-13.824V190.63466668c0-8.192-6.656-14.848-14.848-14.848h-19.968z",fill:U}),h("path",{d:"M487.424 889.51466668c-8.704 0-17.408-2.048-25.6-6.656C358.4 827.05066668 232.448 813.73866668 87.04 797.86666668l-13.312-1.536c-33.28-3.072-58.368-30.72-58.368-64.512V191.14666668c0-35.328 29.184-65.024 65.024-66.048 163.84-2.56 306.688 26.624 424.448 87.552 21.504 10.752 35.328 33.792 35.328 57.856V836.26666668c0 18.944-9.728 36.352-26.112 46.08-8.192 4.608-17.408 7.168-26.624 7.168z m-386.56-713.216H81.408c-8.192 0-14.848 6.656-14.848 14.848v540.672c0 7.168 5.632 13.312 12.8 13.824l13.312 1.536c151.04 15.872 281.088 30.208 393.728 90.624h0.512c0.512 0.512 1.024 0.512 1.536 0s1.024-1.024 1.024-1.536V270.50666668c0-5.12-3.072-10.24-7.168-12.288-106.496-54.784-234.496-81.92-381.44-81.92z",fill:U}),h("path",{d:"M386.56 416.93866668c-3.072 0-6.656-0.512-9.728-2.048-67.584-27.136-136.704-40.96-204.288-40.96-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6c74.24 0 149.504 14.848 223.744 45.056 13.312 5.12 19.456 19.968 14.336 33.28-4.096 9.728-13.824 15.872-24.064 15.872z m0 171.52c-3.072 0-6.656-0.512-9.728-2.048-67.584-27.136-136.704-40.96-204.288-40.96-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6c74.24 0 149.504 14.848 223.744 45.056 13.312 5.12 19.456 19.968 14.336 33.28-4.096 9.728-13.824 15.872-24.064 15.872z m256.512-171.52c-10.24 0-19.968-6.144-23.552-15.872-5.12-13.312 1.024-28.16 14.336-33.28 73.728-29.696 148.992-45.056 223.744-45.056 14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6c-68.096 0-136.704 13.824-204.288 40.96-3.584 1.536-7.168 2.048-10.24 2.048z m0 171.52c-10.24 0-19.968-6.144-23.552-15.872-5.12-13.312 1.024-28.16 14.336-33.28 73.728-29.696 148.992-45.056 223.744-45.056 14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6c-68.096 0-136.704 13.824-204.288 40.96-3.584 1.536-7.168 2.048-10.24 2.048z",fill:U})),Q.postslists=h("svg",W(),h("path",{d:"M154 63c38.585-3.549 87.825-1 131-1h324c21.986 0 46.771-2.819 66 0 11.027 1.617 26.985 22.985 38 34 70.388 70.388 142.474 141.474 215 214 11.001 11.001 31.66 25.64 34 37 4.283 20.798 0 51.069 0 73 0 147.213 2.939 289.276 0 438-1.354 68.465-45.274 104-114 104H265c-47.349 0-105.861 6.086-139-7-35.031-13.833-58.411-40.73-63-83-4.718-43.462-1-90.155-1-144V217c0-22.874-2.529-48.263 1-71 7.309-47.087 44.564-78.729 91-83z m-12 128v598c0 25.297-4.657 76.62 5 87 10.792 11.601 61.731 6 86 6h555c24.86 0 76.86 5.363 88-5 9.054-8.424 6-40.445 6-60V442c0-21.463 3.845-47.044 0-63-2.278-9.453-19.905-22.905-28-31-61.891-61.891-119.072-117.072-180-178-9.53-9.53-21.852-26.199-32-28-16.563-2.939-39.449 0-60 0H219c-20.042 0-48.823-2.389-62 1-18.908 4.862-15 23.169-15 48zM237 249c25.855-3.795 59.35-1 86-1h212c34.246 0 63 4.409 63 40 0 48.994-57.106 40-110 40H311c-52.225 0-111.121 9.443-109-42 0.828-20.071 15.229-34.098 35-37zM237 474c41.5-6.092 97.15-1 142-1h352c23.335 0 50.952-3.611 67 3 31.346 12.914 28.819 62.127 0 74-14.449 5.953-46.639 3-70 3H292c-46.79 0-91.773 4.328-90-42 0.76-19.867 15.16-34.087 35-37zM237 698c41.5-6.092 97.15-1 142-1h352c23.335 0 50.952-3.611 67 3 31.346 12.914 28.819 62.127 0 74-14.449 5.953-46.639 3-70 3H292c-46.79 0-91.773 4.328-90-42 0.76-19.867 15.16-34.088 35-37z",fill:U})),Q.enlighter=h("svg",W(),h("path",{d:"M512 0a512 512 0 1 1 0 1024A512 512 0 0 1 512 0z m0 73.142857a438.857143 438.857143 0 1 0 0 877.714286A438.857143 438.857143 0 0 0 512 73.142857z m50.834286 150.674286a36.571429 36.571429 0 0 1 29.622857 42.422857l-88.868572 504.246857a36.571429 36.571429 0 0 1-72.045714-12.726857l88.868572-504.246857a36.571429 36.571429 0 0 1 42.422857-29.622857zM341.430857 382.317714a36.571429 36.571429 0 0 1 0 51.785143l-77.531428 77.531429 77.531428 77.531428a36.571429 36.571429 0 0 1-51.712 51.785143L186.221714 537.453714a36.571429 36.571429 0 0 1 0-51.712l103.497143-103.497143a36.571429 36.571429 0 0 1 51.712 0z m388.827429-4.169143l5.12 4.169143 103.424 103.497143a36.571429 36.571429 0 0 1 4.242285 46.665143l-4.242285 5.046857-103.424 103.424a36.571429 36.571429 0 0 1-55.954286-46.665143l4.169143-5.12 77.604571-77.531428-77.531428-77.531429a36.571429 36.571429 0 0 1 46.592-55.954286z",fill:U})),Q.buttons=h("svg",W(),h("path",{d:"M769 468.7c5.5-22.1 11.1-49.7 11.1-77.4 0-44.2-11.1-88.4-27.6-127.1-16.6-38.7-38.7-71.9-71.9-105-27.6-27.6-60.8-49.7-99.5-66.3-38.7-16.6-82.9-27.7-127.1-27.7s-88.4 11.1-127.1 27.6-77.4 38.7-105 71.9c-27.6 27.6-55.3 66.3-71.9 105s-22.1 77.4-22.1 127.1c0 38.7 5.5 71.9 16.6 105 11.1 33.2 27.6 60.8 49.7 88.4s44.2 49.7 77.4 71.9c27.6 22.1 60.8 33.2 94 44.2V584.8c-38.7-16.6-66.3-44.2-88.4-77.4-22.1-33.2-33.2-71.9-33.2-110.6 0-27.6 5.5-55.3 16.6-82.9s27.6-49.7 44.2-66.3c16.6-22.1 38.7-33.2 66.3-44.2 27.6-11.1 55.3-16.6 82.9-16.6s55.3 5.5 82.9 16.6c22.1 11.1 44.2 22.1 60.8 44.2 16.6 16.6 33.2 38.7 44.2 66.3 11.1 27.6 16.6 55.3 16.6 82.9v5.5c0 0.1 110.5 66.4 110.5 66.4z",fill:U}),h("path",{d:"M426.3 866.7c11.1-16.6 27.6-33.2 44.2-49.7 11.1-11.1 27.6-27.6 49.7-44.2 16.6-16.6 38.7-27.6 60.8-44.2L669.5 922c11.1 16.6 22.1 27.6 44.2 33.2 16.6 5.5 38.7 5.5 55.3-5.5 16.6-11.1 27.6-22.1 33.2-44.2 5.5-16.6 5.5-38.7-5.5-55.3L686.1 684.3c27.6-5.5 49.7-11.1 77.4-16.6 27.6-5.5 49.7-5.5 66.3-5.5h66.3L420.8 291.8l5.5 574.9z",fill:U})),Q.tabs=h("svg",W(),h("path",{d:"M420.608 489.984a15.104 15.104 0 0 1 4.864 11.776 14.848 14.848 0 0 1-4.864 11.776 17.664 17.664 0 0 1-12.288 4.352h-44.288V665.6a15.104 15.104 0 0 1-5.376 12.032 18.176 18.176 0 0 1-13.056 5.12 17.664 17.664 0 0 1-13.056-5.12 15.872 15.872 0 0 1-5.12-12.032v-147.712h-44.032a16.64 16.64 0 0 1-12.288-4.608 14.848 14.848 0 0 1-4.864-11.776 14.848 14.848 0 0 1 4.864-11.52 17.152 17.152 0 0 1 12.288-4.352H409.6a16.384 16.384 0 0 1 11.008 4.352zM557.824 534.016a15.872 15.872 0 0 1 4.864 12.288V665.6a15.616 15.616 0 0 1-4.864 12.032 15.872 15.872 0 0 1-12.032 5.12 16.64 16.64 0 0 1-12.032-4.864 17.664 17.664 0 0 1-4.864-12.032 61.952 61.952 0 0 1-44.032 19.712 64.512 64.512 0 0 1-35.328-9.984 69.376 69.376 0 0 1-25.6-27.904 92.16 92.16 0 0 1 0-80.384 67.072 67.072 0 0 1 25.6-27.904 61.696 61.696 0 0 1 34.304-9.984 66.816 66.816 0 0 1 45.312 17.408 16.64 16.64 0 0 1 4.864-12.288 17.408 17.408 0 0 1 24.064 0zM518.912 640a55.04 55.04 0 0 0 0-67.328 36.864 36.864 0 0 0-29.952-13.568 36.352 36.352 0 0 0-29.44 13.568 51.2 51.2 0 0 0-11.52 33.536 51.2 51.2 0 0 0 11.264 33.792 37.632 37.632 0 0 0 29.696 13.312 38.4 38.4 0 0 0 29.952-13.312zM712.448 539.136a70.4 70.4 0 0 1 25.6 27.648 86.016 86.016 0 0 1 9.216 40.192 87.04 87.04 0 0 1-9.216 40.448 68.608 68.608 0 0 1-25.6 27.904 61.696 61.696 0 0 1-34.304 9.984 57.6 57.6 0 0 1-25.6-5.632 61.952 61.952 0 0 1-19.712-13.312v1.792a16.64 16.64 0 0 1-16.896 17.152 15.616 15.616 0 0 1-12.032-4.864 16.128 16.128 0 0 1-4.864-12.288v-176.64a16.64 16.64 0 0 1 4.864-12.288 17.408 17.408 0 0 1 24.064 0 16.64 16.64 0 0 1 4.864 12.288v58.624a55.296 55.296 0 0 1 18.688-14.592 53.248 53.248 0 0 1 25.6-6.4 64.512 64.512 0 0 1 35.328 9.984z m-9.984 102.4a51.2 51.2 0 0 0 11.52-33.792 51.2 51.2 0 0 0-11.264-33.536 40.192 40.192 0 0 0-59.648 0 55.04 55.04 0 0 0 0 67.328 37.632 37.632 0 0 0 29.952 13.568 37.12 37.12 0 0 0 29.44-15.104zM857.088 337.408V281.6a76.8 76.8 0 0 0-76.8-76.8H402.176a76.8 76.8 0 0 0-57.088-25.6H206.336a76.8 76.8 0 0 0-76.8 76.8v512a76.8 76.8 0 0 0 76.8 76.8h622.592a76.8 76.8 0 0 0 76.8-76.8V409.6a76.8 76.8 0 0 0-48.64-72.192z m-51.2-56.576v51.2h-153.6V281.6a76.8 76.8 0 0 0-4.608-25.6h132.608a25.6 25.6 0 0 1 25.6 25.6z m-230.4-25.6a25.6 25.6 0 0 1 25.6 25.6v51.2h-179.2V256z m279.04 512a25.6 25.6 0 0 1-25.6 25.6H206.336a25.6 25.6 0 0 1-25.6-25.6V256a25.6 25.6 0 0 1 25.6-25.6h138.752a25.6 25.6 0 0 1 25.6 25.6v102.4a25.6 25.6 0 0 0 25.6 25.6h432.64a25.6 25.6 0 0 1 25.6 25.6z",fill:U})),Q.featured=h("svg",W(),h("path",{d:"M879.488423 92.01323c80.158765 0 145.076075 64.91731 145.076075 145.076075v550.385888c0 80.158765-64.91731 145.076075-145.076075 145.076075H145.076075C64.91731 931.98677 0 867.06946 0 786.910695V237.089305c0-80.158765 64.91731-145.076075 145.076075-145.076075h734.412348z m76.207277 284.507167H68.3043v410.954796c0 41.772878 33.305402 75.642778 75.07828 76.207277H878.923925c41.772878 0 75.642778-33.305402 76.207277-75.07828v-1.128997l0.564498-410.954796zM441.437707 461.759647c3.951488 0 7.338479 1.128997 10.725468 2.822492l205.477398 122.496141c10.16097 6.209482 13.54796 18.628445 7.338479 28.789416-1.693495 2.822492-4.515987 5.644983-7.338479 7.338478L452.163175 745.137817c-10.16097 6.209482-23.144432 2.822492-28.789415-7.338479-1.693495-3.38699-2.822492-6.77398-2.822492-10.725468V482.646086c0-11.289967 9.596472-20.886439 20.886439-20.886439zM68.3043 235.39581V307.651599h101.609702L75.642778 204.9129c-4.515987 9.596472-6.77398 20.32194-7.338478 30.48291z m811.184123-75.07828h-95.964718L910.535832 304.829107c0.564498 1.128997 1.693495 1.693495 2.257994 2.822492h43.466372V237.089305c0-41.772878-33.305402-75.642778-75.07828-76.207276l-1.693495-0.564499z m-187.413451 0h-125.318632l125.318632 145.076075c0.564498 0.564498 1.128997 1.693495 1.693495 2.257994h127.576627l-129.270122-147.334069z m-216.202866 0H353.375965l125.318633 145.076075c0.564498 0.564498 1.128997 1.693495 1.693495 2.257994h123.060639c0 0.564498-127.576626-147.334068-127.576626-147.334069z m-212.815877 0H145.076075c-5.080485 0-10.16097 0.564498-15.241455 1.693495l132.092613 143.947079 1.693495 1.693495h127.576626L263.056229 160.31753z",fill:U})),Q.download=h("svg",W(),h("path",{d:"M543.6 825.3H131.3c-28 0-50.7-22.8-50.7-50.7V141c0-29.9 24.3-54.2 54.2-54.2h126.3c25.1 0 46.6 17.9 51.2 42.6l20.9 111.9c11.7 62.6 66.4 108 130.1 108h385.6c29.9 0 54.2 24.3 54.2 54.3V476c0 22.2 18 40.3 40.3 40.3 22.2 0 40.3-18 40.3-40.3v-72.4c0-74.3-60.5-134.8-134.8-134.8H463.3c-24.9 0-46.3-17.8-50.9-42.3l-20.9-111.9C379.8 51.7 324.9 6.2 261.1 6.2H134.8C60.5 6.2 0 66.7 0 141v633.6C0 847 58.9 905.9 131.3 905.9h412.4c22.2 0 40.3-18 40.3-40.3-0.1-22.3-18.1-40.3-40.4-40.3z",fill:U}),h("path",{d:"M560.1 140.4h338.3c22.2 0 40.3-18 40.3-40.3 0-22.2-18-40.3-40.3-40.3H560.1c-22.2 0-40.3 18-40.3 40.3 0 22.3 18 40.3 40.3 40.3zM1014.6 828c-12.6-12.6-33-12.6-45.6 0l-95.4 95.4V605.5c0-17.8-14.4-32.2-32.2-32.2s-32.2 14.4-32.2 32.2v317.9L713.8 828c-12.6-12.6-33-12.6-45.6 0s-12.6 33 0 45.6l123.9 123.9c13.1 13.1 30.1 19.8 47.3 20.3 0.6 0 1.3 0.1 1.9 0.1 0.6 0 1.3 0 1.9-0.1 17.2-0.5 34.3-7.2 47.3-20.3l123.9-123.9c12.7-12.7 12.7-33 0.2-45.6z",fill:U})),Q.seamlessimg=h("svg",W(),h("path",{d:"M551.36 124.16a36.608 36.608 0 0 1 0 71.68L544 196.48H132.48v458.24l126.336-303.104 2.24-4.544a36.608 36.608 0 0 1 62.784-0.192l80 133.312 41.152-61.632 5.184-6.272a36.672 36.672 0 0 1 51.072 0.64l73.088 73.152 4.736 5.76a36.544 36.544 0 0 1-50.624 50.624l-5.76-4.672-41.6-41.6-48.384 72.576a36.672 36.672 0 0 1-61.824-1.408L298.496 446.592l-155.008 372.096c-0.704 1.728-1.728 3.328-2.688 4.928h403.2l7.36 0.768a36.672 36.672 0 0 1 0 71.68l-7.36 0.704H131.968A72.576 72.576 0 0 1 59.52 824.32V195.968c0-40.064 32.448-72.512 72.512-72.576H544l7.36 0.768zM921.664 824.32a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.088h219.456l7.36 0.768zM921.664 649.344a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.152h219.456l7.36 0.768zM921.664 474.368a36.608 36.608 0 0 1 0 71.616l-7.36 0.768h-219.456a36.544 36.544 0 1 1 0-73.152h219.456l7.36 0.768zM921.664 299.328a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.088h219.456l7.36 0.704zM921.664 124.352a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.152h219.456l7.36 0.768z",fill:U})),Q.modal=h("svg",W(),h("path",{d:"M654.601 708.8a36.965 36.965 0 0 0 26.158-10.843 37.047 37.047 0 0 0 10.843-26.186V434.47H454.555a36.992 36.992 0 0 0-32.594 18.322 37.074 37.074 0 0 0 0 37.422 36.992 36.992 0 0 0 32.594 18.322H565.33l-44.525 44.58L365.239 708.92a37.056 37.056 0 0 0 16.274 62.574 36.955 36.955 0 0 0 36.023-10.222L573.23 605.403l44.489-44.544v110.912A37.01 37.01 0 0 0 654.6 708.8z m313.92-450.834h-0.393V227.84c0-95.131-77.76-172.983-172.846-172.983H227.657c-95.049 0-172.8 77.852-172.8 172.983v568.265c0 95.186 77.751 172.983 172.8 172.983h567.625c95.086 0 172.8-77.833 172.8-172.983v-209.92a38.162 38.162 0 0 0-38.034-37.202 38.162 38.162 0 0 0-38.034 37.211v209.92c-0.247 53.385-43.401 96.604-96.732 96.878H227.657c-53.321-0.274-96.484-43.493-96.731-96.887V331.547H968.53v-73.581z m-76.452 0H130.926V227.84c0.274-53.367 43.42-96.558 96.731-96.832h567.625c53.312 0.274 96.457 43.465 96.732 96.832l0.055 30.126z m-80.951-82.368H475.246c-9.847 0-17.93 8.411-17.93 18.679v3.291c0 10.267 8.083 18.679 17.93 18.679h335.872c9.856 0 17.929-8.412 17.929-18.688v-3.282c0-10.268-8.073-18.68-17.93-18.68z m-488.85-2.643a22.994 22.994 0 0 0-16.22 39.223 22.93 22.93 0 0 0 39.168-16.256 22.967 22.967 0 0 0-22.949-22.967z m69.522 0a22.994 22.994 0 0 0-16.22 39.223 22.93 22.93 0 0 0 39.177-16.256 22.985 22.985 0 0 0-22.976-22.967h0.019z",fill:U})),Q.headingLevel1=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})),Q.headingLevel2=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})),Q.headingLevel3=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})),Q.headingLevel4=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})),Q.headingLevel5=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"}));var Y=[{color:"#fb2121"},{color:"#ef0c7e"},{color:"#F3AC07"},{color:"#8CA803"},{color:"#64BD05"},{color:"#11C33F"},{color:"#08B89A"},{color:"#09ACE2"},{color:"#1F91F3"},{color:"#3B6ED5"},{color:"#664FFA"},{color:"#A845F7"},{color:"#333"},{color:"#666"},{color:"#999"},{color:"#f8f8f8"}];function ee(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);timg",attribute:"src",default:""},file_name:{type:"string",selector:".file-download-name",source:"text"},desc:{type:"array",source:"query",selector:".file-download-desc",default:[{left:"",right:""}],query:{left:{type:"string",source:"text",selector:".desc-left"},right:{type:"string",source:"text",selector:".desc-right"}}}},edit:function(e){var t=e.attributes,a=t.file_id,l=t.file_name,r=a||"javascript:;"==t.url?"":t.url,n=t.desc,o=t.icon,i=e.setAttributes,s=e.isSelected;function c(e){return e&&e.type&&"image"===e.type?e.sizes&&e.sizes.thumbnail&&e.sizes.thumbnail.url?e.sizes.thumbnail.url:e.url:""}var u=h(j,{title:Z("gutenberg_select_or_upload_file"),onSelect:function(e){var t=e.filename||e.name,a=J("gutenberg_ext_file",function(e){return e.substring(e.lastIndexOf(".")+1)}(t)),l=e.filesizeInBytes?function(e,t,a){var l;for(a=a||["B","K","M","G","TB"];(l=a.shift())&&e>1024;)e/=1024;return("B"===l?e:e.toFixed(void 0===t?1:t))+l}(e.filesizeInBytes):"";"image"===e.type&&(o=c(e)),i({file_name:t,url:"",icon:o,file_id:e.id,desc:[{left:a,right:l}]})},value:a,render:function(e){var t=e.open;return h("a",{className:"but jb-blue is-secondary flex0",onClick:t},Z(a?"gutenberg_replace":"gutenberg_select_or_upload")+Z("gutenberg_file"))}});return h("div",{},h("div",{className:"muted-box file-download-box"},h("div",{className:"flex ac jsb"},h("div",{className:"flex ac flex1"},h("div",{className:"mr10"},h("div",{className:"file-download-icon"},[o&&h("img",{className:"fit-cover",src:o,alt:Z("gutenberg_download_icon")})])),h("div",{className:"flex1"},[s?[r||a?h(L,{className:"",tagName:"input",onChange:function(e){i({file_name:e})},value:l,placeholder:Z("gutenberg_enter_file_name")}):Z("gutenberg_enter_download_url_or_file")]:h("div",{className:"text-ellipsis-2 file-download-name"},l||Z("gutenberg_enter_file_name"))],[s?h("div",{className:"flex ac"},[a?h("div",{className:"flex ac"},h("div",{className:"px12"},Z("gutenberg_local_file_selected")),h("div",{className:"mb6 ml10"},h("a",{className:"but c-blue-2",onClick:function(){i({file_id:0})}},Z("gutenberg_enter_url")))):h(L,{className:"flex1",tagName:"input",onChange:function(e){i({url:e})},value:r,placeholder:Z("gutenberg_enter_download_url")})],h("div",{className:"mb6 ml6"},u)):h("div",{className:"px12 opacity5"},r||(a?Z("gutenberg_local_file"):""))])),h("div",{className:"flex0 ml20"},[s||h("div",{className:"but c-blue file-download-btn"},h("i",{className:"fa fas fa-download"},Z("gutenberg_download")))])),h("div",{className:"mt10"},n.map(function(e,t){return s?h("div",{className:"flex ab jsb muted-2-color file-download-desc"},h("div",{className:"desc-left"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){n[t].left=e,i({desc:ee(n)})},value:e.left,placeholder:Z("gutenberg_enter_file_attr")})),h("div",{className:"desc-right flex ac"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){n[t].right=e,i({desc:ee(n)})},value:e.right,placeholder:Z("gutenberg_enter_file_attr")}),h("button",{className:"mb6 ml6 c-red fa far fa-trash-alt",type:"button",onClick:function(){n.splice(t,1),i({desc:ee(n)})}}))):e.left||e.right?h("div",{className:"flex ab jsb muted-2-color file-download-desc em09"},h("div",{className:"desc-left"},e.left),h("div",{className:"desc-right"},e.right)):void 0})),[s&&h("a",{className:"but c-blue is-secondary hollow",onClick:function(){i({desc:[].concat(ee(n),{left:"",right:""})})}},Z("gutenberg_add_file_attr"))]),h(H,null,te(13990),h(V,{icon:"image",title:Z("gutenberg_file_icon")},h("div",{className:"components-base-control"},[o&&h("div",{className:" "},h("img",{src:o}))],h("div",{className:"flex ac"},h(j,{title:Z("gutenberg_select_or_upload_file_icon"),allowedTypes:["image"],onSelect:function(e){i({icon:c(e)})},render:function(e){var t=e.open;return h("a",{className:"but jb-blue",onClick:t},Z(o?"gutenberg_replace":"gutenberg_add")+Z("gutenberg_icon"))}}),[o&&h("a",{className:"but c-red ml6",onClick:function(){i({icon:""})}},Z("gutenberg_remove"))]),h("div",{className:"mt6 em09 opacity5"},Z("gutenberg_file_icon_square_hint"))))))},save:function(e){var t=e.attributes,a=~~t.file_id,l=t.file_name,r=t.url||"javascript:;",n=t.icon,o=t.desc,i={className:"but c-blue file-download-btn",href:r};a&&(i["data-download-file"]=a);var s=o.map(function(e){if(e.left||e.right)return h("div",{className:"flex ab jsb muted-2-color file-download-desc em09"},h("div",{className:"desc-left"},e.left),h("div",{className:"desc-right"},e.right))});return h("div",{contenteditable:"false",className:"muted-box file-download-box mb20"},h("div",{className:"flex ac jsb"},h("div",{className:"flex ac"},h("div",{className:"mr10"},h("div",{className:"file-download-icon"},[n&&h("img",{className:"fit-cover no-imgbox",src:n,alt:Z("gutenberg_download_icon")})])),h("div",{className:"text-ellipsis-2 file-download-name",contenteditable:"true"},l)),h("div",{className:"flex0 ml20"},h("a",i,h("i",{className:"fa fas fa-download"}),Z("gutenberg_download")))),[s&&h("div",{className:"mt10"},s)])}}),f("aksrtblock/tabs",{title:ae(Z("gutenberg_tab")),icon:Q.tabs,supports:{className:!1,anchor:!0},description:Z("gutenberg_tab_desc"),category:"aksrt_block_cat",attributes:{tabHeaders:{type:"array",default:[Z("gutenberg_tab_col_1"),Z("gutenberg_tab_col_2"),Z("gutenberg_tab_col_3")]},tabActive:{type:"number",default:0},open:{type:"number",default:0},layout:{type:"string",default:"nav-top"}},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,r=t.tabHeaders,n=t.tabActive,o=t.layout,i=e.clientId,s=function(e){var t=_(i);l({tabActive:e}),K(t.innerBlocks.length,function(a){v(t.innerBlocks[a].clientId,{tabActive:e,id:a})})},c=function(e){if(r.length<2)return le("warning",Z("gutenberg_cannot_delete_tab_min_one"));var t=g(i);return m(t[e],!1),r.splice(e,1),l({tabHeaders:ee(r)}),s(0),!1};return h("div",{className:"tab-card theme-card-box "+o},h("div",{className:"tab-header flex ab"},r.map(function(e,t){return h("div",{className:"tab-header-item"+((a=t)==n?" active":""),onClick:function(){s(a)}},h(L,{className:"tab-header-input",onChange:function(e){r[a]=e,l({tabHeaders:ee(r)})},value:r[a],placeholder:Z("gutenberg_enter_title")}),h("div",{className:"tab-operation"},h("a",{className:"but b-red circular",onClick:function(){c(a)}},h("i",{className:"fa fas fa-times"}))));var a}),[a&&h("a",{className:"but jb-blue em09 ml6",onClick:function(){var e=y("aksrtblock/tab");p(e,r.length,i),l({tabHeaders:[].concat(ee(r),"")}),s(r.length)}},Z("gutenberg_add_plus"))]),h("div",{className:"tab-content"},h(k,{template:[["aksrtblock/tab",{id:0}],["aksrtblock/tab",{id:1}],["aksrtblock/tab",{id:2}]],templateLock:!1,allowedBlocks:["aksrtblock/tab"]})),h(H,null,te(2195),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},h(F,{label:Z("gutenberg_nav_position"),value:o,onChange:function(e){l({layout:e})},options:[{label:Z("gutenberg_top"),value:"nav-top"},{label:Z("gutenberg_left"),value:"nav-left"},{label:Z("gutenberg_right"),value:"nav-left nav-right"}]})))))},save:function(e){var t=e.attributes,a=t.tabHeaders,l=t.open,r=t.layout;return h("div",{className:"mb20 post-tab "+r},h("div",{className:"list-inline scroll-x mini-scrollbar tab-nav-theme"},a.map(function(e,t){return h("li",{className:(r=t)==l?"active":""},h("a",{className:"post-tab-toggle",href:"javascript:;","tab-id":r},a[r]||J("gutenberg_tab_col_n",r+1)));var r})),h("div",{className:"tab-content"},h(k.Content,null)))}}),f("aksrtblock/tab",{title:ae(Z("gutenberg_tab")),parent:["aksrtblock/tabs"],icon:Q.tabs,supports:{className:!1,reusable:!1},category:"aksrt_block_cat",attributes:{id:{type:"number",default:0},pid:{type:"string"},tabActive:{type:"number",default:0},open:{type:"number",default:0}},edit:function(e){var t=e.attributes,a=t.id,l=t.tabActive;return h(A,null,h("div",{className:"",style:{display:a===l?"block":"none"}},h(k,{template:[["core/paragraph"]],templateLock:!1})))},save:function(e){var t=e.attributes,a=t.id,l=t.open;return h("div",{className:"tab-pane fade"+(a==l?" active in":""),"tab-id":a},h(k.Content,null))}}),f("aksrtblock/dplayerfeatured",{title:ae(Z("gutenberg_video_series")),icon:Q.featured,supports:{className:!1,color:!1},description:Z("gutenberg_video_series_desc"),category:"aksrt_block_cat",attributes:{featured:{type:"array",source:"query",selector:".switch-video",default:[],query:{text:{type:"string",source:"attribute",attribute:"title"},url:{type:"string",source:"attribute",attribute:"video-url"},media_id:{type:"number",source:"attribute",attribute:"media-id"}}},pic:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"video-pic",default:""},loop:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-loop",default:""},autoplay:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-autoplay",default:""},volume:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-volume",default:1},height:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-scale-height",default:0},hide_controller:{type:"boolean",default:!1}},transforms:{to:[{type:"block",blocks:["aksrtblock/dplayer"],transform:function(e){var t={url:e.featured[0].url,media_id:e.featured[0].media_id,pic:e.pic,loop:e.loop,autoplay:e.autoplay,volume:e.volume,hide_controller:e.hide_controller};return y("aksrtblock/dplayer",t)}},{type:"block",blocks:["aksrtblock/iframeseries"],transform:function(e){var t={lists:e.featured};return y("aksrtblock/iframeseries",t)}}]},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,r=t.pic,n=t.loop,o=t.autoplay,i=t.hide_controller,s=t.height||0,c=t.volume||1,u=t.featured.length?t.featured:[{text:"",url:"",media_id:""},{text:"",url:"",media_id:""}],b=function(e){if(u.length<3)return le("warning",Z("gutenberg_cannot_delete_episode_min_two"));u.splice(e,1),l({featured:ee(u)})};return h("div",{},h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.featured,h("span",{className:"ml10"},Z("gutenberg_video_series_module"))),h("div",{className:"opacity8 mb10 px12"},Z("gutenberg_video_series_hint")),[a?u.map(function(e,t){return h("div",{className:"flex featured-item"},h("span",{className:"mr10 c-red"},(a=t)+1),h("div",{className:"flex1"},h("div",{className:"flex ab"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){u[a].text=e,l({featured:ee(u)})},value:u[a].text,placeholder:J("gutenberg_episode_title_placeholder",a+1)}),[u.length>2&&h("button",{className:"mb6 ml6 c-red fa far fa-trash-alt",type:"button",onClick:function(){b(a)}})]),h("div",{className:"flex ab"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){u[a].url=e,u[a].media_id="",l({featured:ee(u)})},value:u[a].url,placeholder:Z("gutenberg_enter_video_url_or_upload")}),h(j,{title:Z("gutenberg_select_or_upload_video"),allowedTypes:["video"],onSelect:function(e){u[a].url=e.url,u[a].media_id=e.id,l({featured:ee(u)})},value:u[a].media_id,render:function(e){var t=e.open;return h("a",{className:"but c-blue is-secondary flex0",onClick:t},Z("gutenberg_local_video"))}}))));var a}):u.map(function(e,t){return h("div",{className:"flex featured-item px12 opacity8",style:{padding:"2px 10px","margin-bottom":"-1px"}},t+1+":"+e.url)})],[a&&h("a",{className:"but jb-blue",onClick:function(){l({featured:[].concat(ee(u),{url:"",media_id:""})})}},Z("gutenberg_add_episode"))]),h(H,null,te(2223),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},[r&&h("div",{className:" "},h("img",{src:r}))],h(j,{title:Z("gutenberg_select_or_upload_poster"),allowedTypes:["image"],onSelect:function(e){l({pic:e.url})},render:function(e){var t=e.open;return h("a",{className:"but jb-blue",onClick:t},Z(r?"gutenberg_replace":"gutenberg_add")+Z("gutenberg_poster_image"))}})),h(P,{label:Z("gutenberg_autoplay"),checked:o,onChange:function(e){l({autoplay:e})}}),h(P,{label:Z("gutenberg_loop"),checked:n,onChange:function(e){l({loop:e})}}),h(P,{label:Z("gutenberg_hide_controller"),checked:i,onChange:function(e){l({hide_controller:e})}}),h(R,{label:Z("gutenberg_initial_volume"),value:~~(100*c),onChange:function(e){l({volume:e/100})},allowReset:!0,min:"0",max:"100"}),h(R,{label:Z("gutenberg_fixed_aspect_ratio"),help:s>0?J("gutenberg_height_of_width",s):Z("gutenberg_height_ratio_auto"),value:~~s,onChange:function(e){l({height:e})},allowReset:!0,min:"0",step:"5",max:"200"}))))},save:function(e){var t=e.attributes,a=t.pic,l=t.loop||"",r=t.autoplay||"",n=t.hide_controller||"",o=t.height||0,i=t.featured,s=t.volume||1;if(i&&i[0]){var c=i[0].url,u=h("div",{className:"graphic",style:{"padding-bottom":"50%"}},h("div",{className:"abs-center text-center"},h("i",{className:"fa fas fa-play-circle fa-4x muted-3-color opacity5"}))),b={className:"new-dplayer"+(n?" controller-hide":"")+(o>0?" dplayer-scale-height":""),"video-url":c,"video-pic":a,"data-loop":l,"data-autoplay":r,"data-volume":s};return o>0&&(b.style="--scale-height:"+o+"%;",b["data-scale-height"]=o),h("div",{className:"mb20"},h("div",b,u),h("div",{className:"featured-video-episode mt10 dplayer-featured"},i.map(function(e,t){t+=1;var a=e.text||J("gutenberg_episode_n",t);return h("a",{className:"switch-video text-ellipsis"+(1==t?" active":""),"data-index":t,"video-url":e.url,"media-id":e.media_id,title:e.text,href:"javascript:;"},h("span",{className:"mr6 badg badg-sm"},t),h("i",{className:"episode-active-icon"},""),a)})))}}}),f("aksrtblock/iframe",{title:ae(Z("gutenberg_super_embed")),icon:Q.iframe,description:Z("gutenberg_super_embed_desc"),category:"aksrt_block_cat",attributes:{url:{source:"attribute",selector:"iframe",attribute:"src"},aspect:{type:"attribute",selector:"iframe",attribute:"data-aspect"},allowfullscreen:{type:"attribute",selector:"iframe",attribute:"allowfullscreen"}},transforms:{to:[{type:"block",blocks:["aksrtblock/iframeseries"],transform:function(e){var t={lists:[{url:e.url,title:""}],aspect:e.aspect,allowfullscreen:e.allowfullscreen};return y("aksrtblock/iframeseries",t)}},{type:"block",blocks:["aksrtblock/dplayer"],transform:function(e){var t={url:e.url};return y("aksrtblock/dplayer",t)}}]},edit:function(t){var a=t.attributes,l=t.isSelected,r=t.setAttributes,n=a.url,o=a.allowfullscreen,i=a.aspect||"56%";return h("div",{className:"aksrtblock-iframe"},h("div",{className:!n||l?"theme-card-box":"nois_selected"},[n&&h("div",{className:"aksrtblock-iframe-div",style:{"padding-bottom":i}},h("iframe",{className:"",width:"100%",src:n}),h("div",{className:"iframe-mask"}))],[!n&&h("div",{className:"components-placeholder__label",style:{width:"95%",height:"27px","font-size":"15px"}},Q.iframe,Z("gutenberg_embed_online_content"))],[(!n||l)&&h("div",{className:"mt20"},h("div",{className:"opacity8 iframe-label"},Z("gutenberg_embed_url_hint_multi")),h("a",{className:"block-editor-block-card__description"},""))],[(!n||l)&&h(L,{style:{width:"95%"},tagName:"input",onChange:function(t){var a=e.parseHTML(t),l=e(a).attr("src")||t;r({url:l})},value:n,placeholder:Z("gutenberg_enter_url_or_embed_code")})]),h(H,null,te(1934),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h(F,{label:Z("gutenberg_aspect_ratio_settings"),value:i,onChange:function(e){r({aspect:e})},options:[{label:Z("gutenberg_ratio_landscape_4_1"),value:"25%"},{label:Z("gutenberg_ratio_landscape_3_1"),value:"33%"},{label:Z("gutenberg_ratio_landscape_5_2"),value:"40%"},{label:Z("gutenberg_ratio_landscape_2_1"),value:"50%"},{label:Z("gutenberg_ratio_landscape_16_9"),value:"56%"},{label:Z("gutenberg_ratio_landscape_5_3"),value:"60%"},{label:Z("gutenberg_ratio_landscape_4_3"),value:"75%"},{label:Z("gutenberg_ratio_landscape_5_4"),value:"80%"},{label:Z("gutenberg_ratio_landscape_8_7"),value:"87.5%"},{label:Z("gutenberg_ratio_square_1_1"),value:"100%"},{label:Z("gutenberg_ratio_portrait_7_8"),value:"114%"},{label:Z("gutenberg_ratio_portrait_4_5"),value:"125%"},{label:Z("gutenberg_ratio_portrait_3_4"),value:"133%"},{label:Z("gutenberg_ratio_portrait_3_5"),value:"166%"},{label:Z("gutenberg_ratio_portrait_1_2"),value:"200%"},{label:Z("gutenberg_ratio_portrait_2_5"),value:"250%"},{label:Z("gutenberg_ratio_portrait_1_3"),value:"300%"}]}),h(P,{label:Z("gutenberg_allow_fullscreen"),checked:!!o,onChange:function(e){r({allowfullscreen:e})}}))))},save:function(e){var t=e.attributes,a=t.url,l=t.aspect||"56%",r={className:"","data-aspect":l,framespacing:"0",border:"0",width:"100%",frameborder:"no",src:a};if(t.allowfullscreen&&(r.allowfullscreen="allowfullscreen"),a)return h("div",{className:"wp-block-embed is-type-video mb20"},h("div",{className:"",style:{"padding-bottom":l}},h("iframe",r)))}}),f("aksrtblock/iframeseries",{title:ae(Z("gutenberg_embed_series")),icon:Q.iframeseries,supports:{className:!1,color:!1},description:Z("gutenberg_embed_series_desc"),category:"aksrt_block_cat",attributes:{lists:{type:"array",source:"query",selector:".switch-iframe",default:[{text:"",url:""},{text:"",url:""}],query:{text:{type:"string",source:"attribute",attribute:"title"},url:{type:"string",source:"attribute",attribute:"iframe-url"}}},aspect:{type:"attribute",selector:"iframe",attribute:"data-aspect"},allowfullscreen:{type:"attribute",selector:"iframe",attribute:"allowfullscreen"}},transforms:{to:[{type:"block",blocks:["aksrtblock/iframe"],transform:function(e){var t={url:e.lists[0].url,aspect:e.aspect,allowfullscreen:e.allowfullscreen};return y("aksrtblock/iframe",t)}},{type:"block",blocks:["aksrtblock/dplayerfeatured"],transform:function(e){var t={featured:e.lists};return y("aksrtblock/dplayerfeatured",t)}}]},edit:function(t){var a=t.attributes,l=t.isSelected,r=t.setAttributes,n=a.lists,o=a.allowfullscreen,i=a.aspect||"56%",s=function(e){if(n.length<3)return le("warning",Z("gutenberg_cannot_delete_episode_min_two"));n.splice(e,1),r({lists:ee(n)})};return h("div",{className:"aksrtblock-iframe"},h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.iframeseries,h("span",{className:"ml10"},Z("gutenberg_embed_series_module"))),h("div",{className:"opacity8 mb10 px12"},Z("gutenberg_embed_series_hint")),[l?n.map(function(t,a){return h("div",{className:"flex featured-item"},h("span",{className:"mr10 c-red"},(l=a)+1),h("div",{className:"flex1"},h("div",{className:"flex ab"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){n[l].text=e,r({lists:ee(n)})},value:n[l].text,placeholder:J("gutenberg_episode_title_placeholder",l+1)}),[n.length>2&&h("button",{className:"mb6 ml6 c-red fa far fa-trash-alt",type:"button",onClick:function(){s(l)}})]),h(L,{className:"flex1 mr6",tagName:"input",onChange:function(t){var a=e.parseHTML(t),o=e(a).attr("src")||t;n[l].url=o,r({lists:ee(n)})},value:n[l].url,placeholder:Z("gutenberg_enter_embed_url")})));var l}):n.map(function(e,t){return h("div",{className:"flex featured-item px12 opacity8",style:{padding:"2px 10px","margin-bottom":"-1px"}},t+1+":"+e.url)})],[l&&h("a",{className:"but jb-blue",onClick:function(){r({lists:[].concat(ee(n),{url:"",media_id:""})})}},Z("gutenberg_add_episode"))]),h(H,null,te(1934),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h(F,{label:Z("gutenberg_aspect_ratio_settings"),value:i,onChange:function(e){r({aspect:e})},options:[{label:Z("gutenberg_ratio_landscape_4_1"),value:"25%"},{label:Z("gutenberg_ratio_landscape_3_1"),value:"33%"},{label:Z("gutenberg_ratio_landscape_5_2"),value:"40%"},{label:Z("gutenberg_ratio_landscape_2_1"),value:"50%"},{label:Z("gutenberg_ratio_landscape_16_9"),value:"56%"},{label:Z("gutenberg_ratio_landscape_5_3"),value:"60%"},{label:Z("gutenberg_ratio_landscape_4_3"),value:"75%"},{label:Z("gutenberg_ratio_landscape_5_4"),value:"80%"},{label:Z("gutenberg_ratio_landscape_8_7"),value:"87.5%"},{label:Z("gutenberg_ratio_square_1_1"),value:"100%"},{label:Z("gutenberg_ratio_portrait_7_8"),value:"114%"},{label:Z("gutenberg_ratio_portrait_4_5"),value:"125%"},{label:Z("gutenberg_ratio_portrait_3_4"),value:"133%"},{label:Z("gutenberg_ratio_portrait_3_5"),value:"166%"},{label:Z("gutenberg_ratio_portrait_1_2"),value:"200%"},{label:Z("gutenberg_ratio_portrait_2_5"),value:"250%"},{label:Z("gutenberg_ratio_portrait_1_3"),value:"300%"}]}),h(P,{label:Z("gutenberg_allow_fullscreen"),checked:!!o,onChange:function(e){r({allowfullscreen:e})}}))))},save:function(e){var t=e.attributes,a=t.lists,l=t.aspect||"56%";if(a&&a[0]){var r={className:"","data-aspect":l,framespacing:"0",border:"0",width:"100%",frameborder:"no",src:a[0].url};return t.allowfullscreen&&(r.allowfullscreen="allowfullscreen"),h("div",{className:"mb20 iframe-series"},h("div",{className:"wp-block-embed is-type-video"},h("div",{className:"iframe-series-box",style:{"padding-bottom":l}},h("iframe",r))),h("div",{className:"featured-video-episode mt10 dplayer-featured"},a.map(function(e,t){t+=1;var a=e.text||J("gutenberg_episode_n",t);return h("a",{className:"switch-iframe text-ellipsis"+(1==t?" active":""),"data-index":t,"iframe-url":e.url,title:e.text,href:"javascript:;"},h("span",{className:"mr6 badg badg-sm"},t),h("i",{className:"episode-active-icon"},""),a)})))}}}),f("aksrtblock/dplayer",{title:ae(Z("gutenberg_video")),icon:Q.video,description:Z("gutenberg_video_desc"),category:"aksrt_block_cat",attributes:{url:{source:"attribute",selector:".new-dplayer",attribute:"video-url"},media_id:{source:"attribute",selector:".new-dplayer",attribute:"media-id"},pic:{source:"attribute",selector:".new-dplayer",attribute:"video-pic"},loop:{source:"attribute",selector:".new-dplayer",attribute:"data-loop"},autoplay:{source:"attribute",selector:".new-dplayer",attribute:"data-autoplay"},volume:{source:"attribute",selector:".new-dplayer",attribute:"data-volume"},height:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-scale-height",default:0},hide_controller:{source:"attribute",selector:".new-dplayer",attribute:"data-hide"}},transforms:{to:[{type:"block",blocks:["aksrtblock/dplayerfeatured"],transform:function(e){var t={featured:[{text:"",url:e.url,media_id:e.media_id},{text:"",url:"",media_id:""}],pic:e.pic,loop:e.loop,autoplay:e.autoplay,volume:e.volume,hide_controller:e.hide_controller};return y("aksrtblock/dplayerfeatured",t)}},{type:"block",blocks:["aksrtblock/iframe"],transform:function(e){var t={url:e.url};return y("aksrtblock/iframe",t)}}]},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,r=t.url,n=t.media_id,o=t.pic,i=t.loop,s=t.autoplay,c=t.hide_controller,u=t.height||0,b=t.volume||1;return h("div",{},h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.video,h("span",{className:"ml10"},Z("gutenberg_video_module"))),h("div",{className:"opacity8 mb10 px12"},Z("gutenberg_video_hint")),h(L,{style:{width:"95%"},tagName:"input",onChange:function(e){l({url:e,media_id:""})},value:r,placeholder:Z("gutenberg_enter_video_url_or_upload")}),h(j,{title:Z("gutenberg_select_or_upload_video"),allowedTypes:["video"],onSelect:function(e){l({url:e.url,media_id:e.id})},value:n,render:function(e){var t=e.open;return a&&h("a",{className:"but jb-blue",onClick:t},Z("gutenberg_select_local_video"))}})),h(H,null,te(1921),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},[o&&h("div",{className:" "},h("img",{src:o}))],h(j,{title:Z("gutenberg_select_or_upload_poster"),allowedTypes:["image"],onSelect:function(e){l({pic:e.url})},render:function(e){var t=e.open;return h("a",{className:"but jb-blue",onClick:t},Z(o?"gutenberg_replace":"gutenberg_add")+Z("gutenberg_poster_image"))}})),h(P,{label:Z("gutenberg_autoplay"),checked:s,onChange:function(e){l({autoplay:e})}}),h(P,{label:Z("gutenberg_loop"),checked:i,onChange:function(e){l({loop:e})}}),h(P,{label:Z("gutenberg_hide_controller"),checked:c,onChange:function(e){l({hide_controller:e})}}),h(R,{label:Z("gutenberg_initial_volume"),value:~~(100*b),onChange:function(e){l({volume:e/100})},allowReset:!0,min:"0",max:"100"}),h(R,{label:Z("gutenberg_fixed_aspect_ratio"),help:u>0?J("gutenberg_height_of_width",u):Z("gutenberg_height_ratio_auto"),value:~~u,onChange:function(e){l({height:e})},allowReset:!0,min:"0",step:"5",max:"200"}))))},save:function(e){var t=e.attributes,a=t.url,l=t.media_id,r=t.pic,n=t.loop||"",o=t.autoplay||"",i=t.hide_controller||"",s=t.height||0,c=t.volume||1;if(a){var u=h("div",{className:"graphic",style:{"padding-bottom":"50%"}},h("div",{className:"abs-center text-center"},h("i",{className:"fa fas fa-play-circle fa-4x muted-3-color opacity5"}))),b={className:"new-dplayer post-dplayer"+(i?" controller-hide":"")+(s>0?" dplayer-scale-height":""),"video-url":a,"media-id":l,"video-pic":r,"data-loop":n,"data-hide":i,"data-autoplay":o,"data-volume":c};return s>0&&(b.style="--scale-height:"+s+"%;",b["data-scale-height"]=s),h("div",b,u)}}}),f("aksrtblock/feature",{title:ae(Z("gutenberg_feature")),icon:Q.feature,description:Z("gutenberg_feature_desc"),category:"aksrt_block_cat",attributes:{title:{type:"array",source:"children",selector:".feature-title"},icon:{source:"attribute",selector:".feature",attribute:"data-icon"},note:{type:"array",source:"children",selector:".feature-note"},theme:{source:"attribute",selector:".feature",attribute:"class"},color:{source:"attribute",selector:".feature",attribute:"data-color"}},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,n=t.title,o=t.note,i=t.icon||"fa-flag",s=t.color||"feature-icon no1";let c=h(r.ColorPalette,{value:s||"#444",colors:Y,className:"q-ColorPalette",onChange:function(e){l({color:e})}});var u=h(L,{tagName:"div",onChange:function(e){l({icon:e})},value:i,placeholder:Z("gutenberg_enter_icon_class")}),b=h(q,{tagName:"div",onChange:function(e){l({title:e})},value:n,placeholder:Z("gutenberg_enter_feature_title")}),d=h(q,{tagName:"div",onChange:function(e){l({note:e})},value:o,placeholder:Z("gutenberg_enter_feature_note")});return h("div",{},h("div",{className:"feature"},h("div",{className:"feature-icon"},h("i",{style:{color:s},className:"fa "+i})),[a&&h("div",{className:"feature-iconbj"},h("div",{className:"feature-icont"},Z("gutenberg_enter_fa_icon_class")),u)],[a&&c],h("div",{className:"feature-title"},b),h("div",{className:"feature-note"},d)),h(H,null,h("div",{className:"modal-ss block-editor-block-card"},h("div",{className:"components-base-control"},h("h5",{},Z("gutenberg_icon_usage")),h("p",{},Z("gutenberg_icon_usage_desc")),h("a",{href:"http://fontawesome.dashgame.com",target:"blank"},Z("gutenberg_font_awesome")))),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},h("div",{className:"feature-icont"},Z("gutenberg_fa_icon_class")),u,h("div",{className:"feature-icont"},Z("gutenberg_select_icon_color")),c))))},save:function(e){var t=e.attributes,a=t.title,l=t.note,r=t.color||"feature-icon no1",n=t.icon||"fa-flag",o=t.theme||"feature feature-default";return h("div",{className:o,"data-icon":n,"data-color":r},h("div",{className:"feature-icon"},h("i",{style:{color:r},className:"fa "+n})),h("div",{className:"feature-title"},a),h("div",{className:"feature-note"},l))}}),i("aksrtblock/set-color",{title:Z("gutenberg_set_color"),tagName:"qc",className:null,attributes:{style:"style",block:"inline-block"},edit:class extends C{constructor(){super(...arguments),this.show_modal=this.show_modal.bind(this),this.close_modal=this.close_modal.bind(this),this.words_selected=this.words_selected.bind(this),this.set_popover_rect=this.set_popover_rect.bind(this),this.remove_Format=this.remove_Format.bind(this),this.onChange_cb=this.onChange_cb.bind(this),this.set_color=this.set_color.bind(this),this.set_color2=this.set_color2.bind(this),this.xsba=this.xsba.bind(this),this.xsba_f=this.xsba_f.bind(this),this.set_background=this.set_background.bind(this),this.set_background2=this.set_background2.bind(this),this.state={modal_visibility:!1}}words_selected(){const{value:e}=this.props;return e.start!==e.end}set_popover_rect(){const e=a.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):null;var l=w(t);this.setState({popover_rect:l})}show_modal(){this.setState({modal_visibility:!0}),this.set_popover_rect()}close_modal(){this.setState({modal_visibility:!1})}xsba(){this.setState({xsba:!0})}xsba_f(){this.setState({xsba:!1})}remove_Format(){this.setState({color:"",background:""}),this.props.onChange(t.richText.toggleFormat(this.props.value,{type:"aksrtblock/set-color"}))}onChange_cb(){this.props.onChange(t.richText.applyFormat(this.props.value,{type:"aksrtblock/set-color",attributes:{style:"color:"+this.state.color+";background:"+this.state.background}}))}set_color(e){this.setState({color:"rgba("+e.rgb.r+","+e.rgb.g+","+e.rgb.b+","+e.rgb.a+")"}),this.onChange_cb()}set_color2(e){this.setState({color:e}),this.props.onChange(t.richText.applyFormat(this.props.value,{type:"aksrtblock/set-color",attributes:{style:"color:"+e+";background:"+this.state.background}}))}set_background2(e){this.setState({background:e}),this.props.onChange(t.richText.applyFormat(this.props.value,{type:"aksrtblock/set-color",attributes:{style:"color:"+this.state.color+";background:"+e}}))}set_background(e){this.setState({background:"rgba("+e.rgb.r+","+e.rgb.g+","+e.rgb.b+","+e.rgb.a+")"}),this.onChange_cb()}render(){let{isActive:e}=this.props,t=h(r.ColorPicker,{color:this.state.color||"#444",onChangeComplete:this.set_color}),a=h(r.ColorPalette,{value:this.state.color||"#444",colors:Y,clearable:!1,className:"q-ColorPalette",disableCustomColors:!0,onChange:this.set_color2}),l=h(r.ColorPalette,{value:this.state.background||"#fff",colors:Y,clearable:!1,className:"q-ColorPalette",disableCustomColors:!0,onChange:this.set_background2}),n=h(r.ColorPicker,{color:this.state.background||"#fff",onChangeComplete:this.set_background}),o=h("button",{className:"remove-Format",onClick:this.remove_Format},h("span",{className:"dashicons dashicons-image-rotate"}));return h(A,null,h(N,{icon:"art",title:Z("gutenberg_custom_color"),onClick:this.show_modal,isActive:e,isDisabled:!this.words_selected()}),this.state.modal_visibility&&h(x,{anchorRect:this.state.popover_rect,position:"bottom",className:"color_popover",onFocusOutside:this.close_modal},h(r.ButtonGroup,{},h("button",{className:"btn btn-default "+(!this.state.xsba&&"isS"),onClick:this.xsba_f},Z("gutenberg_color")),h("button",{className:"btn btn-default "+(this.state.xsba&&"isS"),onClick:this.xsba},Z("gutenberg_bg_color"))),o,!this.state.xsba&&h("div",{},h("p",{},Z("gutenberg_select_text_color")),a,t),this.state.xsba&&h("div",{},h("p",{},Z("gutenberg_select_bg_color")),l,n)))}}}),f("aksrtblock/modal",{title:ae(Z("gutenberg_modal")),icon:Q.modal,description:Z("gutenberg_modal_desc"),category:"aksrt_block_cat",attributes:{biaoti:{type:"array",source:"children",selector:".modal-title"},kuandu:{type:"attribute",selector:".modal-dialog",attribute:"data-kd"},btn1:{type:"array",source:"children",selector:"button.btn1"},btn2:{type:"array",source:"children",selector:"button.btn2"},id:{source:"attribute",selector:".modal",attribute:"id"},btn1kg:{type:"attribute",attribute:"data-bkg1",default:!0},btn2kg:{type:"attribute",attribute:"data-bkg2",default:!0},btntm1:{type:"attribute",selector:"button.btn1",attribute:"class"},btntm2:{type:"attribute",selector:"button.btn2",attribute:"class"},oncopy:{source:"string"}},edit:function(e){var t=e.attributes,a=t.biaoti,l=t.btn1,r=t.btn2,n=t.btntm1||"btn1 but",o=t.btntm2||"btn2 but c-blue",i=t.btn1kg,s=t.btn2kg,c=t.oncopy,u=t.kuandu||"",b=e.setAttributes,d=parseInt((Math.random()+1)*Math.pow(10,4));function g(e){var t=e.target.className;b({btntm1:"btn1 "+t})}function _(e){var t=e.target.className;b({btntm2:"btn2 "+t})}t.id||b({id:"modal_"+d});var p=h(k,{},""),m=h(q,{tagName:"div",onChange:function(e){b({biaoti:e})},value:a,placeholder:Z("gutenberg_enter_title_dots")}),v=h(q,{tagName:"div",onChange:function(e){b({btn1:e})},value:l,placeholder:Z("gutenberg_button_1")}),f=h(q,{tagName:"div",onChange:function(e){b({btn2:e})},value:r,placeholder:Z("gutenberg_button_2")}),y=h("span",{className:"modal-bu"},[h("button",{className:"but",onClick:g}),h("button",{className:"but c-blue",onClick:g}),h("button",{className:"but c-red",onClick:g}),h("button",{className:"but c-yellow",onClick:g}),h("button",{className:"but c-green",onClick:g}),h("button",{className:"but c-purple",onClick:g}),h("button",{className:"but b-blue",onClick:g}),h("button",{className:"but b-red",onClick:g}),h("button",{className:"but b-yellow",onClick:g}),h("button",{className:"but b-green",onClick:g}),h("button",{className:"but b-purple",onClick:g})]),N=h("span",{className:"modal-bu"},[h("button",{className:"but",onClick:_}),h("button",{className:"but c-blue",onClick:_}),h("button",{className:"but c-red",onClick:_}),h("button",{className:"but c-yellow",onClick:_}),h("button",{className:"but c-green",onClick:_}),h("button",{className:"but c-purple",onClick:_}),h("button",{className:"but b-blue",onClick:_}),h("button",{className:"but b-red",onClick:_}),h("button",{className:"but b-yellow",onClick:_}),h("button",{className:"but b-green",onClick:_}),h("button",{className:"but b-purple",onClick:_})]);return h("div",{},h("div",{className:"modal "+u},h("div",{className:"modal-title"},m,h("button",{className:"close"},"×")),h("div",{className:"modal-body"},p),[(i||s)&&h("div",{className:"modal-footer"},[i&&h("span",{className:n},v)],[s&&h("span",{className:o},f)])]),h(H,{},h("div",{className:"modal-ss padding-h"},h("h5",{},Z("gutenberg_usage_tutorial")),h("p",{},Z("gutenberg_modal_usage_desc")),h("p",{className:"modal-code"},"javascript:void($('#"+t.id+"').modal('show'));"),h("div",{className:"Copy"},h(S,{text:"javascript:void($('#"+t.id+"').modal('show'));",className:"Copy but jb-blue",onCopy:function(){b({oncopy:!0})},onFinishCopy:function(){b({oncopy:!1})}},Z(c?"gutenberg_code_copied":"gutenberg_click_copy_code")))),h(V,{title:Z("gutenberg_modal_settings")},h(F,{label:Z("gutenberg_width_select"),value:u,onChange:function(e){b({kuandu:e})},options:[{label:Z("gutenberg_width_default"),value:""},{label:Z("gutenberg_width_xs"),value:"modal-sm"},{label:Z("gutenberg_width_sm"),value:"modal-mini"},{label:Z("gutenberg_width_lg"),value:"modal-lg"}]}),h("p",{}," "),h(P,{label:Z("gutenberg_enable_button_1"),checked:i,onChange:function(e){b({btn1kg:e})}}),[i&&y],h(P,{label:Z("gutenberg_enable_button_2"),checked:s,onChange:function(e){b({btn2kg:e})}}),[s&&N])))},save:function(e){var t=e.attributes,a=t.btn1,l=t.btn2,r=t.btntm1||"btn1 but",n=t.btntm2||"btn2 but c-blue",o=t.btn1kg,i=t.btn2kg,s=t.kuandu,c=t.id,u=t.biaoti,b=h("div",{className:"modal-header"},h("strong",{className:"modal-title"},u),h("button",{className:"close","data-dismiss":"modal"},h("div",{"data-class":"ic-close","data-svg":"close","data-viewbox":"0 0 1024 1024"},""))),d=h("div",{className:"modal-body"},h(k.Content)),g=[(o&&a||i&&l)&&h("div",{className:"modal-footer"},[o&&a&&h("button",{className:r},a)],[i&&l&&h("button",{className:n},l)])];return h("div",{},h("div",{className:"modal fade",id:c,"aria-hidden":"true","data-bkg1":o,"aria-bkg2":i,role:"dialog",tabindex:"-1"},h("div",{className:"modal-dialog "+s,"data-kd":s},h("div",{className:"modal-content"},b,d,g))))}}),f("aksrtblock/collapse",{title:ae(Z("gutenberg_accordion")),icon:{src:"sort",foreground:U},description:Z("gutenberg_accordion_desc"),category:"aksrt_block_cat",attributes:{biaoti:{type:"array",source:"children",selector:".biaoti"},isshow:{type:"attribute",selector:".panel",attribute:"data-isshow",default:!0},theme:{source:"attribute",selector:".panel",attribute:"class"},id:{source:"attribute",selector:".collapse",attribute:"id"},ffs:{source:"string"}},edit:function(e){var t=e.attributes,a=t.biaoti,l=t.theme||"panel panel-default",r=t.isshow,n=t.ffs||"ffshow",o=e.setAttributes,i=parseInt((Math.random()+1)*Math.pow(10,4));function s(e){var t=e.target.className;o({theme:"panel "+t})}t.id||o({id:"collapse_"+i});var c=h(k,{},""),u=h(q,{tagName:"div",onChange:function(e){o({biaoti:e})},value:a,isSelected:e.isSelected,placeholder:Z("gutenberg_enter_accordion_title")});h("span",{className:"g_extend anz panel_b"},[h("button",{className:"panel-default",onClick:s}),h("button",{className:"panel-info",onClick:s}),h("button",{className:"panel-success",onClick:s}),h("button",{className:"panel-warning",onClick:s}),h("button",{className:"panel-danger",onClick:s})]);return h("div",{},h("div",{className:l},h("div",{className:"panel-heading"},u),h("span",{className:n+" isshow dashicons dashicons-arrow-down-alt2",onClick:function(){o("ffshow"==n?{ffs:"ffhide"}:{ffs:"ffshow"})}}),h("div",{className:n+" panel-body"},c)),h(H,null,h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("p",{},h(P,{label:Z("gutenberg_default_expand"),checked:r,onChange:function(e){o({isshow:e})}})),h("i",{className:".components-base-control__help"},Z(r?"gutenberg_default_expanded":"gutenberg_default_collapsed")))))},save:function(e){var t=e.attributes,a=t.theme||"panel",l=t.isshow,r=t.id,n=t.biaoti,o=h("div",{className:"panel-heading "+(l?"":"collapsed"),href:"#"+r,"data-toggle":"collapse","aria-controls":"collapseExample"},h("i",{className:"fa fas fa-plus"}),h("strong",{className:"biaoti "},n)),i=h("div",{className:"collapse "+(l?"in":""),id:r},h("div",{className:"panel-body"},h(k.Content)));return h("div",{},h("div",{className:a,"data-theme":a,"data-isshow":l},o,i))}}),f("aksrtblock/enlighter",{title:ae(Z("gutenberg_code_highlight")),icon:Q.enlighter,category:"aksrt_block_cat",description:Z("gutenberg_code_highlight_desc"),keywords:["code","sourcecode",Z("gutenberg_code")],attributes:{content:{type:"string",selector:"code.gl",source:"text"},c_language:{type:"attribute",attribute:"data-enlighter-language",default:"generic"},theme:{type:"attribute",attribute:"data-enlighter-theme",default:""},highlight:{type:"attribute",attribute:"data-enlighter-highlight",default:""},linenumbers:{type:"attribute",attribute:"data-enlighter-linenumbers",default:""},lineoffset:{type:"attribute",attribute:"data-enlighter-lineoffset",default:""},title:{type:"attribute",attribute:"data-enlighter-title",default:""},group:{type:"attribute",attribute:"data-enlighter-group",default:""}},transforms:{from:[{type:"raw",priority:4,isMatch:function(e){return"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName},transform:function(e){return y("aksrtblock/enlighter",{content:e.textContent})}},{type:"raw",priority:4,isMatch:function(e){return"PRE"===e.nodeName&&"EnlighterJSRAW"===e.className},transform:function(e){return y("aksrtblock/enlighter",{content:e.textContent,language:e.dataset.enlighterLanguage||"",theme:e.dataset.enlighterTheme||"",highlight:e.dataset.enlighterHighlight||"",linenumbers:e.dataset.enlighterLinenumbers||"",lineoffset:e.dataset.enlighterLineoffset||"",title:e.dataset.enlighterTitle||"",group:e.dataset.enlighterGroup||""})}},{type:"block",blocks:["core/code","core/preformatted","core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/enlighter",{content:t})}}],to:[{type:"block",blocks:["core/code"],transform:function(e){var t=e.content;return y("core/code",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes,a=e.setAttributes,l=h(T,null,h(I,{className:"enlighter-dropdownmenu",icon:"editor-paste-text",label:Z("gutenberg_set_code_language"),controls:[{title:"yaml",value:"yaml",onClick:function(){return a({c_language:"yaml"})}},{title:"xml/html",value:"xml",onClick:function(){return a({c_language:"xml"})}},{title:"visualbasic",value:"visualbasic",onClick:function(){return a({c_language:"visualbasic"})}},{title:"vhdl",value:"vhdl",onClick:function(){return a({c_language:"vhdl"})}},{title:"typescript",value:"typescript",onClick:function(){return a({c_language:"typescript"})}},{title:"swift",value:"swift",onClick:function(){return a({c_language:"swift"})}},{title:"squirrel",value:"squirrel",onClick:function(){return a({c_language:"squirrel"})}},{title:"sql",value:"sql",onClick:function(){return a({c_language:"sql"})}},{title:"shell",value:"shell",onClick:function(){return a({c_language:"shell"})}},{title:"scss/sass",value:"scss",onClick:function(){return a({c_language:"scss"})}},{title:"rust",value:"rust",onClick:function(){return a({c_language:"rust"})}},{title:"ruby",value:"ruby",onClick:function(){return a({c_language:"ruby"})}},{title:"raw",value:"raw",onClick:function(){return a({c_language:"raw"})}},{title:"python",value:"python",onClick:function(){return a({c_language:"python"})}},{title:"prolog",value:"prolog",onClick:function(){return a({c_language:"prolog"})}},{title:"powershell",value:"powershell",onClick:function(){return a({c_language:"powershell"})}},{title:"php",value:"php",onClick:function(){return a({c_language:"php"})}},{title:"nsis",value:"nsis",onClick:function(){return a({c_language:"nsis"})}},{title:"matlab",value:"matlab",onClick:function(){return a({c_language:"matlab"})}},{title:"markdown",value:"markdown",onClick:function(){return a({c_language:"markdown"})}},{title:"lua",value:"lua",onClick:function(){return a({c_language:"lua"})}},{title:"less",value:"less",onClick:function(){return a({c_language:"less"})}},{title:"kotlin",value:"kotlin",onClick:function(){return a({c_language:"kotlin"})}},{title:"json",value:"json",onClick:function(){return a({c_language:"json"})}},{title:"javascript",value:"javascript",onClick:function(){return a({c_language:"javascript"})}},{title:"java",value:"java",onClick:function(){return a({c_language:"java"})}},{title:"ini/conf",value:"ini",onClick:function(){return a({c_language:"ini"})}},{title:"groovy",value:"groovy",onClick:function(){return a({c_language:"groovy"})}},{title:"go/golang",value:"go",onClick:function(){return a({c_language:"go"})}},{title:"docker",value:"dockerfile",onClick:function(){return a({c_language:"dockerfile"})}},{title:"diff",value:"diff",onClick:function(){return a({c_language:"diff"})}},{title:"cordpro",value:"cordpro",onClick:function(){return a({c_language:"cordpro"})}},{title:"cython",value:"cython",onClick:function(){return a({c_language:"cython"})}},{title:"css",value:"css",onClick:function(){return a({c_language:"css"})}},{title:"csharp",value:"csharp",onClick:function(){return a({c_language:"csharp"})}},{title:"Cpp/C++/C",value:"cpp",onClick:function(){return a({c_language:"cpp"})}},{title:"avrassembly",value:"avrassembly",onClick:function(){return a({c_language:"avrassembly"})}},{title:"assembly",value:"assembly",onClick:function(){return a({c_language:"assembly"})}},{title:Z("gutenberg_auto_detect"),value:"generic",onClick:function(){return a({c_language:"generic"})}}]})),r=h(M,{value:t.content,onChange:function(e){return a({content:e})},placeholder:Z("gutenberg_enter_code"),"aria-label":"Code"}),n=h(F,{label:Z("gutenberg_code_language"),value:t.c_language,options:[{label:"yaml",value:"yaml"},{label:"xml/html",value:"xml"},{label:"visualbasic",value:"visualbasic"},{label:"vhdl",value:"vhdl"},{label:"typescript",value:"typescript"},{label:"swift",value:"swift"},{label:"squirrel",value:"squirrel"},{label:"sql",value:"sql"},{label:"shell",value:"shell"},{label:"scss/sass",value:"scss"},{label:"rust",value:"rust"},{label:"ruby",value:"ruby"},{label:"raw",value:"raw"},{label:"python",value:"python"},{label:"prolog",value:"prolog"},{label:"powershell",value:"powershell"},{label:"php",value:"php"},{label:"nsis",value:"nsis"},{label:"matlab",value:"matlab"},{label:"markdown",value:"markdown"},{label:"lua",value:"lua"},{label:"less",value:"less"},{label:"kotlin",value:"kotlin"},{label:"json",value:"json"},{label:"javascript",value:"javascript"},{label:"java",value:"java"},{label:"ini/conf",value:"ini"},{label:"groovy",value:"groovy"},{label:"go/golang",value:"go"},{label:"docker",value:"dockerfile"},{label:"diff",value:"diff"},{label:"cordpro",value:"cordpro"},{label:"cython",value:"cython"},{label:"css",value:"css"},{label:"csharp",value:"csharp"},{label:"Cpp/C++/C",value:"cpp"},{label:"avrassembly",value:"avrassembly"},{label:"assembly",value:"assembly"},{label:Z("gutenberg_auto_detect"),value:"generic"}],onChange:function(e){return a({c_language:e})}}),o=h(H,null,h(V,{icon:"admin-appearance",title:Z("gutenberg_code_settings")},n,h(F,{label:Z("gutenberg_select_theme"),value:t.theme,options:[{label:"enlighter",value:"enlighter"},{label:"classic",value:"classic"},{label:"beyond",value:"beyond"},{label:"mowtwo",value:"mowtwo"},{label:"eclipse",value:"eclipse"},{label:"droide",value:"droide"},{label:"minimal",value:"minimal"},{label:"atomic",value:"atomic"},{label:"dracula",value:"dracula"},{label:"bootstrap4",value:"bootstrap4"},{label:"rowhammer",value:"rowhammer"},{label:"godzilla",value:"godzilla"},{label:Z("gutenberg_follow_theme"),value:""}],onChange:function(e){return a({theme:e})}}),h(B,{label:Z("gutenberg_show_line_numbers"),selected:t.linenumbers,options:[{label:Z("gutenberg_follow_theme"),value:""},{label:Z("gutenberg_show"),value:"true"},{label:Z("gutenberg_hide"),value:"false"}],onChange:function(e){return a({linenumbers:e})}}),h(L,{label:Z("gutenberg_start_line_number"),value:t.lineoffset,onChange:function(e){return a({lineoffset:e})},placeholder:Z("gutenberg_line_number_example")}),h(L,{label:Z("gutenberg_highlight_lines"),value:t.highlight,onChange:function(e){return a({highlight:e})},placeholder:Z("gutenberg_highlight_lines_format")})),h(V,{title:Z("gutenberg_code_group"),initialOpen:!1,icon:"excerpt-view"},h("p",null,Z("gutenberg_code_group_desc")),h(L,{label:Z("gutenberg_code_title"),value:t.title,onChange:function(e){return a({title:e})},placeholder:Z("gutenberg_code_group_title")}),h(L,{label:Z("gutenberg_custom_group_id"),value:t.group,onChange:function(e){return a({group:e})},placeholder:Z("gutenberg_custom_group_id_placeholder")})));return h("div",null,h(A,null,h(O,null,l)),h("div",{className:"enlighter-block-wrapper"},h("div",{className:"enlighter-header"},h("div",{className:"enlighter-title"})),h("pre",{tagName:"pre",className:"enlighter-pre"},h("div",{className:"enlighter-label"},Z("gutenberg_language_label"),t.c_language,Z("gutenberg_theme_label"),t.theme?t.theme:Z("gutenberg_follow_theme_short")),r),h("div",{className:"enlighter-footer"}),o))},save:function(e){var t=e.attributes,a=h("code",{className:"gl","data-enlighter-language":t.c_language,"data-enlighter-theme":t.theme,"data-enlighter-highlight":t.highlight,"data-enlighter-linenumbers":t.linenumbers,"data-enlighter-lineoffset":t.lineoffset,"data-enlighter-title":t.title,"data-enlighter-group":t.group},t.content);return h("pre",{},a)}}),f("aksrtblock/biaoti",{title:ae(Z("gutenberg_heading")),icon:Q.biaoti,category:"aksrt_block_cat",description:Z("gutenberg_heading_desc"),className:!1,textdomain:"default",attributes:{content:{type:"array",source:"children",selector:".title-theme"},typeClass:{source:"attribute",selector:".title-theme",attribute:"class"},color:{source:"attribute",selector:".title-theme",attribute:"data-color"},tag_name:{source:"tag",selector:".title-theme",attribute:"data-color"}},transforms:{from:[{type:"block",blocks:["core/heading","core/preformatted","core/paragraph"],transform:function(e){var t=e.content,a=e.level?"h"+e.level:"h2";return y("aksrtblock/biaoti",{content:t,tag_name:a})}}],to:[{type:"block",blocks:["core/heading"],transform:function(e){var t=e.content,a=e.tag_name?e.tag_name.replace("h",""):2;return y("core/heading",{content:t,level:~~a})}},{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("core/paragraph",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes.content,a=e.attributes.tag_name||"h2",l=t.typeClass||"title-theme",n=e.attributes.color;var o=h(q,{tagName:"div",onChange:function(t){e.setAttributes({content:t})},value:t,isSelected:e.isSelected,placeholder:Z("gutenberg_enter_heading"),disableLineBreaks:!0}),i=h("div",{className:l,"data-color":n,style:{color:n,"border-left-color":n}},h(a,{},o));var s=a.replace("h",""),c=h(T,{},h(I,{icon:Q["headingLevel"+s],label:Z("gutenberg_heading_level"),controls:[1,2,3,4,5].map(function(t){{const l="h"+t,r=a===l;return{icon:Q["headingLevel"+t],isActive:r,onClick:function(){e.setAttributes({tag_name:l})},role:"menuitemradio"}}})})),u=h(r.ColorPalette,{value:n,colors:Y,className:"q-ColorPalette",onChange:function(t){e.setAttributes({color:t})}});return h("div",{},i,h(O,null,c),h(H,null,h(V,{title:Z("gutenberg_custom_color")},h("p",{className:"components-base-control"},Z("gutenberg_heading_color_hint")),h("p",{className:"components-base-control"},u))))},save:function(e){var t=e.attributes.content,a=e.attributes.tag_name||"h2",l=e.attributes.typeClass||"title-theme",r=e.attributes.color;return h(a,{"data-color":r,className:l,style:r&&"--theme-color:"+r},t)}}),f("aksrtblock/hide-content",{title:ae(Z("gutenberg_hidden_content")),icon:{src:"hidden",foreground:U},description:Z("gutenberg_hidden_content_desc"),category:"aksrt_block_cat",attributes:{type:{source:"attribute",selector:"div",attribute:"data-type"},password:{source:"attribute",selector:"[data-password]",attribute:"data-password",default:""},img_id:{source:"attribute",selector:"[data-img-id]",attribute:"data-img-id",default:""},img_url:{source:"attribute",selector:"[data-img-url]",attribute:"data-img-url",default:""},desc:{source:"attribute",selector:"[data-desc]",attribute:"data-desc",default:""}},edit:function(e){var t=e.setAttributes,a=e.attributes,l=a.type||"reply",r=h("div",{className:"hide-innerblocks"},h(k)),n={reply:Z("gutenberg_comment_visible"),payshow:Z("gutenberg_paid_reading"),logged:Z("gutenberg_login_visible"),password:Z("gutenberg_password_verify"),vip1:Z("gutenberg_all_vip_visible"),vip2:Z("gutenberg_vip2_visible")},o=h(T,{},h(I,{icon:"editor-paste-text",className:"aksrtblock-buttons-sl",label:Z("gutenberg_hidden_mode_select"),controls:[{title:n.reply,value:"reply",onClick:function(){t({type:"reply"})}},{title:n.logged,value:"logged",onClick:function(){t({type:"logged"})}},{title:n.password,value:"password",onClick:function(){t({type:"password"})}},{title:n.payshow,value:"payshow",onClick:function(){t({type:"payshow"})}},{title:n.vip1,value:"vip1",onClick:function(){t({type:"vip1"})}},{title:n.vip2,value:"vip2",onClick:function(){t({type:"vip2"})}}]})),i=h(A,null,h(O,null,o));return h("div",{className:"hide-content"},i,h("div",{className:"hide-title"},J("gutenberg_hidden_content_title",n[l]),h("span",{className:"dashicons dashicons-admin-generic",style:{float:"right",margin:"5px 10px"}})),r,h(H,null,te(853),h(V,{title:Z("gutenberg_hidden_content_settings")},h(F,{label:Z("gutenberg_hidden_visible_mode"),value:l,options:[{label:n.reply,value:"reply"},{label:n.logged,value:"logged"},{label:n.password,value:"password"},{label:n.payshow,value:"payshow"},{label:n.vip1,value:"vip1"},{label:n.vip2,value:"vip2"}],onChange:function(e){t({type:e})}}),["payshow"==l&&h("div",{className:"block-editor-block-card__description"},Z("gutenberg_paid_reading_hint"),h("a",{href:"#wznav_3",target:"blank"},Z("gutenberg_view_official_tutorial_link")))],["password"==l&&h("div",{className:"block-editor-block-card__description"},h(L,{label:Z("gutenberg_set_password"),value:a.password||"",onChange:function(e){return t({password:e})},placeholder:Z("gutenberg_enter_password")}),h(L,{label:Z("gutenberg_remind_text"),value:a.desc||"",onChange:function(e){return t({desc:e})},placeholder:Z("gutenberg_enter_remind_content")}),[a.img_id&&h("div",{className:" "},h("img",{src:a.img_url}))],h(j,{title:Z("gutenberg_remind_image"),allowedTypes:["image"],onSelect:function(e){t({img_url:e.url,img_id:e.id})},value:a.img_id,render:function(e){var t=e.open;return h(z,{className:"but jb-blue is-secondary",onClick:t},[a.img_id?Z("gutenberg_replace_remind_image"):Z("gutenberg_add_remind_image")])}}),h("div",{className:"mt10 em09"},Z("gutenberg_password_remind_hint")),h("div",{className:"mt6 em09"},Z("gutenberg_password_unique_hint")))],h("div",{className:"opacity8 mb10 em09 mt10 c-yellow"},Z("gutenberg_hidden_no_nest_hint")))))},save:function(e){var t=e.attributes,a=t.type||"reply",l={},r="";return"password"==a&&(l={"data-password":t.password,"data-img-id":t.img_id,"data-img-url":t.img_url,"data-desc":t.desc},r=' password="'+t.password+'" img_id="'+t.img_id+'" img_url="'+t.img_url+'" desc="'+t.desc+'"'),h("div",{"data-type":a},[h("span",{},'[hidecontent type="'+a+'"'+r+"]"),h(k.Content),h("span",l,"[/hidecontent]")])}});var re=$(function(t,a){var l=t.url||G.root+"wp/v2/search";e.get(l,t,a)},600);f("aksrtblock/postslists",{title:ae(Z("gutenberg_post_list")),icon:Q.postslists,attributes:{orderby:{source:"attribute",selector:".single-posts-lists",attribute:"data-orderby",default:"date"},cat:{source:"attribute",selector:".single-posts-lists",attribute:"data-cat",default:""},topics:{source:"attribute",selector:".single-posts-lists",attribute:"data-topics",default:""},style:{source:"attribute",selector:".single-posts-lists",attribute:"data-style",default:"text"},count:{source:"attribute",selector:".single-posts-lists",attribute:"data-count",default:12},paginate:{source:"attribute",selector:".single-posts-lists",attribute:"data-paginate",default:""}},description:Z("gutenberg_post_list_desc"),category:"aksrt_block_cat",edit:function(e){var t=e.attributes,a=e.setAttributes,l=t.orderby||"date",r=t.cat||"",n=t.topics||"",o=t.style||"text",i=t.count||12,s=t.paginate||"",c=function(e){var t=Z("topics"===e?"gutenberg_topics":"gutenberg_category"),l=J("gutenberg_taxonomy_id_select",t);return h(L,{label:J("gutenberg_taxonomy_limit",t),value:"topics"===e?n:r,help:J("gutenberg_taxonomy_id_help",t),onChange:function(t){return a("topics"===e?{topics:t}:{cat:t})},placeholder:l})},u=h("div",{},c("cat"),c("topics"),h(F,{label:Z("gutenberg_orderby"),value:l,options:[{label:Z("gutenberg_post_title"),value:"title"},{label:Z("gutenberg_recent_update"),value:"modified"},{label:Z("gutenberg_latest_publish"),value:"date"},{label:Z("gutenberg_by_comments"),value:"comment_count"},{label:Z("gutenberg_by_likes"),value:"like"},{label:Z("gutenberg_by_views"),value:"views"},{label:Z("gutenberg_by_favorites"),value:"favorite"},{label:Z("gutenberg_sale_price"),value:"aksrtpay_price"},{label:Z("gutenberg_points_price"),value:"aksrtpay_points_price"},{label:Z("gutenberg_sales_volume"),value:"sales_volume"},{label:Z("gutenberg_random_order"),value:"rand"}],onChange:function(e){return a({orderby:e})}}),h(B,{label:Z("gutenberg_list_style"),selected:o,options:[{label:Z("gutenberg_text_list"),value:"text"},{label:Z("gutenberg_mini_card"),value:"minicard"}],onChange:function(e){return a({style:e})}}),h(L,{label:(""!=s?Z("gutenberg_per_page"):"")+Z("gutenberg_display_count"),value:i,onChange:function(e){return a({count:e})},placeholder:Z("gutenberg_enter_display_count")}),h(B,{label:Z("gutenberg_pagination"),selected:s,options:[{label:Z("gutenberg_not_show"),value:""},{label:Z("gutenberg_ajax_pagination"),value:"ajax"},{label:Z("gutenberg_number_pagination"),value:"number"}],onChange:function(e){return a({paginate:e})}})),b=h(H,null,te(22555),h(V,{title:Z("gutenberg_post_list_settings")},u));return h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.postsbox,h("span",{className:"ml10"},ae(Z("gutenberg_post_list")))),h("div",{className:"opacity8 mb10 em09"},Z("gutenberg_post_list_desc")),e.isSelected?h(V,{initialOpen:!1,title:Z("gutenberg_post_list_settings")},u):h("div",{class:"px12"},'[cat="'+t.cat+'" topics="'+t.topics+'" orderby="'+t.orderby+'" style="'+t.style+'" count="'+t.count+'" paginate="'+t.paginate+'"]'),b)},save:function(e){var t=e.attributes;return h("div",{class:"single-posts-lists",contenteditable:"false","data-orderby":t.orderby,"data-cat":t.cat,"data-topics":t.topics,"data-style":t.style,"data-count":t.count,"data-paginate":t.paginate},'[postslists cat="'+t.cat+'" topics="'+t.topics+'" orderby="'+t.orderby+'" style="'+t.style+'" count="'+t.count+'" paginate="'+t.paginate+'"]')}}),f("aksrtblock/postsbox",{title:ae(Z("gutenberg_post_card")),icon:Q.postsbox,attributes:{post_id:{source:"attribute",selector:"div",attribute:"data-pid"}},description:Z("gutenberg_post_card_desc"),category:"aksrt_block_cat",edit:function(e){var t=e.attributes.post_id,a=e.attributes;function l(t){if(!(t.length<2||~~t||a.loading)){var l={per_page:20,search:t,type:"post",post_type:["post","forum_post"],order_by:"post_title"};return e.setAttributes({loading:!0}),re(l,function(t){t=t||[],e.setAttributes({search_lists:t}),e.setAttributes({loading:!1})})}}a.search_lists=a.search_lists||[];var n=h("div",{className:"rti-container"},e.isSelected?h("div",{},h(L,{tagName:"div",onChange:function(t){e.setAttributes({post_id:t}),l(t)},required:!0,onKeyDown:function(e){13==e.keyCode&&l(e.target.value)},value:t,placeholder:Z("gutenberg_search_post_id"),label:Z("gutenberg_search_post_id")}),a.loading&&h(r.Spinner,{style:{position:"absolute",right:"12px",bottom:"30px"}})):h("div",{className:" "+(~~t?"px12":"c-red em09")},~~t?"[ID:"+t+"]"+(a.post_title?a.post_title:""):Z("gutenberg_post_id_invalid")));return h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.postsbox,h("span",{className:"ml10"},ae(Z("gutenberg_post_card")))),h("div",{className:"opacity8 mb10 em09"},Z("gutenberg_post_card_hint")),n,e.isSelected&&a.search_lists.length>0&&h(x,{focusOnMount:!1,position:"left middle center ",className:" "},h("div",{className:"block-editor-link-control"},h("div",{className:"mt6 block-editor-link-control__search-results"},a.search_lists.map(function(t,l){return function(t){return h("button",{className:"components-button components-menu-item__button block-editor-link-control__search-item has-text has-icon",key:t,onClick:function(){e.setAttributes({post_id:a.search_lists[t].id,post_title:a.search_lists[t].title}),this.popover_anchor_rect=!1}},h("span",{className:"em12 mr6"},Q.postsbox),h("span",{className:"components-menu-item__item"},h("span",{className:"components-menu-item__info-wrapper"},h("span",{className:"components-menu-item__item"},"["+a.search_lists[t].id+"]"+a.search_lists[t].title))),h("span",{className:"components-menu-item__shortcut"},a.search_lists[t].subtype))}(l)})))),h(H,null,te(860)))},save:function(e){var t=e.attributes.post_id;return h("div",{"data-pid":t},'[postsbox post_id="'+t+'"]')}}),f("aksrtblock/quote",{title:ae(Z("gutenberg_quote")),icon:{src:"format-quote",foreground:U},description:Z("gutenberg_quote_desc"),category:"aksrt_block_cat",attributes:{content:{type:"array",source:"children",selector:".quote_q p"},typeClass:{source:"attribute",selector:".quote_q",attribute:"class"},color:{source:"attribute",selector:".quote_q",attribute:"data-color"}},transforms:{from:[{type:"block",blocks:["aksrtblock/alert","core/quote","core/preformatted","core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/quote",{content:t})}}],to:[{type:"block",blocks:["core/quote"],transform:function(e){var t=e.content;return y("core/quote",{content:t})}},{type:"block",blocks:["aksrtblock/alert"],transform:function(e){var t=e.content;return y("aksrtblock/alert",{content:t})}},{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("core/paragraph",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes.content,a=e.attributes.typeClass||"quote_q",l=e.attributes.color,n=l||"";var o=h(q,{tagName:"div",isSelected:e.isSelected,onChange:function(t){e.setAttributes({content:t})},value:t,placeholder:Z("gutenberg_enter_content")}),i=h("div",{className:a,style:{"--quote-color":n}},h("i",{className:"fa fas fa-quote-left"}),o),s=h(r.ColorPalette,{value:l||"#555",colors:Y,className:"q-ColorPalette",onChange:function(t){e.setAttributes({color:t})}});return h("div",{},i,h("div",{},h(H,null,h(V,{title:Z("gutenberg_custom_color")},h("p",{},Z("gutenberg_quote_color_hint")),h("p",{},s)))))},save:function(e){var t=e.attributes.content,a=e.attributes.typeClass||"quote_q",l=e.attributes.color,r=h("div",{className:a,"data-color":l,style:l&&"--quote-color:"+l},h("i",{className:"fa fas fa-quote-left"}),h("p",{},t));return h("div",{},r)}}),f("aksrtblock/alert",{title:ae(Z("gutenberg_alert")),icon:{src:"info",foreground:U},description:Z("gutenberg_alert_desc"),category:"aksrt_block_cat",attributes:{content:{type:"array",source:"children",selector:"div.alert"},typeClass:{source:"attribute",selector:".alert",attribute:"class"},isChecked:{source:"attribute",selector:".alert",attribute:"data-isclose"}},transforms:{from:[{type:"block",blocks:["aksrtblock/quote","core/quote","core/preformatted","core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/alert",{content:t})}}],to:[{type:"block",blocks:["core/quote"],transform:function(e){var t=e.content;return y("core/quote",{content:t})}},{type:"block",blocks:["aksrtblock/quote"],transform:function(e){var t=e.content;return y("aksrtblock/quote",{content:t})}},{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("core/paragraph",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes.content,a=e.attributes.typeClass||"alert jb-blue",l=e.attributes.isChecked,r=e.isSelected;function n(t){var a=t.target.className;e.setAttributes({typeClass:"alert "+a})}var o=h(q,{tagName:"div",isSelected:e.isSelected,onChange:function(t){e.setAttributes({content:t})},value:t,placeholder:Z("gutenberg_enter_content")}),i=h("div",{className:a},o),s=h("span",{className:"g_extend anz alert_b"},[h("button",{className:"jb-blue",onClick:n}),h("button",{className:"jb-green",onClick:n}),h("button",{className:"jb-yellow",onClick:n}),h("button",{className:"jb-red",onClick:n})]),c=h("div",{className:"close_an"},h(P,{label:Z("gutenberg_alert_closable"),checked:l,onChange:function(t){e.setAttributes({isChecked:t})}}));return h("div",{},[i,l&&h("button",{className:"close"},"×"),r&&s,r&&c],h(H,null,h(V,{icon:"admin-appearance",title:Z("gutenberg_alert_settings")},h("div",{},Z("gutenberg_alert_type")),h("div",{},s)),c))},save:function(e){var t=e.attributes.content,a=e.attributes.isChecked||"",l=e.attributes.typeClass||"alert jb-blue",r=h("button",{type:"button",className:"close","data-dismiss":"alert","aria-label":"Close"},h("div",{"data-class":"ic-close","data-svg":"close","data-viewbox":"0 0 1024 1024"})),n=h("div",{className:l,"data-isclose":a,role:"alert"},t);return h("div",{className:"alert-dismissible fade in"},[a&&r],n)}}),f("aksrtblock/buttons",{title:ae(Z("gutenberg_buttons")),description:Z("gutenberg_buttons_desc"),icon:Q.buttons,category:"aksrt_block_cat",attributes:{alignment:{type:"string"},quantity:{type:"attribute",attribute:"data-quantity",default:1},radius:{type:"attribute",attribute:"data-radius",default:!0},content1:{type:"array",source:"children",selector:"span.an_1"},typeClass1:{source:"attribute",selector:".an_1",attribute:"class"},content2:{type:"array",source:"children",selector:"span.an_2"},typeClass2:{source:"attribute",selector:".an_2",attribute:"class"},content3:{type:"array",source:"children",selector:"span.an_3"},typeClass3:{source:"attribute",selector:".an_3",attribute:"class"},content4:{type:"array",source:"children",selector:"span.an_4"},typeClass4:{source:"attribute",selector:".an_4",attribute:"class"},content5:{type:"array",source:"children",selector:"span.an_5"},typeClass5:{source:"attribute",selector:".an_5",attribute:"class"}},transforms:{from:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/buttons",{content1:t})}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content1;return y("core/paragraph",{content:t})}}]},edit:function(t){var a=t.attributes,l=t.setAttributes,r=a.alignment,n=t.isSelected,o=a.quantity,i=a.radius,s=[];for(let r=0;r<=5;r++)s["c"+r]=a["content"+r],s["cs"+r]=a["typeClass"+r]||"but b-blue",s["rt"+r]=h(q,{tagName:"div",onChange:function(e){l({["content"+r]:e})},value:s["c"+r],isSelected:t.isS,placeholder:Z("gutenberg_button")+"-"+r}),s["crt"+r]=h("div",{className:s["cs"+r]},s["rt"+r]),s["bk"+r]=h("button",{className:"anz sz",onClick:function(){e(".anz.an.x"+r).slideToggle(200)}},h("span",{className:"dashicons dashicons-admin-appearance"})),s["btt"+r]=h("div",{className:"g_extend anz an x"+r},h("button",{className:"but b-red",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-yellow",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-blue",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-green",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-purple",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-red",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-yellow",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-blue",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-green",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-purple",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-red",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-yellow",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-blue",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-green",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-purple",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""));var c=h(T,{},h(I,{icon:"plus-alt",className:"aksrtblock-buttons-sl",label:Z("gutenberg_button_count"),controls:[{title:Z("gutenberg_count_1"),value:1,onClick:function(){l({quantity:1})}},{title:Z("gutenberg_count_2"),onClick:function(){l({quantity:2})}},{title:Z("gutenberg_count_3"),value:3,onClick:function(){l({quantity:3})}},{title:Z("gutenberg_count_4"),value:4,onClick:function(){l({quantity:4})}},{title:Z("gutenberg_count_5"),value:5,onClick:function(){l({quantity:5})}}]})),u=h(A,null,h(O,null,c,h(E,{value:r,onChange:function(e){l({alignment:e})}})));return h("div",{style:{textAlign:r},className:"aniuzu "+(i&&"radius")},u,[s.crt1,n&&s.bk1,n&&s.btt1],[o>=2&&[s.crt2,n&&s.bk2,n&&s.btt2]],[o>=3&&[s.crt3,n&&s.bk3,n&&s.btt3]],[o>=4&&[s.crt4,n&&s.bk4,n&&s.btt4]],[o>=5&&[s.crt5,n&&s.bk5,n&&s.btt5]],h(H,null,h(V,{icon:"admin-generic",title:Z("gutenberg_button_settings")},h(R,{label:Z("gutenberg_button_count"),value:o,onChange:function(e){l({quantity:e})},min:"1",max:"5"}),h(P,{className:"close_an",label:Z("gutenberg_button_radius"),checked:i,onChange:function(e){l({radius:e})}}))))},save:function(e){var t=e.attributes,a=t.alignment,l=t.quantity,r=t.radius,n=[];for(let e=0;e<=5;e++)n[e]=t["content"+e],n["s"+e]=t["typeClass"+e]||"an_"+e+" but b-blue",n["jg"+e]=h("span",{className:n["s"+e]},n[e]);return h("div",{"data-quantity":l,"data-radius":r,style:{textAlign:a},className:r&&"radius"},[l>0&&n.jg1],[l>1&&n.jg2],[l>2&&n.jg3],[l>3&&n.jg4],[l>4&&n.jg5])}}),f("aksrtblock/carousel",{title:ae(Z("gutenberg_carousel")),description:Z("gutenberg_carousel_desc"),icon:{src:"images-alt2",foreground:U},category:"aksrt_block_cat",attributes:{center:{type:"string",selector:"div",source:"attribute",attribute:"data-cen",default:!0},interval:{type:"string",selector:".carousel",source:"attribute",attribute:"data-interval",default:4e3},limitedwidth:{type:"string",selector:"div",source:"attribute",attribute:"data-liw",default:!0},maxwidth:{type:"string",source:"attribute",selector:"div",attribute:"data-mw",default:600},effect:{type:"string",selector:".carousel",source:"attribute",attribute:"data-effect",default:""},jyloop:{type:"string",selector:".carousel",source:"attribute",attribute:"data-jyloop",default:!0},id:{type:"string",selector:".carousel",source:"attribute",attribute:"id"},proportion:{type:"string",selector:".carousel",source:"attribute",attribute:"proportion",default:"0.6"}},edit:function(e){var t=e.attributes,a=t.limitedwidth,l=t.interval,r=t.center,n=t.maxwidth,o=t.effect,i=t.jyloop,s=e.setAttributes,c=parseInt((Math.random()+1)*Math.pow(10,4));t.id||s({id:c});var u=h(k,{allowedBlocks:["core/gallery"],templateLock:"",template:[["core/gallery",{linkTo:"none",columns:"8"}]]},""),b=h(R,{label:Z("gutenberg_switch_interval"),value:l/1e3,onChange:function(e){s({interval:1e3*e})},min:"1",max:"20"}),d=h(P,{label:Z("gutenberg_loop"),checked:i,onChange:function(e){s({jyloop:e})}}),g=h(P,{label:Z("gutenberg_limit_max_width"),checked:a,onChange:function(e){s({limitedwidth:e})}}),_=h(P,{label:Z("gutenberg_center_display"),checked:r,onChange:function(e){s({center:e})}}),p=h(R,{label:Z("gutenberg_max_width"),value:n,onChange:function(e){s({maxwidth:e})},min:"200",max:"1500"}),m=h(F,{label:Z("gutenberg_switch_animation"),value:o,onChange:function(e){s({effect:e})},options:[{label:Z("gutenberg_slide"),value:""},{label:Z("gutenberg_fade"),value:"fade"},{label:Z("gutenberg_3d_cube"),value:"cube"},{label:Z("gutenberg_3d_slide"),value:"coverflow"},{label:Z("gutenberg_3d_flip"),value:"flip"}]});return h("div",{className:"carousel iss"},h("div",{className:"leab"},ae(Z("gutenberg_carousel")),h("span",{className:"dashicons dashicons-admin-generic"})),u,h(H,null,te(675),h(V,{title:Z("gutenberg_carousel_settings")},m,h(F,{label:Z("gutenberg_keep_aspect_ratio"),value:t.proportion,options:[{label:Z("gutenberg_disabled"),value:""},{label:Z("gutenberg_ratio_landscape_3_1"),value:"0.333"},{label:Z("gutenberg_ratio_landscape_5_2"),value:"0.4"},{label:Z("gutenberg_ratio_landscape_2_1"),value:"0.5"},{label:Z("gutenberg_ratio_landscape_5_3"),value:"0.6"},{label:Z("gutenberg_ratio_landscape_4_3"),value:"0.75"},{label:Z("gutenberg_ratio_landscape_5_4"),value:"0.75"},{label:Z("gutenberg_ratio_landscape_8_7"),value:"0.875"},{label:Z("gutenberg_ratio_square_1_1"),value:"1"},{label:Z("gutenberg_ratio_portrait_7_8"),value:"1.142"},{label:Z("gutenberg_ratio_portrait_4_5"),value:"1.25"},{label:Z("gutenberg_ratio_portrait_3_4"),value:"1.333"},{label:Z("gutenberg_ratio_portrait_3_5"),value:"1.666"},{label:Z("gutenberg_ratio_portrait_1_2"),value:"2"},{label:Z("gutenberg_ratio_portrait_2_5"),value:"2.5"},{label:Z("gutenberg_ratio_portrait_1_3"),value:"3"}],onChange:function(e){s({proportion:e})}}),b,d,g,a&&[p,_],h("p",null,Z("gutenberg_carousel_ratio_hint")))))},save:function(e){var t=e.attributes,a=t.limitedwidth?"true":"",l=t.center?"true":"",r=t.maxwidth,n=t.interval,o=t.effect,i=t.jyloop?"true":"",s=a&&l?"10px auto":"",c=a&&r+"px"||"",u=t.id,b=h("div",{className:"swiper-button-next"}),d=h("div",{className:"swiper-button-prev"}),g=h("div",{className:"swiper-pagination"});return h("div",{"data-mw":r,"data-liw":a,"data-cen":l,className:"wp-block-carousel"},h("div",{className:"carousel slide","data-effect":o,"data-jyloop":i,"data-interval":n,id:u,proportion:t.proportion,style:{"max-width":c,margin:s}},h(k.Content),b,d,g))}}),f("aksrtblock/seamlessimg",{title:ae(Z("gutenberg_seamless_image")),description:Z("gutenberg_seamless_image_desc"),className:!1,icon:Q.seamlessimg,category:"aksrt_block_cat",attributes:{full_container:{type:"string",selector:"div",source:"attribute",attribute:"data-full-container",default:!0}},edit:function(e){var t=e.attributes.full_container,a=(e.attributes.isChecked,e.setAttributes);var l=h(k,{allowedBlocks:["core/gallery"],templateLock:"",template:[["core/gallery",{linkTo:"none",columns:1,imageCrop:!1,fixedHeight:!1,sizeSlug:"full"}]]},""),r=h(P,{label:Z("gutenberg_width_full_container"),checked:t,onChange:function(e){a({full_container:e})}});return h("div",{className:"carousel iss seamless-img"+(t?" full-container":"")},h("div",{className:"leab"},ae(Z("gutenberg_seamless_image")),h("span",{className:"dashicons dashicons-admin-generic"})),l,h(H,null,te(675),h(V,{title:Z("gutenberg_seamless_image_settings")},r,h("p",{className:"px12 opacity5"},Z("gutenberg_seamless_image_full_hint")))))},save:function(e){var t=e.attributes.full_container?"true":"";return h("div",{"data-full-container":t,className:"seamless-img"+(t?" full-container":"")},h(k.Content))}}),f("aksrtblock/productbox",{title:ae(Z("gutenberg_product")),icon:Q.productbox,className:!1,attributes:{post_id:{source:"attribute",selector:"div",attribute:"data-pid"}},description:Z("gutenberg_product_desc"),category:"aksrt_block_cat",edit:function(e){var t=e.attributes.post_id,a=e.attributes,l=e.setAttributes;function n(e){if(!(e.length<2||~~e||a.loading)){var t={per_page:20,search:e,type:"post",post_type:["shop_product"],order_by:"post_title"};return l({loading:!0}),re(t,function(e){l({search_lists:e=e||[],loading:!1})})}}a.search_lists=a.search_lists||[];var o=h("div",{className:"rti-container"},e.isSelected?h("div",{},h(L,{tagName:"div",onChange:function(e){l({post_id:e}),n(e)},required:!0,onKeyDown:function(e){13==e.keyCode&&n(e.target.value)},value:t,placeholder:Z("gutenberg_search_product_id"),label:Z("gutenberg_search_product_id")}),a.loading&&h(r.Spinner,{style:{position:"absolute",right:"12px",bottom:"30px"}})):h("div",{className:" "+(~~t?"px12":"c-red em09")},~~t?"[ID:"+t+"]"+(a.post_title?a.post_title:""):Z("gutenberg_product_id_invalid")));return h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.productbox,h("span",{className:"ml10"},ae(Z("gutenberg_shop_product")))),h("div",{className:"opacity8 mb10 em09"},Z("gutenberg_product_card_desc")),o,e.isSelected&&a.search_lists.length>0&&h(x,{focusOnMount:!1,position:"left middle center ",className:" "},h("div",{className:"block-editor-link-control"},h("div",{className:"mt6 block-editor-link-control__search-results"},a.search_lists.map(function(t,l){return function(t){return h("button",{className:"components-button components-menu-item__button block-editor-link-control__search-item has-text has-icon",key:t,onClick:function(){e.setAttributes({post_id:a.search_lists[t].id,post_title:a.search_lists[t].title}),this.popover_anchor_rect=!1}},h("span",{className:"em12 mr6"},Q.postsbox),h("span",{className:"components-menu-item__item"},h("span",{className:"components-menu-item__info-wrapper"},h("span",{className:"components-menu-item__item"},"["+a.search_lists[t].id+"]"+a.search_lists[t].title))),h("span",{className:"components-menu-item__shortcut"},a.search_lists[t].subtype))}(l)})))),h(H,null,te(860)))},save:function(e){var t=e.attributes.post_id;return h("div",{className:"post-productbox",contenteditable:"false","data-pid":t},'[productbox id="'+t+'"]')}}),l.updateCategory("aksrt_block_cat",{icon:Q.legacy})})}(jQuery,wp,window); \ No newline at end of file +!function(e,t,a){e(document).ready(function(){console.log(Z("gutenberg_editor_enhanced"));var l=t.blocks,r=t.components,n=t.element,o=t.blockEditor?t.blockEditor:t.editor,i=t.richText.registerFormatType,s=t.data,c=s.dispatch,u=s.select,b=c("core/block-editor")?c("core/block-editor"):c("core/editor"),d=u("core/block-editor")?u("core/block-editor"):u("core/editor"),g=d.getBlockOrder,_=d.getBlock,p=b.insertBlock,m=b.removeBlock,v=b.updateBlockAttributes,h=n.createElement,f=l.registerBlockType,y=l.createBlock,k=o.InnerBlocks,N=o.RichTextToolbarButton,C=n.Component,w=t.dom.getRectangleFromRange,x=r.Popover,z=r.Button,q=o.RichText,M=o.PlainText,j=o.MediaUpload,A=n.Fragment,H=o.InspectorControls,V=r.PanelBody,S=r.ClipboardButton,L=r.TextControl,B=r.RadioControl,T=r.Toolbar,F=r.SelectControl,P=r.ToggleControl,R=r.RangeControl,I=r.DropdownMenu,O=o.BlockControls,E=o.AlignmentToolbar,D=a.lodash||a._,G=a.wpApiSettings,K=D.times,$=D.debounce;function Z(e){var t=a.aksrt_block_var&&a.aksrt_block_var.i18n;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e}function J(e){var t=Array.prototype.slice.call(arguments,1),a=Z(e),l=0;return a.replace(/%(\d+\$)?s/g,function(e,a){var r=a?parseInt(a,10)-1:l++;return void 0!==t[r]&&null!==t[r]?t[r]:e})}var Q={},U="#1fbc45",W=function(e){return{viewBox:e=e||"0 0 1024 1024",className:"svg-icon",xmlns:X}},X="http://www.w3.org/2000/svg";Q.legacy=h("svg",{width:"16px",height:"16px",viewBox:"0 0 80 90",className:"svg-icon mb10",xmlns:X,fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"1.414"},h("g",{fillRule:"nonzero",transform:"scale(0.19785394)"},h("path",{d:"m 408.68862,333.8044 0.009,0.59315 0.004,0.29795 c 0.18694,71.91774 -59.58485,130.93907 -134.53126,132.29044 -0.85543,0.0154 -1.71097,0.0231 -2.56654,0.0231 H 21.034693 C 11.007191,467.00905 2.5761396,460.42672 0.14656613,451.50411 L 338.63176,215.013 c 45.60925,25.97569 68.96153,65.57282 70.05686,118.7914 z M 231.25625,0 C 278.01331,0 321.188,23.909861 344.73248,62.682399 L 0,303.53751 V 20.793975 C 0,9.3097796 9.6674353,0 21.592821,0 Z",fill:U}))),Q.productbox=h("svg",W(),h("path",{d:"M975.36 400.64A88.32 88.32 0 0 0 887.68 320h-57.6c0-176.64-142.72-320-318.08-320-175.36 0-318.08 143.36-318.08 320h-57.6c-45.44 0-83.2 34.56-87.68 80.64l-44.16 446.08c-4.48 45.44 10.24 90.88 40.96 124.8 30.08 33.28 72.96 52.48 118.4 52.48h696.32c45.44 0 88.96-19.2 119.04-53.12 30.08-33.92 45.44-79.36 40.96-124.8l-44.8-445.44zM512 64c140.16 0 254.08 114.56 254.08 256H257.92c0-141.44 113.92-256 254.08-256z m419.84 864c-18.56 20.48-44.16 32-71.68 32H163.84c-27.52 0-53.12-11.52-71.68-32-18.56-20.48-27.52-47.36-24.96-75.52l44.16-446.08c1.28-12.8 12.16-22.4 24.96-22.4h57.6v96c0 17.92 14.08 32 32 32 17.28 0 32-14.08 32-32V384h508.8v96c0 17.92 14.08 32 32 32 17.28 0 32-14.08 32-32V384h57.6c12.8 0 23.68 9.6 24.96 22.4l44.16 446.08c1.92 28.16-7.04 54.4-25.6 75.52z",fill:U}),h("path",{d:"M752 679.04a536.768 536.768 0 0 1-480 0 31.744 31.744 0 0 0-42.88 14.08c-7.68 16-1.28 35.2 14.08 42.88 83.84 42.24 176.64 63.36 268.8 63.36 92.16 0 184.32-21.12 268.8-63.36 16-7.68 21.76-26.88 14.08-42.88a31.744 31.744 0 0 0-42.88-14.08z",fill:U})),Q.video=h("svg",W(),h("path",{d:"M704 874.666667H128c-46.933333 0-85.333333-38.4-85.333333-85.333334V234.666667c0-46.933333 38.4-85.333333 85.333333-85.333334h576c46.933333 0 85.333333 38.4 85.333333 85.333334v554.666666c0 46.933333-38.4 85.333333-85.333333 85.333334zM128 213.333333c-12.8 0-21.333333 8.533333-21.333333 21.333334v554.666666c0 12.8 8.533333 21.333333 21.333333 21.333334h576c12.8 0 21.333333-8.533333 21.333333-21.333334V234.666667c0-12.8-8.533333-21.333333-21.333333-21.333334H128z",fill:U}),h("path",{d:"M277.333333 490.666667c-59.733333 0-106.666667-46.933333-106.666666-106.666667s46.933333-106.666667 106.666666-106.666667 106.666667 46.933333 106.666667 106.666667-46.933333 106.666667-106.666667 106.666667z m0-149.333334c-23.466667 0-42.666667 19.2-42.666666 42.666667s19.2 42.666667 42.666666 42.666667 42.666667-19.2 42.666667-42.666667-19.2-42.666667-42.666667-42.666667zM938.666667 800c-8.533333 0-14.933333-2.133333-21.333334-6.4L725.333333 682.666667V341.333333l192-110.933333c10.666667-6.4 21.333333-6.4 32-4.266667 10.666667 2.133333 21.333333 8.533333 25.6 19.2 4.266667 6.4 6.4 14.933333 6.4 21.333334v490.666666c0 23.466667-19.2 42.666667-42.666666 42.666667z m-149.333334-153.6l128 74.666667V302.933333l-128 74.666667v268.8z",fill:U})),Q.iframe=h("svg",W(),h("path",{d:"M885.76 52.053333h-364.8c-47.786667 0-86.186667 38.826667-86.186667 86.186667v82.346667H139.093333c-48.213333 0-87.466667 39.253333-87.466666 87.04v576.426666c0 48.213333 39.253333 87.466667 87.466666 87.466667h576.426667c48.213333 0 87.04-39.253333 87.04-87.466667v-294.826666h82.773333c47.786667 0 86.186667-38.826667 86.186667-86.186667V138.666667c0.426667-47.786667-37.973333-86.613333-85.76-86.613334z m-151.04 832.426667c0 10.666667-8.533333 19.2-19.2 19.2H139.093333c-10.666667 0-19.2-8.533333-19.2-19.2V308.053333c0-10.666667 8.533333-19.2 19.2-19.2h295.253334v214.186667c0 12.373333 2.56 24.32 7.68 34.986667L255.146667 725.333333v-68.693333c0-18.773333-15.36-34.133333-34.133334-34.133333s-34.133333 15.36-34.133333 34.133333v151.04a33.109333 33.109333 0 0 0 9.386667 23.466667c0.426667 0.426667 0.426667 0.426667 0.426666 0.853333 0.426667 0.426667 0.853333 0.426667 1.28 0.853333 2.986667 2.56 5.973333 5.12 9.813334 6.4 4.266667 1.706667 8.533333 2.56 13.226666 2.56h151.04c18.773333 0 34.133333-15.36 34.133334-34.133333s-15.36-34.133333-34.133334-34.133333H303.36l189.013333-189.013334c8.96 2.986667 18.346667 5.12 28.586667 5.12h213.76v294.826667z m168.96-381.013333c0 9.813333-8.106667 17.92-17.92 17.92h-364.8c-9.813333 0-17.92-8.106667-17.92-17.92V138.666667c0-9.813333 8.106667-17.92 17.92-17.92h364.8c9.813333 0 17.92 8.106667 17.92 17.92v364.8z",fill:U})),Q.iframeseries=h("svg",W(),h("path",{d:"m 662.88377,441.87421 a 42.666667,42.666667 0 0 1 -72.87235,-31.63569 l 7.28782,-180.63176 a 43.235556,43.235556 0 0 1 42.55618,-42.72389 42.666667,42.666667 0 0 1 42.72388,42.55617 l -7.2815,183.84988 a 40.96,40.96 0 0 1 -12.41403,28.58529 z",fill:U}),h("path",{d:"m 843.88852,434.27746 a 42.097778,42.097778 0 0 1 -28.53625,12.52636 l -181.00475,7.59675 a 42.666667,42.666667 0 0 1 -4.18877,-84.46761 l 180.60327,-7.19369 a 42.666667,42.666667 0 0 1 32.32355,72.34431 z",fill:U}),h("path",{d:"M 873.65726,230.27007 662.88377,441.87421 a 42.666668,42.666668 0 0 1 -60.45832,-60.221 L 813.19894,170.04908 a 42.666667,42.666667 0 0 1 60.45832,60.22099 z",fill:U}),h("path",{d:"m 922.2479,554.42362 0.64665,328.81714 a 42.097778,42.097778 0 0 1 -42.58268,42.75049 l -735.00302,1.44546 a 42.097778,42.097778 0 0 1 -42.75049,-42.58267 l -1.17919,-599.60773 a 42.666667,42.666667 0 0 1 42.58268,-42.75049 l 302.6483,-0.59519 a 42.666667,42.666667 0 1 1 0.16782,85.33316 l -259.98172,0.51129 1.00689,511.99901 649.66986,-1.27765 -0.55939,-284.44389 a 42.666667,42.666667 0 1 1 85.33317,-0.16782 z",fill:U}),h("path",{d:"m 705.18337,682.28186 a 42.097778,42.097778 0 0 1 -42.58268,42.75049 l -341.33267,0.67126 a 42.666667,42.666667 0 0 1 -0.16782,-85.33316 l 341.33268,-0.67127 a 42.666667,42.666667 0 0 1 42.75049,42.58268 z M 534.15231,497.16007 a 42.097778,42.097778 0 0 1 -42.58268,42.75049 L 320.9033,540.2462 a 42.666667,42.666667 0 1 1 -0.16782,-85.33317 l 170.66634,-0.33564 a 42.666667,42.666667 0 0 1 42.75049,42.58268 z",fill:U})),Q.feature=h("svg",W(),h("path",{d:"M833.176 606.564c37.737-60.688 59.927-131.977 59.927-208.47 0-218.921-178.605-397.021-398.09-397.021-219.534 0-398.178 178.1-398.178 397.021 0 87.873 29.126 168.877 77.787 234.72L30.118 883.48l156.358 11.582L275.333 1024l136.88-237.615c26.767 5.693 54.414 8.782 82.806 8.782 38.717 0 76.062-5.787 111.49-16.139L747.663 1024l88.858-128.938 156.314-11.582-159.659-276.916zM362.37 772.156L271.496 929.8l-57.172-83.017-100.66-7.458 95.25-165.296c0.79 0.832 1.719 1.474 2.509 2.307 9.742 9.86 19.876 19.33 30.555 28.111 2.364 1.917 4.918 3.581 7.283 5.448 8.902 6.966 18.004 13.636 27.45 19.872 3.641 2.401 7.384 4.463 11.07 6.72 9.104 5.542 18.353 10.794 27.9 15.603 3.002 1.57 6.05 2.995 9.154 4.414a397.407 397.407 0 0 0 34.93 14.575c0.885 0.342 1.72 0.782 2.605 1.078z m43.495-39.2a355.38 355.38 0 0 1-51.657-18.007 8.63 8.63 0 0 0-0.79-0.346c-15.4-6.822-30.112-14.916-44.236-23.843-1.62-1.035-3.344-1.967-4.92-2.995-13.377-8.731-26.027-18.592-38.076-29.146a321.702 321.702 0 0 1-7.632-6.916c-11.853-10.988-23.17-22.664-33.55-35.424-48.562-59.66-77.789-135.564-77.789-218.185 0-191.2 156.018-346.781 347.799-346.781 191.737 0 347.704 155.58 347.704 346.781 0 73.108-22.88 140.862-61.749 196.844-8.705 12.509-18.347 24.336-28.633 35.57-2.263 2.503-4.426 5.006-6.74 7.408-11.461 11.826-23.669 22.916-36.655 33.023-1.379 1.078-2.807 2.06-4.185 3.139-28.487 21.441-60.174 38.76-94.022 50.682-1.72 0.587-3.394 1.273-5.115 1.865l-8.611 2.995a347.098 347.098 0 0 1-101.994 15.307c-30.847 0-60.662-4.42-89.149-11.972z m402.807 113.826l-57.17 83.017-96.925-168.19c13.58-5.938 26.711-12.76 39.457-20.167 1.625-0.934 3.198-1.917 4.773-2.895 10.773-6.43 21.154-13.346 31.193-20.703a354.339 354.339 0 0 0 7.971-5.94c8.657-6.67 16.925-13.686 24.992-21.05 3.15-2.843 6.298-5.542 9.345-8.435 7.53-7.313 14.616-15.011 21.507-22.86 2.36-2.654 5.064-5.006 7.327-7.754L909.29 839.324l-100.617 7.458z",fill:U}),h("path",{d:"M654.672 637.872l-30.548-177.414 129.3-125.559-178.65-25.904-79.71-161.369-79.95 161.369-178.693 25.904 129.343 125.56-30.503 177.361 159.753-83.753 159.658 83.805z m-309.915-267.94l103.814-15.016 46.398-93.76 46.347 93.76 103.765 15.017L570 442.889l17.76 103.033-92.74-48.671-92.845 48.721 17.713-103.083-75.13-72.956z",fill:U})),Q.biaoti=h("svg",W(),h("path",{d:"M203.127 1023.991a143.334 143.334 0 0 1-109.74-49.27 154.98 154.98 0 0 1-38.073-100.782V160.854A165.73 165.73 0 0 1 225.074 0.052h573.783a165.73 165.73 0 0 1 169.76 160.802V873.94a139.302 139.302 0 0 1-6.718 44.792 137.063 137.063 0 0 1-91.823 92.27 154.532 154.532 0 0 1-143.334-25.978L583.857 873.49a89.584 89.584 0 0 0-105.261-4.479L290.023 997.564a158.115 158.115 0 0 1-86.896 26.427z m21.948-961.23a102.573 102.573 0 0 0-106.605 98.093V873.94a89.584 89.584 0 0 0 22.396 60.021 86.448 86.448 0 0 0 113.771 11.646L443.211 817.5a151.396 151.396 0 0 1 179.167 6.72L763.472 936.2a93.167 93.167 0 0 0 85.552 15.229 77.938 77.938 0 0 0 52.406-51.959 83.76 83.76 0 0 0 3.584-25.53V160.853A102.573 102.573 0 0 0 798.857 62.76zM377.367 152.344h268.75q44.792 0 44.792 44.792 0 44.791-44.792 44.791h-268.75q-44.792 0-44.792-44.791 0-44.792 44.792-44.792z",fill:U})),Q.postsbox=h("svg",W(),h("path",{d:"M544.256 887.97866668c-9.728 0-19.456-2.56-28.16-8.192-16.896-10.24-27.136-28.16-26.624-48.128V269.99466668c0-24.576 13.824-47.616 35.84-58.368 117.76-60.416 260.608-90.112 423.936-87.04 35.84 1.024 65.024 30.208 65.024 66.048V731.30666668c0 33.792-25.088 61.44-58.88 65.024l-20.992 2.56c-141.312 15.36-263.168 29.184-364.032 82.944-8.192 4.096-17.408 6.144-26.112 6.144zM928.768 175.78666668c-146.432 0-274.432 27.648-380.416 81.92-4.608 2.56-7.68 7.168-7.68 12.8v562.688c0 1.536 0.512 2.56 2.048 3.584s2.56 0.512 3.072 0h0.512c109.568-58.368 236.032-72.192 382.976-88.576l20.992-2.56c7.68-0.512 13.312-6.656 13.312-13.824V190.63466668c0-8.192-6.656-14.848-14.848-14.848h-19.968z",fill:U}),h("path",{d:"M487.424 889.51466668c-8.704 0-17.408-2.048-25.6-6.656C358.4 827.05066668 232.448 813.73866668 87.04 797.86666668l-13.312-1.536c-33.28-3.072-58.368-30.72-58.368-64.512V191.14666668c0-35.328 29.184-65.024 65.024-66.048 163.84-2.56 306.688 26.624 424.448 87.552 21.504 10.752 35.328 33.792 35.328 57.856V836.26666668c0 18.944-9.728 36.352-26.112 46.08-8.192 4.608-17.408 7.168-26.624 7.168z m-386.56-713.216H81.408c-8.192 0-14.848 6.656-14.848 14.848v540.672c0 7.168 5.632 13.312 12.8 13.824l13.312 1.536c151.04 15.872 281.088 30.208 393.728 90.624h0.512c0.512 0.512 1.024 0.512 1.536 0s1.024-1.024 1.024-1.536V270.50666668c0-5.12-3.072-10.24-7.168-12.288-106.496-54.784-234.496-81.92-381.44-81.92z",fill:U}),h("path",{d:"M386.56 416.93866668c-3.072 0-6.656-0.512-9.728-2.048-67.584-27.136-136.704-40.96-204.288-40.96-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6c74.24 0 149.504 14.848 223.744 45.056 13.312 5.12 19.456 19.968 14.336 33.28-4.096 9.728-13.824 15.872-24.064 15.872z m0 171.52c-3.072 0-6.656-0.512-9.728-2.048-67.584-27.136-136.704-40.96-204.288-40.96-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6c74.24 0 149.504 14.848 223.744 45.056 13.312 5.12 19.456 19.968 14.336 33.28-4.096 9.728-13.824 15.872-24.064 15.872z m256.512-171.52c-10.24 0-19.968-6.144-23.552-15.872-5.12-13.312 1.024-28.16 14.336-33.28 73.728-29.696 148.992-45.056 223.744-45.056 14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6c-68.096 0-136.704 13.824-204.288 40.96-3.584 1.536-7.168 2.048-10.24 2.048z m0 171.52c-10.24 0-19.968-6.144-23.552-15.872-5.12-13.312 1.024-28.16 14.336-33.28 73.728-29.696 148.992-45.056 223.744-45.056 14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6c-68.096 0-136.704 13.824-204.288 40.96-3.584 1.536-7.168 2.048-10.24 2.048z",fill:U})),Q.postslists=h("svg",W(),h("path",{d:"M154 63c38.585-3.549 87.825-1 131-1h324c21.986 0 46.771-2.819 66 0 11.027 1.617 26.985 22.985 38 34 70.388 70.388 142.474 141.474 215 214 11.001 11.001 31.66 25.64 34 37 4.283 20.798 0 51.069 0 73 0 147.213 2.939 289.276 0 438-1.354 68.465-45.274 104-114 104H265c-47.349 0-105.861 6.086-139-7-35.031-13.833-58.411-40.73-63-83-4.718-43.462-1-90.155-1-144V217c0-22.874-2.529-48.263 1-71 7.309-47.087 44.564-78.729 91-83z m-12 128v598c0 25.297-4.657 76.62 5 87 10.792 11.601 61.731 6 86 6h555c24.86 0 76.86 5.363 88-5 9.054-8.424 6-40.445 6-60V442c0-21.463 3.845-47.044 0-63-2.278-9.453-19.905-22.905-28-31-61.891-61.891-119.072-117.072-180-178-9.53-9.53-21.852-26.199-32-28-16.563-2.939-39.449 0-60 0H219c-20.042 0-48.823-2.389-62 1-18.908 4.862-15 23.169-15 48zM237 249c25.855-3.795 59.35-1 86-1h212c34.246 0 63 4.409 63 40 0 48.994-57.106 40-110 40H311c-52.225 0-111.121 9.443-109-42 0.828-20.071 15.229-34.098 35-37zM237 474c41.5-6.092 97.15-1 142-1h352c23.335 0 50.952-3.611 67 3 31.346 12.914 28.819 62.127 0 74-14.449 5.953-46.639 3-70 3H292c-46.79 0-91.773 4.328-90-42 0.76-19.867 15.16-34.087 35-37zM237 698c41.5-6.092 97.15-1 142-1h352c23.335 0 50.952-3.611 67 3 31.346 12.914 28.819 62.127 0 74-14.449 5.953-46.639 3-70 3H292c-46.79 0-91.773 4.328-90-42 0.76-19.867 15.16-34.088 35-37z",fill:U})),Q.enlighter=h("svg",W(),h("path",{d:"M512 0a512 512 0 1 1 0 1024A512 512 0 0 1 512 0z m0 73.142857a438.857143 438.857143 0 1 0 0 877.714286A438.857143 438.857143 0 0 0 512 73.142857z m50.834286 150.674286a36.571429 36.571429 0 0 1 29.622857 42.422857l-88.868572 504.246857a36.571429 36.571429 0 0 1-72.045714-12.726857l88.868572-504.246857a36.571429 36.571429 0 0 1 42.422857-29.622857zM341.430857 382.317714a36.571429 36.571429 0 0 1 0 51.785143l-77.531428 77.531429 77.531428 77.531428a36.571429 36.571429 0 0 1-51.712 51.785143L186.221714 537.453714a36.571429 36.571429 0 0 1 0-51.712l103.497143-103.497143a36.571429 36.571429 0 0 1 51.712 0z m388.827429-4.169143l5.12 4.169143 103.424 103.497143a36.571429 36.571429 0 0 1 4.242285 46.665143l-4.242285 5.046857-103.424 103.424a36.571429 36.571429 0 0 1-55.954286-46.665143l4.169143-5.12 77.604571-77.531428-77.531428-77.531429a36.571429 36.571429 0 0 1 46.592-55.954286z",fill:U})),Q.buttons=h("svg",W(),h("path",{d:"M769 468.7c5.5-22.1 11.1-49.7 11.1-77.4 0-44.2-11.1-88.4-27.6-127.1-16.6-38.7-38.7-71.9-71.9-105-27.6-27.6-60.8-49.7-99.5-66.3-38.7-16.6-82.9-27.7-127.1-27.7s-88.4 11.1-127.1 27.6-77.4 38.7-105 71.9c-27.6 27.6-55.3 66.3-71.9 105s-22.1 77.4-22.1 127.1c0 38.7 5.5 71.9 16.6 105 11.1 33.2 27.6 60.8 49.7 88.4s44.2 49.7 77.4 71.9c27.6 22.1 60.8 33.2 94 44.2V584.8c-38.7-16.6-66.3-44.2-88.4-77.4-22.1-33.2-33.2-71.9-33.2-110.6 0-27.6 5.5-55.3 16.6-82.9s27.6-49.7 44.2-66.3c16.6-22.1 38.7-33.2 66.3-44.2 27.6-11.1 55.3-16.6 82.9-16.6s55.3 5.5 82.9 16.6c22.1 11.1 44.2 22.1 60.8 44.2 16.6 16.6 33.2 38.7 44.2 66.3 11.1 27.6 16.6 55.3 16.6 82.9v5.5c0 0.1 110.5 66.4 110.5 66.4z",fill:U}),h("path",{d:"M426.3 866.7c11.1-16.6 27.6-33.2 44.2-49.7 11.1-11.1 27.6-27.6 49.7-44.2 16.6-16.6 38.7-27.6 60.8-44.2L669.5 922c11.1 16.6 22.1 27.6 44.2 33.2 16.6 5.5 38.7 5.5 55.3-5.5 16.6-11.1 27.6-22.1 33.2-44.2 5.5-16.6 5.5-38.7-5.5-55.3L686.1 684.3c27.6-5.5 49.7-11.1 77.4-16.6 27.6-5.5 49.7-5.5 66.3-5.5h66.3L420.8 291.8l5.5 574.9z",fill:U})),Q.tabs=h("svg",W(),h("path",{d:"M420.608 489.984a15.104 15.104 0 0 1 4.864 11.776 14.848 14.848 0 0 1-4.864 11.776 17.664 17.664 0 0 1-12.288 4.352h-44.288V665.6a15.104 15.104 0 0 1-5.376 12.032 18.176 18.176 0 0 1-13.056 5.12 17.664 17.664 0 0 1-13.056-5.12 15.872 15.872 0 0 1-5.12-12.032v-147.712h-44.032a16.64 16.64 0 0 1-12.288-4.608 14.848 14.848 0 0 1-4.864-11.776 14.848 14.848 0 0 1 4.864-11.52 17.152 17.152 0 0 1 12.288-4.352H409.6a16.384 16.384 0 0 1 11.008 4.352zM557.824 534.016a15.872 15.872 0 0 1 4.864 12.288V665.6a15.616 15.616 0 0 1-4.864 12.032 15.872 15.872 0 0 1-12.032 5.12 16.64 16.64 0 0 1-12.032-4.864 17.664 17.664 0 0 1-4.864-12.032 61.952 61.952 0 0 1-44.032 19.712 64.512 64.512 0 0 1-35.328-9.984 69.376 69.376 0 0 1-25.6-27.904 92.16 92.16 0 0 1 0-80.384 67.072 67.072 0 0 1 25.6-27.904 61.696 61.696 0 0 1 34.304-9.984 66.816 66.816 0 0 1 45.312 17.408 16.64 16.64 0 0 1 4.864-12.288 17.408 17.408 0 0 1 24.064 0zM518.912 640a55.04 55.04 0 0 0 0-67.328 36.864 36.864 0 0 0-29.952-13.568 36.352 36.352 0 0 0-29.44 13.568 51.2 51.2 0 0 0-11.52 33.536 51.2 51.2 0 0 0 11.264 33.792 37.632 37.632 0 0 0 29.696 13.312 38.4 38.4 0 0 0 29.952-13.312zM712.448 539.136a70.4 70.4 0 0 1 25.6 27.648 86.016 86.016 0 0 1 9.216 40.192 87.04 87.04 0 0 1-9.216 40.448 68.608 68.608 0 0 1-25.6 27.904 61.696 61.696 0 0 1-34.304 9.984 57.6 57.6 0 0 1-25.6-5.632 61.952 61.952 0 0 1-19.712-13.312v1.792a16.64 16.64 0 0 1-16.896 17.152 15.616 15.616 0 0 1-12.032-4.864 16.128 16.128 0 0 1-4.864-12.288v-176.64a16.64 16.64 0 0 1 4.864-12.288 17.408 17.408 0 0 1 24.064 0 16.64 16.64 0 0 1 4.864 12.288v58.624a55.296 55.296 0 0 1 18.688-14.592 53.248 53.248 0 0 1 25.6-6.4 64.512 64.512 0 0 1 35.328 9.984z m-9.984 102.4a51.2 51.2 0 0 0 11.52-33.792 51.2 51.2 0 0 0-11.264-33.536 40.192 40.192 0 0 0-59.648 0 55.04 55.04 0 0 0 0 67.328 37.632 37.632 0 0 0 29.952 13.568 37.12 37.12 0 0 0 29.44-15.104zM857.088 337.408V281.6a76.8 76.8 0 0 0-76.8-76.8H402.176a76.8 76.8 0 0 0-57.088-25.6H206.336a76.8 76.8 0 0 0-76.8 76.8v512a76.8 76.8 0 0 0 76.8 76.8h622.592a76.8 76.8 0 0 0 76.8-76.8V409.6a76.8 76.8 0 0 0-48.64-72.192z m-51.2-56.576v51.2h-153.6V281.6a76.8 76.8 0 0 0-4.608-25.6h132.608a25.6 25.6 0 0 1 25.6 25.6z m-230.4-25.6a25.6 25.6 0 0 1 25.6 25.6v51.2h-179.2V256z m279.04 512a25.6 25.6 0 0 1-25.6 25.6H206.336a25.6 25.6 0 0 1-25.6-25.6V256a25.6 25.6 0 0 1 25.6-25.6h138.752a25.6 25.6 0 0 1 25.6 25.6v102.4a25.6 25.6 0 0 0 25.6 25.6h432.64a25.6 25.6 0 0 1 25.6 25.6z",fill:U})),Q.featured=h("svg",W(),h("path",{d:"M879.488423 92.01323c80.158765 0 145.076075 64.91731 145.076075 145.076075v550.385888c0 80.158765-64.91731 145.076075-145.076075 145.076075H145.076075C64.91731 931.98677 0 867.06946 0 786.910695V237.089305c0-80.158765 64.91731-145.076075 145.076075-145.076075h734.412348z m76.207277 284.507167H68.3043v410.954796c0 41.772878 33.305402 75.642778 75.07828 76.207277H878.923925c41.772878 0 75.642778-33.305402 76.207277-75.07828v-1.128997l0.564498-410.954796zM441.437707 461.759647c3.951488 0 7.338479 1.128997 10.725468 2.822492l205.477398 122.496141c10.16097 6.209482 13.54796 18.628445 7.338479 28.789416-1.693495 2.822492-4.515987 5.644983-7.338479 7.338478L452.163175 745.137817c-10.16097 6.209482-23.144432 2.822492-28.789415-7.338479-1.693495-3.38699-2.822492-6.77398-2.822492-10.725468V482.646086c0-11.289967 9.596472-20.886439 20.886439-20.886439zM68.3043 235.39581V307.651599h101.609702L75.642778 204.9129c-4.515987 9.596472-6.77398 20.32194-7.338478 30.48291z m811.184123-75.07828h-95.964718L910.535832 304.829107c0.564498 1.128997 1.693495 1.693495 2.257994 2.822492h43.466372V237.089305c0-41.772878-33.305402-75.642778-75.07828-76.207276l-1.693495-0.564499z m-187.413451 0h-125.318632l125.318632 145.076075c0.564498 0.564498 1.128997 1.693495 1.693495 2.257994h127.576627l-129.270122-147.334069z m-216.202866 0H353.375965l125.318633 145.076075c0.564498 0.564498 1.128997 1.693495 1.693495 2.257994h123.060639c0 0.564498-127.576626-147.334068-127.576626-147.334069z m-212.815877 0H145.076075c-5.080485 0-10.16097 0.564498-15.241455 1.693495l132.092613 143.947079 1.693495 1.693495h127.576626L263.056229 160.31753z",fill:U})),Q.download=h("svg",W(),h("path",{d:"M543.6 825.3H131.3c-28 0-50.7-22.8-50.7-50.7V141c0-29.9 24.3-54.2 54.2-54.2h126.3c25.1 0 46.6 17.9 51.2 42.6l20.9 111.9c11.7 62.6 66.4 108 130.1 108h385.6c29.9 0 54.2 24.3 54.2 54.3V476c0 22.2 18 40.3 40.3 40.3 22.2 0 40.3-18 40.3-40.3v-72.4c0-74.3-60.5-134.8-134.8-134.8H463.3c-24.9 0-46.3-17.8-50.9-42.3l-20.9-111.9C379.8 51.7 324.9 6.2 261.1 6.2H134.8C60.5 6.2 0 66.7 0 141v633.6C0 847 58.9 905.9 131.3 905.9h412.4c22.2 0 40.3-18 40.3-40.3-0.1-22.3-18.1-40.3-40.4-40.3z",fill:U}),h("path",{d:"M560.1 140.4h338.3c22.2 0 40.3-18 40.3-40.3 0-22.2-18-40.3-40.3-40.3H560.1c-22.2 0-40.3 18-40.3 40.3 0 22.3 18 40.3 40.3 40.3zM1014.6 828c-12.6-12.6-33-12.6-45.6 0l-95.4 95.4V605.5c0-17.8-14.4-32.2-32.2-32.2s-32.2 14.4-32.2 32.2v317.9L713.8 828c-12.6-12.6-33-12.6-45.6 0s-12.6 33 0 45.6l123.9 123.9c13.1 13.1 30.1 19.8 47.3 20.3 0.6 0 1.3 0.1 1.9 0.1 0.6 0 1.3 0 1.9-0.1 17.2-0.5 34.3-7.2 47.3-20.3l123.9-123.9c12.7-12.7 12.7-33 0.2-45.6z",fill:U})),Q.seamlessimg=h("svg",W(),h("path",{d:"M551.36 124.16a36.608 36.608 0 0 1 0 71.68L544 196.48H132.48v458.24l126.336-303.104 2.24-4.544a36.608 36.608 0 0 1 62.784-0.192l80 133.312 41.152-61.632 5.184-6.272a36.672 36.672 0 0 1 51.072 0.64l73.088 73.152 4.736 5.76a36.544 36.544 0 0 1-50.624 50.624l-5.76-4.672-41.6-41.6-48.384 72.576a36.672 36.672 0 0 1-61.824-1.408L298.496 446.592l-155.008 372.096c-0.704 1.728-1.728 3.328-2.688 4.928h403.2l7.36 0.768a36.672 36.672 0 0 1 0 71.68l-7.36 0.704H131.968A72.576 72.576 0 0 1 59.52 824.32V195.968c0-40.064 32.448-72.512 72.512-72.576H544l7.36 0.768zM921.664 824.32a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.088h219.456l7.36 0.768zM921.664 649.344a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.152h219.456l7.36 0.768zM921.664 474.368a36.608 36.608 0 0 1 0 71.616l-7.36 0.768h-219.456a36.544 36.544 0 1 1 0-73.152h219.456l7.36 0.768zM921.664 299.328a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.088h219.456l7.36 0.704zM921.664 124.352a36.608 36.608 0 0 1 0 71.68l-7.36 0.704h-219.456a36.544 36.544 0 1 1 0-73.152h219.456l7.36 0.768z",fill:U})),Q.modal=h("svg",W(),h("path",{d:"M654.601 708.8a36.965 36.965 0 0 0 26.158-10.843 37.047 37.047 0 0 0 10.843-26.186V434.47H454.555a36.992 36.992 0 0 0-32.594 18.322 37.074 37.074 0 0 0 0 37.422 36.992 36.992 0 0 0 32.594 18.322H565.33l-44.525 44.58L365.239 708.92a37.056 37.056 0 0 0 16.274 62.574 36.955 36.955 0 0 0 36.023-10.222L573.23 605.403l44.489-44.544v110.912A37.01 37.01 0 0 0 654.6 708.8z m313.92-450.834h-0.393V227.84c0-95.131-77.76-172.983-172.846-172.983H227.657c-95.049 0-172.8 77.852-172.8 172.983v568.265c0 95.186 77.751 172.983 172.8 172.983h567.625c95.086 0 172.8-77.833 172.8-172.983v-209.92a38.162 38.162 0 0 0-38.034-37.202 38.162 38.162 0 0 0-38.034 37.211v209.92c-0.247 53.385-43.401 96.604-96.732 96.878H227.657c-53.321-0.274-96.484-43.493-96.731-96.887V331.547H968.53v-73.581z m-76.452 0H130.926V227.84c0.274-53.367 43.42-96.558 96.731-96.832h567.625c53.312 0.274 96.457 43.465 96.732 96.832l0.055 30.126z m-80.951-82.368H475.246c-9.847 0-17.93 8.411-17.93 18.679v3.291c0 10.267 8.083 18.679 17.93 18.679h335.872c9.856 0 17.929-8.412 17.929-18.688v-3.282c0-10.268-8.073-18.68-17.93-18.68z m-488.85-2.643a22.994 22.994 0 0 0-16.22 39.223 22.93 22.93 0 0 0 39.168-16.256 22.967 22.967 0 0 0-22.949-22.967z m69.522 0a22.994 22.994 0 0 0-16.22 39.223 22.93 22.93 0 0 0 39.177-16.256 22.985 22.985 0 0 0-22.976-22.967h0.019z",fill:U})),Q.headingLevel1=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})),Q.headingLevel2=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})),Q.headingLevel3=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})),Q.headingLevel4=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})),Q.headingLevel5=h("svg",{xmlns:X,viewBox:"0 0 24 24"},h("path",{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"}));var Y=[{color:"#fb2121"},{color:"#ef0c7e"},{color:"#F3AC07"},{color:"#8CA803"},{color:"#64BD05"},{color:"#11C33F"},{color:"#08B89A"},{color:"#09ACE2"},{color:"#1F91F3"},{color:"#3B6ED5"},{color:"#664FFA"},{color:"#A845F7"},{color:"#333"},{color:"#666"},{color:"#999"},{color:"#f8f8f8"}];function ee(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);timg",attribute:"src",default:""},file_name:{type:"string",selector:".file-download-name",source:"text"},desc:{type:"array",source:"query",selector:".file-download-desc",default:[{left:"",right:""}],query:{left:{type:"string",source:"text",selector:".desc-left"},right:{type:"string",source:"text",selector:".desc-right"}}}},edit:function(e){var t=e.attributes,a=t.file_id,l=t.file_name,r=a||"javascript:;"==t.url?"":t.url,n=t.desc,o=t.icon,i=e.setAttributes,s=e.isSelected;function c(e){return e&&e.type&&"image"===e.type?e.sizes&&e.sizes.thumbnail&&e.sizes.thumbnail.url?e.sizes.thumbnail.url:e.url:""}var u=h(j,{title:Z("gutenberg_select_or_upload_file"),onSelect:function(e){var t=e.filename||e.name,a=J("gutenberg_ext_file",function(e){return e.substring(e.lastIndexOf(".")+1)}(t)),l=e.filesizeInBytes?function(e,t,a){var l;for(a=a||["B","K","M","G","TB"];(l=a.shift())&&e>1024;)e/=1024;return("B"===l?e:e.toFixed(void 0===t?1:t))+l}(e.filesizeInBytes):"";"image"===e.type&&(o=c(e)),i({file_name:t,url:"",icon:o,file_id:e.id,desc:[{left:a,right:l}]})},value:a,render:function(e){var t=e.open;return h("a",{className:"but jb-blue is-secondary flex0",onClick:t},Z(a?"gutenberg_replace":"gutenberg_select_or_upload")+Z("gutenberg_file"))}});return h("div",{},h("div",{className:"muted-box file-download-box"},h("div",{className:"flex ac jsb"},h("div",{className:"flex ac flex1"},h("div",{className:"mr10"},h("div",{className:"file-download-icon"},[o&&h("img",{className:"fit-cover",src:o,alt:Z("gutenberg_download_icon")})])),h("div",{className:"flex1"},[s?[r||a?h(L,{className:"",tagName:"input",onChange:function(e){i({file_name:e})},value:l,placeholder:Z("gutenberg_enter_file_name")}):Z("gutenberg_enter_download_url_or_file")]:h("div",{className:"text-ellipsis-2 file-download-name"},l||Z("gutenberg_enter_file_name"))],[s?h("div",{className:"flex ac"},[a?h("div",{className:"flex ac"},h("div",{className:"px12"},Z("gutenberg_local_file_selected")),h("div",{className:"mb6 ml10"},h("a",{className:"but c-blue-2",onClick:function(){i({file_id:0})}},Z("gutenberg_enter_url")))):h(L,{className:"flex1",tagName:"input",onChange:function(e){i({url:e})},value:r,placeholder:Z("gutenberg_enter_download_url")})],h("div",{className:"mb6 ml6"},u)):h("div",{className:"px12 opacity5"},r||(a?Z("gutenberg_local_file"):""))])),h("div",{className:"flex0 ml20"},[s||h("div",{className:"but c-blue file-download-btn"},h("i",{className:"fa fas fa-download"},Z("gutenberg_download")))])),h("div",{className:"mt10"},n.map(function(e,t){return s?h("div",{className:"flex ab jsb muted-2-color file-download-desc"},h("div",{className:"desc-left"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){n[t].left=e,i({desc:ee(n)})},value:e.left,placeholder:Z("gutenberg_enter_file_attr")})),h("div",{className:"desc-right flex ac"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){n[t].right=e,i({desc:ee(n)})},value:e.right,placeholder:Z("gutenberg_enter_file_attr")}),h("button",{className:"mb6 ml6 c-red fa far fa-trash-alt",type:"button",onClick:function(){n.splice(t,1),i({desc:ee(n)})}}))):e.left||e.right?h("div",{className:"flex ab jsb muted-2-color file-download-desc em09"},h("div",{className:"desc-left"},e.left),h("div",{className:"desc-right"},e.right)):void 0})),[s&&h("a",{className:"but c-blue is-secondary hollow",onClick:function(){i({desc:[].concat(ee(n),{left:"",right:""})})}},Z("gutenberg_add_file_attr"))]),h(H,null,te(13990),h(V,{icon:"image",title:Z("gutenberg_file_icon")},h("div",{className:"components-base-control"},[o&&h("div",{className:" "},h("img",{src:o}))],h("div",{className:"flex ac"},h(j,{title:Z("gutenberg_select_or_upload_file_icon"),allowedTypes:["image"],onSelect:function(e){i({icon:c(e)})},render:function(e){var t=e.open;return h("a",{className:"but jb-blue",onClick:t},Z(o?"gutenberg_replace":"gutenberg_add")+Z("gutenberg_icon"))}}),[o&&h("a",{className:"but c-red ml6",onClick:function(){i({icon:""})}},Z("gutenberg_remove"))]),h("div",{className:"mt6 em09 opacity5"},Z("gutenberg_file_icon_square_hint"))))))},save:function(e){var t=e.attributes,a=~~t.file_id,l=t.file_name,r=t.url||"javascript:;",n=t.icon,o=t.desc,i={className:"but c-blue file-download-btn",href:r};a&&(i["data-aksrt-file-id"]=a);var s=o.map(function(e){if(e.left||e.right)return h("div",{className:"flex ab jsb muted-2-color file-download-desc em09"},h("div",{className:"desc-left"},e.left),h("div",{className:"desc-right"},e.right))});return h("div",{contenteditable:"false",className:"muted-box file-download-box mb20"},h("div",{className:"flex ac jsb"},h("div",{className:"flex ac"},h("div",{className:"mr10"},h("div",{className:"file-download-icon"},[n&&h("img",{className:"fit-cover no-imgbox",src:n,alt:Z("gutenberg_download_icon")})])),h("div",{className:"text-ellipsis-2 file-download-name",contenteditable:"true"},l)),h("div",{className:"flex0 ml20"},h("a",i,h("i",{className:"fa fas fa-download"}),Z("gutenberg_download")))),[s&&h("div",{className:"mt10"},s)])}}),f("aksrtblock/tabs",{title:ae(Z("gutenberg_tab")),icon:Q.tabs,supports:{className:!1,anchor:!0},description:Z("gutenberg_tab_desc"),category:"aksrt_block_cat",attributes:{tabHeaders:{type:"array",default:[Z("gutenberg_tab_col_1"),Z("gutenberg_tab_col_2"),Z("gutenberg_tab_col_3")]},tabActive:{type:"number",default:0},open:{type:"number",default:0},layout:{type:"string",default:"nav-top"}},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,r=t.tabHeaders,n=t.tabActive,o=t.layout,i=e.clientId,s=function(e){var t=_(i);l({tabActive:e}),K(t.innerBlocks.length,function(a){v(t.innerBlocks[a].clientId,{tabActive:e,id:a})})},c=function(e){if(r.length<2)return le("warning",Z("gutenberg_cannot_delete_tab_min_one"));var t=g(i);return m(t[e],!1),r.splice(e,1),l({tabHeaders:ee(r)}),s(0),!1};return h("div",{className:"tab-card theme-card-box "+o},h("div",{className:"tab-header flex ab"},r.map(function(e,t){return h("div",{className:"tab-header-item"+((a=t)==n?" active":""),onClick:function(){s(a)}},h(L,{className:"tab-header-input",onChange:function(e){r[a]=e,l({tabHeaders:ee(r)})},value:r[a],placeholder:Z("gutenberg_enter_title")}),h("div",{className:"tab-operation"},h("a",{className:"but b-red circular",onClick:function(){c(a)}},h("i",{className:"fa fas fa-times"}))));var a}),[a&&h("a",{className:"but jb-blue em09 ml6",onClick:function(){var e=y("aksrtblock/tab");p(e,r.length,i),l({tabHeaders:[].concat(ee(r),"")}),s(r.length)}},Z("gutenberg_add_plus"))]),h("div",{className:"tab-content"},h(k,{template:[["aksrtblock/tab",{id:0}],["aksrtblock/tab",{id:1}],["aksrtblock/tab",{id:2}]],templateLock:!1,allowedBlocks:["aksrtblock/tab"]})),h(H,null,te(2195),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},h(F,{label:Z("gutenberg_nav_position"),value:o,onChange:function(e){l({layout:e})},options:[{label:Z("gutenberg_top"),value:"nav-top"},{label:Z("gutenberg_left"),value:"nav-left"},{label:Z("gutenberg_right"),value:"nav-left nav-right"}]})))))},save:function(e){var t=e.attributes,a=t.tabHeaders,l=t.open,r=t.layout;return h("div",{className:"mb20 post-tab "+r},h("div",{className:"list-inline scroll-x mini-scrollbar tab-nav-theme"},a.map(function(e,t){return h("li",{className:(r=t)==l?"active":""},h("a",{className:"post-tab-toggle",href:"javascript:;","tab-id":r},a[r]||J("gutenberg_tab_col_n",r+1)));var r})),h("div",{className:"tab-content"},h(k.Content,null)))}}),f("aksrtblock/tab",{title:ae(Z("gutenberg_tab")),parent:["aksrtblock/tabs"],icon:Q.tabs,supports:{className:!1,reusable:!1},category:"aksrt_block_cat",attributes:{id:{type:"number",default:0},pid:{type:"string"},tabActive:{type:"number",default:0},open:{type:"number",default:0}},edit:function(e){var t=e.attributes,a=t.id,l=t.tabActive;return h(A,null,h("div",{className:"",style:{display:a===l?"block":"none"}},h(k,{template:[["core/paragraph"]],templateLock:!1})))},save:function(e){var t=e.attributes,a=t.id,l=t.open;return h("div",{className:"tab-pane fade"+(a==l?" active in":""),"tab-id":a},h(k.Content,null))}}),f("aksrtblock/dplayerfeatured",{title:ae(Z("gutenberg_video_series")),icon:Q.featured,supports:{className:!1,color:!1},description:Z("gutenberg_video_series_desc"),category:"aksrt_block_cat",attributes:{featured:{type:"array",source:"query",selector:".switch-video",default:[],query:{text:{type:"string",source:"attribute",attribute:"title"},url:{type:"string",source:"attribute",attribute:"video-url"},media_id:{type:"number",source:"attribute",attribute:"media-id"}}},pic:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"video-pic",default:""},loop:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-loop",default:""},autoplay:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-autoplay",default:""},volume:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-volume",default:1},height:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-scale-height",default:0},hide_controller:{type:"boolean",default:!1}},transforms:{to:[{type:"block",blocks:["aksrtblock/dplayer"],transform:function(e){var t={url:e.featured[0].url,media_id:e.featured[0].media_id,pic:e.pic,loop:e.loop,autoplay:e.autoplay,volume:e.volume,hide_controller:e.hide_controller};return y("aksrtblock/dplayer",t)}},{type:"block",blocks:["aksrtblock/iframeseries"],transform:function(e){var t={lists:e.featured};return y("aksrtblock/iframeseries",t)}}]},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,r=t.pic,n=t.loop,o=t.autoplay,i=t.hide_controller,s=t.height||0,c=t.volume||1,u=t.featured.length?t.featured:[{text:"",url:"",media_id:""},{text:"",url:"",media_id:""}],b=function(e){if(u.length<3)return le("warning",Z("gutenberg_cannot_delete_episode_min_two"));u.splice(e,1),l({featured:ee(u)})};return h("div",{},h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.featured,h("span",{className:"ml10"},Z("gutenberg_video_series_module"))),h("div",{className:"opacity8 mb10 px12"},Z("gutenberg_video_series_hint")),[a?u.map(function(e,t){return h("div",{className:"flex featured-item"},h("span",{className:"mr10 c-red"},(a=t)+1),h("div",{className:"flex1"},h("div",{className:"flex ab"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){u[a].text=e,l({featured:ee(u)})},value:u[a].text,placeholder:J("gutenberg_episode_title_placeholder",a+1)}),[u.length>2&&h("button",{className:"mb6 ml6 c-red fa far fa-trash-alt",type:"button",onClick:function(){b(a)}})]),h("div",{className:"flex ab"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){u[a].url=e,u[a].media_id="",l({featured:ee(u)})},value:u[a].url,placeholder:Z("gutenberg_enter_video_url_or_upload")}),h(j,{title:Z("gutenberg_select_or_upload_video"),allowedTypes:["video"],onSelect:function(e){u[a].url=e.url,u[a].media_id=e.id,l({featured:ee(u)})},value:u[a].media_id,render:function(e){var t=e.open;return h("a",{className:"but c-blue is-secondary flex0",onClick:t},Z("gutenberg_local_video"))}}))));var a}):u.map(function(e,t){return h("div",{className:"flex featured-item px12 opacity8",style:{padding:"2px 10px","margin-bottom":"-1px"}},t+1+":"+e.url)})],[a&&h("a",{className:"but jb-blue",onClick:function(){l({featured:[].concat(ee(u),{url:"",media_id:""})})}},Z("gutenberg_add_episode"))]),h(H,null,te(2223),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},[r&&h("div",{className:" "},h("img",{src:r}))],h(j,{title:Z("gutenberg_select_or_upload_poster"),allowedTypes:["image"],onSelect:function(e){l({pic:e.url})},render:function(e){var t=e.open;return h("a",{className:"but jb-blue",onClick:t},Z(r?"gutenberg_replace":"gutenberg_add")+Z("gutenberg_poster_image"))}})),h(P,{label:Z("gutenberg_autoplay"),checked:o,onChange:function(e){l({autoplay:e})}}),h(P,{label:Z("gutenberg_loop"),checked:n,onChange:function(e){l({loop:e})}}),h(P,{label:Z("gutenberg_hide_controller"),checked:i,onChange:function(e){l({hide_controller:e})}}),h(R,{label:Z("gutenberg_initial_volume"),value:~~(100*c),onChange:function(e){l({volume:e/100})},allowReset:!0,min:"0",max:"100"}),h(R,{label:Z("gutenberg_fixed_aspect_ratio"),help:s>0?J("gutenberg_height_of_width",s):Z("gutenberg_height_ratio_auto"),value:~~s,onChange:function(e){l({height:e})},allowReset:!0,min:"0",step:"5",max:"200"}))))},save:function(e){var t=e.attributes,a=t.pic,l=t.loop||"",r=t.autoplay||"",n=t.hide_controller||"",o=t.height||0,i=t.featured,s=t.volume||1;if(i&&i[0]){var c=i[0].url,u=h("div",{className:"graphic",style:{"padding-bottom":"50%"}},h("div",{className:"abs-center text-center"},h("i",{className:"fa fas fa-play-circle fa-4x muted-3-color opacity5"}))),b={className:"new-dplayer"+(n?" controller-hide":"")+(o>0?" dplayer-scale-height":""),"video-url":c,"video-pic":a,"data-loop":l,"data-autoplay":r,"data-volume":s};return o>0&&(b.style="--scale-height:"+o+"%;",b["data-scale-height"]=o),h("div",{className:"mb20"},h("div",b,u),h("div",{className:"featured-video-episode mt10 dplayer-featured"},i.map(function(e,t){t+=1;var a=e.text||J("gutenberg_episode_n",t);return h("a",{className:"switch-video text-ellipsis"+(1==t?" active":""),"data-index":t,"video-url":e.url,"media-id":e.media_id,title:e.text,href:"javascript:;"},h("span",{className:"mr6 badg badg-sm"},t),h("i",{className:"episode-active-icon"},""),a)})))}}}),f("aksrtblock/iframe",{title:ae(Z("gutenberg_super_embed")),icon:Q.iframe,description:Z("gutenberg_super_embed_desc"),category:"aksrt_block_cat",attributes:{url:{source:"attribute",selector:"iframe",attribute:"src"},aspect:{type:"attribute",selector:"iframe",attribute:"data-aspect"},allowfullscreen:{type:"attribute",selector:"iframe",attribute:"allowfullscreen"}},transforms:{to:[{type:"block",blocks:["aksrtblock/iframeseries"],transform:function(e){var t={lists:[{url:e.url,title:""}],aspect:e.aspect,allowfullscreen:e.allowfullscreen};return y("aksrtblock/iframeseries",t)}},{type:"block",blocks:["aksrtblock/dplayer"],transform:function(e){var t={url:e.url};return y("aksrtblock/dplayer",t)}}]},edit:function(t){var a=t.attributes,l=t.isSelected,r=t.setAttributes,n=a.url,o=a.allowfullscreen,i=a.aspect||"56%";return h("div",{className:"aksrtblock-iframe"},h("div",{className:!n||l?"theme-card-box":"nois_selected"},[n&&h("div",{className:"aksrtblock-iframe-div",style:{"padding-bottom":i}},h("iframe",{className:"",width:"100%",src:n}),h("div",{className:"iframe-mask"}))],[!n&&h("div",{className:"components-placeholder__label",style:{width:"95%",height:"27px","font-size":"15px"}},Q.iframe,Z("gutenberg_embed_online_content"))],[(!n||l)&&h("div",{className:"mt20"},h("div",{className:"opacity8 iframe-label"},Z("gutenberg_embed_url_hint_multi")),h("a",{className:"block-editor-block-card__description"},""))],[(!n||l)&&h(L,{style:{width:"95%"},tagName:"input",onChange:function(t){var a=e.parseHTML(t),l=e(a).attr("src")||t;r({url:l})},value:n,placeholder:Z("gutenberg_enter_url_or_embed_code")})]),h(H,null,te(1934),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h(F,{label:Z("gutenberg_aspect_ratio_settings"),value:i,onChange:function(e){r({aspect:e})},options:[{label:Z("gutenberg_ratio_landscape_4_1"),value:"25%"},{label:Z("gutenberg_ratio_landscape_3_1"),value:"33%"},{label:Z("gutenberg_ratio_landscape_5_2"),value:"40%"},{label:Z("gutenberg_ratio_landscape_2_1"),value:"50%"},{label:Z("gutenberg_ratio_landscape_16_9"),value:"56%"},{label:Z("gutenberg_ratio_landscape_5_3"),value:"60%"},{label:Z("gutenberg_ratio_landscape_4_3"),value:"75%"},{label:Z("gutenberg_ratio_landscape_5_4"),value:"80%"},{label:Z("gutenberg_ratio_landscape_8_7"),value:"87.5%"},{label:Z("gutenberg_ratio_square_1_1"),value:"100%"},{label:Z("gutenberg_ratio_portrait_7_8"),value:"114%"},{label:Z("gutenberg_ratio_portrait_4_5"),value:"125%"},{label:Z("gutenberg_ratio_portrait_3_4"),value:"133%"},{label:Z("gutenberg_ratio_portrait_3_5"),value:"166%"},{label:Z("gutenberg_ratio_portrait_1_2"),value:"200%"},{label:Z("gutenberg_ratio_portrait_2_5"),value:"250%"},{label:Z("gutenberg_ratio_portrait_1_3"),value:"300%"}]}),h(P,{label:Z("gutenberg_allow_fullscreen"),checked:!!o,onChange:function(e){r({allowfullscreen:e})}}))))},save:function(e){var t=e.attributes,a=t.url,l=t.aspect||"56%",r={className:"","data-aspect":l,framespacing:"0",border:"0",width:"100%",frameborder:"no",src:a};if(t.allowfullscreen&&(r.allowfullscreen="allowfullscreen"),a)return h("div",{className:"wp-block-embed is-type-video mb20"},h("div",{className:"",style:{"padding-bottom":l}},h("iframe",r)))}}),f("aksrtblock/iframeseries",{title:ae(Z("gutenberg_embed_series")),icon:Q.iframeseries,supports:{className:!1,color:!1},description:Z("gutenberg_embed_series_desc"),category:"aksrt_block_cat",attributes:{lists:{type:"array",source:"query",selector:".switch-iframe",default:[{text:"",url:""},{text:"",url:""}],query:{text:{type:"string",source:"attribute",attribute:"title"},url:{type:"string",source:"attribute",attribute:"iframe-url"}}},aspect:{type:"attribute",selector:"iframe",attribute:"data-aspect"},allowfullscreen:{type:"attribute",selector:"iframe",attribute:"allowfullscreen"}},transforms:{to:[{type:"block",blocks:["aksrtblock/iframe"],transform:function(e){var t={url:e.lists[0].url,aspect:e.aspect,allowfullscreen:e.allowfullscreen};return y("aksrtblock/iframe",t)}},{type:"block",blocks:["aksrtblock/dplayerfeatured"],transform:function(e){var t={featured:e.lists};return y("aksrtblock/dplayerfeatured",t)}}]},edit:function(t){var a=t.attributes,l=t.isSelected,r=t.setAttributes,n=a.lists,o=a.allowfullscreen,i=a.aspect||"56%",s=function(e){if(n.length<3)return le("warning",Z("gutenberg_cannot_delete_episode_min_two"));n.splice(e,1),r({lists:ee(n)})};return h("div",{className:"aksrtblock-iframe"},h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.iframeseries,h("span",{className:"ml10"},Z("gutenberg_embed_series_module"))),h("div",{className:"opacity8 mb10 px12"},Z("gutenberg_embed_series_hint")),[l?n.map(function(t,a){return h("div",{className:"flex featured-item"},h("span",{className:"mr10 c-red"},(l=a)+1),h("div",{className:"flex1"},h("div",{className:"flex ab"},h(L,{className:"flex1 mr6",tagName:"input",onChange:function(e){n[l].text=e,r({lists:ee(n)})},value:n[l].text,placeholder:J("gutenberg_episode_title_placeholder",l+1)}),[n.length>2&&h("button",{className:"mb6 ml6 c-red fa far fa-trash-alt",type:"button",onClick:function(){s(l)}})]),h(L,{className:"flex1 mr6",tagName:"input",onChange:function(t){var a=e.parseHTML(t),o=e(a).attr("src")||t;n[l].url=o,r({lists:ee(n)})},value:n[l].url,placeholder:Z("gutenberg_enter_embed_url")})));var l}):n.map(function(e,t){return h("div",{className:"flex featured-item px12 opacity8",style:{padding:"2px 10px","margin-bottom":"-1px"}},t+1+":"+e.url)})],[l&&h("a",{className:"but jb-blue",onClick:function(){r({lists:[].concat(ee(n),{url:"",media_id:""})})}},Z("gutenberg_add_episode"))]),h(H,null,te(1934),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h(F,{label:Z("gutenberg_aspect_ratio_settings"),value:i,onChange:function(e){r({aspect:e})},options:[{label:Z("gutenberg_ratio_landscape_4_1"),value:"25%"},{label:Z("gutenberg_ratio_landscape_3_1"),value:"33%"},{label:Z("gutenberg_ratio_landscape_5_2"),value:"40%"},{label:Z("gutenberg_ratio_landscape_2_1"),value:"50%"},{label:Z("gutenberg_ratio_landscape_16_9"),value:"56%"},{label:Z("gutenberg_ratio_landscape_5_3"),value:"60%"},{label:Z("gutenberg_ratio_landscape_4_3"),value:"75%"},{label:Z("gutenberg_ratio_landscape_5_4"),value:"80%"},{label:Z("gutenberg_ratio_landscape_8_7"),value:"87.5%"},{label:Z("gutenberg_ratio_square_1_1"),value:"100%"},{label:Z("gutenberg_ratio_portrait_7_8"),value:"114%"},{label:Z("gutenberg_ratio_portrait_4_5"),value:"125%"},{label:Z("gutenberg_ratio_portrait_3_4"),value:"133%"},{label:Z("gutenberg_ratio_portrait_3_5"),value:"166%"},{label:Z("gutenberg_ratio_portrait_1_2"),value:"200%"},{label:Z("gutenberg_ratio_portrait_2_5"),value:"250%"},{label:Z("gutenberg_ratio_portrait_1_3"),value:"300%"}]}),h(P,{label:Z("gutenberg_allow_fullscreen"),checked:!!o,onChange:function(e){r({allowfullscreen:e})}}))))},save:function(e){var t=e.attributes,a=t.lists,l=t.aspect||"56%";if(a&&a[0]){var r={className:"","data-aspect":l,framespacing:"0",border:"0",width:"100%",frameborder:"no",src:a[0].url};return t.allowfullscreen&&(r.allowfullscreen="allowfullscreen"),h("div",{className:"mb20 iframe-series"},h("div",{className:"wp-block-embed is-type-video"},h("div",{className:"iframe-series-box",style:{"padding-bottom":l}},h("iframe",r))),h("div",{className:"featured-video-episode mt10 dplayer-featured"},a.map(function(e,t){t+=1;var a=e.text||J("gutenberg_episode_n",t);return h("a",{className:"switch-iframe text-ellipsis"+(1==t?" active":""),"data-index":t,"iframe-url":e.url,title:e.text,href:"javascript:;"},h("span",{className:"mr6 badg badg-sm"},t),h("i",{className:"episode-active-icon"},""),a)})))}}}),f("aksrtblock/dplayer",{title:ae(Z("gutenberg_video")),icon:Q.video,description:Z("gutenberg_video_desc"),category:"aksrt_block_cat",attributes:{url:{source:"attribute",selector:".new-dplayer",attribute:"video-url"},media_id:{source:"attribute",selector:".new-dplayer",attribute:"media-id"},pic:{source:"attribute",selector:".new-dplayer",attribute:"video-pic"},loop:{source:"attribute",selector:".new-dplayer",attribute:"data-loop"},autoplay:{source:"attribute",selector:".new-dplayer",attribute:"data-autoplay"},volume:{source:"attribute",selector:".new-dplayer",attribute:"data-volume"},height:{type:"string",source:"attribute",selector:".new-dplayer",attribute:"data-scale-height",default:0},hide_controller:{source:"attribute",selector:".new-dplayer",attribute:"data-hide"}},transforms:{to:[{type:"block",blocks:["aksrtblock/dplayerfeatured"],transform:function(e){var t={featured:[{text:"",url:e.url,media_id:e.media_id},{text:"",url:"",media_id:""}],pic:e.pic,loop:e.loop,autoplay:e.autoplay,volume:e.volume,hide_controller:e.hide_controller};return y("aksrtblock/dplayerfeatured",t)}},{type:"block",blocks:["aksrtblock/iframe"],transform:function(e){var t={url:e.url};return y("aksrtblock/iframe",t)}}]},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,r=t.url,n=t.media_id,o=t.pic,i=t.loop,s=t.autoplay,c=t.hide_controller,u=t.height||0,b=t.volume||1;return h("div",{},h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.video,h("span",{className:"ml10"},Z("gutenberg_video_module"))),h("div",{className:"opacity8 mb10 px12"},Z("gutenberg_video_hint")),h(L,{style:{width:"95%"},tagName:"input",onChange:function(e){l({url:e,media_id:""})},value:r,placeholder:Z("gutenberg_enter_video_url_or_upload")}),h(j,{title:Z("gutenberg_select_or_upload_video"),allowedTypes:["video"],onSelect:function(e){l({url:e.url,media_id:e.id})},value:n,render:function(e){var t=e.open;return a&&h("a",{className:"but jb-blue",onClick:t},Z("gutenberg_select_local_video"))}})),h(H,null,te(1921),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},[o&&h("div",{className:" "},h("img",{src:o}))],h(j,{title:Z("gutenberg_select_or_upload_poster"),allowedTypes:["image"],onSelect:function(e){l({pic:e.url})},render:function(e){var t=e.open;return h("a",{className:"but jb-blue",onClick:t},Z(o?"gutenberg_replace":"gutenberg_add")+Z("gutenberg_poster_image"))}})),h(P,{label:Z("gutenberg_autoplay"),checked:s,onChange:function(e){l({autoplay:e})}}),h(P,{label:Z("gutenberg_loop"),checked:i,onChange:function(e){l({loop:e})}}),h(P,{label:Z("gutenberg_hide_controller"),checked:c,onChange:function(e){l({hide_controller:e})}}),h(R,{label:Z("gutenberg_initial_volume"),value:~~(100*b),onChange:function(e){l({volume:e/100})},allowReset:!0,min:"0",max:"100"}),h(R,{label:Z("gutenberg_fixed_aspect_ratio"),help:u>0?J("gutenberg_height_of_width",u):Z("gutenberg_height_ratio_auto"),value:~~u,onChange:function(e){l({height:e})},allowReset:!0,min:"0",step:"5",max:"200"}))))},save:function(e){var t=e.attributes,a=t.url,l=t.media_id,r=t.pic,n=t.loop||"",o=t.autoplay||"",i=t.hide_controller||"",s=t.height||0,c=t.volume||1;if(a){var u=h("div",{className:"graphic",style:{"padding-bottom":"50%"}},h("div",{className:"abs-center text-center"},h("i",{className:"fa fas fa-play-circle fa-4x muted-3-color opacity5"}))),b={className:"new-dplayer post-dplayer"+(i?" controller-hide":"")+(s>0?" dplayer-scale-height":""),"video-url":a,"media-id":l,"video-pic":r,"data-loop":n,"data-hide":i,"data-autoplay":o,"data-volume":c};return s>0&&(b.style="--scale-height:"+s+"%;",b["data-scale-height"]=s),h("div",b,u)}}}),f("aksrtblock/feature",{title:ae(Z("gutenberg_feature")),icon:Q.feature,description:Z("gutenberg_feature_desc"),category:"aksrt_block_cat",attributes:{title:{type:"array",source:"children",selector:".feature-title"},icon:{source:"attribute",selector:".feature",attribute:"data-icon"},note:{type:"array",source:"children",selector:".feature-note"},theme:{source:"attribute",selector:".feature",attribute:"class"},color:{source:"attribute",selector:".feature",attribute:"data-color"}},edit:function(e){var t=e.attributes,a=e.isSelected,l=e.setAttributes,n=t.title,o=t.note,i=t.icon||"fa-flag",s=t.color||"feature-icon no1";let c=h(r.ColorPalette,{value:s||"#444",colors:Y,className:"q-ColorPalette",onChange:function(e){l({color:e})}});var u=h(L,{tagName:"div",onChange:function(e){l({icon:e})},value:i,placeholder:Z("gutenberg_enter_icon_class")}),b=h(q,{tagName:"div",onChange:function(e){l({title:e})},value:n,placeholder:Z("gutenberg_enter_feature_title")}),d=h(q,{tagName:"div",onChange:function(e){l({note:e})},value:o,placeholder:Z("gutenberg_enter_feature_note")});return h("div",{},h("div",{className:"feature"},h("div",{className:"feature-icon"},h("i",{style:{color:s},className:"fa "+i})),[a&&h("div",{className:"feature-iconbj"},h("div",{className:"feature-icont"},Z("gutenberg_enter_fa_icon_class")),u)],[a&&c],h("div",{className:"feature-title"},b),h("div",{className:"feature-note"},d)),h(H,null,h("div",{className:"modal-ss block-editor-block-card"},h("div",{className:"components-base-control"},h("h5",{},Z("gutenberg_icon_usage")),h("p",{},Z("gutenberg_icon_usage_desc")),h("a",{href:"http://fontawesome.dashgame.com",target:"blank"},Z("gutenberg_font_awesome")))),h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("div",{className:"components-base-control"},h("div",{className:"feature-icont"},Z("gutenberg_fa_icon_class")),u,h("div",{className:"feature-icont"},Z("gutenberg_select_icon_color")),c))))},save:function(e){var t=e.attributes,a=t.title,l=t.note,r=t.color||"feature-icon no1",n=t.icon||"fa-flag",o=t.theme||"feature feature-default";return h("div",{className:o,"data-icon":n,"data-color":r},h("div",{className:"feature-icon"},h("i",{style:{color:r},className:"fa "+n})),h("div",{className:"feature-title"},a),h("div",{className:"feature-note"},l))}}),i("aksrtblock/set-color",{title:Z("gutenberg_set_color"),tagName:"qc",className:null,attributes:{style:"style",block:"inline-block"},edit:class extends C{constructor(){super(...arguments),this.show_modal=this.show_modal.bind(this),this.close_modal=this.close_modal.bind(this),this.words_selected=this.words_selected.bind(this),this.set_popover_rect=this.set_popover_rect.bind(this),this.remove_Format=this.remove_Format.bind(this),this.onChange_cb=this.onChange_cb.bind(this),this.set_color=this.set_color.bind(this),this.set_color2=this.set_color2.bind(this),this.xsba=this.xsba.bind(this),this.xsba_f=this.xsba_f.bind(this),this.set_background=this.set_background.bind(this),this.set_background2=this.set_background2.bind(this),this.state={modal_visibility:!1}}words_selected(){const{value:e}=this.props;return e.start!==e.end}set_popover_rect(){const e=a.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):null;var l=w(t);this.setState({popover_rect:l})}show_modal(){this.setState({modal_visibility:!0}),this.set_popover_rect()}close_modal(){this.setState({modal_visibility:!1})}xsba(){this.setState({xsba:!0})}xsba_f(){this.setState({xsba:!1})}remove_Format(){this.setState({color:"",background:""}),this.props.onChange(t.richText.toggleFormat(this.props.value,{type:"aksrtblock/set-color"}))}onChange_cb(){this.props.onChange(t.richText.applyFormat(this.props.value,{type:"aksrtblock/set-color",attributes:{style:"color:"+this.state.color+";background:"+this.state.background}}))}set_color(e){this.setState({color:"rgba("+e.rgb.r+","+e.rgb.g+","+e.rgb.b+","+e.rgb.a+")"}),this.onChange_cb()}set_color2(e){this.setState({color:e}),this.props.onChange(t.richText.applyFormat(this.props.value,{type:"aksrtblock/set-color",attributes:{style:"color:"+e+";background:"+this.state.background}}))}set_background2(e){this.setState({background:e}),this.props.onChange(t.richText.applyFormat(this.props.value,{type:"aksrtblock/set-color",attributes:{style:"color:"+this.state.color+";background:"+e}}))}set_background(e){this.setState({background:"rgba("+e.rgb.r+","+e.rgb.g+","+e.rgb.b+","+e.rgb.a+")"}),this.onChange_cb()}render(){let{isActive:e}=this.props,t=h(r.ColorPicker,{color:this.state.color||"#444",onChangeComplete:this.set_color}),a=h(r.ColorPalette,{value:this.state.color||"#444",colors:Y,clearable:!1,className:"q-ColorPalette",disableCustomColors:!0,onChange:this.set_color2}),l=h(r.ColorPalette,{value:this.state.background||"#fff",colors:Y,clearable:!1,className:"q-ColorPalette",disableCustomColors:!0,onChange:this.set_background2}),n=h(r.ColorPicker,{color:this.state.background||"#fff",onChangeComplete:this.set_background}),o=h("button",{className:"remove-Format",onClick:this.remove_Format},h("span",{className:"dashicons dashicons-image-rotate"}));return h(A,null,h(N,{icon:"art",title:Z("gutenberg_custom_color"),onClick:this.show_modal,isActive:e,isDisabled:!this.words_selected()}),this.state.modal_visibility&&h(x,{anchorRect:this.state.popover_rect,position:"bottom",className:"color_popover",onFocusOutside:this.close_modal},h(r.ButtonGroup,{},h("button",{className:"btn btn-default "+(!this.state.xsba&&"isS"),onClick:this.xsba_f},Z("gutenberg_color")),h("button",{className:"btn btn-default "+(this.state.xsba&&"isS"),onClick:this.xsba},Z("gutenberg_bg_color"))),o,!this.state.xsba&&h("div",{},h("p",{},Z("gutenberg_select_text_color")),a,t),this.state.xsba&&h("div",{},h("p",{},Z("gutenberg_select_bg_color")),l,n)))}}}),f("aksrtblock/modal",{title:ae(Z("gutenberg_modal")),icon:Q.modal,description:Z("gutenberg_modal_desc"),category:"aksrt_block_cat",attributes:{biaoti:{type:"array",source:"children",selector:".modal-title"},kuandu:{type:"attribute",selector:".modal-dialog",attribute:"data-kd"},btn1:{type:"array",source:"children",selector:"button.btn1"},btn2:{type:"array",source:"children",selector:"button.btn2"},id:{source:"attribute",selector:".modal",attribute:"id"},btn1kg:{type:"attribute",attribute:"data-bkg1",default:!0},btn2kg:{type:"attribute",attribute:"data-bkg2",default:!0},btntm1:{type:"attribute",selector:"button.btn1",attribute:"class"},btntm2:{type:"attribute",selector:"button.btn2",attribute:"class"},oncopy:{source:"string"}},edit:function(e){var t=e.attributes,a=t.biaoti,l=t.btn1,r=t.btn2,n=t.btntm1||"btn1 but",o=t.btntm2||"btn2 but c-blue",i=t.btn1kg,s=t.btn2kg,c=t.oncopy,u=t.kuandu||"",b=e.setAttributes,d=parseInt((Math.random()+1)*Math.pow(10,4));function g(e){var t=e.target.className;b({btntm1:"btn1 "+t})}function _(e){var t=e.target.className;b({btntm2:"btn2 "+t})}t.id||b({id:"modal_"+d});var p=h(k,{},""),m=h(q,{tagName:"div",onChange:function(e){b({biaoti:e})},value:a,placeholder:Z("gutenberg_enter_title_dots")}),v=h(q,{tagName:"div",onChange:function(e){b({btn1:e})},value:l,placeholder:Z("gutenberg_button_1")}),f=h(q,{tagName:"div",onChange:function(e){b({btn2:e})},value:r,placeholder:Z("gutenberg_button_2")}),y=h("span",{className:"modal-bu"},[h("button",{className:"but",onClick:g}),h("button",{className:"but c-blue",onClick:g}),h("button",{className:"but c-red",onClick:g}),h("button",{className:"but c-yellow",onClick:g}),h("button",{className:"but c-green",onClick:g}),h("button",{className:"but c-purple",onClick:g}),h("button",{className:"but b-blue",onClick:g}),h("button",{className:"but b-red",onClick:g}),h("button",{className:"but b-yellow",onClick:g}),h("button",{className:"but b-green",onClick:g}),h("button",{className:"but b-purple",onClick:g})]),N=h("span",{className:"modal-bu"},[h("button",{className:"but",onClick:_}),h("button",{className:"but c-blue",onClick:_}),h("button",{className:"but c-red",onClick:_}),h("button",{className:"but c-yellow",onClick:_}),h("button",{className:"but c-green",onClick:_}),h("button",{className:"but c-purple",onClick:_}),h("button",{className:"but b-blue",onClick:_}),h("button",{className:"but b-red",onClick:_}),h("button",{className:"but b-yellow",onClick:_}),h("button",{className:"but b-green",onClick:_}),h("button",{className:"but b-purple",onClick:_})]);return h("div",{},h("div",{className:"modal "+u},h("div",{className:"modal-title"},m,h("button",{className:"close"},"×")),h("div",{className:"modal-body"},p),[(i||s)&&h("div",{className:"modal-footer"},[i&&h("span",{className:n},v)],[s&&h("span",{className:o},f)])]),h(H,{},h("div",{className:"modal-ss padding-h"},h("h5",{},Z("gutenberg_usage_tutorial")),h("p",{},Z("gutenberg_modal_usage_desc")),h("p",{className:"modal-code"},"javascript:void($('#"+t.id+"').modal('show'));"),h("div",{className:"Copy"},h(S,{text:"javascript:void($('#"+t.id+"').modal('show'));",className:"Copy but jb-blue",onCopy:function(){b({oncopy:!0})},onFinishCopy:function(){b({oncopy:!1})}},Z(c?"gutenberg_code_copied":"gutenberg_click_copy_code")))),h(V,{title:Z("gutenberg_modal_settings")},h(F,{label:Z("gutenberg_width_select"),value:u,onChange:function(e){b({kuandu:e})},options:[{label:Z("gutenberg_width_default"),value:""},{label:Z("gutenberg_width_xs"),value:"modal-sm"},{label:Z("gutenberg_width_sm"),value:"modal-mini"},{label:Z("gutenberg_width_lg"),value:"modal-lg"}]}),h("p",{}," "),h(P,{label:Z("gutenberg_enable_button_1"),checked:i,onChange:function(e){b({btn1kg:e})}}),[i&&y],h(P,{label:Z("gutenberg_enable_button_2"),checked:s,onChange:function(e){b({btn2kg:e})}}),[s&&N])))},save:function(e){var t=e.attributes,a=t.btn1,l=t.btn2,r=t.btntm1||"btn1 but",n=t.btntm2||"btn2 but c-blue",o=t.btn1kg,i=t.btn2kg,s=t.kuandu,c=t.id,u=t.biaoti,b=h("div",{className:"modal-header"},h("strong",{className:"modal-title"},u),h("button",{className:"close","data-dismiss":"modal"},h("div",{"data-class":"ic-close","data-svg":"close","data-viewbox":"0 0 1024 1024"},""))),d=h("div",{className:"modal-body"},h(k.Content)),g=[(o&&a||i&&l)&&h("div",{className:"modal-footer"},[o&&a&&h("button",{className:r},a)],[i&&l&&h("button",{className:n},l)])];return h("div",{},h("div",{className:"modal fade",id:c,"aria-hidden":"true","data-bkg1":o,"aria-bkg2":i,role:"dialog",tabindex:"-1"},h("div",{className:"modal-dialog "+s,"data-kd":s},h("div",{className:"modal-content"},b,d,g))))}}),f("aksrtblock/collapse",{title:ae(Z("gutenberg_accordion")),icon:{src:"sort",foreground:U},description:Z("gutenberg_accordion_desc"),category:"aksrt_block_cat",attributes:{biaoti:{type:"array",source:"children",selector:".biaoti"},isshow:{type:"attribute",selector:".panel",attribute:"data-isshow",default:!0},theme:{source:"attribute",selector:".panel",attribute:"class"},id:{source:"attribute",selector:".collapse",attribute:"id"},ffs:{source:"string"}},edit:function(e){var t=e.attributes,a=t.biaoti,l=t.theme||"panel panel-default",r=t.isshow,n=t.ffs||"ffshow",o=e.setAttributes,i=parseInt((Math.random()+1)*Math.pow(10,4));function s(e){var t=e.target.className;o({theme:"panel "+t})}t.id||o({id:"collapse_"+i});var c=h(k,{},""),u=h(q,{tagName:"div",onChange:function(e){o({biaoti:e})},value:a,isSelected:e.isSelected,placeholder:Z("gutenberg_enter_accordion_title")});h("span",{className:"g_extend anz panel_b"},[h("button",{className:"panel-default",onClick:s}),h("button",{className:"panel-info",onClick:s}),h("button",{className:"panel-success",onClick:s}),h("button",{className:"panel-warning",onClick:s}),h("button",{className:"panel-danger",onClick:s})]);return h("div",{},h("div",{className:l},h("div",{className:"panel-heading"},u),h("span",{className:n+" isshow dashicons dashicons-arrow-down-alt2",onClick:function(){o("ffshow"==n?{ffs:"ffhide"}:{ffs:"ffshow"})}}),h("div",{className:n+" panel-body"},c)),h(H,null,h(V,{icon:"admin-generic",title:Z("gutenberg_settings")},h("p",{},h(P,{label:Z("gutenberg_default_expand"),checked:r,onChange:function(e){o({isshow:e})}})),h("i",{className:".components-base-control__help"},Z(r?"gutenberg_default_expanded":"gutenberg_default_collapsed")))))},save:function(e){var t=e.attributes,a=t.theme||"panel",l=t.isshow,r=t.id,n=t.biaoti,o=h("div",{className:"panel-heading "+(l?"":"collapsed"),href:"#"+r,"data-toggle":"collapse","aria-controls":"collapseExample"},h("i",{className:"fa fas fa-plus"}),h("strong",{className:"biaoti "},n)),i=h("div",{className:"collapse "+(l?"in":""),id:r},h("div",{className:"panel-body"},h(k.Content)));return h("div",{},h("div",{className:a,"data-theme":a,"data-isshow":l},o,i))}}),f("aksrtblock/enlighter",{title:ae(Z("gutenberg_code_highlight")),icon:Q.enlighter,category:"aksrt_block_cat",description:Z("gutenberg_code_highlight_desc"),keywords:["code","sourcecode",Z("gutenberg_code")],attributes:{content:{type:"string",selector:"code.gl",source:"text"},c_language:{type:"attribute",attribute:"data-enlighter-language",default:"generic"},theme:{type:"attribute",attribute:"data-enlighter-theme",default:""},highlight:{type:"attribute",attribute:"data-enlighter-highlight",default:""},linenumbers:{type:"attribute",attribute:"data-enlighter-linenumbers",default:""},lineoffset:{type:"attribute",attribute:"data-enlighter-lineoffset",default:""},title:{type:"attribute",attribute:"data-enlighter-title",default:""},group:{type:"attribute",attribute:"data-enlighter-group",default:""}},transforms:{from:[{type:"raw",priority:4,isMatch:function(e){return"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName},transform:function(e){return y("aksrtblock/enlighter",{content:e.textContent})}},{type:"raw",priority:4,isMatch:function(e){return"PRE"===e.nodeName&&"EnlighterJSRAW"===e.className},transform:function(e){return y("aksrtblock/enlighter",{content:e.textContent,language:e.dataset.enlighterLanguage||"",theme:e.dataset.enlighterTheme||"",highlight:e.dataset.enlighterHighlight||"",linenumbers:e.dataset.enlighterLinenumbers||"",lineoffset:e.dataset.enlighterLineoffset||"",title:e.dataset.enlighterTitle||"",group:e.dataset.enlighterGroup||""})}},{type:"block",blocks:["core/code","core/preformatted","core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/enlighter",{content:t})}}],to:[{type:"block",blocks:["core/code"],transform:function(e){var t=e.content;return y("core/code",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes,a=e.setAttributes,l=h(T,null,h(I,{className:"enlighter-dropdownmenu",icon:"editor-paste-text",label:Z("gutenberg_set_code_language"),controls:[{title:"yaml",value:"yaml",onClick:function(){return a({c_language:"yaml"})}},{title:"xml/html",value:"xml",onClick:function(){return a({c_language:"xml"})}},{title:"visualbasic",value:"visualbasic",onClick:function(){return a({c_language:"visualbasic"})}},{title:"vhdl",value:"vhdl",onClick:function(){return a({c_language:"vhdl"})}},{title:"typescript",value:"typescript",onClick:function(){return a({c_language:"typescript"})}},{title:"swift",value:"swift",onClick:function(){return a({c_language:"swift"})}},{title:"squirrel",value:"squirrel",onClick:function(){return a({c_language:"squirrel"})}},{title:"sql",value:"sql",onClick:function(){return a({c_language:"sql"})}},{title:"shell",value:"shell",onClick:function(){return a({c_language:"shell"})}},{title:"scss/sass",value:"scss",onClick:function(){return a({c_language:"scss"})}},{title:"rust",value:"rust",onClick:function(){return a({c_language:"rust"})}},{title:"ruby",value:"ruby",onClick:function(){return a({c_language:"ruby"})}},{title:"raw",value:"raw",onClick:function(){return a({c_language:"raw"})}},{title:"python",value:"python",onClick:function(){return a({c_language:"python"})}},{title:"prolog",value:"prolog",onClick:function(){return a({c_language:"prolog"})}},{title:"powershell",value:"powershell",onClick:function(){return a({c_language:"powershell"})}},{title:"php",value:"php",onClick:function(){return a({c_language:"php"})}},{title:"nsis",value:"nsis",onClick:function(){return a({c_language:"nsis"})}},{title:"matlab",value:"matlab",onClick:function(){return a({c_language:"matlab"})}},{title:"markdown",value:"markdown",onClick:function(){return a({c_language:"markdown"})}},{title:"lua",value:"lua",onClick:function(){return a({c_language:"lua"})}},{title:"less",value:"less",onClick:function(){return a({c_language:"less"})}},{title:"kotlin",value:"kotlin",onClick:function(){return a({c_language:"kotlin"})}},{title:"json",value:"json",onClick:function(){return a({c_language:"json"})}},{title:"javascript",value:"javascript",onClick:function(){return a({c_language:"javascript"})}},{title:"java",value:"java",onClick:function(){return a({c_language:"java"})}},{title:"ini/conf",value:"ini",onClick:function(){return a({c_language:"ini"})}},{title:"groovy",value:"groovy",onClick:function(){return a({c_language:"groovy"})}},{title:"go/golang",value:"go",onClick:function(){return a({c_language:"go"})}},{title:"docker",value:"dockerfile",onClick:function(){return a({c_language:"dockerfile"})}},{title:"diff",value:"diff",onClick:function(){return a({c_language:"diff"})}},{title:"cordpro",value:"cordpro",onClick:function(){return a({c_language:"cordpro"})}},{title:"cython",value:"cython",onClick:function(){return a({c_language:"cython"})}},{title:"css",value:"css",onClick:function(){return a({c_language:"css"})}},{title:"csharp",value:"csharp",onClick:function(){return a({c_language:"csharp"})}},{title:"Cpp/C++/C",value:"cpp",onClick:function(){return a({c_language:"cpp"})}},{title:"avrassembly",value:"avrassembly",onClick:function(){return a({c_language:"avrassembly"})}},{title:"assembly",value:"assembly",onClick:function(){return a({c_language:"assembly"})}},{title:Z("gutenberg_auto_detect"),value:"generic",onClick:function(){return a({c_language:"generic"})}}]})),r=h(M,{value:t.content,onChange:function(e){return a({content:e})},placeholder:Z("gutenberg_enter_code"),"aria-label":"Code"}),n=h(F,{label:Z("gutenberg_code_language"),value:t.c_language,options:[{label:"yaml",value:"yaml"},{label:"xml/html",value:"xml"},{label:"visualbasic",value:"visualbasic"},{label:"vhdl",value:"vhdl"},{label:"typescript",value:"typescript"},{label:"swift",value:"swift"},{label:"squirrel",value:"squirrel"},{label:"sql",value:"sql"},{label:"shell",value:"shell"},{label:"scss/sass",value:"scss"},{label:"rust",value:"rust"},{label:"ruby",value:"ruby"},{label:"raw",value:"raw"},{label:"python",value:"python"},{label:"prolog",value:"prolog"},{label:"powershell",value:"powershell"},{label:"php",value:"php"},{label:"nsis",value:"nsis"},{label:"matlab",value:"matlab"},{label:"markdown",value:"markdown"},{label:"lua",value:"lua"},{label:"less",value:"less"},{label:"kotlin",value:"kotlin"},{label:"json",value:"json"},{label:"javascript",value:"javascript"},{label:"java",value:"java"},{label:"ini/conf",value:"ini"},{label:"groovy",value:"groovy"},{label:"go/golang",value:"go"},{label:"docker",value:"dockerfile"},{label:"diff",value:"diff"},{label:"cordpro",value:"cordpro"},{label:"cython",value:"cython"},{label:"css",value:"css"},{label:"csharp",value:"csharp"},{label:"Cpp/C++/C",value:"cpp"},{label:"avrassembly",value:"avrassembly"},{label:"assembly",value:"assembly"},{label:Z("gutenberg_auto_detect"),value:"generic"}],onChange:function(e){return a({c_language:e})}}),o=h(H,null,h(V,{icon:"admin-appearance",title:Z("gutenberg_code_settings")},n,h(F,{label:Z("gutenberg_select_theme"),value:t.theme,options:[{label:"enlighter",value:"enlighter"},{label:"classic",value:"classic"},{label:"beyond",value:"beyond"},{label:"mowtwo",value:"mowtwo"},{label:"eclipse",value:"eclipse"},{label:"droide",value:"droide"},{label:"minimal",value:"minimal"},{label:"atomic",value:"atomic"},{label:"dracula",value:"dracula"},{label:"bootstrap4",value:"bootstrap4"},{label:"rowhammer",value:"rowhammer"},{label:"godzilla",value:"godzilla"},{label:Z("gutenberg_follow_theme"),value:""}],onChange:function(e){return a({theme:e})}}),h(B,{label:Z("gutenberg_show_line_numbers"),selected:t.linenumbers,options:[{label:Z("gutenberg_follow_theme"),value:""},{label:Z("gutenberg_show"),value:"true"},{label:Z("gutenberg_hide"),value:"false"}],onChange:function(e){return a({linenumbers:e})}}),h(L,{label:Z("gutenberg_start_line_number"),value:t.lineoffset,onChange:function(e){return a({lineoffset:e})},placeholder:Z("gutenberg_line_number_example")}),h(L,{label:Z("gutenberg_highlight_lines"),value:t.highlight,onChange:function(e){return a({highlight:e})},placeholder:Z("gutenberg_highlight_lines_format")})),h(V,{title:Z("gutenberg_code_group"),initialOpen:!1,icon:"excerpt-view"},h("p",null,Z("gutenberg_code_group_desc")),h(L,{label:Z("gutenberg_code_title"),value:t.title,onChange:function(e){return a({title:e})},placeholder:Z("gutenberg_code_group_title")}),h(L,{label:Z("gutenberg_custom_group_id"),value:t.group,onChange:function(e){return a({group:e})},placeholder:Z("gutenberg_custom_group_id_placeholder")})));return h("div",null,h(A,null,h(O,null,l)),h("div",{className:"enlighter-block-wrapper"},h("div",{className:"enlighter-header"},h("div",{className:"enlighter-title"})),h("pre",{tagName:"pre",className:"enlighter-pre"},h("div",{className:"enlighter-label"},Z("gutenberg_language_label"),t.c_language,Z("gutenberg_theme_label"),t.theme?t.theme:Z("gutenberg_follow_theme_short")),r),h("div",{className:"enlighter-footer"}),o))},save:function(e){var t=e.attributes,a=h("code",{className:"gl","data-enlighter-language":t.c_language,"data-enlighter-theme":t.theme,"data-enlighter-highlight":t.highlight,"data-enlighter-linenumbers":t.linenumbers,"data-enlighter-lineoffset":t.lineoffset,"data-enlighter-title":t.title,"data-enlighter-group":t.group},t.content);return h("pre",{},a)}}),f("aksrtblock/biaoti",{title:ae(Z("gutenberg_heading")),icon:Q.biaoti,category:"aksrt_block_cat",description:Z("gutenberg_heading_desc"),className:!1,textdomain:"default",attributes:{content:{type:"array",source:"children",selector:".title-theme"},typeClass:{source:"attribute",selector:".title-theme",attribute:"class"},color:{source:"attribute",selector:".title-theme",attribute:"data-color"},tag_name:{source:"tag",selector:".title-theme",attribute:"data-color"}},transforms:{from:[{type:"block",blocks:["core/heading","core/preformatted","core/paragraph"],transform:function(e){var t=e.content,a=e.level?"h"+e.level:"h2";return y("aksrtblock/biaoti",{content:t,tag_name:a})}}],to:[{type:"block",blocks:["core/heading"],transform:function(e){var t=e.content,a=e.tag_name?e.tag_name.replace("h",""):2;return y("core/heading",{content:t,level:~~a})}},{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("core/paragraph",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes.content,a=e.attributes.tag_name||"h2",l=t.typeClass||"title-theme",n=e.attributes.color;var o=h(q,{tagName:"div",onChange:function(t){e.setAttributes({content:t})},value:t,isSelected:e.isSelected,placeholder:Z("gutenberg_enter_heading"),disableLineBreaks:!0}),i=h("div",{className:l,"data-color":n,style:{color:n,"border-left-color":n}},h(a,{},o));var s=a.replace("h",""),c=h(T,{},h(I,{icon:Q["headingLevel"+s],label:Z("gutenberg_heading_level"),controls:[1,2,3,4,5].map(function(t){{const l="h"+t,r=a===l;return{icon:Q["headingLevel"+t],isActive:r,onClick:function(){e.setAttributes({tag_name:l})},role:"menuitemradio"}}})})),u=h(r.ColorPalette,{value:n,colors:Y,className:"q-ColorPalette",onChange:function(t){e.setAttributes({color:t})}});return h("div",{},i,h(O,null,c),h(H,null,h(V,{title:Z("gutenberg_custom_color")},h("p",{className:"components-base-control"},Z("gutenberg_heading_color_hint")),h("p",{className:"components-base-control"},u))))},save:function(e){var t=e.attributes.content,a=e.attributes.tag_name||"h2",l=e.attributes.typeClass||"title-theme",r=e.attributes.color;return h(a,{"data-color":r,className:l,style:r&&"--theme-color:"+r},t)}}),f("aksrtblock/hide-content",{title:ae(Z("gutenberg_hidden_content")),icon:{src:"hidden",foreground:U},description:Z("gutenberg_hidden_content_desc"),category:"aksrt_block_cat",attributes:{type:{source:"attribute",selector:"div",attribute:"data-type"},password:{source:"attribute",selector:"[data-password]",attribute:"data-password",default:""},img_id:{source:"attribute",selector:"[data-img-id]",attribute:"data-img-id",default:""},img_url:{source:"attribute",selector:"[data-img-url]",attribute:"data-img-url",default:""},desc:{source:"attribute",selector:"[data-desc]",attribute:"data-desc",default:""}},edit:function(e){var t=e.setAttributes,a=e.attributes,l=a.type||"reply",r=h("div",{className:"hide-innerblocks"},h(k)),n={reply:Z("gutenberg_comment_visible"),payshow:Z("gutenberg_paid_reading"),logged:Z("gutenberg_login_visible"),password:Z("gutenberg_password_verify"),vip1:Z("gutenberg_all_vip_visible"),vip2:Z("gutenberg_vip2_visible")},o=h(T,{},h(I,{icon:"editor-paste-text",className:"aksrtblock-buttons-sl",label:Z("gutenberg_hidden_mode_select"),controls:[{title:n.reply,value:"reply",onClick:function(){t({type:"reply"})}},{title:n.logged,value:"logged",onClick:function(){t({type:"logged"})}},{title:n.password,value:"password",onClick:function(){t({type:"password"})}},{title:n.payshow,value:"payshow",onClick:function(){t({type:"payshow"})}},{title:n.vip1,value:"vip1",onClick:function(){t({type:"vip1"})}},{title:n.vip2,value:"vip2",onClick:function(){t({type:"vip2"})}}]})),i=h(A,null,h(O,null,o));return h("div",{className:"hide-content"},i,h("div",{className:"hide-title"},J("gutenberg_hidden_content_title",n[l]),h("span",{className:"dashicons dashicons-admin-generic",style:{float:"right",margin:"5px 10px"}})),r,h(H,null,te(853),h(V,{title:Z("gutenberg_hidden_content_settings")},h(F,{label:Z("gutenberg_hidden_visible_mode"),value:l,options:[{label:n.reply,value:"reply"},{label:n.logged,value:"logged"},{label:n.password,value:"password"},{label:n.payshow,value:"payshow"},{label:n.vip1,value:"vip1"},{label:n.vip2,value:"vip2"}],onChange:function(e){t({type:e})}}),["payshow"==l&&h("div",{className:"block-editor-block-card__description"},Z("gutenberg_paid_reading_hint"),h("a",{href:"#wznav_3",target:"blank"},Z("gutenberg_view_official_tutorial_link")))],["password"==l&&h("div",{className:"block-editor-block-card__description"},h(L,{label:Z("gutenberg_set_password"),value:a.password||"",onChange:function(e){return t({password:e})},placeholder:Z("gutenberg_enter_password")}),h(L,{label:Z("gutenberg_remind_text"),value:a.desc||"",onChange:function(e){return t({desc:e})},placeholder:Z("gutenberg_enter_remind_content")}),[a.img_id&&h("div",{className:" "},h("img",{src:a.img_url}))],h(j,{title:Z("gutenberg_remind_image"),allowedTypes:["image"],onSelect:function(e){t({img_url:e.url,img_id:e.id})},value:a.img_id,render:function(e){var t=e.open;return h(z,{className:"but jb-blue is-secondary",onClick:t},[a.img_id?Z("gutenberg_replace_remind_image"):Z("gutenberg_add_remind_image")])}}),h("div",{className:"mt10 em09"},Z("gutenberg_password_remind_hint")),h("div",{className:"mt6 em09"},Z("gutenberg_password_unique_hint")))],h("div",{className:"opacity8 mb10 em09 mt10 c-yellow"},Z("gutenberg_hidden_no_nest_hint")))))},save:function(e){var t=e.attributes,a=t.type||"reply",l={},r="";return"password"==a&&(l={"data-password":t.password,"data-img-id":t.img_id,"data-img-url":t.img_url,"data-desc":t.desc},r=' password="'+t.password+'" img_id="'+t.img_id+'" img_url="'+t.img_url+'" desc="'+t.desc+'"'),h("div",{"data-type":a},[h("span",{},'[hidecontent type="'+a+'"'+r+"]"),h(k.Content),h("span",l,"[/hidecontent]")])}});var re=$(function(t,a){var l=t.url||G.root+"wp/v2/search";e.get(l,t,a)},600);f("aksrtblock/postslists",{title:ae(Z("gutenberg_post_list")),icon:Q.postslists,attributes:{orderby:{source:"attribute",selector:".single-posts-lists",attribute:"data-orderby",default:"date"},cat:{source:"attribute",selector:".single-posts-lists",attribute:"data-cat",default:""},topics:{source:"attribute",selector:".single-posts-lists",attribute:"data-topics",default:""},style:{source:"attribute",selector:".single-posts-lists",attribute:"data-style",default:"text"},count:{source:"attribute",selector:".single-posts-lists",attribute:"data-count",default:12},paginate:{source:"attribute",selector:".single-posts-lists",attribute:"data-paginate",default:""}},description:Z("gutenberg_post_list_desc"),category:"aksrt_block_cat",edit:function(e){var t=e.attributes,a=e.setAttributes,l=t.orderby||"date",r=t.cat||"",n=t.topics||"",o=t.style||"text",i=t.count||12,s=t.paginate||"",c=function(e){var t=Z("topics"===e?"gutenberg_topics":"gutenberg_category"),l=J("gutenberg_taxonomy_id_select",t);return h(L,{label:J("gutenberg_taxonomy_limit",t),value:"topics"===e?n:r,help:J("gutenberg_taxonomy_id_help",t),onChange:function(t){return a("topics"===e?{topics:t}:{cat:t})},placeholder:l})},u=h("div",{},c("cat"),c("topics"),h(F,{label:Z("gutenberg_orderby"),value:l,options:[{label:Z("gutenberg_post_title"),value:"title"},{label:Z("gutenberg_recent_update"),value:"modified"},{label:Z("gutenberg_latest_publish"),value:"date"},{label:Z("gutenberg_by_comments"),value:"comment_count"},{label:Z("gutenberg_by_likes"),value:"like"},{label:Z("gutenberg_by_views"),value:"views"},{label:Z("gutenberg_by_favorites"),value:"favorite"},{label:Z("gutenberg_sale_price"),value:"aksrtpay_price"},{label:Z("gutenberg_points_price"),value:"aksrtpay_points_price"},{label:Z("gutenberg_sales_volume"),value:"sales_volume"},{label:Z("gutenberg_random_order"),value:"rand"}],onChange:function(e){return a({orderby:e})}}),h(B,{label:Z("gutenberg_list_style"),selected:o,options:[{label:Z("gutenberg_text_list"),value:"text"},{label:Z("gutenberg_mini_card"),value:"minicard"}],onChange:function(e){return a({style:e})}}),h(L,{label:(""!=s?Z("gutenberg_per_page"):"")+Z("gutenberg_display_count"),value:i,onChange:function(e){return a({count:e})},placeholder:Z("gutenberg_enter_display_count")}),h(B,{label:Z("gutenberg_pagination"),selected:s,options:[{label:Z("gutenberg_not_show"),value:""},{label:Z("gutenberg_ajax_pagination"),value:"ajax"},{label:Z("gutenberg_number_pagination"),value:"number"}],onChange:function(e){return a({paginate:e})}})),b=h(H,null,te(22555),h(V,{title:Z("gutenberg_post_list_settings")},u));return h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.postsbox,h("span",{className:"ml10"},ae(Z("gutenberg_post_list")))),h("div",{className:"opacity8 mb10 em09"},Z("gutenberg_post_list_desc")),e.isSelected?h(V,{initialOpen:!1,title:Z("gutenberg_post_list_settings")},u):h("div",{class:"px12"},'[cat="'+t.cat+'" topics="'+t.topics+'" orderby="'+t.orderby+'" style="'+t.style+'" count="'+t.count+'" paginate="'+t.paginate+'"]'),b)},save:function(e){var t=e.attributes;return h("div",{class:"single-posts-lists",contenteditable:"false","data-orderby":t.orderby,"data-cat":t.cat,"data-topics":t.topics,"data-style":t.style,"data-count":t.count,"data-paginate":t.paginate},'[postslists cat="'+t.cat+'" topics="'+t.topics+'" orderby="'+t.orderby+'" style="'+t.style+'" count="'+t.count+'" paginate="'+t.paginate+'"]')}}),f("aksrtblock/postsbox",{title:ae(Z("gutenberg_post_card")),icon:Q.postsbox,attributes:{post_id:{source:"attribute",selector:"div",attribute:"data-pid"}},description:Z("gutenberg_post_card_desc"),category:"aksrt_block_cat",edit:function(e){var t=e.attributes.post_id,a=e.attributes;function l(t){if(!(t.length<2||~~t||a.loading)){var l={per_page:20,search:t,type:"post",post_type:["post","forum_post"],order_by:"post_title"};return e.setAttributes({loading:!0}),re(l,function(t){t=t||[],e.setAttributes({search_lists:t}),e.setAttributes({loading:!1})})}}a.search_lists=a.search_lists||[];var n=h("div",{className:"rti-container"},e.isSelected?h("div",{},h(L,{tagName:"div",onChange:function(t){e.setAttributes({post_id:t}),l(t)},required:!0,onKeyDown:function(e){13==e.keyCode&&l(e.target.value)},value:t,placeholder:Z("gutenberg_search_post_id"),label:Z("gutenberg_search_post_id")}),a.loading&&h(r.Spinner,{style:{position:"absolute",right:"12px",bottom:"30px"}})):h("div",{className:" "+(~~t?"px12":"c-red em09")},~~t?"[ID:"+t+"]"+(a.post_title?a.post_title:""):Z("gutenberg_post_id_invalid")));return h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.postsbox,h("span",{className:"ml10"},ae(Z("gutenberg_post_card")))),h("div",{className:"opacity8 mb10 em09"},Z("gutenberg_post_card_hint")),n,e.isSelected&&a.search_lists.length>0&&h(x,{focusOnMount:!1,position:"left middle center ",className:" "},h("div",{className:"block-editor-link-control"},h("div",{className:"mt6 block-editor-link-control__search-results"},a.search_lists.map(function(t,l){return function(t){return h("button",{className:"components-button components-menu-item__button block-editor-link-control__search-item has-text has-icon",key:t,onClick:function(){e.setAttributes({post_id:a.search_lists[t].id,post_title:a.search_lists[t].title}),this.popover_anchor_rect=!1}},h("span",{className:"em12 mr6"},Q.postsbox),h("span",{className:"components-menu-item__item"},h("span",{className:"components-menu-item__info-wrapper"},h("span",{className:"components-menu-item__item"},"["+a.search_lists[t].id+"]"+a.search_lists[t].title))),h("span",{className:"components-menu-item__shortcut"},a.search_lists[t].subtype))}(l)})))),h(H,null,te(860)))},save:function(e){var t=e.attributes.post_id;return h("div",{"data-pid":t},'[postsbox post_id="'+t+'"]')}}),f("aksrtblock/quote",{title:ae(Z("gutenberg_quote")),icon:{src:"format-quote",foreground:U},description:Z("gutenberg_quote_desc"),category:"aksrt_block_cat",attributes:{content:{type:"array",source:"children",selector:".quote_q p"},typeClass:{source:"attribute",selector:".quote_q",attribute:"class"},color:{source:"attribute",selector:".quote_q",attribute:"data-color"}},transforms:{from:[{type:"block",blocks:["aksrtblock/alert","core/quote","core/preformatted","core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/quote",{content:t})}}],to:[{type:"block",blocks:["core/quote"],transform:function(e){var t=e.content;return y("core/quote",{content:t})}},{type:"block",blocks:["aksrtblock/alert"],transform:function(e){var t=e.content;return y("aksrtblock/alert",{content:t})}},{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("core/paragraph",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes.content,a=e.attributes.typeClass||"quote_q",l=e.attributes.color,n=l||"";var o=h(q,{tagName:"div",isSelected:e.isSelected,onChange:function(t){e.setAttributes({content:t})},value:t,placeholder:Z("gutenberg_enter_content")}),i=h("div",{className:a,style:{"--quote-color":n}},h("i",{className:"fa fas fa-quote-left"}),o),s=h(r.ColorPalette,{value:l||"#555",colors:Y,className:"q-ColorPalette",onChange:function(t){e.setAttributes({color:t})}});return h("div",{},i,h("div",{},h(H,null,h(V,{title:Z("gutenberg_custom_color")},h("p",{},Z("gutenberg_quote_color_hint")),h("p",{},s)))))},save:function(e){var t=e.attributes.content,a=e.attributes.typeClass||"quote_q",l=e.attributes.color,r=h("div",{className:a,"data-color":l,style:l&&"--quote-color:"+l},h("i",{className:"fa fas fa-quote-left"}),h("p",{},t));return h("div",{},r)}}),f("aksrtblock/alert",{title:ae(Z("gutenberg_alert")),icon:{src:"info",foreground:U},description:Z("gutenberg_alert_desc"),category:"aksrt_block_cat",attributes:{content:{type:"array",source:"children",selector:"div.alert"},typeClass:{source:"attribute",selector:".alert",attribute:"class"},isChecked:{source:"attribute",selector:".alert",attribute:"data-isclose"}},transforms:{from:[{type:"block",blocks:["aksrtblock/quote","core/quote","core/preformatted","core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/alert",{content:t})}}],to:[{type:"block",blocks:["core/quote"],transform:function(e){var t=e.content;return y("core/quote",{content:t})}},{type:"block",blocks:["aksrtblock/quote"],transform:function(e){var t=e.content;return y("aksrtblock/quote",{content:t})}},{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("core/paragraph",{content:t})}},{type:"block",blocks:["core/preformatted"],transform:function(e){var t=e.content;return y("core/preformatted",{content:t})}}]},edit:function(e){var t=e.attributes.content,a=e.attributes.typeClass||"alert jb-blue",l=e.attributes.isChecked,r=e.isSelected;function n(t){var a=t.target.className;e.setAttributes({typeClass:"alert "+a})}var o=h(q,{tagName:"div",isSelected:e.isSelected,onChange:function(t){e.setAttributes({content:t})},value:t,placeholder:Z("gutenberg_enter_content")}),i=h("div",{className:a},o),s=h("span",{className:"g_extend anz alert_b"},[h("button",{className:"jb-blue",onClick:n}),h("button",{className:"jb-green",onClick:n}),h("button",{className:"jb-yellow",onClick:n}),h("button",{className:"jb-red",onClick:n})]),c=h("div",{className:"close_an"},h(P,{label:Z("gutenberg_alert_closable"),checked:l,onChange:function(t){e.setAttributes({isChecked:t})}}));return h("div",{},[i,l&&h("button",{className:"close"},"×"),r&&s,r&&c],h(H,null,h(V,{icon:"admin-appearance",title:Z("gutenberg_alert_settings")},h("div",{},Z("gutenberg_alert_type")),h("div",{},s)),c))},save:function(e){var t=e.attributes.content,a=e.attributes.isChecked||"",l=e.attributes.typeClass||"alert jb-blue",r=h("button",{type:"button",className:"close","data-dismiss":"alert","aria-label":"Close"},h("div",{"data-class":"ic-close","data-svg":"close","data-viewbox":"0 0 1024 1024"})),n=h("div",{className:l,"data-isclose":a,role:"alert"},t);return h("div",{className:"alert-dismissible fade in"},[a&&r],n)}}),f("aksrtblock/buttons",{title:ae(Z("gutenberg_buttons")),description:Z("gutenberg_buttons_desc"),icon:Q.buttons,category:"aksrt_block_cat",attributes:{alignment:{type:"string"},quantity:{type:"attribute",attribute:"data-quantity",default:1},radius:{type:"attribute",attribute:"data-radius",default:!0},content1:{type:"array",source:"children",selector:"span.an_1"},typeClass1:{source:"attribute",selector:".an_1",attribute:"class"},content2:{type:"array",source:"children",selector:"span.an_2"},typeClass2:{source:"attribute",selector:".an_2",attribute:"class"},content3:{type:"array",source:"children",selector:"span.an_3"},typeClass3:{source:"attribute",selector:".an_3",attribute:"class"},content4:{type:"array",source:"children",selector:"span.an_4"},typeClass4:{source:"attribute",selector:".an_4",attribute:"class"},content5:{type:"array",source:"children",selector:"span.an_5"},typeClass5:{source:"attribute",selector:".an_5",attribute:"class"}},transforms:{from:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return y("aksrtblock/buttons",{content1:t})}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content1;return y("core/paragraph",{content:t})}}]},edit:function(t){var a=t.attributes,l=t.setAttributes,r=a.alignment,n=t.isSelected,o=a.quantity,i=a.radius,s=[];for(let r=0;r<=5;r++)s["c"+r]=a["content"+r],s["cs"+r]=a["typeClass"+r]||"but b-blue",s["rt"+r]=h(q,{tagName:"div",onChange:function(e){l({["content"+r]:e})},value:s["c"+r],isSelected:t.isS,placeholder:Z("gutenberg_button")+"-"+r}),s["crt"+r]=h("div",{className:s["cs"+r]},s["rt"+r]),s["bk"+r]=h("button",{className:"anz sz",onClick:function(){e(".anz.an.x"+r).slideToggle(200)}},h("span",{className:"dashicons dashicons-admin-appearance"})),s["btt"+r]=h("div",{className:"g_extend anz an x"+r},h("button",{className:"but b-red",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-yellow",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-blue",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-green",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but b-purple",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-red",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-yellow",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-blue",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-green",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but hollow c-purple",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-red",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-yellow",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-blue",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-green",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""),h("button",{className:"but jb-purple",onClick:function(e){l({["typeClass"+r]:"an_"+r+" "+e.target.className})}},""));var c=h(T,{},h(I,{icon:"plus-alt",className:"aksrtblock-buttons-sl",label:Z("gutenberg_button_count"),controls:[{title:Z("gutenberg_count_1"),value:1,onClick:function(){l({quantity:1})}},{title:Z("gutenberg_count_2"),onClick:function(){l({quantity:2})}},{title:Z("gutenberg_count_3"),value:3,onClick:function(){l({quantity:3})}},{title:Z("gutenberg_count_4"),value:4,onClick:function(){l({quantity:4})}},{title:Z("gutenberg_count_5"),value:5,onClick:function(){l({quantity:5})}}]})),u=h(A,null,h(O,null,c,h(E,{value:r,onChange:function(e){l({alignment:e})}})));return h("div",{style:{textAlign:r},className:"aniuzu "+(i&&"radius")},u,[s.crt1,n&&s.bk1,n&&s.btt1],[o>=2&&[s.crt2,n&&s.bk2,n&&s.btt2]],[o>=3&&[s.crt3,n&&s.bk3,n&&s.btt3]],[o>=4&&[s.crt4,n&&s.bk4,n&&s.btt4]],[o>=5&&[s.crt5,n&&s.bk5,n&&s.btt5]],h(H,null,h(V,{icon:"admin-generic",title:Z("gutenberg_button_settings")},h(R,{label:Z("gutenberg_button_count"),value:o,onChange:function(e){l({quantity:e})},min:"1",max:"5"}),h(P,{className:"close_an",label:Z("gutenberg_button_radius"),checked:i,onChange:function(e){l({radius:e})}}))))},save:function(e){var t=e.attributes,a=t.alignment,l=t.quantity,r=t.radius,n=[];for(let e=0;e<=5;e++)n[e]=t["content"+e],n["s"+e]=t["typeClass"+e]||"an_"+e+" but b-blue",n["jg"+e]=h("span",{className:n["s"+e]},n[e]);return h("div",{"data-quantity":l,"data-radius":r,style:{textAlign:a},className:r&&"radius"},[l>0&&n.jg1],[l>1&&n.jg2],[l>2&&n.jg3],[l>3&&n.jg4],[l>4&&n.jg5])}}),f("aksrtblock/carousel",{title:ae(Z("gutenberg_carousel")),description:Z("gutenberg_carousel_desc"),icon:{src:"images-alt2",foreground:U},category:"aksrt_block_cat",attributes:{center:{type:"string",selector:"div",source:"attribute",attribute:"data-cen",default:!0},interval:{type:"string",selector:".carousel",source:"attribute",attribute:"data-interval",default:4e3},limitedwidth:{type:"string",selector:"div",source:"attribute",attribute:"data-liw",default:!0},maxwidth:{type:"string",source:"attribute",selector:"div",attribute:"data-mw",default:600},effect:{type:"string",selector:".carousel",source:"attribute",attribute:"data-effect",default:""},jyloop:{type:"string",selector:".carousel",source:"attribute",attribute:"data-jyloop",default:!0},id:{type:"string",selector:".carousel",source:"attribute",attribute:"id"},proportion:{type:"string",selector:".carousel",source:"attribute",attribute:"proportion",default:"0.6"}},edit:function(e){var t=e.attributes,a=t.limitedwidth,l=t.interval,r=t.center,n=t.maxwidth,o=t.effect,i=t.jyloop,s=e.setAttributes,c=parseInt((Math.random()+1)*Math.pow(10,4));t.id||s({id:c});var u=h(k,{allowedBlocks:["core/gallery"],templateLock:"",template:[["core/gallery",{linkTo:"none",columns:"8"}]]},""),b=h(R,{label:Z("gutenberg_switch_interval"),value:l/1e3,onChange:function(e){s({interval:1e3*e})},min:"1",max:"20"}),d=h(P,{label:Z("gutenberg_loop"),checked:i,onChange:function(e){s({jyloop:e})}}),g=h(P,{label:Z("gutenberg_limit_max_width"),checked:a,onChange:function(e){s({limitedwidth:e})}}),_=h(P,{label:Z("gutenberg_center_display"),checked:r,onChange:function(e){s({center:e})}}),p=h(R,{label:Z("gutenberg_max_width"),value:n,onChange:function(e){s({maxwidth:e})},min:"200",max:"1500"}),m=h(F,{label:Z("gutenberg_switch_animation"),value:o,onChange:function(e){s({effect:e})},options:[{label:Z("gutenberg_slide"),value:""},{label:Z("gutenberg_fade"),value:"fade"},{label:Z("gutenberg_3d_cube"),value:"cube"},{label:Z("gutenberg_3d_slide"),value:"coverflow"},{label:Z("gutenberg_3d_flip"),value:"flip"}]});return h("div",{className:"carousel iss"},h("div",{className:"leab"},ae(Z("gutenberg_carousel")),h("span",{className:"dashicons dashicons-admin-generic"})),u,h(H,null,te(675),h(V,{title:Z("gutenberg_carousel_settings")},m,h(F,{label:Z("gutenberg_keep_aspect_ratio"),value:t.proportion,options:[{label:Z("gutenberg_disabled"),value:""},{label:Z("gutenberg_ratio_landscape_3_1"),value:"0.333"},{label:Z("gutenberg_ratio_landscape_5_2"),value:"0.4"},{label:Z("gutenberg_ratio_landscape_2_1"),value:"0.5"},{label:Z("gutenberg_ratio_landscape_5_3"),value:"0.6"},{label:Z("gutenberg_ratio_landscape_4_3"),value:"0.75"},{label:Z("gutenberg_ratio_landscape_5_4"),value:"0.75"},{label:Z("gutenberg_ratio_landscape_8_7"),value:"0.875"},{label:Z("gutenberg_ratio_square_1_1"),value:"1"},{label:Z("gutenberg_ratio_portrait_7_8"),value:"1.142"},{label:Z("gutenberg_ratio_portrait_4_5"),value:"1.25"},{label:Z("gutenberg_ratio_portrait_3_4"),value:"1.333"},{label:Z("gutenberg_ratio_portrait_3_5"),value:"1.666"},{label:Z("gutenberg_ratio_portrait_1_2"),value:"2"},{label:Z("gutenberg_ratio_portrait_2_5"),value:"2.5"},{label:Z("gutenberg_ratio_portrait_1_3"),value:"3"}],onChange:function(e){s({proportion:e})}}),b,d,g,a&&[p,_],h("p",null,Z("gutenberg_carousel_ratio_hint")))))},save:function(e){var t=e.attributes,a=t.limitedwidth?"true":"",l=t.center?"true":"",r=t.maxwidth,n=t.interval,o=t.effect,i=t.jyloop?"true":"",s=a&&l?"10px auto":"",c=a&&r+"px"||"",u=t.id,b=h("div",{className:"swiper-button-next"}),d=h("div",{className:"swiper-button-prev"}),g=h("div",{className:"swiper-pagination"});return h("div",{"data-mw":r,"data-liw":a,"data-cen":l,className:"wp-block-carousel"},h("div",{className:"carousel slide","data-effect":o,"data-jyloop":i,"data-interval":n,id:u,proportion:t.proportion,style:{"max-width":c,margin:s}},h(k.Content),b,d,g))}}),f("aksrtblock/seamlessimg",{title:ae(Z("gutenberg_seamless_image")),description:Z("gutenberg_seamless_image_desc"),className:!1,icon:Q.seamlessimg,category:"aksrt_block_cat",attributes:{full_container:{type:"string",selector:"div",source:"attribute",attribute:"data-full-container",default:!0}},edit:function(e){var t=e.attributes.full_container,a=(e.attributes.isChecked,e.setAttributes);var l=h(k,{allowedBlocks:["core/gallery"],templateLock:"",template:[["core/gallery",{linkTo:"none",columns:1,imageCrop:!1,fixedHeight:!1,sizeSlug:"full"}]]},""),r=h(P,{label:Z("gutenberg_width_full_container"),checked:t,onChange:function(e){a({full_container:e})}});return h("div",{className:"carousel iss seamless-img"+(t?" full-container":"")},h("div",{className:"leab"},ae(Z("gutenberg_seamless_image")),h("span",{className:"dashicons dashicons-admin-generic"})),l,h(H,null,te(675),h(V,{title:Z("gutenberg_seamless_image_settings")},r,h("p",{className:"px12 opacity5"},Z("gutenberg_seamless_image_full_hint")))))},save:function(e){var t=e.attributes.full_container?"true":"";return h("div",{"data-full-container":t,className:"seamless-img"+(t?" full-container":"")},h(k.Content))}}),f("aksrtblock/productbox",{title:ae(Z("gutenberg_product")),icon:Q.productbox,className:!1,attributes:{post_id:{source:"attribute",selector:"div",attribute:"data-pid"}},description:Z("gutenberg_product_desc"),category:"aksrt_block_cat",edit:function(e){var t=e.attributes.post_id,a=e.attributes,l=e.setAttributes;function n(e){if(!(e.length<2||~~e||a.loading)){var t={per_page:20,search:e,type:"post",post_type:["shop_product"],order_by:"post_title"};return l({loading:!0}),re(t,function(e){l({search_lists:e=e||[],loading:!1})})}}a.search_lists=a.search_lists||[];var o=h("div",{className:"rti-container"},e.isSelected?h("div",{},h(L,{tagName:"div",onChange:function(e){l({post_id:e}),n(e)},required:!0,onKeyDown:function(e){13==e.keyCode&&n(e.target.value)},value:t,placeholder:Z("gutenberg_search_product_id"),label:Z("gutenberg_search_product_id")}),a.loading&&h(r.Spinner,{style:{position:"absolute",right:"12px",bottom:"30px"}})):h("div",{className:" "+(~~t?"px12":"c-red em09")},~~t?"[ID:"+t+"]"+(a.post_title?a.post_title:""):Z("gutenberg_product_id_invalid")));return h("div",{className:"theme-card-box"},h("div",{className:"em12 mb10 flex ac"},Q.productbox,h("span",{className:"ml10"},ae(Z("gutenberg_shop_product")))),h("div",{className:"opacity8 mb10 em09"},Z("gutenberg_product_card_desc")),o,e.isSelected&&a.search_lists.length>0&&h(x,{focusOnMount:!1,position:"left middle center ",className:" "},h("div",{className:"block-editor-link-control"},h("div",{className:"mt6 block-editor-link-control__search-results"},a.search_lists.map(function(t,l){return function(t){return h("button",{className:"components-button components-menu-item__button block-editor-link-control__search-item has-text has-icon",key:t,onClick:function(){e.setAttributes({post_id:a.search_lists[t].id,post_title:a.search_lists[t].title}),this.popover_anchor_rect=!1}},h("span",{className:"em12 mr6"},Q.postsbox),h("span",{className:"components-menu-item__item"},h("span",{className:"components-menu-item__info-wrapper"},h("span",{className:"components-menu-item__item"},"["+a.search_lists[t].id+"]"+a.search_lists[t].title))),h("span",{className:"components-menu-item__shortcut"},a.search_lists[t].subtype))}(l)})))),h(H,null,te(860)))},save:function(e){var t=e.attributes.post_id;return h("div",{className:"post-productbox",contenteditable:"false","data-pid":t},'[productbox id="'+t+'"]')}}),l.updateCategory("aksrt_block_cat",{icon:Q.legacy})})}(jQuery,wp,window); \ No newline at end of file diff --git a/assets/js/runtime/main.js b/assets/js/runtime/main.js index 0458c368..b6a0196f 100644 --- a/assets/js/runtime/main.js +++ b/assets/js/runtime/main.js @@ -1364,17 +1364,6 @@ _win.bd.on('click', '.switch-iframe', function () { _this.addClass('active').siblings().removeClass('active'); }); -//下载文件 -_win.bd.on('click', '.file-download-btn', function () { - var _this = jQuery(this); - var id = _this.attr('data-download-file'); - var nonce = _this.attr('download-nonce'); - _this.attr('target', '_blank'); - if (!id) return; - var href = _win.ajax_url + '?action=download_file&file=' + id + '&nonce=' + nonce; - _this.attr('target', '_blank').removeAttr('data-download-file').attr('href', href); -}); - //文章古腾堡TAB _win.bd.on('click', '.post-tab-toggle', function () { var _this = jQuery(this); diff --git a/assets/js/runtime/main.min.js b/assets/js/runtime/main.min.js index eb1775e8..90410e1e 100644 --- a/assets/js/runtime/main.min.js +++ b/assets/js/runtime/main.min.js @@ -1 +1 @@ -(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('
'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('
'+message+"
"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"aksrt-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("aksrt-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.AksrtModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.aksrtData||window2.aksrt||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/aksrt/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["Content-Type"]="application/json"),result}function responseError(result){var json=result.json,message=json&&(json.message||json.data&&json.data.message),error=new Error(message||(result.status?"请求失败(HTTP "+result.status+")":"请求失败"));return error.status=result.status,error.code=result.status===401?"unauthorized":"http_error",error.response=result,error.json=json,error}function parseResponse(response){return response.text().then(function(text){var type=(response.headers.get("content-type")||"").toLowerCase(),json=null,trimmed=String(text||"").trim();if(type.indexOf("application/json")>=0||trimmed.charAt(0)==="{"||trimmed.charAt(0)==="[")try{json=trimmed?JSON.parse(trimmed):{}}catch{json=null}return{ok:response.ok,status:response.status,headers:response.headers,text,json,data:json&&json.data!==void 0?json.data:json}})}function request(path,options){options=Object.assign({},options||{});var requestUrl=url(path,options.query);delete options.query;var fetchOptions=Object.assign({},options,{credentials:options.credentials||"same-origin",headers:headers(options)});return window2.fetch(requestUrl,fetchOptions).then(function(response){return parseResponse(response)}).then(function(result){if(!result.ok||result.json&&result.json.success===!1)throw responseError(result);return result})}window2.AksrtRequest={url,request,createIdempotencyKey,get:function(path,options){return request(path,Object.assign({},options||{},{method:"GET"}))},post:function(path,body,options){return request(path,Object.assign({},options||{},{method:"POST",body}))}}})(window),(function(window2,document2){"use strict";var DEFAULT_TTL=15e3,entries=Object.create(null),flights=Object.create(null),lastScope="";function scope(){var config=window2.aksrtData||window2.aksrt||{},userId=parseInt(config.userId||0,10)||0,current=(config.isLoggedIn&&userId>0?"user:"+userId:"guest")+":v1";return lastScope&&lastScope!==current&&clear(),lastScope=current,current}function token(key){return scope()+"::"+String(key||"")}function read(key){var id=token(key),entry=entries[id];return entry?entry.expiresAt<=Date.now()?(delete entries[id],{hit:!1,value:void 0}):{hit:!0,value:entry.value}:{hit:!1,value:void 0}}function tagsOf(value){return Array.isArray(value)?value.slice():value?[value]:[]}function set(key,value,options){options=options||{};var ttl=Number(options.ttl||DEFAULT_TTL);return entries[token(key)]={value,expiresAt:Date.now()+Math.max(0,ttl),tags:tagsOf(options.tags)},value}function matchesTags(entry,wanted){return wanted.length?wanted.some(function(tag){return entry.tags.indexOf(tag)>=0}):!0}function invalidate(tags){var wanted=Array.isArray(tags)?tags:tags?[tags]:[],removed=0;return Object.keys(entries).forEach(function(id){(!wanted.length||matchesTags(entries[id],wanted))&&(delete entries[id],removed+=1)}),Object.keys(flights).forEach(function(id){var flight=flights[id];(!wanted.length||matchesTags(flight,wanted))&&(flight.cancelled=!0,delete flights[id],typeof flight.cancel=="function"&&flight.cancel())}),removed}function clear(){entries=Object.create(null),Object.keys(flights).forEach(function(id){var flight=flights[id];flight.cancelled=!0,typeof flight.cancel=="function"&&flight.cancel()}),flights=Object.create(null)}function acquire(key,loader,options){options=options||{};var id=token(key),cached=options.skipCache?{hit:!1}:read(key);if(cached.hit)return{cached:!0,promise:Promise.resolve(cached.value),release:function(){}};var flight=flights[id];flight||(flight={refs:0,settled:!1,cancelled:!1,tags:tagsOf(options.tags),cancel:options.cancel},flight.promise=Promise.resolve().then(loader).then(function(value){return flight.settled=!0,!flight.cancelled&&options.store!==!1&&set(key,value,options),flights[id]===flight&&delete flights[id],value},function(error){throw flight.settled=!0,flights[id]===flight&&delete flights[id],error}),flights[id]=flight),flight.refs+=1;var released=!1;return{cached:!1,promise:flight.promise,release:function(){released||(released=!0,flight.refs=Math.max(0,flight.refs-1),flight.refs===0&&!flight.settled&&(flight.cancelled=!0,flights[id]===flight&&delete flights[id],typeof flight.cancel=="function"&&flight.cancel()))}}}["aksrt:auth:logout","aksrt:account-switch","aksrt:logout","aksrt:user:logout","aksrt:auth:changed","wp_logout"].forEach(function(eventName){document2.addEventListener(eventName,clear)}),window2.AksrtModalCache={get:function(key){return read(key)},set,acquire,invalidate,clear,scope}})(window,document),(function(window2){"use strict";var statuses={idle:"idle",loading:"loading",ready:"ready",empty:"empty",submitting:"submitting",success:"success",error:"error",unauthorized:"unauthorized",stale:"stale"};function create(kind){return{kind:String(kind||"generic"),status:statuses.idle,updatedAt:0,error:null}}window2.AksrtModalState={statuses,create}})(window),(function(window2,document2){"use strict";var ROOT_ID="aksrt-modal-runtime-root",active=null,sequence=0,loaders=Object.create(null);function isMobile(){return window2.matchMedia&&window2.matchMedia("(max-width: 768px)").matches}function ensureRoot(){var root=document2.getElementById(ROOT_ID);return root||(root=document2.createElement("div"),root.id=ROOT_ID,root.className="aksrt-modal-runtime-host",document2.body.appendChild(root),root)}function escapeHtml(value){return String(value??"").replace(/&/g,"&").replace(//g,">").replace(/\"/g,""").replace(/'/g,"'")}function lockScroll(lock){document2.documentElement.classList.toggle("aksrt-modal-runtime-open",!!lock),document2.body.classList.toggle("aksrt-modal-runtime-open",!!lock)}function skeleton(options){return options&&options.skeleton||'
'}function telemetryStart(kind){return kind===!1?"":window2.AksrtModalTelemetry.start(kind||"generic")}function telemetryMark(session,event){!session||!session.telemetryId||window2.AksrtModalTelemetry.mark(session.telemetryId,event)}function setState(session,status,error){session.state.status=status,session.state.error=error||null,session.state.updatedAt=Date.now(),session.shell&&session.shell.setAttribute("data-aksrt-modal-state",status),typeof session.options.onState=="function"&&session.options.onState(status,session)}function focusable(shell){return shell.querySelectorAll("button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])")}function closeSelector(){return"[data-aksrt-modal-close], .aksrt-modal-runtime__close"}function bindChrome(session){var shell=session.shell;shell.addEventListener("click",function(event){var closeButton=event.target.closest(closeSelector());if(closeButton){event.preventDefault(),close("control");return}if(event.target===shell||event.target.classList.contains("aksrt-modal-runtime__overlay")){close("overlay");return}var retry=event.target.closest("[data-aksrt-modal-retry]");retry&&(event.preventDefault(),refresh())}),shell.addEventListener("keydown",function(event){if(event.key==="Escape"){event.preventDefault(),close("escape");return}if(event.key==="Tab"){var nodes=focusable(shell);if(!nodes.length){event.preventDefault(),shell.focus();return}var first=nodes[0],last=nodes[nodes.length-1];event.shiftKey&&document2.activeElement===first?(event.preventDefault(),last.focus()):!event.shiftKey&&document2.activeElement===last&&(event.preventDefault(),first.focus())}})}function createSession(options){options=options||{};var root=ensureRoot(),shell=document2.createElement("div"),bottom=options.bottom===!0||options.mobileBottom!==!1&&isMobile(),heightStyle=options.height?"min-height:"+parseInt(options.height,10)+"px;":"",initialHtml=options.html!==void 0?options.html:skeleton(options),titleId="aksrt-modal-title-"+String(sequence+1),titleHtml=options.title?'

'+escapeHtml(options.title)+'

':"";shell.className="aksrt-modal-runtime"+(bottom?" aksrt-modal-runtime--bottom":"")+(options.className?" "+options.className:""),shell.setAttribute("role","dialog"),shell.setAttribute("aria-modal","true"),options.title&&shell.setAttribute("aria-labelledby",titleId),shell.setAttribute("tabindex","-1"),shell.innerHTML='
'+titleHtml+'
'+initialHtml+"
";var session={id:String(++sequence),shell,content:shell.querySelector(".aksrt-modal-runtime__content"),options,state:window2.AksrtModalState.create(options.kind||"generic"),focusReturn:document2.activeElement,controller:null,flight:null,closed:!1,telemetryId:telemetryStart(options.telemetry===!1?!1:options.kind)};root.appendChild(shell),bindChrome(session),active=session,lockScroll(!0),shell.offsetWidth,shell.classList.add("is-open"),setState(session,options.html!==void 0?"ready":"loading"),telemetryMark(session,"shell");var nodes=focusable(shell);try{(nodes.length?nodes[0]:shell).focus()}catch{}return document2.dispatchEvent(new CustomEvent("aksrt:modal:open",{detail:{shell,options,session}})),options.html!==void 0&&(notifyContentLoaded(session),telemetryMark(session,"first-content"),telemetryMark(session,"ready"),typeof options.onContent=="function"&&options.onContent(options.html,session)),session}function notifyContentLoaded(session){!session||!session.shell||!window2.jQuery||window2.jQuery(session.shell).trigger("loaded.bs.modal")}function abortSessionRequest(session){if(session){if(session.flight&&typeof session.flight.release=="function"&&session.flight.release(),session.flight=null,session.controller)try{session.controller.abort()}catch{}session.controller=null}}function close(reason,preserveRequest){if(active){var session=active;active=null,session.closed=!0,preserveRequest||abortSessionRequest(session),session.shell.classList.remove("is-open"),preserveRequest||lockScroll(!1),document2.dispatchEvent(new CustomEvent("aksrt:modal:close",{detail:{shell:session.shell,reason:reason||"close",session}}));var node=session.shell;window2.setTimeout(function(){node&&node.parentNode&&node.parentNode.removeChild(node);var target=session.focusReturn;if(!preserveRequest&&!active&&target&&target!==node&&document2.contains(target)&&typeof target.focus=="function")try{target.focus()}catch{}},220)}}function responseData(result){return result?result.data!==void 0&&result.data!==null?result.data:result.json&&result.json.data!==void 0?result.json.data:result.json:null}function responseHtml(result){var data=responseData(result);return data&&typeof data.html=="string"?data.html:result&&result.json&&typeof result.json.html=="string"?result.json.html:result&&typeof result.text=="string"?result.text:""}function errorMessage(error){return error&&error.code==="unauthorized"?"请先登录":error&&error.message?String(error.message):"加载失败,请重试"}function renderError(session,error){if(!(!session||session.closed||active!==session)){var unauthorized=error&&error.code==="unauthorized";setState(session,unauthorized?"unauthorized":"error",error),telemetryMark(session,unauthorized?"unauthorized":"error"),session.content.innerHTML='
提示
'+escapeHtml(errorMessage(error))+'
',notifyContentLoaded(session),typeof session.options.onError=="function"&&session.options.onError(error,session)}}function renderResult(session,result){if(!(!session||session.closed||active!==session)){if(session.options.responseType==="json"||typeof session.options.renderData=="function"){var data=responseData(result);if(data==null){setState(session,"empty"),telemetryMark(session,"first-content"),telemetryMark(session,"ready"),session.content.innerHTML='
暂无内容
';return}typeof session.options.renderData=="function"&&session.options.renderData(data,session,result),setState(session,"ready"),telemetryMark(session,"first-content"),notifyContentLoaded(session),telemetryMark(session,"ready"),typeof session.options.onData=="function"&&session.options.onData(data,session,result);return}var html=responseHtml(result);if(!html){setState(session,"empty"),telemetryMark(session,"first-content"),telemetryMark(session,"ready"),session.content.innerHTML='
暂无内容
';return}session.content.innerHTML=html,setState(session,"ready"),telemetryMark(session,"first-content"),notifyContentLoaded(session),telemetryMark(session,"ready"),typeof session.options.onContent=="function"&&session.options.onContent(html,session)}}function load(session,loadOptions){if(loadOptions=loadOptions||{},!session||session.closed||!session.options.url)return Promise.resolve(session&&session.shell);abortSessionRequest(session),setState(session,"loading"),session.content.innerHTML=skeleton(session.options),session.controller=window2.AbortController?new window2.AbortController:null;var requestOptions={method:session.options.method||"GET",headers:session.options.headers||{},body:session.options.body,query:session.options.query,signal:session.controller?session.controller.signal:void 0};requestOptions.body===void 0&&delete requestOptions.body,requestOptions.signal||delete requestOptions.signal;var request=function(){return window2.AksrtRequest.request(session.options.url,requestOptions)},method=String(session.options.method||"GET").toUpperCase(),cacheable=method==="GET"&&session.options.cache!==!1,cacheKey=session.options.cacheKey||method+":"+window2.AksrtRequest.url(session.options.url,session.options.query),cache=window2.AksrtModalCache,acquireOptions={ttl:Number(session.options.cacheTtl||15e3),tags:session.options.cacheTags||session.options.tags||[],skipCache:!!loadOptions.force||!cacheable,store:cacheable,cancel:function(){if(session.controller)try{session.controller.abort()}catch{}}},flight=cacheable?cache.acquire(cacheKey,request,acquireOptions):{promise:request(),release:function(){}};return session.flight=flight,flight.promise.then(function(result){return!session.closed&&active===session&&renderResult(session,result),session.shell}).catch(function(error){var aborted=error&&(error.name==="AbortError"||error.code==="ABORT_ERR");return!aborted&&!session.closed&&active===session&&renderError(session,error),session.shell}).then(function(shell){return session.flight===flight&&(flight&&typeof flight.release=="function"&&flight.release(),session.flight=null),shell})}function open(options){options=options||{},close("replace");var session=createSession(options);return session.shell}function sessionKey(options){if(!options||!options.url)return"";var method=String(options.method||"GET").toUpperCase(),requestUrl=window2.AksrtRequest.url(options.url,options.query);return method+":"+requestUrl}function openRemote(options){if(options=Object.assign({},options||{}),!options.url)return Promise.reject(new Error("missing url"));var sameRequest=active&&active.flight&&sessionKey(active.options)===sessionKey(options);close("replace",!!sameRequest);var session=createSession(options);return load(session).then(function(){return session.shell})}function refresh(options){return!active||!active.options.url?Promise.resolve(null):(options&&typeof options=="object"&&(active.options=Object.assign({},active.options,options)),load(active,{force:!0}))}function registerLoader(kind,loader){!kind||typeof loader!="function"||(loaders[String(kind)]=loader)}function openLoader(kind,context){var loader=loaders[String(kind)];return loader?openRemote(loader(context||{})):Promise.reject(new Error("missing modal loader: "+kind))}function invalidate(tags){return window2.AksrtModalCache.invalidate(tags)}window2.AksrtModalRuntime={open,openRemote,close,refresh,registerLoader,openLoader,invalidate,getActive:function(){return active?active.shell:null},getState:function(){return active?active.state:null}},document2.dispatchEvent(new CustomEvent("aksrt:modal-runtime:ready")),window2.jQuery&&window2.jQuery(document2).on("loaded.bs.modal show.bs.modal",".modal, .aksrt-modal-runtime",function(){typeof window2.auto_fun=="function"&&window2.auto_fun()})})(window,document),(function(window2,document2){"use strict";function openFromTrigger(element){var runtime=window2.AksrtModalRuntime,url=element.getAttribute("data-aksrt-modal-url")||"";if(!(!url||url==="#")){var ttl=parseInt(element.getAttribute("data-aksrt-modal-cache-ttl")||"15000",10),cache=element.getAttribute("data-aksrt-modal-cache")!=="false",tags=(element.getAttribute("data-aksrt-modal-cache-tags")||"").split(",").map(function(tag){return tag.trim()}).filter(Boolean);runtime.openRemote({url,method:element.getAttribute("data-aksrt-modal-method")||"GET",className:element.getAttribute("data-aksrt-modal-class")||"modal-mini full-sm",height:parseInt(element.getAttribute("data-aksrt-modal-height")||"0",10)||0,mobileBottom:element.getAttribute("data-aksrt-modal-mobile-bottom")==="true",bottom:element.getAttribute("data-aksrt-modal-bottom")==="true",kind:element.getAttribute("data-aksrt-modal-kind")||"generic",cacheKey:element.getAttribute("data-aksrt-modal-cache-key")||"",cache,cacheTtl:ttl>0?ttl:15e3,cacheTags:tags})}}document2.addEventListener("click",function(event){var trigger=event.target.closest('[data-aksrt-modal="remote"]');trigger&&(event.preventDefault(),openFromTrigger(trigger))})})(window,document),(function(){"use strict";function initPasswordToggles(root){(root||document).querySelectorAll(".toggle-pwd").forEach(function(btn){btn.dataset.pwdToggleBound||(btn.dataset.pwdToggleBound="1",btn.addEventListener("click",function(){var id=btn.getAttribute("data-target"),input=id?document.getElementById(id):null;if(input){var show=input.getAttribute("type")==="password";input.setAttribute("type",show?"text":"password"),btn.setAttribute("aria-label",show?"隐藏密码":"显示密码")}}))})}function initSearchClear(){var btn=document.getElementById("search-clear-btn"),input=document.getElementById("search-page-input");if(btn&&input&&!btn.dataset.aksrtSearchClearBound){btn.dataset.aksrtSearchClearBound="1";var syncClearButton=function(){var hasValue=input.value.trim().length>0;btn.classList.toggle("is-visible",hasValue),btn.hidden=!hasValue};btn.addEventListener("click",function(){input.value="",input.focus(),syncClearButton()}),input.addEventListener("input",syncClearButton),syncClearButton()}var categorySelect=document.getElementById("search-category-filter");categorySelect&&categorySelect.addEventListener("change",function(){var url=new URL(window.location.href);this.value?url.searchParams.set("aksrt_category",this.value):url.searchParams.delete("aksrt_category"),url.searchParams.get("aksrt_search_type")&&url.searchParams.get("aksrt_search_type")!=="post"&&url.searchParams.delete("aksrt_category"),url.searchParams.delete("paged"),window.location.href=url.toString()})}function initArticleTools(){var buttons=document.querySelectorAll("[data-article-tool]");buttons.length&&buttons.forEach(function(button){button.dataset.aksrtArticleToolBound||(button.dataset.aksrtArticleToolBound="1",button.addEventListener("click",function(){var tool=button.getAttribute("data-article-tool");if(tool==="print"){window.print();return}tool==="pdf"&&(window.print(),notyf("请在打印对话框中选择“另存为 PDF”","info"))}))})}var postMetaDocumentEventsBound=!1;function setPostMetaMenuState(menuRoot,open){var toggle=menuRoot.querySelector(".post-drop-meta__toggle"),menu=menuRoot.querySelector(".post-drop-meta__menu");!toggle||!menu||(menuRoot.classList.toggle("is-open",open),toggle.setAttribute("aria-expanded",open?"true":"false"),menu.setAttribute("aria-hidden",open?"false":"true"))}function closePostMetaMenus(except,restoreFocus){document.querySelectorAll(".post-drop-meta.is-open").forEach(function(menuRoot){if(menuRoot!==except){var toggle=menuRoot.querySelector(".post-drop-meta__toggle");setPostMetaMenuState(menuRoot,!1),restoreFocus&&toggle&&toggle.focus()}})}function initPostMetaMenus(root){var scope=root||document,menuRoots=[];scope.nodeType===1&&scope.matches(".post-drop-meta")&&menuRoots.push(scope),scope.querySelectorAll(".post-drop-meta").forEach(function(menuRoot){menuRoots.push(menuRoot)}),menuRoots.forEach(function(menuRoot){var toggle=menuRoot.querySelector(".post-drop-meta__toggle"),menu=menuRoot.querySelector(".post-drop-meta__menu");!toggle||!menu||toggle.dataset.postMetaMenuBound||(toggle.dataset.postMetaMenuBound="1",setPostMetaMenuState(menuRoot,!1),toggle.addEventListener("click",function(){var open=!menuRoot.classList.contains("is-open");closePostMetaMenus(menuRoot,!1),setPostMetaMenuState(menuRoot,open)}),menu.addEventListener("click",function(event){event.target.closest(".post-drop-meta__item")&&setPostMetaMenuState(menuRoot,!1)}))}),menuRoots.length&&!postMetaDocumentEventsBound&&(postMetaDocumentEventsBound=!0,document.addEventListener("click",function(event){event.target.closest(".post-drop-meta")||closePostMetaMenus(null,!1)}),document.addEventListener("keydown",function(event){event.key==="Escape"&&closePostMetaMenus(null,!0)}))}function getBaseStatCount(statName){var statEl=document.querySelector('[data-stat-count="'+statName+'"][data-base-count]');return statEl&&parseInt(statEl.dataset.baseCount,10)||0}function updateStatCounts(statName,count){var safeCount=Math.max(0,count);document.querySelectorAll('[data-stat-count="'+statName+'"]').forEach(function(statEl){statEl.textContent=String(safeCount)})}function setBaseStatCount(statName,count){var safeCount=Math.max(0,count);document.querySelectorAll('[data-stat-count="'+statName+'"][data-base-count]').forEach(function(statEl){statEl.dataset.baseCount=String(safeCount)}),updateStatCounts(statName,safeCount)}function requestInteraction(actionName,postId,active){if(!window.aksrtData||!aksrtData.ajaxUrl||!aksrtData.nonce)return Promise.reject(new Error("互动服务未配置"));var body=new URLSearchParams;return body.set("action",actionName),body.set("nonce",aksrtData.nonce),body.set("postId",String(postId)),body.set("active",active?"1":"0"),fetch(aksrtData.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},credentials:"same-origin",body:body.toString()}).then(function(response){return response.json().catch(function(){throw new Error("服务器返回无效响应")})}).then(function(payload){if(!payload||!payload.success){var message=payload&&payload.data&&payload.data.message?payload.data.message:"请求失败";throw new Error(message)}return payload.data||{}})}function setButtonBusy(button,busy){button.disabled=!!busy,button.classList.toggle("is-loading",!!busy)}function findInScope(scope,id){return scope=scope||document,scope?scope.nodeType===9?scope.getElementById(id):scope.nodeType===1?scope.id===id?scope:typeof scope.querySelector=="function"?scope.querySelector("#"+id):null:null:null}function collectActionButtons(scope,selector){scope=scope||document;var list=[];if(!scope)return list;if(scope.nodeType===1&&scope.matches&&scope.matches(selector)&&list.push(scope),typeof scope.querySelectorAll=="function")for(var found=scope.querySelectorAll(selector),i=0;i=0?"action-like":selector.indexOf("action-favorite")>=0?"action-favorite":"";if(legacyId){var legacy=findInScope(scope,legacyId);legacy&&list.indexOf(legacy)===-1&&list.push(legacy)}return list}function initInteractionBar(root){var scope=root||document,likeBtns=collectActionButtons(scope,".action-like[data-post-id]"),favBtns=collectActionButtons(scope,".action-favorite[data-post-id]");function paintLike(btn,isActive){btn.dataset.initialActive=isActive?"1":"0",btn.classList.toggle("is-active",isActive);var icon=btn.querySelector("i");icon&&(icon.className="fa fas fa-heart")}function paintFavorite(btn,isActive){btn.dataset.initialActive=isActive?"1":"0",btn.classList.toggle("is-active",isActive);var icon=btn.querySelector("i");icon&&(icon.className="fa fas fa-star")}function applyLikeState(isActive,count){for(var i=0;i '+loadingText,loadingText)}else isSubmitting=!1,submitBtn.classList.remove("is-loading"),submitBtn.classList.remove("countdown-active"),submitBtn.disabled=!1,setSubmitBtnContent(originalBtnHTML,originalBtnHTML)}function collectFormData(){var formData=new FormData(form),postId=document.querySelector('input[name="comment_post_ID"]');return postId&&!formData.get("comment_post_ID")&&formData.append("comment_post_ID",postId.value),formData}function startCountdown(seconds){countdownTimer&&clearInterval(countdownTimer),submitBtn.classList.add("countdown-active"),submitBtn.disabled=!0;var remaining=seconds;countdownTimer=setInterval(function(){setSubmitBtnContent(' 请等待 '+remaining+"s","请等待 "+remaining+"s"),--remaining<=0&&(clearInterval(countdownTimer),countdownTimer=null,submitBtn.classList.remove("countdown-active","is-loading"),submitBtn.disabled=!1,setSubmitBtnContent(originalBtnHTML,originalBtnHTML),isSubmitting=!1)},1e3)}function updateCommentCount(delta){var countEl=document.querySelector("#comments .title-theme small");if(countEl){var text=countEl.textContent||"",match=text.match(/(\d+)/);if(match){var nextCount=Math.max(0,parseInt(match[1],10)+delta);countEl.textContent=text.replace(match[1],String(nextCount))}}}function performSubmit(captchaPayload){setLoading(!0);var formData=collectFormData(),restRoot=window.aksrtData&&aksrtData.siteUrl?String(aksrtData.siteUrl).replace(/\/$/,""):"",editId=form.querySelector('[name="edit_comment_ID"]'),isEdit=editId&&parseInt(editId.value,10)>0,restBase=(restRoot||"")+"/wp-json/aksrt/v1/comment/"+(isEdit?"edit":"submit"),restBody={};formData.forEach(function(v,k){restBody[k]=v}),Object.assign(restBody,captchaPayload||{}),isEdit&&(restBody.comment_id=parseInt(editId.value,10),restBody.content=restBody.comment||restBody.content||""),fetch(restBase,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.aksrtData&&aksrtData.restNonce||""},credentials:"same-origin",body:JSON.stringify(restBody)}).then(function(r){return r.json()}).then(function(json){if(isEdit&&json&&json.success){var cid=restBody.comment_id,contentEl=document.querySelector("#comment-content-"+cid+', [data-comment-id="'+cid+'"] .comment-content'),rendered=json.data&&json.data.content||json.content||"";contentEl&&rendered&&(contentEl.innerHTML=rendered);var textarea=form.querySelector("#comment");textarea&&(textarea.value=""),editId&&editId.remove(),restoreRespondPosition(),setLoading(!1),notyf(json.message||"评论已更新","success");var respondEl=document.getElementById("respond");respondEl&&window.AksrtFixedInput&&window.AksrtFixedInput(respondEl,"hide");return}if(json&&json.success&&json.html){localInsertComment(json.html,json.is_reply,json.parent_id,json.needs_moderation);var textarea=form.querySelector("#comment");textarea&&(textarea.value="");var replyInfo=document.getElementById("comment-reply-info");replyInfo&&(replyInfo.style.display="none"),json.wait_time&&json.wait_time>0?startCountdown(json.wait_time):setLoading(!1),restoreRespondPosition();var respondEl=document.getElementById("respond");respondEl&&window.AksrtFixedInput?window.AksrtFixedInput(respondEl,"hide"):respondEl&&respondEl.classList.remove("show");var editField=form.querySelector('[name="edit_comment_ID"]');editField&&editField.remove();return}if(json&&json.code){notyf(json.message||"评论提交失败","danger"),json.wait_time?startCountdown(json.wait_time):setLoading(!1);return}notyf("评论已提交","success"),setLoading(!1),setTimeout(function(){reloadCommentList()},500)}).catch(function(error){console.error("[AKSRT Comment] 提交失败:",error),notyf(error&&error.message||"网络连接失败,请检查网络后重试","danger"),setLoading(!1)}).finally(function(){window.AKSRTCaptcha&&window.AKSRTCaptcha.reset("comment",form),!countdownTimer&&isSubmitting&&setLoading(!1)})}function localInsertComment(html,isReply,parentId,needsModeration){var temp=document.createElement("div");temp.innerHTML=html;var newComment=temp.firstElementChild;if(!newComment){reloadCommentList();return}if(newComment.style.overflow="hidden",newComment.style.maxHeight="0",newComment.style.opacity="0",newComment.style.transition="max-height 0.4s ease, opacity 0.3s ease",isReply&&parentId){var parentComment=document.querySelector("#comment-"+parentId);if(parentComment){var children=parentComment.querySelector(":scope > .children");children||(children=document.createElement("ol"),children.className="children",parentComment.appendChild(children)),children.insertBefore(newComment,children.firstChild)}else prependToCommentList(newComment)}else prependToCommentList(newComment);requestAnimationFrame(function(){newComment.style.maxHeight=newComment.scrollHeight+100+"px",newComment.style.opacity="1",setTimeout(function(){newComment.style.maxHeight="",newComment.style.overflow="",newComment.style.transition=""},500)}),needsModeration?notyf("评论已提交,等待管理员审核","info"):notyf("评论发布成功","success"),newComment.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun(),updateCommentCount(1)}function prependToCommentList(el){var list=document.querySelector("#comments .commentlist");if(list){var filter=list.querySelector(".comment-filter");filter&&filter.nextSibling?list.insertBefore(el,filter.nextSibling):list.insertBefore(el,list.firstChild)}}function restoreRespondPosition(){var respond=document.getElementById("respond"),placeholder=document.getElementById("wp-temp-form-div");respond&&placeholder&&placeholder.parentNode&&(placeholder.parentNode.insertBefore(respond,placeholder),placeholder.remove())}function handleSubmit(e){if(isSubmitting||countdownTimer)return e.preventDefault(),e.stopImmediatePropagation(),!1;e.preventDefault(),e.stopImmediatePropagation();var captcha=window.AKSRTCaptcha;return setLoading(!0),(captcha?captcha.run("comment",form):Promise.resolve({})).then(function(captchaPayload){if(captchaPayload===null){notyf("人机验证未通过,请重试","warning"),setLoading(!1);return}performSubmit(captchaPayload)}).catch(function(){notyf("人机验证未通过,请重试","warning"),setLoading(!1),captcha&&captcha.reset("comment",form)}),!1}form.addEventListener("submit",handleSubmit,!0)}function getCommentsRestBase(){var root=window.aksrtData&&aksrtData.siteUrl?String(aksrtData.siteUrl).replace(/\/$/,""):"";return root+"/wp-json/aksrt/v1"}function getCurrentCommentPostId(){var input=document.querySelector('input[name="comment_post_ID"]');if(input&&input.value)return parseInt(input.value,10)||0;var comments=document.getElementById("comments");return comments&&comments.dataset.postId&&parseInt(comments.dataset.postId,10)||0}function getCurrentCommentOrder(){var active=document.querySelector("#comments .comment-order-box li.active .comment-orderby");if(active&&active.dataset&&active.dataset.order)return active.dataset.order;var url=new URL(window.location.href);return url.searchParams.get("aksrt_comment_order")||"newest"}function getCurrentAuthorOnly(){var btn=document.querySelector("#comments .btn-only-author");return!!(btn&&btn.classList.contains("active")&&btn.dataset.authorOnly==="0")}var COMMENT_URL_PARAMS=["cpage","aksrt_comment_order","aksrt_author_only"],commentUrlStateCleaned=!1;function stripCommentUrlParams(){if(!(commentUrlStateCleaned||!window.history||typeof window.history.replaceState!="function")){commentUrlStateCleaned=!0;var url=new URL(window.location.href),changed=!1;COMMENT_URL_PARAMS.forEach(function(key){url.searchParams.has(key)&&(url.searchParams.delete(key),changed=!0)}),changed&&window.history.replaceState(null,"",url.toString())}}function getMaxCommentPages(){var pagenav=document.querySelector("#comments .pagenav[data-max-pages]");if(pagenav){var max=parseInt(pagenav.dataset.maxPages,10);if(max>0)return max}var jumpInput=document.querySelector("#comments .jump-input[max]");if(jumpInput){var maxAttr=parseInt(jumpInput.getAttribute("max"),10);if(maxAttr>0)return maxAttr}return 1}function parseCommentPageFromHref(href){if(!href||href==="#"||href.indexOf("javascript:")===0)return 0;try{var url=new URL(href,window.location.href),cpage=parseInt(url.searchParams.get("cpage"),10);if(cpage>0)return cpage;var match=url.pathname.match(/\/comment-page-([0-9]{1,})\/?$/);return match?parseInt(match[1],10):0}catch{return 0}}function scrollCommentsIntoView(){var commentsArea=document.getElementById("comments");if(!(!commentsArea||typeof commentsArea.scrollIntoView!="function")){var rect=commentsArea.getBoundingClientRect();rect.top>=0&&rect.top1&&(page=Math.min(page,maxPages)),showListLoading(commentsArea),fetchCommentFragment({order:getCurrentCommentOrder(),authorOnly:getCurrentAuthorOnly(),page}).then(function(json){if(json&&json.success&&json.data)return applyFragmentPayload(commentsArea,json.data),opts.noScroll||scrollCommentsIntoView(),!0;throw new Error("comment fragment failed")})}function applyFragmentPayload(commentsArea,data){if(!(!commentsArea||!data||!data.html)){var tempList=document.createElement("div");tempList.innerHTML=data.html;var newListWrap=tempList.querySelector("#postcomments");if(newListWrap){var currentListWrap=commentsArea.querySelector("#postcomments");currentListWrap?currentListWrap.replaceWith(newListWrap):commentsArea.appendChild(newListWrap);var currentCount=commentsArea.querySelector(".title-theme small");currentCount&&data.count_text&&(currentCount.textContent=data.count_text),newListWrap.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun()}}}function fetchCommentFragment(opts){opts=opts||{};var postId=opts.postId||getCurrentCommentPostId();if(!postId)return Promise.reject(new Error("missing post id"));var order=opts.order||getCurrentCommentOrder()||"newest",authorOnly=!!opts.authorOnly,page=opts.page||1,qs=new URLSearchParams;qs.set("post_id",String(postId)),qs.set("order",order),qs.set("page",String(page)),authorOnly&&qs.set("author_only","1");var url=getCommentsRestBase()+"/comment/list?"+qs.toString();return fetch(url,{method:"GET",credentials:"same-origin",headers:{"X-WP-Nonce":window.aksrtData&&aksrtData.restNonce||""}}).then(function(r){return r.json()})}function showListLoading(commentsArea){var list=commentsArea.querySelector(".commentlist");if(list){var filter=list.querySelector(".comment-filter"),loader=list.querySelector(".post_ajax_loader"),skeleton=loader?loader.cloneNode(!0):null;Array.prototype.slice.call(list.children).forEach(function(child){child!==filter&&child!==loader&&child.remove()}),skeleton&&(skeleton.style.display="block",skeleton.removeAttribute("hidden"),list.appendChild(skeleton))}}function reloadCommentList(){loadCommentPage(1,{noScroll:!0}).catch(function(error){console.error("[AKSRT Comment] 刷新评论列表失败:",error),window.location.reload()})}function findInScope(scope,id){return scope=scope||document,scope?scope.nodeType===9?scope.getElementById(id):scope.nodeType===1?scope.id===id?scope:typeof scope.querySelector=="function"?scope.querySelector("#"+id):null:null:null}function initCommentOrder(root){var scope=root||document,commentsArea=findInScope(scope,"comments");if(!commentsArea||commentsArea.dataset.orderInit==="1")return;commentsArea.dataset.orderInit="1";function renderLoadingState(){showListLoading(commentsArea)}function applyCommentOrder(order){order!=="newest"&&order!=="oldest"&&order!=="hottest"&&(order="newest"),renderLoadingState();var authorOnly=getCurrentAuthorOnly();fetchCommentFragment({order,authorOnly,page:1}).then(function(json){if(json&&json.success&&json.data){applyFragmentPayload(commentsArea,json.data);return}throw new Error("order fragment failed")}).catch(function(error){console.error("[AKSRT Comment] 排序刷新失败:",error),window.location.reload()})}function applyAuthorFilter(authorOnlyFlag){renderLoadingState();var authorOnly=authorOnlyFlag==="1"||authorOnlyFlag===1||authorOnlyFlag===!0,order=getCurrentCommentOrder();fetchCommentFragment({order,authorOnly,page:1}).then(function(json){if(json&&json.success&&json.data){applyFragmentPayload(commentsArea,json.data);return}throw new Error("author fragment failed")}).catch(function(error){console.error("[AKSRT Comment] Author filter failed:",error),window.location.reload()})}commentsArea.addEventListener("click",function(e){var target=e.target;if(!(!target||typeof target.closest!="function")){var authorBtn=target.closest(".btn-only-author");if(authorBtn&&commentsArea.contains(authorBtn)){e.preventDefault(),applyAuthorFilter(authorBtn.getAttribute("data-author-only")||"0");return}var orderBtn=target.closest(".comment-orderby[data-order]");if(orderBtn&&commentsArea.contains(orderBtn)){e.preventDefault(),applyCommentOrder(orderBtn.getAttribute("data-order")||"newest");return}var pageLink=target.closest(".pagenav a.page-numbers");if(pageLink&&commentsArea.contains(pageLink)&&!pageLink.classList.contains("pag-jump")){var page=parseCommentPageFromHref(pageLink.getAttribute("href"));page>0&&(e.preventDefault(),loadCommentPage(page).catch(function(error){console.error("[AKSRT Comment] 分页刷新失败:",error),window.location.href=pageLink.href}))}}})}var commentPageJumpBound=!1;function jumpToCommentPage(page){loadCommentPage(page).catch(function(error){console.error("[AKSRT Comment] 跳页失败:",error),window.location.reload()})}function initCommentPageJump(){commentPageJumpBound||(commentPageJumpBound=!0,document.addEventListener("click",function(e){var jump=e.target.closest?e.target.closest("#comments .pag-jump"):null;if(jump){e.preventDefault();var input=jump.querySelector(".jump-input");input&&jumpToCommentPage(input.value)}}),document.addEventListener("keydown",function(e){if(e.key==="Enter"){var input=e.target;!input||!input.classList||!input.classList.contains("jump-input")||input.closest("#comments .pagenav")&&(e.preventDefault(),jumpToCommentPage(input.value))}}))}function init(){stripCommentUrlParams(),initCommentSystem(),initCommentPageJump(),initCommentOrder()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init),window.AksrtComments={loadPage:function(page,opts){return loadCommentPage(page,opts)},reload:function(){reloadCommentList()}}})(),(function(){"use strict";function FixedInput(el,action){if(el){if(el.dataset.fixedBound||(el.addEventListener("click",function(e){e.target&&e.target.closest&&e.target.closest(".fixed-body")&&FixedInput(el,"hide")}),el.dataset.fixedBound="1"),action==="show"){el.classList.add("show"),window.setTimeout(function(){var field=el.querySelector("textarea, input");field&&field.focus()},100);return}if(action==="hide"){var cancel=el.querySelector("#cancel-comment-reply-link");cancel&&cancel.click(),el.querySelectorAll("input,textarea").forEach(function(n){try{n.blur()}catch{}}),el.querySelectorAll(".dropup.open, .open").forEach(function(n){n.classList.remove("open")}),el.classList.remove("show")}}}document.addEventListener("click",function(e){var trigger=e.target&&e.target.closest?e.target.closest("[fixed-input]"):null;if(trigger){e.preventDefault();var targetSel=trigger.getAttribute("fixed-input")||"#respond",panel=document.querySelector(targetSel),comments=document.getElementById("comments");comments&&comments.scrollIntoView&&comments.scrollIntoView({behavior:"smooth",block:"start"}),FixedInput(panel,"show")}});function bindAutoheight(ta){if(!(!ta||ta.dataset.autoheightBound)){ta.dataset.autoheightBound="1";var max=parseInt(ta.getAttribute("maxheight")||"188",10)||188,resize=function(){ta.style.height="auto";var h=Math.min(ta.scrollHeight,max);ta.style.height=h+"px",ta.style.overflowY=ta.scrollHeight>max?"auto":"hidden"};ta.addEventListener("input",resize),resize()}}function scan(){document.querySelectorAll("textarea[autoheight], textarea.grin").forEach(bindAutoheight)}function init(){scan();var respond=document.getElementById("respond");respond&&(respond.aksrtFixedInput=function(action){FixedInput(respond,action)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init),window.AksrtFixedInput=FixedInput})(),(function(){"use strict";var respondId="respond",tempId="aksrt-wp-temp-form-div",editingId=0;function getRespond(){return document.getElementById(respondId)}function restRoot(){var d=window.aksrtData||{};return(d.restUrl||d.rest_url||"/wp-json/aksrt/v1").replace(/\/$/,"")}function nonce(){var d=window.aksrtData||{};return d.restNonce||d.nonce||""}function setActionText(text){var el=document.querySelector("#"+respondId+" .action-text");el&&(text?(el.style.display="",el.textContent=text):(el.style.display="none",el.textContent=""))}function ensureParentField(respond){var form=respond.querySelector("#commentform")||respond,parent=form.querySelector('[name="comment_parent"]');return parent||(parent=document.createElement("input"),parent.type="hidden",parent.name="comment_parent",parent.id="comment_parent",parent.value="0",form.appendChild(parent)),parent}function ensureEditField(respond,commentId){var form=respond.querySelector("#commentform")||respond,existing=form.querySelector('[name="edit_comment_ID"]');if(commentId){existing||(existing=document.createElement("input"),existing.type="hidden",existing.name="edit_comment_ID",existing.id="edit_comment_ID",form.appendChild(existing)),existing.value=String(commentId);var parent=form.querySelector('[name="comment_parent"]');parent&&(parent.name="comment_parent_bak")}else if(existing){existing.remove();var bak=form.querySelector('[name="comment_parent_bak"]');bak&&(bak.name="comment_parent")}}function moveForm(commId,parentId,isEdit){var respond=getRespond();if(!respond)return!1;var comm=document.getElementById(commId),parent=ensureParentField(respond),cancel=document.getElementById("cancel-comment-reply-link"),submit=respond.querySelector("#submit"),textarea=respond.querySelector("#comment");if(!document.getElementById(tempId)){var temp=document.createElement("div");temp.id=tempId,temp.style.display="none",respond.parentNode.insertBefore(temp,respond)}if(comm&&comm.parentNode&&comm.parentNode.insertBefore(respond,comm.nextSibling),parent.value=isEdit?"0":String(parentId||"0"),editingId=isEdit&&parseInt(parentId,10)||0,cancel&&(cancel.style.display="",cancel.onclick=function(){var t=document.getElementById(tempId),r=getRespond();return t&&r&&t.parentNode&&(t.parentNode.insertBefore(r,t),t.parentNode.removeChild(t)),ensureEditField(r,0),parent&&(parent.value="0"),setActionText(""),textarea&&(textarea.value=""),editingId=0,cancel.style.display="none",window.AksrtFixedInput?window.AksrtFixedInput(r,"hide"):r&&r.classList.remove("show"),!1}),isEdit&&editingId)setActionText("编辑评论"),ensureEditField(respond,editingId),textarea&&(textarea.disabled=!0,textarea.value="加载中…"),submit&&(submit.disabled=!0),fetch(restRoot()+"/comment/get?comment_id="+encodeURIComponent(String(editingId)),{headers:{"X-WP-Nonce":nonce()},credentials:"same-origin"}).then(function(r){return r.json()}).then(function(json){var content=json&&(json.content||json.data&&json.data.content)||"";textarea&&(textarea.disabled=!1,textarea.value=content,textarea.dispatchEvent(new Event("input"))),submit&&(submit.disabled=!1)}).catch(function(){notyf("加载评论失败","danger"),textarea&&(textarea.disabled=!1,textarea.value=""),submit&&(submit.disabled=!1)});else{var nameEl=comm?comm.querySelector(".comment-header name"):null,author=nameEl?(nameEl.textContent||"").trim():"";setActionText(author?"回复 @"+author:"回复评论"),ensureEditField(respond,0),textarea&&textarea.focus()}return window.AksrtFixedInput?window.AksrtFixedInput(respond,"show"):respond.classList.add("show"),comm&&comm.scrollIntoView&&comm.scrollIntoView({behavior:"smooth",block:"center"}),!1}document.addEventListener("click",function(e){var reply=e.target&&e.target.closest?e.target.closest(".comment-reply-link"):null,edit=e.target&&e.target.closest?e.target.closest('.comment-edit-link, [data-comment-action="edit"]'):null;if(reply){e.preventDefault();var cid=reply.getAttribute("data-commentid")||reply.getAttribute("data-comment-id")||"",postid=reply.getAttribute("data-postid")||"";if(!cid){var li=reply.closest("[data-comment-id], #comment-"+(cid||""));li&&li.getAttribute("data-comment-id")&&(cid=li.getAttribute("data-comment-id"))}if(!cid){var m=(reply.closest('li[id^="comment-"]')||{}).id||"",mm=/comment-(\d+)/.exec(m);mm&&(cid=mm[1])}moveForm("div-comment-"+cid,cid,!1);return}if(edit){e.preventDefault();var eid=edit.getAttribute("data-commentid")||edit.getAttribute("data-comment-id")||"";if(!eid){var row=edit.closest("[data-comment-id]");row&&(eid=row.getAttribute("data-comment-id"))}if(!eid)return;moveForm("div-comment-"+eid,eid,!0)}}),document.addEventListener("click",function(e){var t=e.target&&e.target.closest?e.target.closest('[data-toggle-class="open"], span.dropup > a.but, [data-toggle="dropdown"]'):null;if(t){var wrap=t.closest("span.dropup, span.dropdown");wrap&&(wrap.classList.contains("open")&&t.parentElement!==wrap||(e.preventDefault(),wrap.classList.toggle("open")))}}),document.addEventListener("click",function(e){e.target.closest&&e.target.closest("span.dropup.open, span.dropdown.open")||document.querySelectorAll("span.dropup.open, span.dropdown.open").forEach(function(n){n.classList.remove("open")})}),document.addEventListener("click",function(e){var a=e.target&&e.target.closest?e.target.closest("[data-scroll-to]"):null;if(a){e.preventDefault();var sel=a.getAttribute("data-scroll-to"),el=sel?document.querySelector(sel):null;el&&el.scrollIntoView({behavior:"smooth",block:"center"})}}),window.aksrtCommentMoveForm=moveForm,window.aksrtGetEditingCommentId=function(){return editingId}})(),(function(window2,document2){"use strict";var loadingMap=new WeakMap;function restHeaders(){var h={Accept:"application/json, text/html","X-AKSRT-Ajax":"list"};return window2.aksrtData&&aksrtData.restNonce&&(h["X-WP-Nonce"]=aksrtData.restNonce),h}function closestPager(el){return el?el.closest(".ajaxpager")||el.closest("[data-aksrt-ajaxpager]")||el.closest(".aksrt-ajaxpager"):null}function dispatch(container,name,detail){if(container)try{container.dispatchEvent(new CustomEvent(name,{bubbles:!0,detail:detail||{}}))}catch{}}function showLoader(container){if(container){var loader=container.querySelector(".post_ajax_loader, .post-ajax-loader, [data-aksrt-ajax-loader]");if(loader){loader.classList.add("is-loading"),loader.hidden=!1,loader.style.display="";return}container.classList.add("is-ajax-loading")}}function hideLoader(container){if(container){var loader=container.querySelector(".post_ajax_loader, .post-ajax-loader, [data-aksrt-ajax-loader]");loader&&(loader.classList.remove("is-loading"),loader.hasAttribute("data-aksrt-ajax-loader-hide")&&(loader.hidden=!0,loader.style.display="none")),container.classList.remove("is-ajax-loading")}}function parseHtml(html){var wrap=document2.createElement("div");return wrap.innerHTML=html||"",wrap}function extractFromHtml(html,container){var doc=parseHtml(html),pager=doc.querySelector(".ajaxpager")||doc.querySelector("[data-aksrt-ajaxpager]")||doc.querySelector(".aksrt-ajaxpager"),items=[],scope=pager||doc;scope.querySelectorAll(".ajax-item").forEach(function(n){items.push(n.outerHTML)}),!items.length&&pager&&items.push(pager.innerHTML);var pag=scope.querySelector(".ajax-pag"),headerBits={};doc.querySelectorAll("[win-ajax-replace]").forEach(function(n){var key=n.getAttribute("win-ajax-replace");key&&(headerBits[key]=n.outerHTML)});var titleEl=doc.querySelector("title");return{itemsHtml:items.join(""),paginateHtml:pag?pag.outerHTML:"",headerBits,title:titleEl?titleEl.textContent:"",fullHtml:pager?pager.innerHTML:html}}function syncWinReplace(bits){bits&&Object.keys(bits).forEach(function(key){var live=document2.querySelector('[win-ajax-replace="'+key+'"]');if(live){var tmp=document2.createElement("div");tmp.innerHTML=bits[key];var next=tmp.firstElementChild;next&&live.replaceWith(next)}})}function applyRoute(link,title){if(link){var route=link.getAttribute("route")||link.getAttribute("data-route");if(route==="1"||route==="true"||link.hasAttribute("route")){var href=link.getAttribute("href")||link.getAttribute("ajax-href")||"";if(href){try{window2.history.replaceState({},"",href)}catch{}var rt=title||link.getAttribute("route-title")||link.getAttribute("data-route-title")||"";if(rt)try{document2.title=rt}catch{}}}}}function replacePaginate(container,paginateHtml){if(!(!container||!paginateHtml)){var old=container.querySelector(".ajax-pag");if(!old){container.insertAdjacentHTML("beforeend",paginateHtml);return}var tmp=document2.createElement("div");tmp.innerHTML=paginateHtml;var next=tmp.firstElementChild;next&&old.replaceWith(next)}}function findItemHost(container){if(!container||!container.children)return container;for(var i=0;i"+html+"
");itemsHtml=parsed.itemsHtml||html}else itemsHtml=html;return{itemsHtml,html,paginateHtml:data.paginate_html||data.paginateHtml||"",headerHtml:data.header_html||data.headerHtml||"",headerBits:data.header_bits||null,title:data.title||"",emptyHtml:data.empty_html||"",hasMore:typeof data.has_more<"u"?!!data.has_more:null}}function loadFromLink(link,override){if(override=override||{},!link)return Promise.resolve();var container=override.container||(link.getAttribute("ajaxpager-target")?document2.querySelector(link.getAttribute("ajaxpager-target")):null)||closestPager(link);if(container||(container=link.closest("[data-aksrt-ajax-list]")),!container||loadingMap.get(container))return Promise.resolve();loadingMap.set(container,!0);var replaceAttr=link.getAttribute("ajax-replace"),replace=typeof override.replace=="boolean"?override.replace:replaceAttr==="true"||replaceAttr==="1"||replaceAttr==="replace",href=override.url||link.getAttribute("data-aksrt-ajax-url")||link.getAttribute("ajax-href")||link.getAttribute("href")||"";return dispatch(container,"post_ajax.before",{link,replace,url:href}),showLoader(container),replace&&container.querySelectorAll(".ajax-item").forEach(function(n){n.classList.add("is-fading")}),fetch(href,{method:override.method||"GET",credentials:"same-origin",headers:restHeaders()}).then(function(res){var type=(res.headers.get("content-type")||"").toLowerCase();return type.indexOf("application/json")!==-1?res.json().then(function(json){if(!res.ok||json&&json.success===!1)throw new Error(json&&(json.message||json.data&&json.data.message)||"加载失败");return normalizeJson(json)}):res.text().then(function(text){if(!res.ok)throw new Error("加载失败");return extractFromHtml(text,container)})}).then(function(payload){if(!payload)throw new Error("空响应");return replace&&!payload.itemsHtml&&payload.emptyHtml?inject(container,{itemsHtml:payload.emptyHtml,paginateHtml:payload.paginateHtml},{replace:!0}):inject(container,payload,{replace}),applyRoute(link,payload.title),hideLoader(container),loadingMap.set(container,!1),dispatch(container,"post_ajax.ed",{link,replace,url:href,payload}),typeof window2.auto_fun=="function"&&window2.auto_fun(),document2.dispatchEvent(new CustomEvent("aksrt:posts:rendered",{bubbles:!0,detail:{container,replace}})),payload}).catch(function(err){throw hideLoader(container),loadingMap.set(container,!1),container.querySelectorAll(".ajax-item.is-fading").forEach(function(n){n.classList.remove("is-fading")}),notyf(err&&err.message||"加载失败","danger"),dispatch(container,"post_ajax.error",{link,error:err}),err})}document2.addEventListener("click",function(e){var link=e.target.closest("a.ajax-next, .ajax-next a, button.ajax-next, [data-aksrt-ajax-next]");if(link&&!link.closest("[data-aksrt-ajax-list='off']")&&!link.closest("[data-aksrt-pagination], .aksrt-comment-pagination")){var href=link.getAttribute("href")||link.getAttribute("ajax-href")||link.getAttribute("data-aksrt-ajax-url");!href&&!link.getAttribute("data-aksrt-ajax-url")||(e.preventDefault(),loadFromLink(link.tagName==="A"||link.classList.contains("ajax-next")?link:link.closest(".ajax-next")||link))}}),window2.AksrtAjaxList={load:loadFromLink,inject,extractFromHtml,closestPager}})(window,document),(function(){"use strict";function hasAjaxConfig(){return!!(window.aksrtData&&aksrtData.ajaxUrl&&aksrtData.nonce)}function initAjaxPagination(root){var containers=(root||document).querySelectorAll("[data-aksrt-pagination], .aksrt-comment-pagination");if(containers.length){var triggerText=window.aksrtData&&aksrtData.ajaxTrigger||"加载更多",nomoreText=window.aksrtData&&aksrtData.ajaxNomore||"没有更多了",loadingText=window.aksrtData&&aksrtData.ajaxLoading||"正在加载...",errorText=window.aksrtData&&aksrtData.ajaxLoadError||"加载失败,请重试";containers.forEach(function(container){if(container.dataset.aksrtPaginationBound==="1")return;container.dataset.aksrtPaginationBound="1";var mode=container.dataset.mode||"load_more",nextPage=parseInt(container.dataset.nextPage,10)||2,maxPages=parseInt(container.dataset.maxPages,10)||1,isComment=container.classList.contains("aksrt-comment-pagination"),postId=container.dataset.postId||"",commentOrder=container.dataset.commentOrder||"newest",loading=!1,failed=!1,clickTarget=container.querySelector(".next-page.ajax-next, .ias-btn")||container,loadMoreBtn=container.querySelector("[data-aksrt-load-more]")||clickTarget,indicator=container.querySelector(".post_ajax_loader"),successfulAutoLoads=0,iasMax=isComment?window.aksrtData&&typeof aksrtData.commentIasMax<"u"?parseInt(aksrtData.commentIasMax,10):0:window.aksrtData&&typeof aksrtData.iasMax<"u"?parseInt(aksrtData.iasMax,10):0,homepagePanel=container.closest("[data-home-tab-panel]"),target=homepagePanel||container.previousElementSibling;if(!homepagePanel&&target&&target.classList&&target.classList.contains("content-stream__footer")&&(target=target.previousElementSibling),isComment){var commentList=container.closest("#comment-list, .commentlist, ol.commentlist")||document.getElementById("comment-list");commentList&&(target=commentList)}!target&&container.parentElement&&(target=container.parentElement.querySelector(".post-grid, .comment-list, .commentlist, .content-stream__list"));function showSkeleton(){if(target){var loader=target.querySelector(".post-ajax-loader");loader&&loader.classList.add("is-loading")}}function hideSkeleton(){if(target){var loader=target.querySelector(".post-ajax-loader");loader&&loader.classList.remove("is-loading")}}function stopInfinite(markNomore){if(container.classList.remove("ias-pending"),markNomore&&loadMoreBtn){loadMoreBtn.innerHTML=nomoreText,loadMoreBtn.classList.remove("is-loading"),loadMoreBtn.classList.add("ajax-nomore");var nextWrap=loadMoreBtn.closest(".next-page");nextWrap&&nextWrap.classList.add("no-more"),loadMoreBtn.style.pointerEvents="none"}else loadMoreBtn&&!loadMoreBtn.classList.contains("ajax-nomore")&&(loadMoreBtn.classList.remove("is-loading"),failed?loadMoreBtn.textContent=errorText:loadMoreBtn.innerHTML=triggerText,loadMoreBtn.style.pointerEvents="")}function markFailed(message){failed=!0,stopInfinite(!1),loadMoreBtn&&(loadMoreBtn.textContent=message||errorText,loadMoreBtn.classList.remove("is-loading"),loadMoreBtn.classList.remove("ajax-nomore"),loadMoreBtn.style.pointerEvents="")}function loadNextPage(fromAuto){if(loading||failed||nextPage>maxPages||!target)return Promise.resolve(!1);if(!hasAjaxConfig())return markFailed(errorText),Promise.resolve(!1);loading=!0,indicator&&(indicator.style.display="flex"),loadMoreBtn&&(loadMoreBtn.classList.add("is-loading"),loadMoreBtn.textContent=loadingText),showSkeleton();var action=isComment?"aksrt_load_more_comments":"aksrt_load_more_posts",queryContext=container.dataset.queryContext||"",queryVars=container.dataset.queryVars||"",renderConfig=container.dataset.renderConfig||"",body=new URLSearchParams;if(body.set("action",action),body.set("nonce",aksrtData.nonce),body.set("page",String(nextPage)),queryContext&&body.set("query_context",queryContext),!isComment&&queryVars&&body.set("query_vars",queryVars),!isComment&&renderConfig&&body.set("render_config",renderConfig),isComment&&postId){body.set("post_id",postId),body.set("comment_order",commentOrder);var authorOnly=container.dataset.authorOnly||"0";authorOnly==="1"&&body.set("author_only","1")}return fetch(aksrtData.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},credentials:"same-origin",body:body.toString()}).then(function(r){if(!r.ok)throw new Error("HTTP "+r.status);return r.text().then(function(text){try{return JSON.parse(text)}catch{throw new Error("Invalid JSON")}})}).then(function(res){if(!(res&&res.success&&res.data&&typeof res.data.html=="string")){var msg=res&&res.data&&res.data.message?res.data.message:errorText;return markFailed(msg),!1}var temp=document.createElement("div");temp.innerHTML=res.data.html;for(var newItems=temp.children;newItems.length>0;)homepagePanel&&container.parentNode===target||container.parentNode===target?target.insertBefore(newItems[0],container):target.appendChild(newItems[0]);return target.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun(),nextPage++,container.dataset.nextPage=String(nextPage),fromAuto&&successfulAutoLoads++,(nextPage>maxPages||!res.data.has_more)&&(stopInfinite(!0),loadMoreBtn||(container.innerHTML=''+nomoreText+"")),!0}).catch(function(){return markFailed(errorText),!1}).finally(function(){if(loading=!1,hideSkeleton(),indicator&&(indicator.style.display="none"),loadMoreBtn&&!loadMoreBtn.classList.contains("ajax-nomore")&&!failed&&(loadMoreBtn.classList.remove("is-loading"),loadMoreBtn.innerHTML=triggerText,mode==="infinite")){var lazyTrigger=clickTarget.closest(".next-page")||clickTarget;iasMax>0&&successfulAutoLoads>=iasMax?(container.classList.remove("ias-pending"),lazyTrigger.classList.remove("lazyload","lazyloaded","lazyloading"),lazyTrigger.removeAttribute("lazyload-action")):(lazyTrigger.classList.remove("lazyloaded","lazyloading"),lazyTrigger.classList.add("lazyload"),window.lazySizes&&lazySizes.loader&&lazySizes.loader.checkElems())}})}if(loadMoreBtn&&clickTarget.addEventListener("click",function(e){if(e.preventDefault(),loadMoreBtn.dataset.jumpComments==="1"){var jumpInput=container.querySelector(".jump-input");if(!jumpInput)return;var targetPage=parseInt(jumpInput.value,10)||1,max=parseInt(jumpInput.dataset.maxPages||String(maxPages),10)||maxPages;if(targetPage=Math.max(1,Math.min(max,targetPage)),window.AksrtComments&&typeof window.AksrtComments.loadPage=="function"){e.preventDefault(),window.AksrtComments.loadPage(targetPage);return}window.location.hash="comments",window.location.reload();return}if(loadMoreBtn.dataset.jumpArchive==="1"){var archiveJumpInput=container.querySelector(".jump-input");if(!archiveJumpInput)return;var archiveTargetPage=parseInt(archiveJumpInput.value,10)||1,archiveMax=parseInt(archiveJumpInput.dataset.maxPages||String(maxPages),10)||maxPages;archiveTargetPage=Math.max(1,Math.min(archiveMax,archiveTargetPage));var archiveUrl=new URL(window.location.href);archiveUrl.searchParams.set(loadMoreBtn.dataset.pageVar||"paged",String(archiveTargetPage)),window.location.href=archiveUrl.toString();return}var fromAuto=clickTarget.dataset.lazyAuto==="1";if(delete clickTarget.dataset.lazyAuto,fromAuto&&iasMax>0&&successfulAutoLoads>=iasMax){container.classList.remove("ias-pending");return}failed=!1,loadNextPage(fromAuto)}),(container.classList.contains("lazyload")||clickTarget.classList.contains("lazyload"))&&container.addEventListener("lazybeforeunveil",function(e){e.target!==container&&e.target!==clickTarget||(clickTarget.dataset.lazyAuto="1",clickTarget.click())}),mode==="infinite"){if(isComment&&window.aksrtData&&aksrtData.commentIasAuto===!1||!hasAjaxConfig()){var autoTrigger=clickTarget.closest(".next-page")||clickTarget;autoTrigger.classList.remove("lazyload"),autoTrigger.removeAttribute("lazyload-action");return}container.classList.add("ias-pending")}})}}function init(root){initAjaxPagination(root)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){init()}):init(),window.jQuery&&window.jQuery(document).on("auto_fun",function(){init()})})(),(function(){"use strict";function initArchiveFilter(root){var scope=root||document,bar=scope.querySelector(".archive-filter-bar--ajax[data-ajax-archive]");if(!bar||bar.dataset.aksrtArchiveInit==="1")return;bar.dataset.aksrtArchiveInit="1";var archiveType=bar.dataset.ajaxArchive||"category",termId=parseInt(bar.dataset.termId,10)||0,wrap=scope.querySelector("[data-ajax-wrap]");if(!wrap)return;var loading=wrap.querySelector(".archive__ajax-loading"),REST_BASE="/wp-json/aksrt/v1/archive/posts",emptyText=archiveType==="tag"?"该标签下暂无文章":"该分类下暂无文章",state={filter_cat:"",filter_tag:"",sort:"date",page:1},activeCat=bar.querySelector("[data-filter-cat].is-active");activeCat&&(state.filter_cat=activeCat.dataset.filterCat||"");var activeTag=bar.querySelector("[data-filter-tag].is-active");activeTag&&(state.filter_tag=activeTag.dataset.filterTag||"");var activeSort=bar.querySelector("[data-filter-sort].is-active");activeSort&&(state.sort=activeSort.dataset.filterSort||"date");function buildUrl(){var params=new URLSearchParams;return params.set("archive_type",archiveType),params.set("term_id",String(termId)),state.filter_cat&¶ms.set("filter_cat",state.filter_cat),state.filter_tag&¶ms.set("filter_tag",state.filter_tag),params.set("sort",state.sort||"date"),params.set("page",String(state.page)),REST_BASE+"?"+params.toString()}function updateActiveChips(){bar.querySelectorAll("[data-filter-cat]").forEach(function(el){el.classList.toggle("is-active",(el.dataset.filterCat||"")===state.filter_cat)}),bar.querySelectorAll("[data-filter-tag]").forEach(function(el){el.classList.toggle("is-active",(el.dataset.filterTag||"")===state.filter_tag)}),bar.querySelectorAll("[data-filter-sort]").forEach(function(el){el.classList.toggle("is-active",(el.dataset.filterSort||"date")===state.sort)})}function showLoading(){loading&&loading.classList.add("is-loading"),wrap.classList.add("is-loading")}function hideLoading(){loading&&loading.classList.remove("is-loading"),wrap.classList.remove("is-loading")}function rebuildEmptyState(){var noResults=document.createElement("div");noResults.className="no-results content-stream__empty",noResults.innerHTML="

"+emptyText+"

",wrap.appendChild(noResults)}function fetchPosts(pushState){showLoading(),fetch(buildUrl(),{method:"GET",headers:{Accept:"application/json"},credentials:"same-origin"}).then(function(r){if(!r.ok)throw new Error("HTTP "+r.status);return r.json()}).then(function(data){if(hideLoading(),data.html!==void 0){var children=Array.from(wrap.children);if(children.forEach(function(child){child!==loading&&wrap.removeChild(child)}),data.html){var temp=document.createElement("div");for(temp.innerHTML=data.html;temp.firstChild;)wrap.appendChild(temp.firstChild)}else rebuildEmptyState();wrap.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun()}if(pushState!==!1){var url=new URL(window.location.href);url.searchParams.delete("orderby"),url.searchParams.delete("order"),url.searchParams.delete("paged"),url.searchParams.delete("aksrt_filter_cat"),url.searchParams.delete("aksrt_filter_tag"),state.filter_cat&&url.searchParams.set("aksrt_filter_cat",state.filter_cat),state.filter_tag&&url.searchParams.set("aksrt_filter_tag",state.filter_tag),state.sort&&url.searchParams.set("orderby",state.sort),state.page>1&&url.searchParams.set("paged",String(state.page)),history.pushState({aksrtArchive:!0,state:Object.assign({},state)},"",url.toString())}}).catch(function(){hideLoading()})}bar.addEventListener("click",function(e){var chip=e.target.closest("[data-filter-cat], [data-filter-tag], [data-filter-sort]");if(chip){e.preventDefault();var changed=!1;if(chip.dataset.filterCat!==void 0){var newCat=chip.dataset.filterCat;newCat!==state.filter_cat&&(state.filter_cat=newCat,changed=!0)}if(chip.dataset.filterTag!==void 0){var newTag=chip.dataset.filterTag;newTag!==state.filter_tag&&(state.filter_tag=newTag,changed=!0)}if(chip.dataset.filterSort!==void 0){var newSort=chip.dataset.filterSort||"date";newSort!==state.sort&&(state.sort=newSort,changed=!0)}changed&&(state.page=1,updateActiveChips(),fetchPosts(!0))}}),wrap.addEventListener("click",function(e){var pageLink=e.target.closest(".pagination a, .nav-links a, a.page-numbers");if(!(!pageLink||!wrap.contains(pageLink))){var href=pageLink.getAttribute("href");if(href){var match=href.match(/[?&]paged=(\d+)/);match&&(e.preventDefault(),state.page=parseInt(match[1],10)||1,fetchPosts(!0))}}}),window.addEventListener("popstate",function(e){e.state&&e.state.aksrtArchive&&(state=Object.assign(state,e.state.state),updateActiveChips(),fetchPosts(!1))})}function init(root){initArchiveFilter(root)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){init()}):init(),window.jQuery&&window.jQuery(document).on("auto_fun",function(){init()})})(),(function(){"use strict";function initFooterTabbar(){var tabbar=document.getElementById("footer-tabbar");if(!tabbar||tabbar.dataset.aksrtTabbarInit==="1")return;tabbar.dataset.aksrtTabbarInit="1";var addBackdrop=document.getElementById("tabbar-add-backdrop"),ticking=!1,scrollThreshold=100,isHidden=!1;function handleScrollDownHide(){var body=document.body,scrollTop=window.pageYOffset||document.documentElement.scrollTop;scrollTop>scrollThreshold?body.classList.contains("scroll-down")&&!isHidden?(tabbar.classList.add("is-hidden"),isHidden=!0):body.classList.contains("scroll-up")&&isHidden&&(tabbar.classList.remove("is-hidden"),isHidden=!1):(tabbar.classList.remove("is-hidden"),isHidden=!1)}function handleOntopWrap(){var ontopWraps=tabbar.querySelectorAll(".tabbar-ontop-wrap"),scrollTop=window.pageYOffset||document.documentElement.scrollTop;ontopWraps.forEach(function(wrap){scrollTop>scrollThreshold?wrap.classList.add("is-scrolled"):wrap.classList.remove("is-scrolled")})}function onScroll(){ticking||(requestAnimationFrame(function(){tabbar.classList.contains("scroll-down-hide")&&handleScrollDownHide(),handleOntopWrap(),ticking=!1}),ticking=!0)}window.addEventListener("scroll",onScroll,{passive:!0});function closeAddPanels(){document.querySelectorAll(".tabbar-add-panel").forEach(function(panel){panel.setAttribute("hidden","")}),addBackdrop&&addBackdrop.setAttribute("hidden",""),document.body.classList.remove("tabbar-add-open")}function openAddPanel(panelId){closeAddPanels();var panel=document.getElementById(panelId);panel&&(panel.removeAttribute("hidden"),addBackdrop&&addBackdrop.removeAttribute("hidden"),document.body.classList.add("tabbar-add-open"))}addBackdrop&&addBackdrop.addEventListener("click",closeAddPanels),document.addEventListener("keydown",function(e){e.key==="Escape"&&closeAddPanels()});var homeClickTimer=null;tabbar.addEventListener("click",function(e){var addBtn=e.target.closest('.tabbar-item[data-type="add"]');if(addBtn){e.preventDefault(),openAddPanel(addBtn.getAttribute("data-panel-id"));return}var searchBtn=e.target.closest('.tabbar-item[data-type="search"]');if(searchBtn){e.preventDefault(),typeof window.__aksrtOpenSearchPanel=="function"&&window.__aksrtOpenSearchPanel();return}var ontopBtn=e.target.closest(".tabbar-ontop-btn");if(ontopBtn){e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"});return}var homeBtn=e.target.closest('.tabbar-item[data-type="home"]');if(homeBtn&&tabbar.classList.contains("has-animation")){if(homeClickTimer){clearTimeout(homeClickTimer),homeClickTimer=null,window.location.reload();return}homeClickTimer=setTimeout(function(){homeClickTimer=null},350)}}),document.addEventListener("click",function(e){e.target.closest("[data-close-tabbar-add-panel]")&&closeAddPanels()})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initFooterTabbar):initFooterTabbar()})(),(function(){"use strict";function renderGradientBackground(container){if(!(!container||container.dataset.aksrtGradientState||typeof window.Grade!="function")){var source=container.querySelector("img");!source||!source.classList.contains("lazyloaded")&&!(source.complete&&source.naturalWidth>0)||(container.dataset.aksrtGradientState="loading",window.Grade(container,null,function(result){var gradientData=result&&result[0],colors=gradientData&&gradientData.gradientData;if(!gradientData||!colors||!colors[0]||!colors[1]){delete container.dataset.aksrtGradientState;return}var opacity=container.getAttribute("data-opacity"),colorName=opacity?"rgba":"rgb",alpha=opacity?","+opacity:"",color1=colorName+"("+colors[0].rgba.slice(0,3).join(",")+alpha+") 10%",color2=colorName+"("+colors[1].rgba.slice(0,3).join(",")+alpha+") 80%";gradientData.element.classList.add("gradient-bg-loaded"),gradientData.element.style.backgroundImage="linear-gradient(135deg, "+color1+", "+color2+")",container.dataset.aksrtGradientState="loaded"}))}}function initGradientBackgrounds(root){var scope=root||document;scope.nodeType===1&&scope.matches(".gradient-bg")&&renderGradientBackground(scope),scope.querySelectorAll(".gradient-bg").forEach(renderGradientBackground)}document.addEventListener("lazyloaded",function(event){!(event.target instanceof Element)||!event.target.matches(".gradient-bg img")||renderGradientBackground(event.target.closest(".gradient-bg"))},!0);function initPostThumbMedia(root){var scope=root||document;scope.querySelectorAll("[data-post-thumb-video]").forEach(function(box){if(box.dataset.aksrtThumbVideoBound==="1")return;box.dataset.aksrtThumbVideoBound="1";var video=box.querySelector("video");if(!video)return;function loadVideo(){!video.getAttribute("src")&&video.dataset.src&&(video.setAttribute("src",video.dataset.src),video.load())}function playVideo(){loadVideo();var result=video.play(),postItem=box.closest(".posts-item");postItem&&postItem.classList.add("thumb-dplayer-playing"),result&&typeof result.catch=="function"&&result.catch(function(){})}function pauseVideo(){video.pause();var postItem=box.closest(".posts-item");postItem&&postItem.classList.remove("thumb-dplayer-playing")}var item=box.closest(".item-thumbnail")||box;item.addEventListener("mouseenter",playVideo),item.addEventListener("mouseleave",pauseVideo),item.addEventListener("focusin",playVideo),item.addEventListener("focusout",pauseVideo)})}function init(root){initPostThumbMedia(root),initGradientBackgrounds(root)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){init()}):init(),window.jQuery&&window.jQuery(document).on("auto_fun",function(){init()})})(),(function(){"use strict";function initSlideCovers(){var covers=document.querySelectorAll(".single-cover--slide");covers.forEach(function(cover){var slides=cover.querySelectorAll(".single-cover__slide"),dots=cover.querySelectorAll(".single-cover__dot");if(slides.length<2)return;var current=0,interval=5e3;function goTo(idx){slides[current].classList.remove("is-active"),dots[current]&&dots[current].classList.remove("is-active"),current=idx,slides[current].classList.add("is-active"),dots[current]&&dots[current].classList.add("is-active")}var timer=setInterval(function(){goTo((current+1)%slides.length)},interval);dots.forEach(function(dot,i){dot.addEventListener("click",function(){clearInterval(timer),goTo(i),timer=setInterval(function(){goTo((current+1)%slides.length)},interval)})})})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initSlideCovers):initSlideCovers()})(),(function(){"use strict";function initHiddenContent(){document.addEventListener("click",function(e){var btn=e.target.closest(".aksrt-hidden-content__submit-btn");if(btn){e.preventDefault();var wrapper=btn.closest(".aksrt-hidden-content--locked");if(wrapper){var mode=wrapper.getAttribute("data-aksrt-visibility-mode"),pid=wrapper.getAttribute("data-aksrt-visibility-pid"),input=wrapper.querySelector(".aksrt-hidden-content__password-input"),password=input?input.value.trim():"";if(mode==="password"&&!password){input&&input.focus();return}var formData=new FormData;formData.append("action","aksrt_check_visibility"),formData.append("_nonce",window.aksrtData&&aksrtData.visibilityNonce||""),formData.append("mode",mode),formData.append("pid",pid),password&&formData.append("password",password),btn.disabled=!0,btn.textContent="...",fetch(window.aksrtData&&aksrtData.ajaxUrl||"/wp-admin/admin-ajax.php",{method:"POST",body:formData,credentials:"same-origin"}).then(function(res){return res.json()}).then(function(data){if(data.success)window.location.reload();else{var msg=data.data&&data.data.message?data.data.message:"验证失败";alert(msg),btn.disabled=!1,btn.textContent="验证"}}).catch(function(){alert("网络错误,请重试"),btn.disabled=!1,btn.textContent="验证"})}}}),document.addEventListener("keydown",function(e){if(e.key==="Enter"&&e.target.classList.contains("aksrt-hidden-content__password-input")){e.preventDefault();var wrapper=e.target.closest(".aksrt-hidden-content--locked");if(wrapper){var btn=wrapper.querySelector(".aksrt-hidden-content__submit-btn");btn&&btn.click()}}})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initHiddenContent):initHiddenContent()})(),(function(){"use strict";var THEME_KEY="aksrt-theme",THEME_COOKIE_KEY="theme_mode";function normalizeStoredTheme(value){return value==="dark"||value==="dark-theme"?"dark":value==="light"||value==="white-theme"?"light":null}function toCookieTheme(value){return value==="dark"?"dark-theme":"white-theme"}function getCookie(name){for(var parts=document.cookie?document.cookie.split("; "):[],i=0;i=20||hour<8?"dark":"light"}function resolveConfiguredTheme(mode){var normalized=normalizeStoredTheme(mode);return normalized||(mode==="time-auto"||mode==="auto"?getTimeAutoTheme():"light")}function syncBrandLogos(isDark){document.querySelectorAll("[data-logo-light]").forEach(function(img){var lightSrc=img.getAttribute("data-logo-light")||"",darkSrc=img.getAttribute("data-logo-dark")||"";lightSrc&&img.setAttribute("src",isDark&&darkSrc?darkSrc:lightSrc)})}function syncThemeColorMeta(isDark){var meta=document.querySelector('meta[name="theme-color"]');meta||(meta=document.createElement("meta"),meta.setAttribute("name","theme-color"),document.head.appendChild(meta)),meta.setAttribute("content",isDark?"#2F3135":"#FDFCFE")}function getThemeImageAttr(img,name){return img.getAttribute(name)||img.getAttribute("data-"+name)||""}function setThemeImageSource(img,src){!src||img.getAttribute("src")===src||img.setAttribute("src",src)}function syncThemeImages(isDark){document.querySelectorAll("img[switch-src], img[data-switch-src]").forEach(function(img){var darkSrc=getThemeImageAttr(img,"switch-src");img.dataset.aksrtThemeLightSrc||(img.dataset.aksrtThemeLightSrc=img.getAttribute("src")||""),setThemeImageSource(img,isDark&&darkSrc?darkSrc:img.dataset.aksrtThemeLightSrc)}),document.querySelectorAll("img[white-src], img[dark-src], img[data-white-src], img[data-dark-src]").forEach(function(img){var lightSrc=getThemeImageAttr(img,"white-src")||img.dataset.aksrtThemeLightSrc||img.getAttribute("src")||"",darkSrc=getThemeImageAttr(img,"dark-src");!img.dataset.aksrtThemeLightSrc&&lightSrc&&(img.dataset.aksrtThemeLightSrc=lightSrc),setThemeImageSource(img,isDark&&darkSrc?darkSrc:lightSrc)})}function syncCodeHighlightTheme(isDark){if(typeof window.AksrtPrecodeApplyTheme=="function"){window.AksrtPrecodeApplyTheme(isDark);return}var settings=window.aksrtData&&window.aksrtData.codeHighlight||{},theme=isDark?settings.darkTheme||"monokai":settings.lightTheme||"enlighter";document.querySelectorAll(".enlighter-default").forEach(function(el){el.className=el.className.replace(/\benlighter-t-[\w-]+\b/g,"").replace(/\s+/g," ").trim(),el.classList.add("enlighter-t-"+theme)})}function dispatchThemeChange(isDark){try{document.dispatchEvent(new CustomEvent("aksrt:theme-change",{detail:{theme:isDark?"dark":"light",isDark}}))}catch{}}function applyTheme(mode){var isDark=mode==="dark";document.documentElement.classList.toggle("dark",isDark),document.documentElement.setAttribute("data-theme",isDark?"dark":"light"),document.body.classList.toggle("theme-dark",isDark),document.body.classList.toggle("dark-theme",isDark),document.body.classList.toggle("white-theme",!isDark),document.body.setAttribute("data-theme",isDark?"dark":"light"),syncBrandLogos(isDark),syncThemeColorMeta(isDark),syncThemeImages(isDark),syncCodeHighlightTheme(isDark),dispatchThemeChange(isDark),document.querySelectorAll("#theme-toggle, #theme-toggle-desktop, #theme-toggle-mobile, #dropdown-theme-toggle, #float-theme-toggle, .toggle-theme, .theme-toggle-btn, [data-action='toggle-theme']").forEach(function(btn){if(btn){btn.setAttribute("aria-pressed",isDark?"true":"false"),btn.classList.toggle("is-dark",isDark);var moon=btn.querySelector(".theme-icon-moon, .float-btn__icon-moon"),sun=btn.querySelector(".theme-icon-sun, .float-btn__icon-sun");moon&&(moon.removeAttribute("style"),moon.setAttribute("aria-hidden",isDark?"true":"false")),sun&&(sun.removeAttribute("style"),sun.setAttribute("aria-hidden",isDark?"false":"true"))}});var floatBtn=document.getElementById("float-theme-toggle");floatBtn&&floatBtn.setAttribute("aria-pressed",isDark?"true":"false");var ddBtn=document.getElementById("dropdown-theme-toggle");ddBtn&&ddBtn.setAttribute("aria-pressed",isDark?"true":"false")}var themeInitialized=!1;function initTheme(){if(themeInitialized)return;themeInitialized=!0;var stored=getStoredTheme(),configuredMode=window.aksrtData&&window.aksrtData.themeMode||"light";applyTheme(stored==="dark"||stored==="light"?stored:resolveConfiguredTheme(configuredMode));function prefersReducedMotion(){return window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function getThemeTransitionPoint(event){return event&&typeof event.clientX=="number"&&typeof event.clientY=="number"?{x:event.clientX,y:event.clientY}:{x:window.innerWidth/2,y:window.innerHeight/2}}function runThemeTransition(next,event){if(!document.startViewTransition||prefersReducedMotion()){applyTheme(next);return}var point=getThemeTransitionPoint(event),endRadius=Math.hypot(Math.max(point.x,window.innerWidth-point.x),Math.max(point.y,window.innerHeight-point.y)),clipPath=["circle(0px at "+point.x+"px "+point.y+"px)","circle("+endRadius+"px at "+point.x+"px "+point.y+"px)"],enteringDark=next==="dark";try{var transition=document.startViewTransition(function(){applyTheme(next)});transition.ready.then(function(){try{document.documentElement.animate({clipPath:enteringDark?clipPath:clipPath.slice().reverse()},{duration:500,easing:enteringDark?"ease-in":"ease-out",fill:"both",pseudoElement:enteringDark?"::view-transition-new(root)":"::view-transition-old(root)"})}catch{}}).catch(function(){})}catch{applyTheme(next)}}function bindToggle(id){var el=document.getElementById(id);el&&el.addEventListener("click",function(event){var next=document.body.classList.contains("theme-dark")?"light":"dark";setStoredTheme(next),runThemeTransition(next,event)})}bindToggle("theme-toggle"),bindToggle("theme-toggle-desktop"),bindToggle("dropdown-theme-toggle"),bindToggle("float-theme-toggle"),bindToggle("theme-toggle-mobile")}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initTheme):initTheme()})(),(function(){"use strict";var API_ROOT=(function(){var data=window.aksrtData||{},raw=data.apiUrl||data.restUrl||data.rest_url||"/index.php?rest_route=/aksrt/v1";return String(raw).replace(/\/$/,"")})(),NONCE=window.aksrtData&&window.aksrtData.restNonce||"";function buttonsFor(userId){return Array.prototype.slice.call(document.querySelectorAll('[data-aksrt-follow="'+userId+'"]'))}function setLoading(buttons,loading){buttons.forEach(function(button){button.disabled=loading,button.classList.toggle("is-loading",loading)})}function updateButton(button,isFollowing){var icon=button.querySelector("i"),label=button.querySelector("[data-aksrt-follow-label]");label&&(button.classList.toggle("is-following",isFollowing),icon&&(icon.className=isFollowing?"fa fas fa-heart em09":"fa far fa-heart em09"),label.textContent=isFollowing?"已关注":"关注",button.title=isFollowing?"点击取消关注":"关注该用户")}function updateFollowerCount(count){var countEl=document.querySelector(".aksrt-user-home__stat-value[data-followers]");countEl&&count!==void 0&&(countEl.textContent=count)}document.addEventListener("click",function(event){var button=event.target.closest("[data-aksrt-follow]");if(button){event.preventDefault();var targetUserId=parseInt(button.getAttribute("data-aksrt-follow"),10);if(!(!targetUserId||button.disabled)){var matchingButtons=buttonsFor(targetUserId);setLoading(matchingButtons,!0),fetch(API_ROOT+"/follow/toggle",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":NONCE},body:JSON.stringify({target_user_id:targetUserId})}).then(function(response){return response.json()}).then(function(result){if(!result.success||!result.data){notyf(result.message||"操作失败","danger");return}var isFollowing=!!result.data.is_following;if(matchingButtons.forEach(function(matchingButton){updateButton(matchingButton,isFollowing)}),updateFollowerCount(result.data.follower_count),!isFollowing){var managementItem=button.closest(".uc-follow-management__item");managementItem&&managementItem.remove()}notyf(isFollowing?"关注成功":"已取消关注","success")}).catch(function(){notyf("网络错误,请重试","danger")}).finally(function(){setLoading(matchingButtons,!1)})}}})})(),(function(){"use strict";var initialized=!1;function initScrollDirection(){var body=document.body;function sync(){body.classList.toggle("aksrt-body-scroll",body.classList.contains("body-scroll")),body.classList.toggle("aksrt-scroll-down",body.classList.contains("scroll-down")),body.classList.toggle("aksrt-scroll-up",body.classList.contains("scroll-up")),body.classList.add("aksrt-scrolling"),clearTimeout(body._aksrtScrollTimer),body._aksrtScrollTimer=setTimeout(function(){body.classList.remove("aksrt-scrolling")},300)}function onScroll(){requestAnimationFrame(sync)}window.addEventListener("scroll",onScroll,{passive:!0})}function init(){initialized||(initialized=!0,initScrollDirection())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init()})(),(function(){"use strict";function initTilt(){document.querySelectorAll("[data-aksrt-tilt]").forEach(function(el){if(!el.dataset.tiltInit){el.dataset.tiltInit="1";var maxTilt=parseInt(el.dataset.aksrtTiltMax||"15",10),perspective=parseInt(el.dataset.aksrtTiltPerspective||"1000",10),scale=parseFloat(el.dataset.aksrtTiltScale||"1.03"),speed=parseInt(el.dataset.aksrtTiltSpeed||"400",10),glare=el.dataset.aksrtTiltGlare==="1";el.style.transformStyle="preserve-3d",el.style.transition="transform "+speed+"ms ease";var glareEl=null;glare&&(glareEl=document.createElement("div"),glareEl.style.cssText="position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity "+speed+"ms;",el.style.position=el.style.position||"relative",el.style.overflow="hidden",el.appendChild(glareEl)),el.addEventListener("mousemove",function(e){var rect=el.getBoundingClientRect(),x=(e.clientX-rect.left)/rect.width,y=(e.clientY-rect.top)/rect.height,tiltX=(.5-y)*maxTilt,tiltY=(x-.5)*maxTilt;el.style.transform="perspective("+perspective+"px) rotateX("+tiltX+"deg) rotateY("+tiltY+"deg) scale3d("+scale+","+scale+","+scale+")",glareEl&&(glareEl.style.opacity="1",glareEl.style.background="linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%)",glareEl.style.transform="translate("+(x-.5)*100+"%, "+(y-.5)*100+"%)")}),el.addEventListener("mouseleave",function(){el.style.transform="perspective("+perspective+"px) rotateX(0deg) rotateY(0deg) scale3d(1,1,1)",glareEl&&(glareEl.style.opacity="0")})}})}function initScrollAnimations(){if(!("IntersectionObserver"in window)){document.querySelectorAll("[data-aksrt-animate]").forEach(function(el){el.style.opacity="1",el.style.transform="none"});return}var observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){var el=entry.target,animation=el.dataset.aksrtAnimate||"fadeInUp",delay=parseInt(el.dataset.aksrtAnimateDelay||"0",10),duration=parseInt(el.dataset.aksrtAnimateDuration||"600",10);setTimeout(function(){el.style.transition="opacity "+duration+"ms ease, transform "+duration+"ms ease",el.style.opacity="1",el.style.transform="translateY(0) translateX(0) scale(1)",el.classList.add("aksrt-animated")},delay),observer.unobserve(el)}})},{threshold:.1,rootMargin:"0px 0px -50px 0px"});document.querySelectorAll("[data-aksrt-animate]").forEach(function(el){if(!el.dataset.aksrtAnimateInit){el.dataset.aksrtAnimateInit="1";var animation=el.dataset.aksrtAnimate||"fadeInUp";switch(el.style.opacity="0",animation){case"fadeIn":el.style.transform="none";break;case"fadeInUp":el.style.transform="translateY(30px)";break;case"fadeInDown":el.style.transform="translateY(-30px)";break;case"fadeInLeft":el.style.transform="translateX(-30px)";break;case"fadeInRight":el.style.transform="translateX(30px)";break;case"zoomIn":el.style.transform="scale(0.9)";break;default:el.style.transform="translateY(30px)"}observer.observe(el)}})}function initSticky(){document.querySelectorAll("[data-aksrt-sticky]").forEach(function(el){if(el.dataset.aksrtStickyInit)return;el.dataset.aksrtStickyInit="1";var top=parseInt(el.dataset.aksrtStickyTop||"80",10),offset=parseInt(el.dataset.aksrtStickyOffset||"0",10);function update(){var rect=el.getBoundingClientRect(),parentRect=el.parentElement.getBoundingClientRect();parentRect.topel.offsetHeight+top&&(el.style.position="sticky",el.style.top=top+"px")}window.addEventListener("scroll",update,{passive:!0})})}var parallaxScrollBound=!1;function initParallax(){if(!document.querySelector("[data-aksrt-parallax]")||parallaxScrollBound)return;parallaxScrollBound=!0;var ticking=!1;function update(){document.querySelectorAll("[data-aksrt-parallax]").forEach(function(el){var speed=parseFloat(el.dataset.aksrtParallax||"0.3"),rect=el.getBoundingClientRect(),center=rect.top+rect.height/2,windowCenter=window.innerHeight/2,offset=(center-windowCenter)*speed;el.style.transform="translateY("+offset+"px)"}),ticking=!1}window.addEventListener("scroll",function(){ticking||(requestAnimationFrame(update),ticking=!0)},{passive:!0})}var rippleBound=!1;function initRipple(){rippleBound||(rippleBound=!0,document.addEventListener("click",function(e){var el=e.target.closest(".aksrt-ripple");if(el){var rect=el.getBoundingClientRect(),x=e.clientX-rect.left,y=e.clientY-rect.top,size=Math.max(rect.width,rect.height)*2,wave=document.createElement("span");wave.className="aksrt-ripple__wave",wave.style.width=wave.style.height=size+"px",wave.style.left=x-size/2+"px",wave.style.top=y-size/2+"px",el.appendChild(wave),wave.addEventListener("animationend",function(){wave.remove()})}}))}function initFloatLabels(){document.querySelectorAll(".aksrt-float-label__input").forEach(function(input){input.dataset.aksrtFloatInit||(input.dataset.aksrtFloatInit="1",input.value&&input.setAttribute("data-has-value","1"),input.addEventListener("input",function(){this.value?this.setAttribute("data-has-value","1"):this.removeAttribute("data-has-value")}))})}function initSigninCalendar(){var calendar=document.querySelector("[data-aksrt-signin-calendar]");if(calendar){var data=[];try{data=JSON.parse(calendar.dataset.aksrtSigninCalendar||"[]")}catch{}for(var today=new Date,html='",calendar.innerHTML=html}}function init(){initTilt(),initScrollAnimations(),initRipple(),initSticky(),initParallax(),initFloatLabels(),initSigninCalendar()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init),window.AksrtEnhancements={initTilt,initScrollAnimations,initRipple}})(),(function(){"use strict";var canvas=null,ctx=null;function getCanvas(){return canvas||(canvas=document.createElement("canvas"),canvas.width=40,canvas.height=40,ctx=canvas.getContext("2d",{willReadFrequently:!0})),{canvas,ctx}}function extractColor(img){try{var c=getCanvas();c.ctx.drawImage(img,0,0,40,40);for(var data=c.ctx.getImageData(0,0,40,40).data,r=0,g=0,b=0,count=0,step=4,i=0;i240||data[i+3]<128||(r+=pr,g+=pg,b+=pb,count++)}return count===0?null:(r=Math.round(r/count),g=Math.round(g/count),b=Math.round(b/count),{r,g,b,hex:rgbToHex(r,g,b)})}catch{return null}}function rgbToHex(r,g,b){return"#"+((1<<24)+(r<<16)+(g<<8)+b).toString(16).slice(1)}function lighten(r,g,b,amount){return rgbToHex(Math.min(255,r+amount),Math.min(255,g+amount),Math.min(255,b+amount))}function darken(r,g,b,amount){return rgbToHex(Math.max(0,r-amount),Math.max(0,g-amount),Math.max(0,b-amount))}function applyColor(target,color){if(!(!target||!color)){var r=color.r,g=color.g,b=color.b;target.style.setProperty("--aksrt-dynamic-color",color.hex),target.style.setProperty("--aksrt-dynamic-color-rgb",r+","+g+","+b),target.style.setProperty("--aksrt-dynamic-color-light",lighten(r,g,b,60)),target.style.setProperty("--aksrt-dynamic-color-dark",darken(r,g,b,40)),!target.style.background&&!target.style.backgroundColor&&target.style.setProperty("--aksrt-dynamic-bg","rgba("+r+","+g+","+b+",0.05)")}}function processImage(img){if(img.dataset.aksrtColorDone)return;!img.crossOrigin&&img.src.indexOf(window.location.origin)!==0&&(img.crossOrigin="anonymous");function extract(){var color=extractColor(img);if(color){img.dataset.aksrtColorDone="1";var targetSelector=img.dataset.aksrtColorTarget,target=targetSelector?img.closest(targetSelector)||document.querySelector(targetSelector):img.parentElement;applyColor(target,color)}}img.complete&&img.naturalWidth>0?extract():img.addEventListener("load",extract,{once:!0})}function init(){document.querySelectorAll("[data-aksrt-color-extract]").forEach(processImage)}window.AksrtColorExtract={extract:extractColor,apply:applyColor,process:processImage,init},document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init)})(),(function(){"use strict";var reducedMotion=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function initCountUp(){if(!reducedMotion&&"IntersectionObserver"in window){var els=document.querySelectorAll("[data-aksrt-countup]:not([data-aksrt-countup-init])");if(els.length){var observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(!entry.isIntersecting)return;var el=entry.target;observer.unobserve(el);var target=parseFloat(el.dataset.target||"0"),duration=parseInt(el.dataset.duration||"2000",10),decimals=(el.dataset.decimals||"0|").split("|"),prefix=decimals[1]||"",dec=parseInt(decimals[0],10)||0,start=0,startTime=null;function step(timestamp){startTime||(startTime=timestamp);var progress=Math.min((timestamp-startTime)/duration,1),eased=1-Math.pow(1-progress,3),current=start+(target-start)*eased;el.textContent=prefix+current.toFixed(dec).replace(/\B(?=(\d{3})+(?!\d))/g,","),progress<1?requestAnimationFrame(step):el.textContent=prefix+target.toFixed(dec).replace(/\B(?=(\d{3})+(?!\d))/g,",")}requestAnimationFrame(step)})},{threshold:.3});els.forEach(function(el){el.dataset.aksrtCountupInit="1",observer.observe(el)})}}}function initCountdown(){var els=document.querySelectorAll("[data-aksrt-countdown]:not([data-aksrt-countdown-init])");if(!els.length)return;function pad(n){return n<10?"0"+n:""+n}function update(el){var now=Date.now(),end=new Date(el.dataset.end).getTime(),diff=end-now;if(diff<=0){el.textContent=el.dataset.expired||"已结束";return}var d=Math.floor(diff/864e5),h=Math.floor(diff%864e5/36e5),m=Math.floor(diff%864e5/6e4),s=Math.floor(diff%6e4/1e3),format=el.dataset.format||"dhms";format==="dhms"?el.textContent=(d>0?d+"天 ":"")+pad(h)+":"+pad(m)+":"+pad(s):format==="hms"?el.textContent=pad(h+d*24)+":"+pad(m)+":"+pad(s):el.textContent=(d>0?d+"天 ":"")+pad(h)+"时"+pad(m)+"分"+pad(s)+"秒"}els.forEach(function(el){el.dataset.aksrtCountdownInit="1",update(el),setInterval(function(){update(el)},1e3)})}function initTilt(){reducedMotion||document.querySelectorAll("[data-aksrt-tilt]").forEach(function(el){if(!el.dataset.tiltBound){el.dataset.tiltBound="1";var maxDeg=parseFloat(el.dataset.tiltMax||"10"),perspective=parseFloat(el.dataset.tiltPerspective||"800"),scale=parseFloat(el.dataset.tiltScale||"1.03"),glare=el.dataset.tiltGlare==="1",glareEl=null;glare&&(glareEl=document.createElement("div"),glareEl.style.cssText="position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(135deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.25) 100%);opacity:0;transition:opacity 0.2s;",el.style.position=el.style.position||"relative",el.style.overflow="hidden",el.appendChild(glareEl)),el.addEventListener("mousemove",function(e){var rect=el.getBoundingClientRect(),x=(e.clientX-rect.left)/rect.width,y=(e.clientY-rect.top)/rect.height,rotateX=(.5-y)*maxDeg,rotateY=(x-.5)*maxDeg;el.style.transform="perspective("+perspective+"px) rotateX("+rotateX+"deg) rotateY("+rotateY+"deg) scale3d("+scale+","+scale+","+scale+")",glareEl&&(glareEl.style.opacity="1")}),el.addEventListener("mouseleave",function(){el.style.transform="perspective("+perspective+"px) rotateX(0deg) rotateY(0deg) scale3d(1,1,1)",glareEl&&(glareEl.style.opacity="0")})}})}var fpsDetected=!1;function initFpsDetection(){if(fpsDetected||!("requestAnimationFrame"in window))return;fpsDetected=!0;var frames=0,startTime=performance.now();function countFrames(){frames++;var elapsed=performance.now()-startTime;if(elapsed>=1e3){var fps=Math.round(frames*1e3/elapsed);fps<24&&document.body.classList.add("fps-accelerat");return}requestAnimationFrame(countFrames)}requestAnimationFrame(countFrames)}function init(){initCountUp(),initCountdown(),typeof initMarquee=="function"&&initMarquee(),initTilt(),initFpsDetection()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init)})(),(function(){"use strict";var TOKEN_FIELDS=Object.freeze(["captcha_verified","aksrt_captcha_challenge","aksrt_captcha_proof","cf_turnstile_response","tencent_ticket","tencent_randstr","geetest_lot_number","geetest_captcha_output","geetest_pass_token","geetest_gen_time","aliyun_captcha_verify_param"]),loaders={},instances={},scenes={};function asElement(scope){if(!scope)return null;if(scope.nodeType===1||scope.nodeType===9)return scope;if(typeof scope!="string")return null;if(instances[scope])return instances[scope].box;try{return document.querySelector(scope)}catch{return null}}function scopeBoundary(box,config){if(config.scope)try{var configured=document.querySelector(config.scope);if(configured)return configured}catch{}return box.closest("[data-aksrt-captcha-scope], form, [data-aksrt-download-box], [data-aksrt-auth], .aksrt-modal, [data-signin-captcha], #comments")||box.parentElement}function register(instance){instances[instance.uid]=instance,scenes[instance.scene]=scenes[instance.scene]||[],scenes[instance.scene].indexOf(instance)===-1&&scenes[instance.scene].push(instance)}function resolve(scene,scope){if(scan(),typeof scope=="string"&&instances[scope]&&instances[scope].scene===scene)return instances[scope];var candidates=scenes[scene]||[],element=asElement(scope);if(element&&element.getAttribute){var uid=element.getAttribute("data-aksrt-captcha-uid")||element.getAttribute("data-captcha-uid");if(uid&&instances[uid]&&instances[uid].scene===scene)return instances[uid]}if(!element)return scope?null:candidates.length===1?candidates[0]:null;var matches=candidates.filter(function(instance){var boundary=instance.scope;return element===instance.box||element===instance.mount||element===boundary||instance.box.contains(element)||instance.mount.contains(element)||boundary&&boundary.contains(element)||element.contains&&(element.contains(instance.box)||boundary&&element.contains(boundary))});return matches.length===1?matches[0]:matches.length?(matches.sort(function(a,b){return a.scope===b.scope?0:a.scope&&b.scope&&a.scope.contains(b.scope)?1:a.scope&&b.scope&&b.scope.contains(a.scope)?-1:0}),matches[0]):null}function verify(scene,scope){var instance=resolve(scene,scope);return instance?instance.verify():Promise.resolve(!0)}function collect(scene,scope){var instance=resolve(scene,scope);return instance?instance.collect():{}}function reset(scene,scope){var instance=resolve(scene,scope);instance&&instance.reset()}function releaseRunLock(instance){instance.runLocked=!1;var waiters=instance.lockWaiters.slice();instance.lockWaiters=[],waiters.forEach(function(resolveWaiter){resolveWaiter(null)})}function run(scene,scope){var instance=resolve(scene,scope);return instance?instance.runLocked?new Promise(function(resolveWaiter){instance.lockWaiters.push(resolveWaiter)}):(instance.runLocked=!0,instance.verify().then(function(passed){return passed||releaseRunLock(instance),passed?instance.collect():null}).catch(function(error){throw releaseRunLock(instance),error})):Promise.resolve({})}window.AKSRTCaptcha=Object.freeze({verify,collect,reset,run,TOKEN_FIELDS});function scan(){var mounts=document.querySelectorAll("[data-aksrt-captcha-config]");Array.prototype.forEach.call(mounts,function(mount){if(!mount.dataset.aksrtCaptchaBound){var config;try{config=JSON.parse(mount.getAttribute("data-aksrt-captcha-config"))}catch{return}!config||!config.scene||!config.uid||!config.vid||(mount.dataset.aksrtCaptchaBound="1",initMount(config,mount))}})}function initMount(C,mount){var box=document.getElementById(C.uid),hField=document.getElementById(C.vid);if(!box||!hField)return;var container=box.closest("form")||mount;mount.setAttribute("data-aksrt-captcha-uid",C.uid);var verified=!1,pending=[],refreshingChallenge=null,providerReset=function(){},triggerCaptcha=function(){showTip("验证码加载中,请稍候","#e67e22"),finishPending(!1)};function loadScriptOnce(key,src,readyCheck){return typeof readyCheck=="function"&&readyCheck()?Promise.resolve():(loaders[key]||(loaders[key]=new Promise(function(resolveLoad,rejectLoad){var existing=document.querySelector('script[data-aksrt-sdk="'+key+'"]');if(existing){if(typeof readyCheck=="function"&&readyCheck()){resolveLoad();return}existing.addEventListener("load",resolveLoad,{once:!0}),existing.addEventListener("error",function(){rejectLoad(new Error(key+" load failed"))},{once:!0});return}var script=document.createElement("script");script.src=src,script.async=!0,script.setAttribute("data-aksrt-sdk",key),script.onload=resolveLoad,script.onerror=function(){rejectLoad(new Error(key+" load failed"))},document.head.appendChild(script)})),loaders[key])}function setField(name,value){var field=container.querySelector('input[name="'+name+'"]');field||(field=document.createElement("input"),field.type="hidden",field.name=name,container.appendChild(field)),field.value=value??""}function collectFields(){var payload={};return TOKEN_FIELDS.forEach(function(name){var field=container.querySelector('input[name="'+name+'"]');field&&field.value!==""&&(payload[name]=field.value)}),payload}function refreshChallenge(){return!C.challenge_url||typeof window.fetch!="function"?Promise.resolve():refreshingChallenge||(refreshingChallenge=window.fetch(C.challenge_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({scene:C.scene})}).then(function(response){return response.json().catch(function(){return{}}).then(function(body){if(!response.ok||!body||body.success===!1)throw new Error(body.message||"challenge refresh failed");var data=body.data||body;if(!data.challenge)throw new Error("challenge missing");setField("aksrt_captcha_challenge",data.challenge)})}).catch(function(){showTip("无法刷新人机验证会话,请刷新页面重试","#e74c3c")}).finally(function(){refreshingChallenge=null}),refreshingChallenge)}function clearProviderTokens(){TOKEN_FIELDS.forEach(function(name){name==="captcha_verified"||name==="aksrt_captcha_challenge"||name==="aksrt_captcha_proof"||Array.prototype.forEach.call(container.querySelectorAll('input[name="'+name+'"]'),function(field){field.remove()})})}function resetVerificationState(){verified=!1,releaseRunLock(instance),hField.value="0",setField("aksrt_captcha_proof",""),clearProviderTokens();try{providerReset()}catch{}refreshChallenge()}function finishPending(ok){var callbacks=pending.slice();pending=[],callbacks.forEach(function(callback){callback(!!ok)})}function cancelPending(message){message&&showTip(message,"#e67e22"),finishPending(!1)}function providerPayload(){var payload=collectFields();return payload.scene=C.scene,payload}function exchangeVerification(){if(!C.exchange_url||typeof window.fetch!="function"){cancelPending("人机验证服务不可用,请刷新页面重试");return}window.fetch(C.exchange_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(providerPayload())}).then(function(response){return response.json().catch(function(){return{}}).then(function(body){if(!response.ok||!body||body.success===!1)throw new Error(body.message||"人机验证失败");var data=body.data||body;if(!data.proof)throw new Error("人机验证凭证缺失");setField("aksrt_captcha_proof",data.proof),clearProviderTokens(),completeVerification()})}).catch(function(error){cancelPending(error.message||"人机验证失败,请重试"),resetVerificationState()})}function completeProviderVerification(){hField.value="1",exchangeVerification()}function completeVerification(){verified=!0,hField.value="1",finishPending(!0)}function showTip(message,color){var tip=box.querySelector(".captcha-tip");tip||(tip=document.createElement("div"),tip.className="captcha-tip",tip.style.cssText="font-size:12px;margin-top:4px;text-align:left;",box.appendChild(tip)),tip.style.color=color||"#e74c3c",tip.textContent=message,setTimeout(function(){tip.parentNode&&tip.remove()},4e3)}function showLoading(){box.innerHTML='
验证码加载中...
'}function clearLoading(){box.innerHTML=""}var instance={uid:C.uid,scene:C.scene,box,mount,scope:scopeBoundary(box,C),runLocked:!1,lockWaiters:[],collect:collectFields,reset:resetVerificationState,verify:function(){var challengeField=container.querySelector('input[name="aksrt_captcha_challenge"]'),preparation=challengeField&&challengeField.value?Promise.resolve():refreshChallenge();return preparation.then(function(){return challengeField=container.querySelector('input[name="aksrt_captcha_challenge"]'),!challengeField||!challengeField.value?(showTip("人机验证会话未就绪,请稍后重试","#e74c3c"),!1):verified||hField.value==="1"?!0:new Promise(function(resolveVerify){pending.push(resolveVerify),pending.length===1&&triggerCaptcha()})})}};register(instance),refreshingChallenge=refreshChallenge();function loadTencent(){showLoading(),loadScriptOnce("tencent","https://turing.captcha.qcloud.com/TJCaptcha.js",function(){return typeof window.TencentCaptcha<"u"}).then(function(){clearLoading();var captchaInstance=null;triggerCaptcha=function(){captchaInstance||(captchaInstance=new window.TencentCaptcha(C.tc.app_id,function(result){if(result.ret===2){cancelPending("已取消验证");return}if(result.ret===0&&result.ticket){if(result.ticket.indexOf("trerror_")===0){cancelPending("验证码服务异常,请刷新页面重试");return}setField("tencent_ticket",result.ticket),setField("tencent_randstr",result.randstr),completeProviderVerification();return}var errorMap={1001:"验证码组件加载失败",1002:"验证码超时",1006:"验证码配置拉取失败",1008:"验证码页面加载异常",1012:"验证码刷新次数过多",1013:"验证码网络异常"};cancelPending(errorMap[result.errorCode]||"验证码异常,请重试")},{userLanguage:"zh-cn"})),captchaInstance.show()}}).catch(function(){clearLoading(),cancelPending("验证码组件加载失败,请刷新重试")})}function loadCloudflare(){var widgetId=null,verifying=!1,modal=null;function closeModal(){if(widgetId!==null&&typeof window.turnstile<"u")try{window.turnstile.remove(widgetId)}catch{}widgetId=null,modal&&modal.parentNode&&modal.parentNode.removeChild(modal),modal=null}function renderWidget(){if(typeof window.turnstile>"u"){setTimeout(renderWidget,200);return}widgetId=window.turnstile.render("#modalWidget_"+C.uid,{sitekey:C.cf.site_key,theme:C.cf.theme,size:C.cf.size,action:"aksrt-verify",cdata:C.scene,callback:function(token){verifying&&(verifying=!1,setField("cf_turnstile_response",token),closeModal(),completeProviderVerification())},"error-callback":function(){verifying=!1,closeModal(),cancelPending("验证码失败,请重试")},"expired-callback":function(){verifying=!1,closeModal(),cancelPending("验证码已过期,请重新验证")}})}function createModal(){modal=document.createElement("div"),modal.className="aksrt-captcha-modal-overlay",modal.innerHTML='
人机验证

请完成验证后继续操作

',document.body.appendChild(modal);var cancel=function(){verifying=!1,closeModal(),cancelPending("已取消验证")};modal.querySelector(".aksrt-captcha-modal-backdrop").addEventListener("click",cancel),modal.querySelector(".aksrt-captcha-modal-close").addEventListener("click",cancel),renderWidget()}window["onTurnstileLoad_"+C.uid]=function(){},typeof window.turnstile>"u"&&loadScriptOnce("cloudflare","https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onTurnstileLoad_"+C.uid+"&render=explicit",function(){return typeof window.turnstile<"u"}).catch(function(){cancelPending("验证码组件加载失败,请刷新重试")}),triggerCaptcha=function(){verifying||(verifying=!0,createModal())},providerReset=closeModal}function loadGeetest(){showLoading();var captchaId=C.gt&&C.gt.captcha_id?String(C.gt.captcha_id).trim():"",product=C.gt&&C.gt.product?String(C.gt.product):"bind";if(!captchaId){clearLoading(),cancelPending("极验 Captcha ID 未配置");return}function render(){clearLoading(),window.initGeetest4({captchaId,product,hideSuccess:!0},function(captchaInstance){function onSuccess(){var result=captchaInstance.getValidate();if(!result){cancelPending("验证码失败,请重试");return}setField("geetest_lot_number",result.lot_number),setField("geetest_captcha_output",result.captcha_output),setField("geetest_pass_token",result.pass_token),setField("geetest_gen_time",result.gen_time),completeProviderVerification()}captchaInstance.onReady(function(){}).onSuccess(onSuccess).onClose(function(){cancelPending("已取消验证")}),product!=="bind"&&product!=="popup"&&captchaInstance.appendTo("#"+C.uid),triggerCaptcha=function(){product==="bind"||product==="popup"?captchaInstance.showCaptcha():showTip("请先完成人机验证","#e67e22")},providerReset=function(){typeof captchaInstance.reset=="function"&&captchaInstance.reset()}})}typeof window.initGeetest4>"u"?loadScriptOnce("geetest","https://static.geetest.com/v4/gt4.js",function(){return typeof window.initGeetest4<"u"}).then(render).catch(function(){clearLoading(),cancelPending("极验组件加载失败")}):render()}function loadAliyun(){showLoading(),window.AliyunCaptchaConfig={region:C.al.region||"cn",prefix:C.al.prefix};function render(){clearLoading();var captchaInstance=null;window.initAliyunCaptcha({SceneId:C.al.scene_id,mode:"popup",element:"#"+C.uid,success:function(verifyParam){setField("aliyun_captcha_verify_param",verifyParam),completeProviderVerification()},fail:function(){cancelPending("验证码失败,请重试")},getInstance:function(value){captchaInstance=value},slideStyle:{width:360,height:40},language:"cn"}),triggerCaptcha=function(){captchaInstance&&captchaInstance.show?captchaInstance.show():cancelPending("验证码组件加载中,请稍候再试")},providerReset=function(){captchaInstance&&typeof captchaInstance.reset=="function"&&captchaInstance.reset()}}typeof window.initAliyunCaptcha>"u"?loadScriptOnce("aliyun","https://o.alicdn.com/captcha-frontend/aliyunCaptcha/AliyunCaptcha.js",function(){return typeof window.initAliyunCaptcha<"u"}).then(render).catch(function(){clearLoading(),cancelPending("验证码组件加载失败,请刷新重试")}):render()}switch(C.provider){case"tencent":loadTencent();break;case"cloudflare":loadCloudflare();break;case"geetest":loadGeetest();break;case"aliyun":loadAliyun();break}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",scan):setTimeout(scan,0),window.jQuery&&window.jQuery(document).on("auto_fun",scan),window.MutationObserver&&new MutationObserver(function(mutations){var shouldScan=mutations.some(function(mutation){return mutation.addedNodes&&mutation.addedNodes.length});shouldScan&&scan()}).observe(document.documentElement,{childList:!0,subtree:!0})})(),(function(){"use strict";if("connection"in navigator){var conn=navigator.connection;if(conn.saveData||conn.effectiveType&&conn.effectiveType.indexOf("2g")!==-1)return}var hasHoverSupport=window.matchMedia("(hover: hover) and (pointer: fine)").matches;if(!hasHoverSupport)return;var prefetcher=document.createElement("link"),isPrefetched={},timer=null,DELAY=65,MAX_PREFETCH=3,prefetchedCount=0;if(!prefetcher.relList||!prefetcher.relList.supports||!prefetcher.relList.supports("prefetch"))return;function prefetch(url){if(!(isPrefetched[url]||prefetchedCount>=MAX_PREFETCH)&&url.indexOf("#")===-1){try{var link=new URL(url,window.location.origin);if(link.origin!==window.location.origin||link.pathname===window.location.pathname&&link.search===window.location.search)return}catch{return}if(!/\.(pdf|zip|rar|7z|tar|gz|exe|dmg|apk|mp[34]|avi|mov|wmv|flv|webm|ogg|wav|bmp|gif|ico|svg|woff2?|ttf|eot)(\?|$)/i.test(url)){isPrefetched[url]=!0,prefetchedCount++;var linkEl=document.createElement("link");linkEl.rel="prefetch",linkEl.href=url,linkEl.as="document",document.head.appendChild(linkEl)}}}function onHoverStart(e){var link=e.target.closest("a");!link||!link.href||link.target!=="_blank"&&(link.hasAttribute("download")||link.getAttribute("rel")!=="nofollow"&&(link.closest(".no-prefetch,[data-no-prefetch]")||(clearTimeout(timer),timer=setTimeout(function(){prefetch(link.href)},DELAY))))}function onHoverEnd(){clearTimeout(timer)}document.addEventListener("mouseover",onHoverStart,{passive:!0,capture:!0}),document.addEventListener("mouseout",onHoverEnd,{passive:!0,capture:!0}),document.addEventListener("focusin",function(e){var link=e.target.closest("a");link&&link.href&&prefetch(link.href)},{passive:!0,capture:!0}),window.addEventListener("pagehide",function(){isPrefetched={},prefetchedCount=0})})(),jQuery.cookie=function(e,o,t){if(o===void 0){var i=null;if(document.cookie&&document.cookie!="")for(var r=document.cookie.split(";"),n=0;n-1||text.indexOf("致命错误")>-1)}function aksrt_sprintf(key){var args=Array.prototype.slice.call(arguments,1),str=aksrt__(key),autoIndex=0;return str.replace(/%(\d+\$)?s/g,function(match,num){var idx=num?parseInt(num,10)-1:autoIndex++;return args[idx]!==void 0&&args[idx]!==null?args[idx]:match})}(function(window2,factory){var lazySizes2=factory(window2,window2.document,Date);window2.lazySizes=lazySizes2,typeof module=="object"&&module.exports&&(module.exports=lazySizes2)})(typeof window<"u"?window:{},function(window2,document2,Date2){"use strict";var lazysizes,lazySizesCfg;if((function(){var prop,lazySizesDefaults={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",loadafterClass:"lazyloadafter",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};lazySizesCfg=window2.lazySizesConfig||window2.lazysizesConfig||{};for(prop in lazySizesDefaults)prop in lazySizesCfg||(lazySizesCfg[prop]=lazySizesDefaults[prop])})(),!document2||!document2.getElementsByClassName)return{init:function(){},cfg:lazySizesCfg,noSupport:!0};var docElem=document2.documentElement,supportPicture=window2.HTMLPictureElement,_addEventListener="addEventListener",_getAttribute="getAttribute",addEventListener=window2[_addEventListener].bind(window2),setTimeout2=window2.setTimeout,requestAnimationFrame2=window2.requestAnimationFrame||setTimeout2,requestIdleCallback=window2.requestIdleCallback,regPicture=/^picture$/i,loadEvents=["load","error","lazyincluded","_lazyloaded"],regClassCache={},forEach=Array.prototype.forEach,hasClass=function(ele,cls){return regClassCache[cls]||(regClassCache[cls]=new RegExp("(\\s|^)"+cls+"(\\s|$)")),regClassCache[cls].test(ele[_getAttribute]("class")||"")&®ClassCache[cls]},addClass=function(ele,cls){hasClass(ele,cls)||ele.setAttribute("class",(ele[_getAttribute]("class")||"").trim()+" "+cls)},removeClass=function(ele,cls){var reg2;(reg2=hasClass(ele,cls))&&ele.setAttribute("class",(ele[_getAttribute]("class")||"").replace(reg2," "))},addRemoveLoadEvents=function(dom,fn,add){var action=add?_addEventListener:"removeEventListener";add&&addRemoveLoadEvents(dom,fn),loadEvents.forEach(function(evt){dom[action](evt,fn)})},triggerEvent=function(elem,name,detail,noBubbles,noCancelable){var event=document2.createEvent("Event");return detail||(detail={}),detail.instance=lazysizes,event.initEvent(name,!noBubbles,!noCancelable),event.detail=detail,elem.dispatchEvent(event),event},updatePolyfill=function(el,full){var polyfill;!supportPicture&&(polyfill=window2.picturefill||lazySizesCfg.pf)?(full&&full.src&&!el[_getAttribute]("srcset")&&el.setAttribute("srcset",full.src),polyfill({reevaluate:!0,elements:[el]})):full&&full.src&&(el.src=full.src)},getCSS=function(elem,style){return(getComputedStyle(elem,null)||{})[style]},getWidth=function(elem,parent,width){for(width=width||elem.offsetWidth;width49?function(){requestIdleCallback(run,{timeout:rICTimeout}),rICTimeout!==lazySizesCfg.ricTimeout&&(rICTimeout=lazySizesCfg.ricTimeout)}:rAFIt(function(){setTimeout2(run)},!0);return function(isPriority){var delay;(isPriority=isPriority===!0)&&(rICTimeout=33),!running&&(running=!0,delay=gDelay-(Date2.now()-lastTime),delay<0&&(delay=0),isPriority||delay<9?idleCallback():setTimeout2(idleCallback,delay))}},debounce2=function(func){var timeout,timestamp,wait=99,run=function(){timeout=null,func()},later=function(){var last=Date2.now()-timestamp;last0,visible&&getCSS(parent,"overflow")!="visible"&&(outerRect=parent.getBoundingClientRect(),visible=eLright>outerRect.left&&eLleftouterRect.top-1&&eLtop500&&docElem.clientWidth>500?500:370:lazySizesCfg.expand,lazysizes._defEx=defaultExpand,preloadExpand=defaultExpand*lazySizesCfg.expFactor,hFac=lazySizesCfg.hFac,isBodyHidden=null,currentExpand2&&loadMode>2&&!document2.hidden?(currentExpand=preloadExpand,lowRuns=0):loadMode>1&&lowRuns>1&&isLoading<6?currentExpand=defaultExpand:currentExpand=shrinkExpand),beforeExpandVal!==elemExpand&&(eLvW=innerWidth+elemExpand*hFac,elvH=innerHeight+elemExpand,elemNegativeExpand=elemExpand*-1,beforeExpandVal=elemExpand),rect=lazyloadElems[i].getBoundingClientRect(),(eLbottom=rect.bottom)>=elemNegativeExpand&&(eLtop=rect.top)<=elvH&&(eLright=rect.right)>=elemNegativeExpand*hFac&&(eLleft=rect.left)<=eLvW&&(eLbottom||eLright||eLleft||eLtop)&&(lazySizesCfg.loadHidden||isVisible(lazyloadElems[i]))&&(isCompleted&&isLoading<3&&!elemExpandVal&&(loadMode<3||lowRuns<4)||isNestedVisible(lazyloadElems[i],elemExpand))){if(unveilElement(lazyloadElems[i]),loadedSomething=!0,isLoading>9)break}else!loadedSomething&&isCompleted&&!autoLoadElem&&isLoading<4&&lowRuns<4&&loadMode>2&&(preloadElems[0]||lazySizesCfg.preloadAfterLoad)&&(preloadElems[0]||!elemExpandVal&&(eLbottom||eLright||eLleft||eLtop||lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr)!="auto"))&&(autoLoadElem=preloadElems[0]||lazyloadElems[i])}autoLoadElem&&!loadedSomething&&unveilElement(autoLoadElem)}},throttledCheckElements=throttle2(checkElements),switchLoadingClass=function(e){var elem=e.target;if(elem._lazyCache){delete elem._lazyCache;return}resetPreloading(e),addClass(elem,lazySizesCfg.loadedClass),removeClass(elem,lazySizesCfg.loadingClass),addRemoveLoadEvents(elem,rafSwitchLoadingClass),triggerEvent(elem,"lazyloaded"),setTimeout2(function(){addClass(elem,lazySizesCfg.loadafterClass)},700)},rafedSwitchLoadingClass=rAFIt(switchLoadingClass),rafSwitchLoadingClass=function(e){rafedSwitchLoadingClass({target:e.target})},changeIframeSrc=function(elem,src){try{elem.contentWindow.location.replace(src)}catch{elem.src=src}},handleSources=function(source){var customMedia,sourceSrcset=source[_getAttribute](lazySizesCfg.srcsetAttr);(customMedia=lazySizesCfg.customMedia[source[_getAttribute]("data-media")||source[_getAttribute]("media")])&&source.setAttribute("media",customMedia),sourceSrcset&&source.setAttribute("srcset",sourceSrcset)},lazyUnveil=rAFIt(function(elem,detail,isAuto,sizes,isImg){var src,srcset,parent,isPicture,event,firesLoad;(event=triggerEvent(elem,"lazybeforeunveil",detail)).defaultPrevented||(sizes&&(isAuto?addClass(elem,lazySizesCfg.autosizesClass):elem.setAttribute("sizes",sizes)),srcset=elem[_getAttribute](lazySizesCfg.srcsetAttr),src=elem[_getAttribute](lazySizesCfg.srcAttr),isImg&&(parent=elem.parentNode,isPicture=parent&®Picture.test(parent.nodeName||"")),firesLoad=detail.firesLoad||"src"in elem&&(srcset||src||isPicture),event={target:elem},addClass(elem,lazySizesCfg.loadingClass),firesLoad&&(clearTimeout(resetPreloadingTimer),resetPreloadingTimer=setTimeout2(resetPreloading,2500),addRemoveLoadEvents(elem,rafSwitchLoadingClass,!0)),isPicture&&forEach.call(parent.getElementsByTagName("source"),handleSources),srcset?elem.setAttribute("srcset",srcset):src&&!isPicture&&(regIframe.test(elem.nodeName)?changeIframeSrc(elem,src):elem.src=src),isImg&&(srcset||isPicture)&&updatePolyfill(elem,{src})),elem._lazyRace&&delete elem._lazyRace,removeClass(elem,lazySizesCfg.lazyClass),rAF(function(){var isLoaded=elem.complete&&elem.naturalWidth>1;(!firesLoad||isLoaded)&&(isLoaded&&addClass(elem,"ls-is-cached"),switchLoadingClass(event),elem._lazyCache=!0,setTimeout2(function(){"_lazyCache"in elem&&delete elem._lazyCache},9)),elem.loading=="lazy"&&isLoading--},!0)}),unveilElement=function(elem){if(!elem._lazyRace){var detail,isImg=regImg.test(elem.nodeName),sizes=isImg&&(elem[_getAttribute](lazySizesCfg.sizesAttr)||elem[_getAttribute]("sizes")),isAuto=sizes=="auto";(isAuto||!isCompleted)&&isImg&&(elem[_getAttribute]("src")||elem.srcset)&&!elem.complete&&!hasClass(elem,lazySizesCfg.errorClass)&&hasClass(elem,lazySizesCfg.lazyClass)||(detail=triggerEvent(elem,"lazyunveilread").detail,isAuto&&autoSizer.updateElem(elem,!0,elem.offsetWidth),elem._lazyRace=!0,isLoading++,lazyUnveil(elem,detail,isAuto,sizes,isImg))}},afterScroll=debounce2(function(){lazySizesCfg.loadMode=3,throttledCheckElements()}),altLoadmodeScrollListner=function(){lazySizesCfg.loadMode==3&&(lazySizesCfg.loadMode=2),afterScroll()},onload=function(){if(!isCompleted){if(Date2.now()-started<999){setTimeout2(onload,999);return}isCompleted=!0,lazySizesCfg.loadMode=3,throttledCheckElements(),addEventListener("scroll",altLoadmodeScrollListner,!0)}};return{_:function(){started=Date2.now(),lazysizes.elements=document2.getElementsByClassName(lazySizesCfg.lazyClass),preloadElems=document2.getElementsByClassName(lazySizesCfg.lazyClass+" "+lazySizesCfg.preloadClass),addEventListener("scroll",throttledCheckElements,!0),addEventListener("resize",throttledCheckElements,!0),addEventListener("pageshow",function(e){if(e.persisted){var loadingElements=document2.querySelectorAll("."+lazySizesCfg.loadingClass);loadingElements.length&&loadingElements.forEach&&requestAnimationFrame2(function(){loadingElements.forEach(function(img){img.complete&&unveilElement(img)})})}}),window2.MutationObserver?new MutationObserver(throttledCheckElements).observe(docElem,{childList:!0,subtree:!0,attributes:!0}):(docElem[_addEventListener]("DOMNodeInserted",throttledCheckElements,!0),docElem[_addEventListener]("DOMAttrModified",throttledCheckElements,!0),setInterval(throttledCheckElements,999)),addEventListener("hashchange",throttledCheckElements,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(name){document2[_addEventListener](name,throttledCheckElements,!0)}),/d$|^c/.test(document2.readyState)?onload():(addEventListener("load",onload),document2[_addEventListener]("DOMContentLoaded",throttledCheckElements),setTimeout2(onload,2e4)),lazysizes.elements.length?(checkElements(),rAF._lsFlush()):throttledCheckElements()},checkElems:throttledCheckElements,unveil:unveilElement,_aLSL:altLoadmodeScrollListner}})(),autoSizer=(function(){var autosizesElems,sizeElement=rAFIt(function(elem,parent,event,width){var sources,i,len;if(elem._lazysizesWidth=width,width+="px",elem.setAttribute("sizes",width),regPicture.test(parent.nodeName||""))for(sources=parent.getElementsByTagName("source"),i=0,len=sources.length;i-40&&angle<40&&distanceX>0?distanceX:0),options.direction=="left"&&(distanceY=0,distanceX=(angle>150||angle<-150)&&0>distanceX?distanceX:0),options.direction=="top"&&(distanceX=0,distanceY=angle>-130&&angle<-50&&0>distanceY?distanceY:0),options.direction=="bottom"&&(distanceX=0,distanceY=angle>50&&angle<130&&distanceY>0?distanceY:0),(distanceX!==0||distanceY!==0)&&(a.preventDefault?a.preventDefault():a.returnValue=!1,cssTransition(_move,distanceX,distanceY,dragging,"grab"),jQuery.isFunction(options.onIng)&&options.onIng(_e,_move,distanceX,distanceY)))}).on("touchend touchcancel pointerup MSPointerUp",touch_selector,function(){var _move=options.start_selector?options.selector?_e.find(options.selector):_e.find(options.start_selector):jQuery(this);dragging&&!is_stop&&(cssTransition(_move,0,0,"null",""),jQuery.isFunction(options.inEnd)&&options.inEnd(_e,_move,distanceX,distanceY),(Math.abs(distanceX)>dep||Math.abs(distanceY)>dep)&&jQuery.isFunction(options.onEnd)&&options.onEnd(_e,_move,distanceX,distanceY),startX=startY=endX=endY=angle=distanceX=distanceY=0,dragging=!1)}).data(is_on,!0)}},_win.bd=jQuery("body"),_win.window=jQuery(window),_win.is_signin=!!_win.bd.hasClass("logged-in");var _wid=_win.window.width(),_hei=_win.window.height();_win.bd.on("click","[data-close]",function(){var e=jQuery(this).attr("data-close");return jQuery(e).removeClass("show in"),!1}),_win.bd.on("click","[data-toggle-class]",function(){var c=jQuery(this).attr("data-toggle-class")||"show",e=jQuery(this).attr("data-target")||this;return jQuery(e).toggleClass(c).trigger("toggleClass"),!1}),_win.bd.on("click",only_drop),_win.bd.on("toggleClass",".dropup,.dropdown",only_drop);function only_drop(e){var drop=jQuery(e.target).closest(".dropup,.dropdown");jQuery(".dropup.open,.dropdown.open").not(drop).removeClass("open")}_win.bd.on("click",".alert-dismissible > .close",function(){jQuery(this).parent().slideUp()}),_win.bd.on("click","[data-onclick]",function(){var e=jQuery(this).attr("data-onclick");return jQuery(e).click()}),jQuery.fn.OnlyOn=function(type,selector,data,fun){var rnotwhite=/\S+/g,is_oned=!1;type=type.match(rnotwhite)[0];var events=jQuery._data(this[0],"events");events&&typeof events.type<"u"&&jQuery.each(events[type],function(i,item){if(item.selector==selector&&item.data==data)return is_oned=!0,!1}),is_oned?console.log("事件重复绑定{type:"+type+",selector:"+selector+",data:"+data+"}"):this.on(type,selector,data,fun)},jQuery.fn.aksrt_ajax=function(data,success,noty,no_loading){return aksrt_ajax(jQuery(this),data,success,noty,no_loading)},jQuery.fn.countdown=function(){function getTimeRemaining(endtime,max_unit){var date=new Date,now=date.getTime(),endDate=new Date(endtime),end=endDate.getTime(),total=end-now,seconds=total/1e3%60;seconds=seconds.toFixed(2);var mseconds=~~(total%1e3),minutes=~~(total/1e3/60%60),hours=~~(total/(1e3*60*60)%24),days=~~(total/(1e3*60*60*24));return max_unit==="minute"&&minutes>0&&(hours=0,days=0,minutes=~~(total/1e3/60)),max_unit==="hour"&&hours>0&&(days=0,hours=~~(total/(1e3*60*60))),seconds=seconds<10?"0"+seconds:seconds,minutes=minutes<10?"0"+minutes:minutes,{total,days,hours,minutes,seconds,mseconds}}jQuery(this).each(function(){var _this=jQuery(this),endtime=_this.attr("data-countdown");if(!endtime)return;var int_second=_this.attr("int-second"),max_unit=_this.attr("max-unit");if(_this.attr("title",aksrt__("countdown_end_time")+endtime),int_second==="auto"){var t=getTimeRemaining(endtime,max_unit);int_second=t.days>0}function updateClock(){var t2=getTimeRemaining(endtime,max_unit);if(int_second&&(t2.seconds=t2.seconds.toString().replace(/\.\d+$/,"")),_this.find(".day").length&&_this.find(".day").html(t2.days),_this.find(".hour").length&&_this.find(".hour").html(t2.hours),_this.find(".minute").length&&_this.find(".minute").html(t2.minutes),_this.find(".second").length)_this.find(".second").html(t2.seconds);else{var html="";t2.days>0&&(html+=''+t2.days+''+aksrt__("countdown_day")+""),(t2.hours>0||t2.days>0)&&(html+=''+t2.hours+''+aksrt__("countdown_hour")+""),(t2.minutes>0||t2.hours>0||t2.days>0)&&(html+=''+t2.minutes+''+aksrt__("countdown_minute")+""),html+=''+t2.seconds+''+aksrt__("countdown_second")+"",_this.html(html)}if(t2.total<=0){clearInterval(timeinterval);var over_text=_this.attr("data-over-text")||aksrt__("countdown_ended");_this.html(over_text).trigger("countdown-over")}}updateClock();var timeinterval=setInterval(updateClock,int_second?1e3:20);_this.removeAttr("data-countdown").addClass("countdown-box")})},_win.dplayer={tbquire:["dplayer"],obj:{}};function new_dplayer(){var selector=".new-dplayer:not(.dplayer-initialized),[data-dplayer]:not(.dplayer-initialized)";jQuery(selector).length&&jQuery(selector).each(function(){var _this=jQuery(this);get_new_dplayer(_this,function(dplayer){_this.addClass("dplayer-initialized").siblings(".dplayer-featured").find(".switch-video").each(function(){var _this2=jQuery(this),video_url=_this2.attr("video-url"),video_pic=_this2.attr("video-pic");_this2.data({"video-url":video_url,"video-pic":video_pic}),_this2.attr({"dplayer-id":dplayer.container.id}),setTimeout(function(){_this2.removeAttr("video-url").removeAttr("video-pic")},50)})})})}function get_new_dplayer(_this,func){var option={},video_url=_this.attr("video-url")||_this.data("video-url"),data_volume=_this.attr("data-volume"),i=parseInt((Math.random()+1)*Math.pow(10,4));if(!(_this.find(".dplayer-video-wrap").length||!video_url)){_this.attr("id","dplayer-"+i),option.container=document.getElementById("dplayer-"+i),option.theme="#f04494",option.video={url:video_url,pic:_this.attr("video-pic")||"",type:_this.attr("video-type")||"auto"},_this.attr("data-loop")&&(option.loop=!0),_this.attr("data-autoplay")&&(option.autoplay=!0),data_volume&&data_volume<1&&(option.volume=data_volume),data_volume==="none"&&(option.volume=0);var option_attr=_this.attr("video-option");if(option_attr){try{option_attr=JSON.parse(option_attr)}catch(e){console.log(e)}jQuery.extend(option,option_attr)}var v_u=video_url.toLowerCase();return v_u.indexOf(".m3u")!=-1&&_win.dplayer.tbquire.push("hls"),v_u.indexOf(".mpd")!=-1&&_win.dplayer.tbquire.push("dash"),v_u.indexOf(".flv")!=-1&&_win.dplayer.tbquire.push("flv"),jQuery("link#dplayer").length||jQuery("dplayer").append(''),_win.dplayer.tbquire.push("dplayer"),tbquire(_win.dplayer.tbquire,function(){try{var newDPlayer=new DPlayer(option);newDPlayer.on("play",function(){_win.dplayer.play=newDPlayer}),_this.data("dplayer",newDPlayer),_win.dplayer.obj[i]=newDPlayer,_this.attr({"video-url":"","video-pic":""}),jQuery.isFunction(func)&&func(newDPlayer)}catch(e){console.error(e)}}),i}}_win.bd.on("click",".swiper-slide.slide-dplayer:not(.slide-dplayer-played) > *",function(){var _this=jQuery(this),dplayer=_this.find(".new-dplayer").data("dplayer");dplayer&&(dplayer.play(),_this.parent().addClass("slide-dplayer-played"))});function thumb_dplayer(mouseenter_e,box_e){var $body=jQuery("body"),thumb_dplayer_data_text="thumb_dplayer_data",thumb_dplayer_data=$body.data(thumb_dplayer_data_text)||{};if(thumb_dplayer_data[mouseenter_e+box_e])return;var ing_class="thumb-dplayer-playing",thumb_hide_class="dplayer-thumb-hide";function to_play(_this_m,_this,dplayer){_this.find(".dplayer-thumb").removeClass(thumb_hide_class),_win.dplayer.thumb_play=dplayer,_this.find(".progress").show(),_this_m.addClass(ing_class)}function to_pause(_this_m,_this,dplayer){dplayer.pause(),_this.find(".dplayer-thumb").addClass(thumb_hide_class),_win.dplayer.thumb_play=!1,_this.find(".progress").hide(),_this_m.removeClass(ing_class)}function video_thumb_stop(){if(_win.dplayer.thumb_play){var _this=jQuery(_win.dplayer.thumb_play.container).closest(box_e),_this_m=_this.closest(mouseenter_e);to_pause(_this_m,_this,_win.dplayer.thumb_play)}}function video_thumb_play(){var _this_m=jQuery(this),_this=_this_m.find(box_e);if(!_this.length)return;var dplayer=_this.find(".dplayer-thumb").data("dplayer");if(dplayer)return to_play(_this_m,_this,dplayer),dplayer.play();function dplayer_init(dplayer2){dplayer2.on("loadeddata",function(){setTimeout(function(){_this.find(".progress-bar").css({width:"100%",opacity:"0",transition:"width .2s, opacity .3s .3s"})},100),setTimeout(function(){_this.find(".progress").remove()},800)}),setTimeout(function(){to_play(_this_m,_this,dplayer2),dplayer2.play()},200)}if(!_this.find(".dplayer-thumb").length){var video_url=_this.attr("video-url"),video_volume=_this.attr("data-volume")||"none",video_pic="",scale_height=~~_this.attr("scale-height"),progress='
',_dplayer=jQuery('
');_this.find(".video-thumb").html(_dplayer).after(progress),setTimeout(function(){_this.find(".progress-bar").css({transition:"width 6s",width:"80%"})},50),_this.attr("video-url",""),get_new_dplayer(_dplayer,dplayer_init)}}$body.on("mouseenter touchstart",mouseenter_e,video_thumb_play),$body.on("mouseleave",mouseenter_e,video_thumb_stop);var thumb_dplayer_init="thumb_dplayer_init";$body.data(thumb_dplayer_init)||$body.on("touchstart",function(e){var _target=jQuery(e.target);!_target.parents("."+ing_class).length&&_win.dplayer.thumb_play&&video_thumb_stop()}).data(thumb_dplayer_init,!0),thumb_dplayer_data[mouseenter_e+box_e]=!0,$body.data(thumb_dplayer_data_text,thumb_dplayer_data)}_win.bd.on("click",".switch-video",function(){var _this=jQuery(this),dplayer=jQuery("#"+_this.attr("dplayer-id")).data("dplayer"),video_url=_this.data("video-url"),video_pic=_this.data("video-pic");if(!(!video_url||!dplayer||_this.hasClass("active"))){_this.addClass("active").siblings().removeClass("active");var v_u=video_url.toLowerCase();v_u.indexOf(".m3u")!=-1&&_win.dplayer.tbquire.push("hls"),v_u.indexOf(".mpd")!=-1&&_win.dplayer.tbquire.push("dash"),v_u.indexOf(".flv")!=-1&&_win.dplayer.tbquire.push("flv"),tbquire(_win.dplayer.tbquire,function(){try{var op={url:video_url,type:"auto"};video_pic&&(op.pic=video_pic),dplayer.switchVideo(op),setTimeout(function(){dplayer.play()},100)}catch(e){console.log(e)}})}}),_win.bd.on("click",".switch-iframe",function(){var _this=jQuery(this),video_url=_this.attr("iframe-url"),$iframe=_this.closest(".iframe-series").find("iframe");if(!(!video_url||_this.hasClass("active"))){try{$iframe[0].contentWindow.location.replace(video_url)}catch{$iframe.attr("src",video_url)}_this.addClass("active").siblings().removeClass("active")}}),_win.bd.on("click",".file-download-btn",function(){var _this=jQuery(this),id=_this.attr("data-download-file"),nonce=_this.attr("download-nonce");if(_this.attr("target","_blank"),!!id){var href=_win.ajax_url+"?action=download_file&file="+id+"&nonce="+nonce;_this.attr("target","_blank").removeAttr("data-download-file").attr("href",href)}}),_win.bd.on("click",".post-tab-toggle",function(){var _this=jQuery(this),tab_id=_this.attr("tab-id");if(!_this.parent().hasClass("active")){var _con=_this.parent().addClass("active").siblings().removeClass("active").parent().next().find('[tab-id="'+tab_id+'"]');_con.siblings().removeClass("in"),setTimeout(function(){_con.addClass("active").siblings().removeClass("active")},150),setTimeout(function(){_con.addClass("in")},160)}}),_win.swiper=[],_win.swiper.tab={},_win.swiper.scroll={},_win.swiper.new={};function new_swiper(){jQuery(".swiper-scroll:not(.swiper-container-initialized),.new-swiper:not(.swiper-container-initialized),.swiper-tab:not(.swiper-container-initialized)").length&&(jQuery("link#swiper").length||jQuery("head").append(''),tbquire(["swiper"],function(){jQuery(".swiper-scroll").each(function(e){if(!jQuery(this).hasClass("swiper-container-initialized")){var option={},_this=jQuery(this),_eq="swiper-scroll-eq-"+e,slideClass=_this.attr("data-slideClass")||!1;if(slideClass&&(option.slideClass=slideClass),!_this.attr("scroll-nogroup")){var c_w=_this.width(),i_w=_this.find(".swiper-wrapper>*:eq(0)").outerWidth(),slidesPerGroup=~~(c_w/i_w);option.slidesPerGroup=slidesPerGroup||1}option.autoplay=_this.attr("data-autoplay")?{delay:~~_this.attr("data-interval")||4e3,disableOnInteraction:!1}:!1,option.loop=_this.attr("data-loop"),option.slidesPerView="auto",option.mousewheel={forceToAxis:!0},option.freeMode=!0,option.freeModeSticky=!0,option.navigation={nextEl:".swiper-scroll."+_eq+" .swiper-button-next",prevEl:".swiper-scroll."+_eq+" .swiper-button-prev"},_this.addClass(_eq).attr("swiper-scroll-index",e),_win.swiper.scroll[e]=new Swiper(".swiper-scroll."+_eq,option)}}),jQuery(".swiper-tab").each(function(e){if(!jQuery(this).hasClass("swiper-container-initialized")){var _eq="swiper-eq-"+e,_this=jQuery(this),speed=~~_this.attr("data-speed")||~~((_this.width()+1200)/170)*50,initialSlide=~~_this.attr("active-index");speed=speed<300?300:speed;var option={loop:!1,initialSlide,autoHeight:!0,spaceBetween:20,autoplay:!1,speed,pagination:{el:".swiper-tab."+_eq+" .swiper-pagination",clickable:!0},on:{init:function(){auto_maxHeight()},slideChangeTransitionEnd:function(bvv){var b=jQuery(".swiper-tab."+_eq+" .swiper-slide-active .post_ajax_trigger .ajax-open");b.length&&(scrollTopTo(jQuery(".swiper-tab."+_eq),-40),b.attr("no-scroll",!0).click());var r=bvv.onStart&&jQuery('[swiper-scroll-index="'+e+'"] .swiper-slide-thumb-active [data-route]');r&&r.length&&history.replaceState(null,document.title,r.attr("data-route")),bvv.onStart=!0}}},tab_id=_this.attr("swiper-tab"),tab_nav=jQuery('[swiper-tab-nav="'+tab_id+'"]');if(tab_nav.length){var tab_nav_index=tab_nav.attr("swiper-scroll-index");option.thumbs={swiper:_win.swiper.scroll[tab_nav_index],autoScrollOffset:2},tab_nav.on("click","a[data-route]",function(e2){e2.preventDefault()})}_this.addClass(_eq).attr("swiper-tab-index",e),_win.swiper.tab[e]=new Swiper(".swiper-tab."+_eq,option)}}),jQuery(".new-swiper").each(function(e){if(!jQuery(this).hasClass("swiper-container-initialized")){var _eq="swiper-eq-"+e,_this=jQuery(this),delay=~~_this.attr("data-interval")||6e3,autoplay=_this.attr("data-autoplay")?{delay,disableOnInteraction:!1}:!1,auto_h=!!_this.attr("auto-height"),speed=~~_this.attr("data-speed")||~~((_this.width()+1e3)/22)*10;speed=speed<400?400:speed,speed=autoplay===!1?speed/1.6:speed;var loop=!!_this.attr("data-loop"),parallax=!!_this.find("[data-swiper-parallax],[data-swiper-parallax-scale]").length,effect=_this.attr("data-effect")||"slide",direction=_this.attr("data-direction")||"horizontal",spaceBetween=~~_this.attr("data-spaceBetween")||0,pagination_type=_this.attr("data-pagination-type")||"bullets";_this.addClass(_eq).attr("swiper-new-index",e);var swiper_args={loop,autoHeight:auto_h,direction,spaceBetween,parallax,effect,lazy:{loadPrevNext:!0},autoplay,speed,pagination:{el:".new-swiper."+_eq+" .swiper-pagination",type:pagination_type,clickable:!0},navigation:{nextEl:".new-swiper."+_eq+" .swiper-button-next",prevEl:".new-swiper."+_eq+" .swiper-button-prev"},on:{lazyImageReady:function(slideEl,imageEl){jQuery(imageEl).addClass("lazyloaded")},slideChange:function(){_this.find(".new-dplayer").each(function(index,item){var dplayer=jQuery(item).data("dplayer");dplayer&&dplayer.pause()})},init:function(){loop&&_this.find(".swiper-slide-duplicate img").addClass("no-imgbox")}}};pagination_type==="thumbnail"&&(swiper_args.pagination.type="bullets",swiper_args.pagination.bulletClass="pagination-thumbnail-item",swiper_args.pagination.bulletActiveClass="pagination-thumbnail-item-active",swiper_args.pagination.renderBullet=function(index,className){var imgsrc,thumbnail,_img=jQuery(this.slides[index]).find("img");return _img.length&&(_img=jQuery(_img[0]),imgsrc=_img.attr("data-src")||_img.attr("src")),imgsrc?(thumbnail='
',thumbnail):""}),_win.swiper.new[e]=new Swiper(".new-swiper."+_eq,swiper_args)}})}))}window.swiper_tab_AutoHeight=debounce(function($con){var tab=$con.closest("[swiper-tab-index]");if(tab.length){var tab_index=tab.attr("swiper-tab-index");_win.swiper.tab[tab_index].updateAutoHeight(500)}},100),jQuery.fn.scrollX=function(){return this.each(function(){var _this=jQuery(this),is_on="is-on";if(!_this.data(is_on)){_this.data(is_on,!0);var btn_class="scroll-x-",prev_btn_class=btn_class+"prev",next_btn_class=btn_class+"next",prev=jQuery(''),next=jQuery('');init()}function scroll(type){var data=get_data();_this.animate({scrollLeft:type==="prev"?data[0]:data[1]},300,"linear",hover_show)}function init(){_this.after(prev).after(next),prev.on("click",function(){scroll("prev")}),next.on("click",scroll),_this.parent().hover(hover_show,function(){prev.hide(),next.hide()})}function hover_show(){var data=get_data();data[3]?prev.show():prev.hide(),data[3]0?prev_scroll:0;var next_scroll=~~(_this_scrollLeft+_this_w);return next_scroll=next_scroll>max?max:next_scroll,[prev_scroll,next_scroll,max,_this_scrollLeft]}})},jQuery.fn.Tabcenter=function(){return this.each(function(){var _this=jQuery(this),_active=_this.find(".active");if(_active.length){var _this_w=_this.innerWidth(),_active_w=_active.innerWidth(),_this_scrollLeft=_this.scrollLeft(),_active_left=_active.position().left,max=~~(_this.prop("scrollWidth")-_this_w),_yd=~~(_this_scrollLeft+_active_left-_this_w/2+_active_w/2);_yd=_yd>0?_yd:0,_yd=_yd>max?max:_yd,_yd!=_this_scrollLeft&&_this.animate({scrollLeft:_yd},300)}})},_win.bd.on("shown.bs.tab","a[data-ajax]",function(){jQuery(this).closest("ul.list-inline").Tabcenter()}),jQuery(".tab-nav-theme,.tab-nav-but,.index-tab ul.list-inline").Tabcenter();function post_ajax(_this,con,jcon,item,loader,pag,next,trigger,replace,nomore,top,ajax_trigger){var $con=_this.closest(con);if($con.attr("ing"))return!1;var $item=find(item),href=_this.attr("ajax-href")||_this.attr("href")||_this.find("a").attr("ajax-href")||_this.find("a").attr("href");jcon=jcon||con,ajax_trigger=ajax_trigger||(_win.ajax_trigger?_win.ajax_trigger:''+aksrt__("load_more")),replace=_this.attr("ajax-replace")||replace,nomore=nomore||_win.ajax_nomore;var $loader=find(".post_ajax_loader");$loader.length||(loader=loader||'

',$loader=jQuery('
'+loader+"
"));function find(selector,$parent,con_selector){$parent=$parent&&$parent.length?$parent:$con,con_selector=con_selector||con;var $element=$parent.find(">"+selector);return $element.length||($element=$parent.find(">*:not("+con_selector+")>"+selector),$element.length)||($element=$parent.find(">*:not("+con_selector+")>*:not("+con_selector+")>"+selector),$element.length)||($element=$parent.find(">*:not("+con_selector+")>*:not("+con_selector+")>*:not("+con_selector+")>"+selector),$element.length)?$element:jQuery("null#null")}return href&&jQuery.ajax({type:"POST",url:href,dataType:"html",beforeSend:function(){replace&&$item.length&&$item.remove(),$con.attr("ing",!0),find(".post_ajax_trigger").remove(),find(".no-more").remove(),find(".post_ajax_loader").remove(),find(".noajax-pag").remove(),find(pag).remove(),$item=find(item),$item.length?top?$item.first().before($loader):$item.last().after($loader):$con.append($loader),$loader.fadeIn(),swiper_tab_AutoHeight($con)},success:function(a){a=jQuery.parseHTML("
"+a+"
");var $a=jQuery(a);$a.find("[win-ajax-replace]").each(function(){var replace_key=jQuery(this).attr("win-ajax-replace"),replace_e=jQuery('[win-ajax-replace="'+replace_key+'"]');replace_e.length&&(replace_e.html(jQuery(this).html()),jQuery(this).remove())});var $jcon=$a.find(jcon),c_c=find(item,$jcon,jcon),c_p=find(pag,$jcon,jcon),n_h=c_p.find(next).attr("href")||c_p.find(next).find("a").attr("href");c_p=c_p.length?c_p:'
'+nomore+"
",c_p=$jcon.find(".noajax-pag").length?$jcon.find(".noajax-pag"):c_p,trigger&&(c_p=typeof n_h<"u"?''+ajax_trigger+"":c_p);var $item_header=find(".ajax-item-header",$jcon,jcon);if($item_header.length&&(find(".ajax-item-header").remove(),$con.prepend($item_header)),$item=find(item),$item.length?top?$item.first().before(c_p).before(c_c):$item.last().after(c_p).after(c_c):top?$con.append(c_p).append(c_c):$con.append(c_c).append(c_p),$con.removeAttr("ing").trigger("post_ajax.ed",jQuery(a)),find(".post_ajax_loader",$con).hide(),_this.attr("no-scroll"))_win.auto_scroll=!0,setTimeout(function(){_win.window.trigger("scroll"),_win.auto_scroll=!1},20);else{var _scroll_To=replace?$con:jQuery(c_c[0]);setTimeout(function(){scrollTopTo(_scroll_To,-40)},100)}if(_this.attr("route")){var route_title=_this.attr("route-title")||$a.find("title").text();history.replaceState(null,route_title,href),route_title&&jQuery("head title").text(route_title)}swiper_tab_AutoHeight($con),auto_fun()}}),!1}if(_win.bd.on("click","[remote-box]",function(){var _this=jQuery(this),remote=_this.attr("remote-box");remote&&jQuery.post(remote,null,function(data){_this.html(data).removeAttr("remote-box"),auto_fun(),_this.trigger("aksrt:remote-loaded")})}),_win.bd.on("show.bs.tab","a[data-ajax]",function(){var _this=jQuery(this),a=_this.data("target")||_this.attr("href"),selector=a+" .post_ajax_trigger .ajax-next",b=jQuery(selector).attr("ajax-replace",!0);if(b.length)b.click();else{var href=_this.attr("data-ajax");if(href){var trigger='';jQuery(a).append(trigger),jQuery(selector).click()}}_this.attr("only-one")&&_this.removeAttr("data-ajax")}),_win.bd.on("click","[ajax-tab],[ajax-target]",function(){var _this=jQuery(this),replace=_this.attr("ajax-replace")?' ajax-replace="true"':"",target=_this.attr("ajax-tab")||_this.attr("ajax-target"),href=_this.attr("data-ajax"),trigger='";console.log(target),jQuery(target).find(".post_ajax_trigger").remove(),jQuery(target).append(trigger),jQuery(target+" .post_ajax_trigger .ajax-next").click(),jQuery('a[href="'+target+'"]').click()}),_win.bd.on("click",".ajax-next",function(e){e.preventDefault();var _this=jQuery(this);if(_this.hasClass("pag-jump"))return!1;var _loader='
'+aksrt__("loading")+"
";_this.attr("ajax-replace")&&(_loader='

',_loader+=_loader,_loader+=_loader),_loader='
'+_loader+"
";var t_con=_this.attr("ajaxpager-target")||".ajaxpager",t_item=_this.attr("ajaxitem-target")||".ajax-item",$item1=_this.parents(t_con+":eq(0)").find(t_item+":first"),$item1_class=$item1.attr("class");if($item1_class&&$item1_class.indexOf("posts-item")>-1)if($item1_class.indexOf("card")>-1){var loader_class=$item1_class.replace("ajax-item","");_loader='

',_loader=_loader.repeat(_wid>766?_wid>992&&!jQuery(".sidebar").length?8:6:4)}else $item1_class.indexOf("list")>-1&&(_loader='

',_loader=_loader.repeat(_wid>766?4:3));return post_ajax(_this,t_con,t_con,t_item,_loader,".ajax-pag")}),_wid<769&&jQuery(".drawer-sm").length){_win.bd.on("click","[data-drawer]",function(){var _this=jQuery(this),title=_this.attr("drawer-title")||"",drawer_selector=_this.attr("drawer-selector")||".drawer-sm",action=_this.attr("data-drawer"),route=_this.attr("route"),route_back=_this.attr("route-back");jQuery(drawer_selector).Drawer(action,title,route,route_back)});var this_url=(window.parent.location.origin+window.parent.location.pathname).replace(/(\/*$)/g,"");_win.url_request=window.parent.location.search,setTimeout(function(){jQuery('[data-drawer][route="'+this_url+'"]').click()},20)}else _win.bd.on("shown.bs.tab","[data-drawer][route]",tabOnRoute),_win.bd.on("hide.bs.tab","[data-drawer][route]",tabOnRoute_hidden);_win.bd.on("shown.bs.tab","[data-route]",tabOnRoute),_win.bd.on("hide.bs.tab","[data-route]",tabOnRoute_hidden);function tabOnRoute_hidden(){var _this=jQuery(this);if(!history.state){var route=_this.attr("route")||_this.attr("data-route"),tab_id=_this.attr("data-target");route&&history.replaceState({tab_id},null,route)}}function tabOnRoute(){var _this=jQuery(this);if(_this.attr("onpopstate"))_this.attr("onpopstate",!1);else{var route=_this.attr("route")||_this.attr("data-route"),tab_id=_this.attr("data-target");route&&routeGo(route,{tab_id})}}window.onpopstate=function(event){var tab=event.state&&jQuery('[data-toggle="tab"][data-target="'+event.state.tab_id+'"]');tab&&tab.length&&tab.attr("onpopstate",!0).click()};function routeGo(url,data,title){title=title||document.title,url&&history.pushState(data,title,url)}if(jQuery.fn.loading=function(action){var _this=jQuery(this);action=action=="show"||action=="hide"?action:_this.hasClass("loading-show")?"hide":"show";var loading_class="loading-backdrop",loading_html='';return action=="show"?_this.addClass("loading-show").append(loading_html).find("."+loading_class).fadeIn(200):_this.removeClass("loading-show").find("."+loading_class).fadeOut(200,function(){jQuery(this).remove()}),_this},jQuery.fn.Drawer=function(action,title,route,route_back){title=title||"";var _this=jQuery(this);if(!_this.length)return;action=action=="show"||action=="hide"?action:_this.hasClass("show")?"hide":"show";var _body=jQuery("body");_this.attr("on-start")||_this.attr("on-start",!0).minitouch({direction:"right",onEnd:function(){_this.Drawer("hide")}});function urlTo(url){history.replaceState(null,document.title,url)}switch(action){case"show":var header=jQuery('
'+title+"
").on("click",".drawer-close",function(){_this.Drawer("hide")});return _body.append(header),setTimeout(function(){_body.addClass("drawer-show")},10),route_back&&_this.data("route_back",route_back),route&&urlTo(route),_this.addClass("show");case"hide":return _body.removeClass("drawer-show"),setTimeout(function(){jQuery(".drawer-header").remove()},400),urlTo(_this.data("route_back")),_this.removeClass("show");default:}},jQuery(".wp-block-carousel").length){jQuery("link#swiper").length||jQuery("head").append('');var _sc=jQuery(".wp-block-carousel"),Sw=[];tbquire(["swiper"],function(){_sc.each(function(si){var _this=jQuery(this),_eq="swiper-post-"+si;_this.find(".wp-block-gallery>.blocks-gallery-grid").length&&_this.find(".wp-block-gallery").html(_this.find(".wp-block-gallery>.blocks-gallery-grid").html()),_this.find(".wp-block-gallery").removeClass().addClass("swiper-wrapper").find(".blocks-gallery-item,>.wp-block-image").addClass("swiper-slide"),_this.find(".carousel-control.left").replaceWith('
'),_this.find(".carousel-control.right").replaceWith('
');var _ss=_this.find(".carousel"),proportion=_ss.attr("proportion")||.6,style=_ss.attr("style");_ss.addClass(_eq+" new-swiper scale-height").attr("style","--scale-height:"+proportion*100+"%;"),_this.attr("style",style);var delay=~~_ss.attr("data-interval")||6e3,loop=_ss.attr("data-jyloop")||!1,effect=_ss.attr("data-effect")||"slide",speed=~~((_ss.width()+1200)/250)*100;Sw["swiper_wz_"+si]=new Swiper(".wp-block-carousel ."+_eq,{spaceBetween:10,speed,loop,effect,autoplay:{delay,disableOnInteraction:!1},pagination:{el:"."+_eq+" .swiper-pagination",clickable:!0},navigation:{nextEl:"."+_eq+" .swiper-button-next",prevEl:"."+_eq+" .swiper-button-prev"}})})})}_win.bd.on("show.bs.modal loaded.bs.modal",".modal:not(.flex)",function(){var o=jQuery(this),i=o.find(".modal-dialog");o.css("display","block"),i.css({"margin-top":Math.max(0,(_hei-i.height())/2)})}),_win.bd.on("show.bs.modal loaded.bs.modal",".modal",function(){auto_fun()}),_win.modal_z_index=1050,_win.bd.on("show.bs.modal",".modal",function(){_win.modal_z_index++,jQuery(".modal.in").addClass("modal-parent"),jQuery(this).css("z-index",_win.modal_z_index).removeClass("modal-parent")}),_win.bd.on("hide.bs.modal",".modal",function(){jQuery(".modal.modal-parent").removeClass("modal-parent")}),_win.bd.on("click",".oauth-untying",function(){if(confirm(aksrt__("confirm_unbind"))==!0){var _this=jQuery(this),data={action:"user_oauth_untying",user_id:_this.attr("user-id"),type:_this.attr("untying-type"),_wpnonce:_this.attr("_wpnonce")};return aksrt_ajax(_this,data),!1}}),_win.bd.on("click",".medal-add-link",function(){if(confirm(aksrt__("confirm_grant_badge"))==!0)return aksrt_ajax(jQuery(this)),!1}),_win.bd.on("click",".medal-remove-link",function(){if(window.confirm(aksrt__("confirm_revoke_badge")))return aksrt_ajax(jQuery(this)),!1}),_win.bd.on("click","[tab-id]",function(e){var tab=jQuery(this).attr("tab-id");if(tab){var _tab=jQuery('a[data-target="#'+tab+'"]');_tab.length||(_tab=jQuery('a[href="#'+tab+'"]')),_tab.length&&(e.preventDefault(),_tab.tab("show"))}}),_win.bd.on("click",'[data-toggle="RefreshModal"]',function(e){e.preventDefault();var _this=jQuery(this),remote=_this.attr("data-remote");if(!remote){var action=_this.attr("data-action");action&&(remote=_win.ajax_url+"?action="+action)}return refresh_modal({class:_this.attr("data-class")||"",height:_this.attr("data-height")||300,mobile_from_bottom:!!_this.attr("mobile-bottom"),new:_this.attr("new"),touch_close:!_this.attr("no-touch"),remote}),!1});function refresh_modal(_config){_config.mobile_from_bottom=typeof _config.mobile_from_bottom>"u"?!0:_config.mobile_from_bottom;var id="refresh_modal",is_new=_config.new,dataclass=_config.class||"",height=_config.height||200,mobile_bottom=_config.mobile_from_bottom&&_wid<769?" bottom":"",touch_close=typeof _config.touch_close>"u"?!0:_config.touch_close,modal_class="modal flex jc fade"+mobile_bottom,remote=_config.remote||"",content=_config.content||"";dataclass+=" modal-dialog",id+=is_new?parseInt((Math.random()+1)*Math.pow(10,4)):"";var _id="#"+id,_modal=jQuery(_id);if(_modal.length){var is_in=_modal.hasClass("in");is_in&&(modal_class+=" in");var $modal_content=_modal.find(".modal-content");_modal.removeClass().addClass(modal_class),_modal.find(".modal-dialog").removeClass().addClass(dataclass),_modal.find(".loading-mask").fadeIn(200),_modal.find(".modal-body").fadeOut(200),$modal_content.css({overflow:"hidden",height:is_in?$modal_content.height():100}).animate({height})}else{var modal_html='',loading='
';_win.bd.append(modal_html),_modal=jQuery(_id),_modal.on("hidden.bs.modal",function(){is_new?jQuery(this).remove():jQuery(this).find(".modal-content").html(loading)}),_modal.find(".modal-content").html(loading).css({height,overflow:"hidden"}),_wid<769&&_modal.minitouch({direction:"bottom",selector:".modal-dialog",start_selector:".modal-colorful-header,.touch-close,.touch",onEnd:function(){_modal.modal("hide")},stop:function(){return!_modal.hasClass("bottom")}})}_modal.find(".touch-close").remove(),mobile_bottom&&touch_close&&_modal.find(".modal-dialog").append('
'),_modal.modal("show"),content?(_modal.find(".modal-body").html(content),_modal_content_open()):remote&&jQuery.post(remote,null,function(data){_modal.find(".modal-body").html(data),setTimeout(function(){_modal.trigger("loaded.bs.modal")},20),_modal_content_open()});function _modal_content_open(){_modal.find(".modal-body").fadeIn(50,function(){var b_height=jQuery(this).outerHeight(!0);_modal.find(".loading-mask").fadeOut(300),_modal.find(".modal-content").animate({height:b_height},300,"swing",function(){_modal.find(".modal-content").css({height:"",overflow:"",transition:""})})})}return _modal}window.auto_maxHeight=debounce(z_auto,100);function z_auto(){if(_win.do_hh=document.documentElement.clientHeight,_win.do_hh>document.body.clientHeight){var min_h=_win.do_hh-jQuery(".footer").outerHeight()-jQuery(".header").outerHeight()-20;jQuery("main").animate({"min-height":min_h})}}window.auto_fun=debounce(z_auto_fun,100);function z_auto_fun(){jQuery(document).trigger("auto_fun"),jQuery(".auto-search").AutoSearch(),jQuery(".dependency-box").dependency(),jQuery(".cloneable").cloneable(),jQuery("[data-countdown]").countdown(),auto_maxHeight(),jQuery("img[data-src]:not(.lazyload,.lazyloaded,.lazyloading,.swiper-lazy)").addClass("lazyload"),jQuery("[data-toggle='tooltip']").tooltip({container:"body"}),jQuery("[data-clipboard-text]").length&&tbquire(["clipboard"]),jQuery("[data-toggle='popover']").popover({sanitize:!1}),_wid>768?(jQuery(".fixed-wrap-nav").autoAffix(20,38),jQuery(".relative>.scroll-x.no-scrollbar").scrollX()):jQuery(".affix-header-sm").autoAffix(0,20),_wid>900&&jQuery(".sidebar").sidebarAffix(),new_swiper(),new_dplayer(),tbquire(["svg-icon"],()=>{show_svg()});var _h_e=_win.highlight_kg?"pre code:not(.enlighter-origin)":"pre code.gl:not(.enlighter-origin),pre code.special:not(.enlighter-origin)";jQuery(_h_e).length&&tbquire(["enlighterjs"],function(){var lin=!!_win.highlight_hh;jQuery("link#enlighterjs").length||jQuery("head").append(''),jQuery(_h_e).enlight({linenumbers:lin,indent:2,textOverflow:"scroll",rawcodeDbclick:!0,rawButton:!1,infoButton:!1,windowButton:!1,theme:_win.highlight_zt})}),_win.imgbox&&jQuery(".alone-imgbox-img,a[data-imgbox],.comment-content .box-img,.wp-posts-content img,.imgbox-container").length&&tbquire(["imgbox"])}(function(){var scroll_throttle=throttle(function(){var h=document.documentElement.scrollTop+document.body.scrollTop,ontop=jQuery(".ontop");h>100?_win.bd.addClass("body-scroll"):_win.bd.removeClass("body-scroll"),h>400?ontop.addClass("show"):ontop.removeClass("show")},100);_win.window.scroll(scroll_throttle);var debounce_scroll_end=debounce(function(){jQuery("[data-toggle='tooltip']").tooltip("hide")},500,!0);_win.window.scroll(debounce_scroll_end);var debounce_scrolling_hide=debounce(function(){_win.bd.addClass("scroll-ing")},500,!0),debounce_scrolling_hide_end=debounce(function(){_win.bd.removeClass("scroll-ing")},500);jQuery(".scrolling-hide").length&&_win.window.scroll(debounce_scrolling_hide).scroll(debounce_scrolling_hide_end);var _last_scroll_top=0,debounce_scroll_down=debounce(function(){var _scroll_top=document.documentElement.scrollTop+document.body.scrollTop;_last_scroll_top>100&&_scroll_top>_last_scroll_top?_win.auto_scroll||_win.bd.removeClass("scroll-up").addClass("scroll-down"):(!_win.auto_scroll||_last_scroll_top<=100)&&_win.bd.removeClass("scroll-down").addClass("scroll-up"),_last_scroll_top=_scroll_top},10,!0);jQuery(".scroll-down-hide").length&&_win.window.scroll(debounce_scroll_down)})();function scrollTopTo(element,offset){var scrollTop=0,body=jQuery("body,html"),duration=duration||300;if(offset=offset||0,element){var target=element instanceof jQuery?element:jQuery(element);scrollTop=target.length?target.offset().top+offset-(body.hasClass("nav-fixed")?jQuery(".header").innerHeight()+20:0):0}Math.abs(scrollTop-body.scrollTop())<80||(_win.auto_scroll=!0,body.animate({scrollTop},duration,"swing",function(){setTimeout(function(){_win.auto_scroll=!1},20)}))}_win.bd.on("click",".toggle-radius,.float-right a,.but-ripple,.but,.item-thumbnail,.menu-item >a,.yiyan-box,.relates-thumb li a",function(e){var _th=jQuery(this);if(!_th.hasClass("nowave")&&!_th.hasClass("is-disabled")){_th.css({overflow:"hidden",position:"relative"});var R,waveWidth=~~_th.outerWidth(),waveHeight=~~_th.outerHeight();waveWidth
").css({display:"block",background:cllor,"border-radius":"50%",position:" absolute","-webkit-transform":"scale(0)",transform:"scale(0)",opacity:".3","-webkit-transition":"all 1.5s cubic-bezier(0.22, 0.61, 0.36, 1)",transition:"all 1.5s cubic-bezier(0.22, 0.61, 0.36, 1)","z-index":"1",overflow:"hidden","pointer-events":"none"});_th.append(wave),wave.css({width:R*2+"px",height:R*2+"px",top:e.pageY-_th.offset().top-R+"px",left:e.pageX-_th.offset().left-R+"px",transform:"scale(1)","-webkit-transform":"scale(1)",opacity:0}),setTimeout(function(){wave.remove()},2e3)}}),jQuery.fn.sidebarAffix=function(){var _this=jQuery(this),_affix=_this.find("[data-affix]"),sidebar_class="sidebar-affix";if(!_affix.length||_this.children("."+sidebar_class).length)return _this;var _body=jQuery("body"),affix_width=_affix.innerWidth(),_header=jQuery(".header");function nav_Height(){return _body.hasClass("nav-fixed")&&(!_header.hasClass("scroll-down-hide")||!_body.hasClass("scroll-down"))?_header.outerHeight(!0):20}var sidebarAffix_con=jQuery('
');_this.prepend(sidebarAffix_con);function top_css(){sidebarAffix_con.css({top:nav_Height()})}var last_top=0;return sidebarAffix_con.affix({offset:{top:function(){var new_top=_this.outerHeight(!0)+_this.offset().top-nav_Height();return new_top!==last_top&&sidebarAffix_con.hasClass("affix")&&top_css(),last_top=new_top,new_top},bottom:function(){var _wrap=_this.parent();return document.body.clientHeight-_wrap.outerHeight()-_wrap.offset().top}}}).on("affix-top.bs.affix",function(){sidebarAffix_con.html("")}).on("affix.bs.affix",function(){sidebarAffix_con.find("[data-affix]").length||sidebarAffix_con.append(_this.find("[data-affix]").clone()),top_css()}).find("[lazyload-action]:not(.lazyload)").addClass("lazyload"),sidebarAffix_con.hasClass("affix")&&sidebarAffix_con.trigger("affix.bs.affix"),sidebarAffix_con.hasClass("affix-bottom")&&sidebarAffix_con.trigger("affix-bottom.bs.affix"),_this},jQuery.fn.autoAffix=function(top,bottom){top=~~top,bottom=~~bottom;var _this=jQuery(this);if(_this.data("bs.affix"))return _this;var _body=jQuery("body"),offset_top=~~_this.attr("offset-top"),offset_bottom=~~_this.attr("offset-bottom"),_wrap_attr=_this.attr("data-wrap"),_wrap=_wrap_attr?jQuery(_wrap_attr):_this.parent(),_header=jQuery(".header");function get_nav_Height(){return(_body.hasClass("nav-fixed")&&(!_header.hasClass("scroll-down-hide")||!_body.hasClass("scroll-down"))?_header.outerHeight():0)+top}function remove_clone(){_this.next(".affix-clone").remove()}function top_css(){_this.css({top:get_nav_Height()})}function this_clone(){_this.next(".affix-clone").length||_this.after(_this.clone().removeClass("affix-top affix affix-bottom").addClass("affix-clone").css("opacity","0"))}_wrap.css("min-height",_this.outerHeight()+bottom);var last_top=0;return _this.affix({offset:{top:function(){var new_top=_this.parent().offset().top-get_nav_Height()+offset_top;return new_top!==last_top&&_this.hasClass("affix")&&top_css(),last_top=new_top,new_top},bottom:function(){return document.body.clientHeight-_wrap.outerHeight()-_wrap.offset().top+bottom+offset_bottom}}}).on("affix-top.bs.affix",function(){_this.css({top:"",width:""}),remove_clone()}).on("affix.bs.affix",function(){this_clone(),top_css()}).on("affix-bottom.bs.affix",function(){this_clone()}),_this.hasClass("affix")&&_this.trigger("affix.bs.affix"),_this.hasClass("affix-bottom")&&_this.trigger("affix-bottom.bs.affix"),_this.hasClass("affix-top")&&_this.trigger("affix-top.bs.affix"),_this},_win.bd.on("click",".toggle-theme",function(event){var isDark=jQuery("body").hasClass("dark-theme");if(!document.startViewTransition){toggle();return}const transition=document.startViewTransition(()=>{toggle()}),{clientX,clientY}=event,endRadius=Math.hypot(Math.max(clientX,innerWidth-clientX),Math.max(clientY,innerHeight-clientY)),clipPath=[`circle(0px at ${clientX}px ${clientY}px)`,`circle(${endRadius}px at ${clientX}px ${clientY}px)`];transition.ready.then(()=>{document.documentElement.animate({clipPath:isDark?[...clipPath].reverse():clipPath},{duration:500,easing:isDark?"ease-out":"ease-in",fill:"both",pseudoElement:isDark?"::view-transition-old(root)":"::view-transition-new(root)"})});function toggle(){var highlight_white_zt="enlighter-t-"+_win.highlight_white_zt,highlight_dark_zt="enlighter-t-"+_win.highlight_dark_zt;jQuery("img[switch-src]").each(function(){var _this=jQuery(this),_src=_this.attr("data-src")||_this.attr("src"),_s_src=_this.attr("switch-src");_this.attr("src",_s_src).attr("switch-src",_src).attr("data-src","")}),jQuery("img[white-src],img[dark-src]").each(function(){var _this=jQuery(this),_s_src=isDark?_this.attr("white-src"):_this.attr("dark-src");_s_src&&_this.attr("src",_s_src)});var _enlighter=jQuery(".enlighter-default"),_body=jQuery("body"),_tinymce_body=jQuery("#post_content_ifr").contents().find("body");isDark?(jQuery('meta[name="theme-color"]').attr("content","#FDFCFE"),document.documentElement.classList.remove("dark"),_tinymce_body.removeClass("dark-theme"),_enlighter.removeClass(highlight_dark_zt).addClass(highlight_white_zt),_body.removeClass("dark-theme"),jQuery.cookie("theme_mode","white-theme",{path:"/"})):(jQuery('meta[name="theme-color"]').attr("content","#2F3135"),document.documentElement.classList.add("dark"),_tinymce_body.addClass("dark-theme"),_enlighter.removeClass(highlight_white_zt).addClass(highlight_dark_zt),_body.addClass("dark-theme"),jQuery.cookie("theme_mode","dark-theme",{path:"/"}))}}),_win.bd.on("click","[ajax-action]",function(){var _this=jQuery(this);if(_this.attr("disabled"))return!1;var id=_this.attr("data-id"),action=_this.attr("ajax-action"),_text=_this.find("text");_text=_text.length?_text:_this.siblings("text");var _this_html=_text.html();_this.attr("disabled",!0),_text.html(''),jQuery.ajax({type:"POST",url:_win.ajax_url,dataType:"json",data:{id,action,_wpnonce:_this.attr("data-nonce")},error:function(n){var _msg=aksrt_sprintf("ajax_error",n.status,n.statusText);aksrt_is_fatal_error_response(n.responseText)&&(_msg=aksrt__("ajax_fatal_error")),notyf(_msg,"danger"),_this.attr("disabled",!1),_text.html(_this_html)},success:function(n){if(_this.attr("disabled",!1),!n.data||!n.success)_text.html(_this_html),n.data&&n.data.msg&¬yf(n.data.msg,n.data.ys||"danger");else{if(n=n.data,n.show_modal&&n.modal){var modal_config={class:"modal-mini full-sm",height:330,mobile_from_bottom:!0,touch_close:!0,content:n.modal};n.modal_config&&(modal_config=jQuery.extend(modal_config,n.modal_config)),modal_config.content=n.modal,refresh_modal(modal_config),_text.html(_this_html);return}jQuery('[ajax-action="'+action+'"][data-id="'+id+'"]').each(function(){var _this2=jQuery(this),_text2=_this2.find("text");_text2=_text2.length?_text2:_this2.siblings("text"),_text2.html(n.text||_this_html).addClass("ajaxed"),n.active?_this2.addClass("active").siblings(".active").removeClass("active"):_this2.removeClass("active")})}}})});function throttle(fn,delay){let valid=!0;return function(...args){if(!valid)return!1;valid=!1,setTimeout(function(){fn.apply(this,args),valid=!0},delay)}}function debounce(callback,delay,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||callback.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,delay),callNow&&callback.apply(context,args)}}if(_win.bd.on("input focus","textarea[autoHeight]",function(){var elem=this,border=~~getComputedStyle(elem).getPropertyValue("border-top-width").replace("px","")+~~getComputedStyle(elem).getPropertyValue("border-bottom-width").replace("px",""),max=~~jQuery(elem).attr("maxHeight");elem.style.height="auto",max>elem.scrollHeight?(elem.style.height=elem.scrollHeight+border+"px",elem.style.overflow="hidden"):(elem.style.height=max+"px",elem.style.overflow="auto")}),_win.bd.on("click",".rewards",function(){jQuery("#rewards-popover").modal("show")}),_win.bd.hasClass("search")){var val=jQuery(".search-desc-text .search-key").text();try{var reg=eval("/"+val+"/i");jQuery(".search-tab .item-heading a,.search-tab .item-excerpt,.search-tab .forum-title a,.search-tab .excerpt,#search-tab-user .display-name").each(function(){var $this=jQuery(this);$this.text().search(reg)!=-1&&$this.html($this.html().replace(reg,function(w){return''+w+""}))})}catch(e){}}_win.bd.on("click",".pag-jump .jump-icon",function(){var _input=jQuery(this).siblings(".jump-input");pag_jump_go(_input)}),_win.bd.on("input",".pag-jump .jump-input",debounce(function(){pag_jump(jQuery(this))},200)),_win.bd.on("keydown",".pag-jump .jump-input",function(event){event.keyCode==13&&pag_jump_go(jQuery(this))});function pag_jump(_input){var max=_input.attr("max"),current=_input.attr("current"),val2=~~_input.val();return(!val2||val2<1||val2>max)&&(val2=val2>max?max:"",_input.val(val2)),val2==current?0:val2}function pag_jump_go(_input){var val2=pag_jump(_input);if(val2){var base=_input.attr("base"),url=base.replace("%#%",val2),parent=_input.parent();if(parent.hasClass("ajax-next")){_input.val("");var _ajax_link=parent.clone().removeClass("pag-jump").addClass("hide").attr("href",url);parent.append(_ajax_link),_ajax_link.click(),_ajax_link.remove()}else location.href=url,location.reload}else _input.focus()}jQuery.fn.cloneable=function(){var cloneable_text="cloneable",cloneable_add_e="."+cloneable_text+"-add",cloneable_remove_e="."+cloneable_text+"-remove",cloneable_item_e="."+cloneable_text+"-item";function max_min(_this,max,min){var count=_this.children(cloneable_item_e).length;max&&max<=count?_this.nextAll(cloneable_add_e).hide():_this.nextAll(cloneable_add_e).show(),min&&min>=count?_this.find(cloneable_remove_e).hide():_this.find(cloneable_remove_e).show()}return this.each(function(){var _this=jQuery(this),_item=_this.children(cloneable_item_e),is_on="is-on",click="click",max=_this.data("max")||0,min=_this.data("min")||0;if(max_min(_this,max,min),!(!_item.length||_this.attr(is_on))){var add_item=jQuery(_item[0]).clone(!1);add_item.find("input,textarea").val(""),_this.attr(is_on,!0).on(click,cloneable_remove_e,function(){jQuery(jQuery(this).parents(cloneable_item_e)[0]).remove(),max_min(_this,max,min)}).nextAll(cloneable_add_e).on(click,function(){var _add_item=add_item.clone(!1),count=_this.children(cloneable_item_e).length;_add_item.find("[name]").each(function(){var $this=jQuery(this),name=$this.attr("name");name=="_pseudo"||!name.includes("[0]")||$this.attr("name",$this.attr("name").replace("[0]","["+count+"]"))}),_this.append(_add_item),max_min(_this,max,min)})}})},jQuery.fn.dependency=function(){function _number(val2){return Number(val2)}function checkBoolean(v){switch(v){case!0:case"true":case 1:case"1":return!0;case null:case!1:case"false":case 0:case"0":return!1;default:return v}}function evalCondition(condition,val1,val2){switch(condition){case"==":return checkBoolean(val1)==checkBoolean(val2);case"!=":return checkBoolean(val1)!=checkBoolean(val2);case">=":return _number(val2)>=_number(val1);case"<=":return _number(val2)<=_number(val1);case">":return _number(val2)>_number(val1);case"<":return _number(val2)<_number(val1);case"any":if(jQuery.isArray(val2)){for(let i=val2.length-1;i>=0;i--)if(jQuery.inArray(val2[i],val1.split(","))!==-1)return!0}else if(jQuery.inArray(val2,val1.split(","))!==-1)return!0;return!1;case"not-any":if(jQuery.isArray(val2)){for(let i=val2.length-1;i>=0;i--)if(jQuery.inArray(val2[i],val1.split(","))==-1)return!0}else if(jQuery.inArray(val2,val1.split(","))==-1)return!0;return!1;default:return!1}}return this.each(function(){var $this=jQuery(this),$fields=$this.find("[data-controller]");if($fields.length){var is_on="is-on";$fields.each(function(){var $field=jQuery(this);if(!$field.attr(is_on)){var controllers=$field.attr(is_on,!0).data("controller").split("|"),conditions=$field.data("condition").split("|"),values=$field.data("value").toString().split("|");jQuery.each(controllers,function(index,depend_id){var value=values[index]||"",condition=conditions[index]||conditions[0]||"==";$this.on("change","[name='"+depend_id+"']",function(){var $elem=jQuery(this),_type=$elem.attr("type"),val2=_type=="checkbox"?$elem.is(":checked"):$elem.val(),is_show=evalCondition(condition,value,val2);$field.trigger("controller.change",is_show),is_show?$field.show():$field.hide()})})}})}})},_win.bd.on("click","[data-for]",function(){var _this=jQuery(this),_tt=_this.html(),_for=_this.attr("data-for"),_form=_this.parents("form"),_v=_this.attr("data-value"),multiple=~~_this.attr("data-multiple"),_group=_this.closest("[for-group]"),active_outerHTML=_this.prop("outerHTML");if(_group.length||(_group=_this.parent()),multiple>1){_tt="",active_outerHTML="";var active_array=[],_input="",is_active=_this.hasClass("active");if(is_active)_group.find('[data-for="'+_for+'"][data-value="'+_v+'"]').removeClass("active");else{var ii={};if(_group.find('[data-for="'+_for+'"].active').each(function(){ii[jQuery(this).attr("data-value")]=1}),Object.keys(ii).length>=multiple)return notyf(aksrt_sprintf("select_max",multiple),"danger");_group.find('[data-for="'+_for+'"][data-value="'+_v+'"]').addClass("active")}_group.find('[data-for="'+_for+'"].active').each(function(){var _this_value=jQuery(this).attr("data-value");active_array.indexOf(_this_value)==-1&&(_tt+=jQuery(this).html(),_input+='',active_array.push(_this_value),active_outerHTML+=jQuery(this).clone().addClass("outerhtml-copy").prop("outerHTML"))}),jQuery.each(active_array,function(index,value){_group.find('[data-for="'+_for+'"][data-value="'+value+'"]').addClass("active")}),_form.find("input[name='"+_for+"[]']").remove(),_form.append(_input)}else _group.find('[data-for="'+_for+'"]').removeClass("active"),_group.find('[data-for="'+_for+'"][data-value="'+_v+'"]').addClass("active"),_form.find("input[name='"+_for+"']").val(_v).trigger("change");_form.find("span[name='"+_for+"']").html(_tt),_form.find("input[name=s]").focus(),_form.find(".active-outerhtml[name='"+_for+"']").html(active_outerHTML)}),_win.bd.on("input","input[limit-min],input[limit-max]",debounce(function(){var _this=jQuery(this),min=Number(_this.attr("limit-min")),max=Number(_this.attr("limit-max")),val2=Number(_this.val()),text,warning_class="limit-warning";_this.next("."+warning_class).length||_this.after('');var _warning=_this.next("."+warning_class);_this.val().length<1?_warning.html("").hide():val2>max?(text=_this.attr("warning-max")||aksrt__("input_max"),_warning.html(text.replace("1$",max)).fadeIn(150)):val2',loading_remind=loading_icon+''+aksrt__("search_loading")+"",is_on="is-on";if(_this.data(is_on))return;function ajax(){var data={},serializeObject=_this.serializeObject();jQuery.each(serializeObject,function(key,val2){data[key]=val2}),_this.find("input[name]").each(function(){var _th=jQuery(this),v=_th.val()||"";data[_th.attr("name")]=v}),_this.addClass(loading),_remind.html(loading_remind),_icon.html(loading_icon),_container.css({height:_container.outerHeight(),overflow:"hidden"}),jQuery.post(ajax_url,data,function(result){var data_html=result.data;data_html&&_container.html('
'+data_html+"
").animate({height:_container.children("."+centent).outerHeight()},200,"swing",function(){_container.css({height:"",overflow:"",transition:""})}),_this.removeClass(loading),_remind.html(result.remind||""),_icon.html(_icon_html),auto_fun()},"json")}function submitted(_input){_input.val().length>=min_length?ajax():_remind.html(min_length_remind)}_this.data(is_on,!0).find(input).on("input",debounce(function(){submitted(jQuery(this))},500)).on("keydown",function(event){event.keyCode==13&&(event.preventDefault(),submitted(jQuery(this)))})})},_win.bd.on("click",".main-search [data-for]",function(){var _placeholder=jQuery(".main-search").find(".scale-placeholder");_placeholder.length&&_placeholder.text(_placeholder.attr("default"))}),_win.bd.on("submit",".main-search form",function(){var _this=jQuery(this),inputs=_this.serializeObject();jQuery.each(inputs,function(k,v){(!v||v=="null")&&k!="s"&&_this.find('input[name="'+k+'"]').remove()})}),_win.bd.on("click",".main-search-btn",function(){var _this=jQuery(this);jQuery(".main-search").addClass("show");var _remote_search=jQuery(".main-search [remote-box]").first();if(_remote_search.length){_remote_search.one("aksrt:remote-loaded",function(){_this.trigger("click")}),_remote_search.trigger("click");return}var _search_form=jQuery(".main-search form");if(_search_form.length){var attr_="search-",obj={type:_this.attr(attr_+"type"),user:_this.attr(attr_+"user"),trem:_this.attr(attr_+"trem")};jQuery.each(obj,function(k,v){if(v){var _k=_search_form.find('input[name="'+k+'"]').val(v),_data_for=_search_form.find('[data-for="'+k+'"][data-value="'+v+'"]').click();if(!_data_for.length&&k=="trem"){var cat_name=_this.attr("trem-name"),_cat_drop=_search_form.find(".cat-drop");cat_name&&_cat_drop.length&&(_cat_drop.append('
  • '+cat_name+"
  • "),_cat_drop.find('[data-value="'+v+'"]').click())}_k.length||_search_form.append('')}});var placeholder=_this.attr(attr_+"placeholder")||_search_form.find(".scale-placeholder").attr("default");_search_form.find(".scale-placeholder").text(placeholder),setTimeout(function(){_search_form.find('[name="s"]').focus()},100)}}),jQuery(".search-page-ajaxpager").length&&(_win.bd.on("click",".page-search-box a.search_keywords",function(){var $this=jQuery(this).clone();return $this.addClass("ajax-next").attr("ajax-replace","true").attr("route","true"),jQuery(".search-page-ajaxpager").append($this),$this.click().remove(),!1}),_win.bd.on("submit",".page-search-box .search-form",function(){var $this=jQuery(this),data=$this.serializeObject(),url=new URL($this.attr("action"));url.search=new URLSearchParams(data).toString();var $link=jQuery('');return jQuery(".search-page-ajaxpager").append($link),$link.click().remove(),!1}));function nav_folding(){var navbar_nav_t=".navbar-nav",sub_menu_t="sub-menu",_collapse=jQuery(".navbar-collapse"),surplus_width=_collapse.width();_collapse.find(">:not("+navbar_nav_t+")").each(function(){surplus_width-=jQuery(this).outerWidth()}),surplus_width-=jQuery(".navbar-header").outerWidth()+40;var navs_width=66,_folding=jQuery('');jQuery(navbar_nav_t+">li").each(function(){navs_width+=jQuery(this).outerWidth(),navs_width>surplus_width&&_folding.find(">."+sub_menu_t).append(jQuery(this))}),_folding.find(">."+sub_menu_t+" li").length&&jQuery(navbar_nav_t).append(_folding)}window.debounce_notyf=debounce(notyf,100,!0);function notyf(str,ys,time,id){jQuery(".notyn").length||_win.bd.append('
    '),ys=ys||"success",ys=="error"&&(ys="danger"),time=time||5e3,time=time<100?time*1e3:time;var id_attr=id?' id="'+id+'"':"",_html=jQuery('
    '+str+"
    "),is_close=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+ys).html(str),_html=jQuery("#"+id),is_close=!0):jQuery(".notyn").append(_html),is_close&&setTimeout(function(){notyf_close(_html)},time)}function notyf_close(_e){_e.addClass("notyn-out"),setTimeout(function(){_e.remove()},1e3)}_win.bd.on("click",".noty1",function(){notyf_close(jQuery(this))}),_win.passw=1,_win.bd.on("click",".passw",function(){var _this=jQuery(this);_win.passw==1?(_this.find(".fa").addClass("fa-eye-slash"),_this.siblings("input").attr("type","text"),_win.passw=2):(_this.find(".fa").removeClass("fa-eye-slash"),_this.siblings("input").attr("type","password"),_win.passw=1)}),_win.bd.on("input change focus",".line-form-input",debounce(function(){placeholder_scale(jQuery(this))},100));function placeholder_scale(_this){var val2=_this.val(),placeholder=_this.siblings(".scale-placeholder");val2.length>0?placeholder.addClass("is-focus"):placeholder.removeClass("is-focus")}function aksrt_is_url(str){try{return new URL(str),!0}catch{return!1}}function is_mail(str){return/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/.test(str)}jQuery.fn.serializeObject=function(){var o={},a=this.serializeArray();return jQuery.each(a,function(){o[this.name]!==void 0?(o[this.name].push||(o[this.name]=[o[this.name]]),o[this.name].push(this.value||"")):o[this.name]=this.value||""}),o},_win.bd.on("click",".trash-history-search",function(){confirm(aksrt__("confirm_clear_search"))==!0&&(jQuery(".history-search").slideUp().delay(1e3,function(){jQuery(this).remove()}),jQuery.cookie("history_search",""))}),_win.bd.on("click",".initiate-checkin",function(){aksrt_ajax(jQuery(this),0,function(data){data.details_link&&jQuery(".initiate-checkin").each(function(){var $link=jQuery(data.details_link),_this=jQuery(this),_class=_this.attr("class"),_text=_this.attr("ed-text");$link.addClass(_class).removeClass("initiate-checkin").html(_text),_this.prop("outerHTML",$link.prop("outerHTML"))})},aksrt__("checkin_loading"))}),_win.bd.on("click",".single-pay-tabbar",function(){scrollTo("#posts-pay",-50),jQuery("#posts-pay .cashier-link").click()}),_win.bd.on("submit","[ajax-submit]",function(){var _this=jQuery(this),but=_this.attr("ajax-submit")||'.wp-ajax-submit,[zibajax="submit"]';return _this.find(but).click(),!1}),_win.bd.on("click",'.wp-ajax-submit,[zibajax="submit"]',function(){var _this=jQuery(this),confirm_text=_this.attr("data-confirm");return confirm_text&&!confirm(confirm_text)||aksrt_ajax(jQuery(this)),!1});function aksrt_ajax(_this,data,success,noty,no_loading){if(_this.attr("disabled"))return!1;if(!data){var _data=_this.attr("form-data");if(_data)try{data=jQuery.parseJSON(_data)}catch{}if(!data){var form=_this.parents("form");data=form.serializeObject()}}var _action=_this.attr("form-action");_action&&(data.action=_action);var _text=_this.html(),_loading=no_loading?_text:''+aksrt__("please_wait")+"";noty!="stop"&¬yf(noty||aksrt__("processing"),"load","","wp_ajax"),_this.attr("disabled",!0).html(_loading);var _url=_this.attr("ajax-href")||_win.ajax_url;jQuery.ajax({type:"POST",url:_url,data,dataType:"json",error:function(n){var _msg=aksrt_sprintf("ajax_error",n.status,n.statusText);aksrt_is_fatal_error_response(n.responseText)&&(_msg=aksrt__("ajax_fatal_error")),console.error("ajax请求错误,错误信息如下:",n),notyf(_msg,"danger","",noty!="stop"?"wp_ajax":""),_this.attr("disabled",!1).html(_text)},success:function(n){var ys=n.ys?n.ys:n.error?"danger":"";noty!="stop"?notyf(n.msg||aksrt__("done"),ys,"","wp_ajax"):n.msg&¬yf(n.msg,ys),_this.attr("disabled",!1).html(_text).trigger("zib_ajax.success",n),jQuery.isFunction(success)&&success(n,_this,data),n.hide_modal&&_this.closest(".modal").modal("hide"),n.reload&&(n.goto?(window.location.href=n.goto,window.location.reload):window.location.reload())}})}_win.bd.on("zib_ajax.success","[next-tab]",function(e,n){var _next=jQuery(this).attr("next-tab");_next&&n&&!n.error&&jQuery('a[href="#'+_next+'"]').tab("show")}),jQuery(".erphp-login-must").each(function(){jQuery(this).addClass("signin-loader")}),_win.window.resize(debounce(function(){_wid=_win.window.width(),auto_fun()},500)),jQuery(".collapse").on("shown.bs.collapse",function(){auto_fun()}),_win.bd.on("click",".read-more-open",function(){jQuery(this).parents(".limit-height").css({height:"","max-height":""}).find(".read-more").remove()});function posts_limit_height(){if(jQuery(".limit-height").length){var r=jQuery(".limit-height");if(r.data("posts-limit-ison"))return;var r_h=r.height(),r_m=r.attr("data-maxheight");if(~~r_h>=~~r_m+79){var nn='';r.append(nn).data("posts-limit-ison",!0)}}}auto_fun(),thumb_dplayer(_wid>640?".posts-item .item-thumbnail,.forum-lists-cover":".posts-item,.forum-posts",".video-thumb-box[video-url]"),jQuery("[load-click]").attr("no-scroll",!0).click(),jQuery(document).on("lazybeforeunveil",function(e){var _this=jQuery(e.target),lazyload_action=_this.attr("lazyload-action");setTimeout(function(){if(lazyload_action==="ias")if(_this.attr("remote-box"))_this.click();else{var _a=_this.is(".ajax-next,.ias-btn")?_this:_this.find(".ajax-next,.ias-btn");_a.attr("no-scroll",!0).click()}if(lazyload_action=="animated"){var animated=_this.attr("data-animated");animated&&_this.addClass("animated "+animated).css("visibility","unset")}},200);var bg=_this.attr("data-bg");bg&&_this.css("background-image","url("+bg+")")});function fps_yh(){var lastTime=0,frames=0,fps=0,fps_average=0,currentTime,stop=0;function updateFPS(){currentTime=performance.now(),frames++,currentTime-lastTime>=300&&(fps=Math.round(frames*1e3/(currentTime-lastTime)),frames=0,lastTime=currentTime,fps>5&&lastTime>1600&&(fps_average=fps_average||fps,fps_average=(fps_average+fps)/2,fps_average<20&&stop++,stop>5&&jQuery("body").addClass("fps-accelerat"))),stop<=5&&lastTime<15e3?requestAnimationFrame(updateFPS):setCookie()}function setCookie(){jQuery.cookie("fps_accelerat",~~fps_average,{path:"/",expires:604800})}requestAnimationFrame(updateFPS)}!jQuery.cookie("fps_accelerat")&&!jQuery("body").hasClass("fps-accelerat")&&fps_yh();function partners_scroll_init(){function init(widget){if(!(!widget||widget.dataset.zpsReady==="1")){var speed=parseFloat(widget.style.getPropertyValue("--zps-speed"))||3,rows=widget.querySelectorAll("[data-zps-row]");rows.forEach(function(row){var track=row.querySelector("[data-zps-track]");if(track){var seed=track.querySelector(".zps-group");if(seed){var setup=function(){var extras=track.querySelectorAll(".zps-group.zps-clone");extras.forEach(function(el){el.remove()});var groupWidth=seed.scrollWidth;if(!(groupWidth<10)){var rowWidth=row.clientWidth||widget.clientWidth||window.innerWidth,needTotal=Math.max(groupWidth*2,rowWidth+groupWidth),copies=Math.ceil(needTotal/groupWidth);copies<2&&(copies=2);for(var i=1;i0)){pending++;var done=function(){pending--,pending<=0&&setup()};img.addEventListener("load",done,{once:!0}),img.addEventListener("error",done,{once:!0})}});var resizeTimer;window.addEventListener("resize",function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(setup,200)})}}}),widget.dataset.zpsReady="1"}}function initAll(){document.querySelectorAll(".aksrt-partners-scroll").forEach(init)}initAll()}function translate_init(){var translate_config=_win.translate_config;translate_config.s&&tbquire(["translate"],function(){translate.selectLanguageTag.show=!1,translate.language.setLocal(translate_config.local||"chinese_simplified"),translate_config.service_url&&translate.request.setHost(translate_config.service_url),translate_config.ignore_text&&(translate.ignore.text=translate_config.ignore_text),translate_config.nomenclature&&translate_config.nomenclature.length>0&&jQuery.each(translate_config.nomenclature,function(index,item){var from=item.from,to=item.to,value=item.value;from=="auto"&&(from=""),value&&to&&translate.nomenclature.append(from,to,value)}),translate_config.auto_discriminate_local&&translate.setAutoDiscriminateLocalLanguage(),translate_config.range&&translate_config.range.length>0&&(translate.language.translateLanguagesRange=translate_config.range),translate_config.loading&&translate.progress.api.startUITip();var $language_dropdown=jQuery(".language-dropdown .dropdown-menu"),translateStart=debounce(function(){jQuery("[data-language]").removeClass("active"),$language_dropdown.loading("show")},400,!0);translate.lifecycle.changeLanguage.trigger.push(translateStart);var renderFinish=debounce(function(uuid){$language_dropdown.loading("hide"),jQuery("[data-language='"+uuid.to+"']").addClass("active")},400);translate.lifecycle.execute.finally.push(renderFinish),_wid>996&&jQuery(".navbar-top .nav>li>a>.menu-item-title").each(function(){var _this=jQuery(this);_this.css({"max-width":~~_this.outerWidth(!0)+5+"px"})}),translate.ignore.class.push("translate-ignore"),translate.ignore.tag.push("svg"),translate.service.use(translate_config.service_use||"client.edge"),translate.listener.start(),translate.execute()})}_win.bd.on("click",".translate-button",function(){var _this=jQuery(this),language=_this.attr("data-language");translate&&translate.changeLanguage(language)}),(function(){var SELECTOR_class="obs-animate",SELECTOR="."+SELECTOR_class,BASE_CLS="in-view",OBS_FLAG="__zaniObserved",REPEAT_CLS="obs-animate-repeat",noAnim=!("IntersectionObserver"in window)||window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(noAnim){removeAnimation(SELECTOR);return}var rootMargin="100px 0px 0px 0px",c_i=0;function execute(entries){c_i=0;for(var isIntersecting_count=0,j=0;j8&&(delay=delay/(isIntersecting_count/8)),$el.css("transition-delay",delay+"s"),$el.addClass(BASE_CLS),c_i++,is_repeat||stop(el)}else is_repeat&&$el.removeClass(BASE_CLS)}}var io=new IntersectionObserver(execute,{root:null,rootMargin,threshold:.01});function stop(el){!el||el.nodeType!==1||!el[OBS_FLAG]||(el[OBS_FLAG]=!1,io.unobserve(el),setTimeout(function(){removeAnimation(el)},50))}function removeAnimation(el){var animation=jQuery(el).attr("data-animation"),animation_class="ani-"+animation;jQuery(el).removeClass(BASE_CLS+" "+SELECTOR_class+" "+animation_class+" "+REPEAT_CLS).removeAttr("data-animation").removeAttr("data-animation-repeat").css("transition-delay","")}function register(el){!el||el.nodeType!==1||el[OBS_FLAG]||(el[OBS_FLAG]=!0,io.observe(el))}function scan(){jQuery(SELECTOR).each(function(){register(this)})}scan()})();function number_stats_init(){function animateCount(el,duration){var target=parseFloat(el.getAttribute("data-target"))||0;if(target===0){el.textContent="0";return}var raw=el.getAttribute("data-target")||"0",decimals=(raw.split(".")[1]||"").length,_duration=~~el.getAttribute("data-duration");duration=_duration>10?_duration:duration;var start=0,startTs=null;duration=duration||1500;function step(ts){startTs||(startTs=ts);var progress=Math.min((ts-startTs)/duration,1),eased=1-Math.pow(1-progress,1.5),value=start+(target-start)*eased;el.textContent=decimals>0?value.toFixed(decimals):Math.floor(value).toString(),progress<1?requestAnimationFrame(step):el.textContent=decimals>0?target.toFixed(decimals):target.toString()}requestAnimationFrame(step)}var wraps=document.querySelectorAll(".stat-number-wrap");if(wraps.length){if(!("IntersectionObserver"in window)){wraps.forEach(function(wrap){wrap.querySelectorAll(".stat-number").forEach(function(el){el.textContent=el.getAttribute("data-target")||""})});return}var io=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){var wrap=entry.target;wrap.dataset.counted!=="1"&&(wrap.dataset.counted="1",wrap.querySelectorAll(".stat-number").forEach(function(el){animateCount(el,1500)}),io.unobserve(wrap))}})},{threshold:.3});wraps.forEach(function(wrap){io.observe(wrap)})}}_win.bd.on("click",".produck-wid-feature-intro .fi-tab",function(){var _this=jQuery(this);if(!_this.hasClass("is-active")){_this.addClass("is-active"),_this.siblings().removeClass("is-active");var panels=_this.closest(".produck-wid-feature-intro").find(".fi-panel");panels.removeClass("is-active"),panels.eq(_this.index()).addClass("is-active")}});function tilt_cases_init(){function isTouchOrMobile(){var isTouch="ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0,isSmall=window.matchMedia&&window.matchMedia("(max-width: 768px)").matches;return isTouch||isSmall}if(isTouchOrMobile())return;var cases=jQuery(".vanilla-tilt:not(.is-initialized)");if(!cases.length)return;function setTranslate3d(imgs,translate3d){var transform=imgs[0].style.transform;transform.includes("translate3d")&&(transform=transform.replace(/translate3d\(.*?\)/g,"").trim()),transform=transform+" "+translate3d,imgs.css("transform",transform)}tbquire(["tilt"],function(){cases.each(function(){var _this=jQuery(this),imgs=_this.find("img"),maxTilt=parseFloat(_this.attr("data-tilt-max"))||10,n=imgs.length,gain=1.22,hoverZone=_this.closest(".tilt-cases-container")||_this,mes=_this.data("tilt-mouse-event-element");if(mes){_this.removeAttr("data-tilt-mouse-event-element");var elZone=_this.closest(mes);hoverZone=elZone.length?elZone:hoverZone}var opt={};hoverZone.length&&(opt["mouse-event-element"]=hoverZone[0]),_this.addClass("is-initialized"),VanillaTilt.init(this,opt),!(n<=1)&&(this.addEventListener("tiltChange",function(e){var detail=e.detail||{},tx=parseFloat(detail.tiltX)||0,ty=parseFloat(detail.tiltY)||0;imgs.each(function(i){var $img=jQuery(this),base=parseFloat($img.attr("data-tilt-depth"));if(isNaN(base)&&(base=20),base===0){setTranslate3d($img,"translate3d(0,0,0)");return}var layerMul=1;n>1&&(layerMul=.48+i/(n-1)*1.14);var effective=base*gain*layerMul,dx=tx/maxTilt*effective*-1,dy=ty/maxTilt*effective;setTranslate3d($img,"translate3d("+dx+"px, "+dy+"px, 0)")})}),hoverZone&&hoverZone.on("mouseleave",function(){imgs.each(function(){setTranslate3d(jQuery(this),"translate3d(0,0,0)")})}))})})}_win.bd.on("click",".customize-preview-widget-edit",function(e){if(!(!wp||!wp.customize||!wp.customize.widgetsPreview)){var _this=jQuery(this),box=_this.closest(".customize-preview-widget-box");e.preventDefault(),wp.customize.widgetsPreview.preview.send("focus-widget-control",box.prop("id"))}}),jQuery(document).ready(function(){if(setTimeout(function(){jQuery(".line-form-input").each(function(){placeholder_scale(jQuery(this))}),_win.views&&jQuery.post(_win.ajax_url,{action:"views_record",id:_win.views}),posts_limit_height(),_win.window.trigger("scroll")},1e3),number_stats_init(),translate_init(),partners_scroll_init(),tilt_cases_init(),jQuery(".navbar-top li.menu-item-has-children>a").each(function(){jQuery(this).append('')}),_wid>996&&jQuery(".header").height()>81&&nav_folding(),posts_limit_height(),auto_maxHeight(),jQuery(".feature").length){var _feh=0,_fehm=0;jQuery(".feature").each(function(){var _th=jQuery(this);(_feh=_th.find(".feature-icon").innerHeight()+_th.find(".feature-title").innerHeight()+_th.find(".feature-note").innerHeight())>_fehm&&(_fehm=_feh)}),jQuery(".feature").css("height",_fehm)}jQuery(".qrcode").length&&tbquire(["qrcode"],function(){jQuery(".qrcode").each(function(){var _this=jQuery(this),text=_this.attr("data-qrcode"),size=_this.attr("data-size")||160;_this.qrcode({width:size,height:size,correctLevel:0,text:text||document.URL,background:"#fff",foreground:"#333"})})}),jQuery(document).on("lazyloaded",function(e){var _this=jQuery(e.target);swiper_tab_AutoHeight(_this)}),jQuery(document).on("lazyloaded",".gradient-bg img",function(e){var _this=jQuery(e.target),_parent=_this.closest(".gradient-bg"),opacity=_parent.attr("data-opacity"),c_11=opacity?"a":"",c_12=opacity?","+opacity:"";tbquire(["grade"],function(){Grade(_parent[0],null,function(gradientData){gradientData=gradientData[0];var rgba=gradientData.gradientData,c_1="rgb"+c_11+"("+rgba[0].rgba.slice(0,3).join(",")+c_12+") 10%",c_2="rgb"+c_11+"("+rgba[1].rgba.slice(0,3).join(",")+c_12+") 80%";jQuery(gradientData.element).addClass("gradient-bg-loaded").css("background-image","linear-gradient(135deg, "+c_1+", "+c_2+")")})})}),_win.qj_loading&&jQuery(".qj_loading").fadeOut(500).delay(1e3,function(){jQuery(this).remove(),jQuery("#qj_dh_css").remove()});function yiyan_nr(n){var yylink=_win.uri+"/yiyan/qv-yiyan.php",y_nr;jQuery.ajax({type:"POST",url:yylink}).done(function(i){var lines=i.replace(/\r\n|\r/g,"/&/").trim().split("/&/");if(lines){var type=n.attr("type");type?y_nr=type==="en"?lines[0]:lines[1]:y_nr='
    '+lines[0]+'
    '+lines[1]+"
    ",n.html(y_nr)}})}jQuery(".yiyan").each(function(){yiyan_nr(jQuery(this))}),setInterval(function(){jQuery(".yiyan").each(function(){yiyan_nr(jQuery(this))})},3e4),jQuery(".yiyan").on("click",function(){yiyan_nr(jQuery(this))}),jQuery("[mini-touch]").each(function(){var _this=jQuery(this),fx=_this.attr("touch-direction");_this.minitouch({direction:fx,onEnd:function(e){_this.attr("mini-touch")==="mobile-nav"?jQuery("body").removeClass("mobile-navbar-show"):e.removeClass("show")}})})}); +(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('
    '),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('
    '+message+"
    "),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"aksrt-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("aksrt-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.AksrtModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.aksrtData||window2.aksrt||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/aksrt/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["Content-Type"]="application/json"),result}function responseError(result){var json=result.json,message=json&&(json.message||json.data&&json.data.message),error=new Error(message||(result.status?"请求失败(HTTP "+result.status+")":"请求失败"));return error.status=result.status,error.code=result.status===401?"unauthorized":"http_error",error.response=result,error.json=json,error}function parseResponse(response){return response.text().then(function(text){var type=(response.headers.get("content-type")||"").toLowerCase(),json=null,trimmed=String(text||"").trim();if(type.indexOf("application/json")>=0||trimmed.charAt(0)==="{"||trimmed.charAt(0)==="[")try{json=trimmed?JSON.parse(trimmed):{}}catch{json=null}return{ok:response.ok,status:response.status,headers:response.headers,text,json,data:json&&json.data!==void 0?json.data:json}})}function request(path,options){options=Object.assign({},options||{});var requestUrl=url(path,options.query);delete options.query;var fetchOptions=Object.assign({},options,{credentials:options.credentials||"same-origin",headers:headers(options)});return window2.fetch(requestUrl,fetchOptions).then(function(response){return parseResponse(response)}).then(function(result){if(!result.ok||result.json&&result.json.success===!1)throw responseError(result);return result})}window2.AksrtRequest={url,request,createIdempotencyKey,get:function(path,options){return request(path,Object.assign({},options||{},{method:"GET"}))},post:function(path,body,options){return request(path,Object.assign({},options||{},{method:"POST",body}))}}})(window),(function(window2,document2){"use strict";var DEFAULT_TTL=15e3,entries=Object.create(null),flights=Object.create(null),lastScope="";function scope(){var config=window2.aksrtData||window2.aksrt||{},userId=parseInt(config.userId||0,10)||0,current=(config.isLoggedIn&&userId>0?"user:"+userId:"guest")+":v1";return lastScope&&lastScope!==current&&clear(),lastScope=current,current}function token(key){return scope()+"::"+String(key||"")}function read(key){var id=token(key),entry=entries[id];return entry?entry.expiresAt<=Date.now()?(delete entries[id],{hit:!1,value:void 0}):{hit:!0,value:entry.value}:{hit:!1,value:void 0}}function tagsOf(value){return Array.isArray(value)?value.slice():value?[value]:[]}function set(key,value,options){options=options||{};var ttl=Number(options.ttl||DEFAULT_TTL);return entries[token(key)]={value,expiresAt:Date.now()+Math.max(0,ttl),tags:tagsOf(options.tags)},value}function matchesTags(entry,wanted){return wanted.length?wanted.some(function(tag){return entry.tags.indexOf(tag)>=0}):!0}function invalidate(tags){var wanted=Array.isArray(tags)?tags:tags?[tags]:[],removed=0;return Object.keys(entries).forEach(function(id){(!wanted.length||matchesTags(entries[id],wanted))&&(delete entries[id],removed+=1)}),Object.keys(flights).forEach(function(id){var flight=flights[id];(!wanted.length||matchesTags(flight,wanted))&&(flight.cancelled=!0,delete flights[id],typeof flight.cancel=="function"&&flight.cancel())}),removed}function clear(){entries=Object.create(null),Object.keys(flights).forEach(function(id){var flight=flights[id];flight.cancelled=!0,typeof flight.cancel=="function"&&flight.cancel()}),flights=Object.create(null)}function acquire(key,loader,options){options=options||{};var id=token(key),cached=options.skipCache?{hit:!1}:read(key);if(cached.hit)return{cached:!0,promise:Promise.resolve(cached.value),release:function(){}};var flight=flights[id];flight||(flight={refs:0,settled:!1,cancelled:!1,tags:tagsOf(options.tags),cancel:options.cancel},flight.promise=Promise.resolve().then(loader).then(function(value){return flight.settled=!0,!flight.cancelled&&options.store!==!1&&set(key,value,options),flights[id]===flight&&delete flights[id],value},function(error){throw flight.settled=!0,flights[id]===flight&&delete flights[id],error}),flights[id]=flight),flight.refs+=1;var released=!1;return{cached:!1,promise:flight.promise,release:function(){released||(released=!0,flight.refs=Math.max(0,flight.refs-1),flight.refs===0&&!flight.settled&&(flight.cancelled=!0,flights[id]===flight&&delete flights[id],typeof flight.cancel=="function"&&flight.cancel()))}}}["aksrt:auth:logout","aksrt:account-switch","aksrt:logout","aksrt:user:logout","aksrt:auth:changed","wp_logout"].forEach(function(eventName){document2.addEventListener(eventName,clear)}),window2.AksrtModalCache={get:function(key){return read(key)},set,acquire,invalidate,clear,scope}})(window,document),(function(window2){"use strict";var statuses={idle:"idle",loading:"loading",ready:"ready",empty:"empty",submitting:"submitting",success:"success",error:"error",unauthorized:"unauthorized",stale:"stale"};function create(kind){return{kind:String(kind||"generic"),status:statuses.idle,updatedAt:0,error:null}}window2.AksrtModalState={statuses,create}})(window),(function(window2,document2){"use strict";var ROOT_ID="aksrt-modal-runtime-root",active=null,sequence=0,loaders=Object.create(null);function isMobile(){return window2.matchMedia&&window2.matchMedia("(max-width: 768px)").matches}function ensureRoot(){var root=document2.getElementById(ROOT_ID);return root||(root=document2.createElement("div"),root.id=ROOT_ID,root.className="aksrt-modal-runtime-host",document2.body.appendChild(root),root)}function escapeHtml(value){return String(value??"").replace(/&/g,"&").replace(//g,">").replace(/\"/g,""").replace(/'/g,"'")}function lockScroll(lock){document2.documentElement.classList.toggle("aksrt-modal-runtime-open",!!lock),document2.body.classList.toggle("aksrt-modal-runtime-open",!!lock)}function skeleton(options){return options&&options.skeleton||'
    '}function telemetryStart(kind){return kind===!1?"":window2.AksrtModalTelemetry.start(kind||"generic")}function telemetryMark(session,event){!session||!session.telemetryId||window2.AksrtModalTelemetry.mark(session.telemetryId,event)}function setState(session,status,error){session.state.status=status,session.state.error=error||null,session.state.updatedAt=Date.now(),session.shell&&session.shell.setAttribute("data-aksrt-modal-state",status),typeof session.options.onState=="function"&&session.options.onState(status,session)}function focusable(shell){return shell.querySelectorAll("button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])")}function closeSelector(){return"[data-aksrt-modal-close], .aksrt-modal-runtime__close"}function bindChrome(session){var shell=session.shell;shell.addEventListener("click",function(event){var closeButton=event.target.closest(closeSelector());if(closeButton){event.preventDefault(),close("control");return}if(event.target===shell||event.target.classList.contains("aksrt-modal-runtime__overlay")){close("overlay");return}var retry=event.target.closest("[data-aksrt-modal-retry]");retry&&(event.preventDefault(),refresh())}),shell.addEventListener("keydown",function(event){if(event.key==="Escape"){event.preventDefault(),close("escape");return}if(event.key==="Tab"){var nodes=focusable(shell);if(!nodes.length){event.preventDefault(),shell.focus();return}var first=nodes[0],last=nodes[nodes.length-1];event.shiftKey&&document2.activeElement===first?(event.preventDefault(),last.focus()):!event.shiftKey&&document2.activeElement===last&&(event.preventDefault(),first.focus())}})}function createSession(options){options=options||{};var root=ensureRoot(),shell=document2.createElement("div"),bottom=options.bottom===!0||options.mobileBottom!==!1&&isMobile(),heightStyle=options.height?"min-height:"+parseInt(options.height,10)+"px;":"",initialHtml=options.html!==void 0?options.html:skeleton(options),titleId="aksrt-modal-title-"+String(sequence+1),titleHtml=options.title?'

    '+escapeHtml(options.title)+'

    ':"";shell.className="aksrt-modal-runtime"+(bottom?" aksrt-modal-runtime--bottom":"")+(options.className?" "+options.className:""),shell.setAttribute("role","dialog"),shell.setAttribute("aria-modal","true"),options.title&&shell.setAttribute("aria-labelledby",titleId),shell.setAttribute("tabindex","-1"),shell.innerHTML='
    '+titleHtml+'
    '+initialHtml+"
    ";var session={id:String(++sequence),shell,content:shell.querySelector(".aksrt-modal-runtime__content"),options,state:window2.AksrtModalState.create(options.kind||"generic"),focusReturn:document2.activeElement,controller:null,flight:null,closed:!1,telemetryId:telemetryStart(options.telemetry===!1?!1:options.kind)};root.appendChild(shell),bindChrome(session),active=session,lockScroll(!0),shell.offsetWidth,shell.classList.add("is-open"),setState(session,options.html!==void 0?"ready":"loading"),telemetryMark(session,"shell");var nodes=focusable(shell);try{(nodes.length?nodes[0]:shell).focus()}catch{}return document2.dispatchEvent(new CustomEvent("aksrt:modal:open",{detail:{shell,options,session}})),options.html!==void 0&&(notifyContentLoaded(session),telemetryMark(session,"first-content"),telemetryMark(session,"ready"),typeof options.onContent=="function"&&options.onContent(options.html,session)),session}function notifyContentLoaded(session){!session||!session.shell||!window2.jQuery||window2.jQuery(session.shell).trigger("loaded.bs.modal")}function abortSessionRequest(session){if(session){if(session.flight&&typeof session.flight.release=="function"&&session.flight.release(),session.flight=null,session.controller)try{session.controller.abort()}catch{}session.controller=null}}function close(reason,preserveRequest){if(active){var session=active;active=null,session.closed=!0,preserveRequest||abortSessionRequest(session),session.shell.classList.remove("is-open"),preserveRequest||lockScroll(!1),document2.dispatchEvent(new CustomEvent("aksrt:modal:close",{detail:{shell:session.shell,reason:reason||"close",session}}));var node=session.shell;window2.setTimeout(function(){node&&node.parentNode&&node.parentNode.removeChild(node);var target=session.focusReturn;if(!preserveRequest&&!active&&target&&target!==node&&document2.contains(target)&&typeof target.focus=="function")try{target.focus()}catch{}},220)}}function responseData(result){return result?result.data!==void 0&&result.data!==null?result.data:result.json&&result.json.data!==void 0?result.json.data:result.json:null}function responseHtml(result){var data=responseData(result);return data&&typeof data.html=="string"?data.html:result&&result.json&&typeof result.json.html=="string"?result.json.html:result&&typeof result.text=="string"?result.text:""}function errorMessage(error){return error&&error.code==="unauthorized"?"请先登录":error&&error.message?String(error.message):"加载失败,请重试"}function renderError(session,error){if(!(!session||session.closed||active!==session)){var unauthorized=error&&error.code==="unauthorized";setState(session,unauthorized?"unauthorized":"error",error),telemetryMark(session,unauthorized?"unauthorized":"error"),session.content.innerHTML='
    提示
    '+escapeHtml(errorMessage(error))+'
    ',notifyContentLoaded(session),typeof session.options.onError=="function"&&session.options.onError(error,session)}}function renderResult(session,result){if(!(!session||session.closed||active!==session)){if(session.options.responseType==="json"||typeof session.options.renderData=="function"){var data=responseData(result);if(data==null){setState(session,"empty"),telemetryMark(session,"first-content"),telemetryMark(session,"ready"),session.content.innerHTML='
    暂无内容
    ';return}typeof session.options.renderData=="function"&&session.options.renderData(data,session,result),setState(session,"ready"),telemetryMark(session,"first-content"),notifyContentLoaded(session),telemetryMark(session,"ready"),typeof session.options.onData=="function"&&session.options.onData(data,session,result);return}var html=responseHtml(result);if(!html){setState(session,"empty"),telemetryMark(session,"first-content"),telemetryMark(session,"ready"),session.content.innerHTML='
    暂无内容
    ';return}session.content.innerHTML=html,setState(session,"ready"),telemetryMark(session,"first-content"),notifyContentLoaded(session),telemetryMark(session,"ready"),typeof session.options.onContent=="function"&&session.options.onContent(html,session)}}function load(session,loadOptions){if(loadOptions=loadOptions||{},!session||session.closed||!session.options.url)return Promise.resolve(session&&session.shell);abortSessionRequest(session),setState(session,"loading"),session.content.innerHTML=skeleton(session.options),session.controller=window2.AbortController?new window2.AbortController:null;var requestOptions={method:session.options.method||"GET",headers:session.options.headers||{},body:session.options.body,query:session.options.query,signal:session.controller?session.controller.signal:void 0};requestOptions.body===void 0&&delete requestOptions.body,requestOptions.signal||delete requestOptions.signal;var request=function(){return window2.AksrtRequest.request(session.options.url,requestOptions)},method=String(session.options.method||"GET").toUpperCase(),cacheable=method==="GET"&&session.options.cache!==!1,cacheKey=session.options.cacheKey||method+":"+window2.AksrtRequest.url(session.options.url,session.options.query),cache=window2.AksrtModalCache,acquireOptions={ttl:Number(session.options.cacheTtl||15e3),tags:session.options.cacheTags||session.options.tags||[],skipCache:!!loadOptions.force||!cacheable,store:cacheable,cancel:function(){if(session.controller)try{session.controller.abort()}catch{}}},flight=cacheable?cache.acquire(cacheKey,request,acquireOptions):{promise:request(),release:function(){}};return session.flight=flight,flight.promise.then(function(result){return!session.closed&&active===session&&renderResult(session,result),session.shell}).catch(function(error){var aborted=error&&(error.name==="AbortError"||error.code==="ABORT_ERR");return!aborted&&!session.closed&&active===session&&renderError(session,error),session.shell}).then(function(shell){return session.flight===flight&&(flight&&typeof flight.release=="function"&&flight.release(),session.flight=null),shell})}function open(options){options=options||{},close("replace");var session=createSession(options);return session.shell}function sessionKey(options){if(!options||!options.url)return"";var method=String(options.method||"GET").toUpperCase(),requestUrl=window2.AksrtRequest.url(options.url,options.query);return method+":"+requestUrl}function openRemote(options){if(options=Object.assign({},options||{}),!options.url)return Promise.reject(new Error("missing url"));var sameRequest=active&&active.flight&&sessionKey(active.options)===sessionKey(options);close("replace",!!sameRequest);var session=createSession(options);return load(session).then(function(){return session.shell})}function refresh(options){return!active||!active.options.url?Promise.resolve(null):(options&&typeof options=="object"&&(active.options=Object.assign({},active.options,options)),load(active,{force:!0}))}function registerLoader(kind,loader){!kind||typeof loader!="function"||(loaders[String(kind)]=loader)}function openLoader(kind,context){var loader=loaders[String(kind)];return loader?openRemote(loader(context||{})):Promise.reject(new Error("missing modal loader: "+kind))}function invalidate(tags){return window2.AksrtModalCache.invalidate(tags)}window2.AksrtModalRuntime={open,openRemote,close,refresh,registerLoader,openLoader,invalidate,getActive:function(){return active?active.shell:null},getState:function(){return active?active.state:null}},document2.dispatchEvent(new CustomEvent("aksrt:modal-runtime:ready")),window2.jQuery&&window2.jQuery(document2).on("loaded.bs.modal show.bs.modal",".modal, .aksrt-modal-runtime",function(){typeof window2.auto_fun=="function"&&window2.auto_fun()})})(window,document),(function(window2,document2){"use strict";function openFromTrigger(element){var runtime=window2.AksrtModalRuntime,url=element.getAttribute("data-aksrt-modal-url")||"";if(!(!url||url==="#")){var ttl=parseInt(element.getAttribute("data-aksrt-modal-cache-ttl")||"15000",10),cache=element.getAttribute("data-aksrt-modal-cache")!=="false",tags=(element.getAttribute("data-aksrt-modal-cache-tags")||"").split(",").map(function(tag){return tag.trim()}).filter(Boolean);runtime.openRemote({url,method:element.getAttribute("data-aksrt-modal-method")||"GET",className:element.getAttribute("data-aksrt-modal-class")||"modal-mini full-sm",height:parseInt(element.getAttribute("data-aksrt-modal-height")||"0",10)||0,mobileBottom:element.getAttribute("data-aksrt-modal-mobile-bottom")==="true",bottom:element.getAttribute("data-aksrt-modal-bottom")==="true",kind:element.getAttribute("data-aksrt-modal-kind")||"generic",cacheKey:element.getAttribute("data-aksrt-modal-cache-key")||"",cache,cacheTtl:ttl>0?ttl:15e3,cacheTags:tags})}}document2.addEventListener("click",function(event){var trigger=event.target.closest('[data-aksrt-modal="remote"]');trigger&&(event.preventDefault(),openFromTrigger(trigger))})})(window,document),(function(){"use strict";function initPasswordToggles(root){(root||document).querySelectorAll(".toggle-pwd").forEach(function(btn){btn.dataset.pwdToggleBound||(btn.dataset.pwdToggleBound="1",btn.addEventListener("click",function(){var id=btn.getAttribute("data-target"),input=id?document.getElementById(id):null;if(input){var show=input.getAttribute("type")==="password";input.setAttribute("type",show?"text":"password"),btn.setAttribute("aria-label",show?"隐藏密码":"显示密码")}}))})}function initSearchClear(){var btn=document.getElementById("search-clear-btn"),input=document.getElementById("search-page-input");if(btn&&input&&!btn.dataset.aksrtSearchClearBound){btn.dataset.aksrtSearchClearBound="1";var syncClearButton=function(){var hasValue=input.value.trim().length>0;btn.classList.toggle("is-visible",hasValue),btn.hidden=!hasValue};btn.addEventListener("click",function(){input.value="",input.focus(),syncClearButton()}),input.addEventListener("input",syncClearButton),syncClearButton()}var categorySelect=document.getElementById("search-category-filter");categorySelect&&categorySelect.addEventListener("change",function(){var url=new URL(window.location.href);this.value?url.searchParams.set("aksrt_category",this.value):url.searchParams.delete("aksrt_category"),url.searchParams.get("aksrt_search_type")&&url.searchParams.get("aksrt_search_type")!=="post"&&url.searchParams.delete("aksrt_category"),url.searchParams.delete("paged"),window.location.href=url.toString()})}function initArticleTools(){var buttons=document.querySelectorAll("[data-article-tool]");buttons.length&&buttons.forEach(function(button){button.dataset.aksrtArticleToolBound||(button.dataset.aksrtArticleToolBound="1",button.addEventListener("click",function(){var tool=button.getAttribute("data-article-tool");if(tool==="print"){window.print();return}tool==="pdf"&&(window.print(),notyf("请在打印对话框中选择“另存为 PDF”","info"))}))})}var postMetaDocumentEventsBound=!1;function setPostMetaMenuState(menuRoot,open){var toggle=menuRoot.querySelector(".post-drop-meta__toggle"),menu=menuRoot.querySelector(".post-drop-meta__menu");!toggle||!menu||(menuRoot.classList.toggle("is-open",open),toggle.setAttribute("aria-expanded",open?"true":"false"),menu.setAttribute("aria-hidden",open?"false":"true"))}function closePostMetaMenus(except,restoreFocus){document.querySelectorAll(".post-drop-meta.is-open").forEach(function(menuRoot){if(menuRoot!==except){var toggle=menuRoot.querySelector(".post-drop-meta__toggle");setPostMetaMenuState(menuRoot,!1),restoreFocus&&toggle&&toggle.focus()}})}function initPostMetaMenus(root){var scope=root||document,menuRoots=[];scope.nodeType===1&&scope.matches(".post-drop-meta")&&menuRoots.push(scope),scope.querySelectorAll(".post-drop-meta").forEach(function(menuRoot){menuRoots.push(menuRoot)}),menuRoots.forEach(function(menuRoot){var toggle=menuRoot.querySelector(".post-drop-meta__toggle"),menu=menuRoot.querySelector(".post-drop-meta__menu");!toggle||!menu||toggle.dataset.postMetaMenuBound||(toggle.dataset.postMetaMenuBound="1",setPostMetaMenuState(menuRoot,!1),toggle.addEventListener("click",function(){var open=!menuRoot.classList.contains("is-open");closePostMetaMenus(menuRoot,!1),setPostMetaMenuState(menuRoot,open)}),menu.addEventListener("click",function(event){event.target.closest(".post-drop-meta__item")&&setPostMetaMenuState(menuRoot,!1)}))}),menuRoots.length&&!postMetaDocumentEventsBound&&(postMetaDocumentEventsBound=!0,document.addEventListener("click",function(event){event.target.closest(".post-drop-meta")||closePostMetaMenus(null,!1)}),document.addEventListener("keydown",function(event){event.key==="Escape"&&closePostMetaMenus(null,!0)}))}function getBaseStatCount(statName){var statEl=document.querySelector('[data-stat-count="'+statName+'"][data-base-count]');return statEl&&parseInt(statEl.dataset.baseCount,10)||0}function updateStatCounts(statName,count){var safeCount=Math.max(0,count);document.querySelectorAll('[data-stat-count="'+statName+'"]').forEach(function(statEl){statEl.textContent=String(safeCount)})}function setBaseStatCount(statName,count){var safeCount=Math.max(0,count);document.querySelectorAll('[data-stat-count="'+statName+'"][data-base-count]').forEach(function(statEl){statEl.dataset.baseCount=String(safeCount)}),updateStatCounts(statName,safeCount)}function requestInteraction(actionName,postId,active){if(!window.aksrtData||!aksrtData.ajaxUrl||!aksrtData.nonce)return Promise.reject(new Error("互动服务未配置"));var body=new URLSearchParams;return body.set("action",actionName),body.set("nonce",aksrtData.nonce),body.set("postId",String(postId)),body.set("active",active?"1":"0"),fetch(aksrtData.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},credentials:"same-origin",body:body.toString()}).then(function(response){return response.json().catch(function(){throw new Error("服务器返回无效响应")})}).then(function(payload){if(!payload||!payload.success){var message=payload&&payload.data&&payload.data.message?payload.data.message:"请求失败";throw new Error(message)}return payload.data||{}})}function setButtonBusy(button,busy){button.disabled=!!busy,button.classList.toggle("is-loading",!!busy)}function findInScope(scope,id){return scope=scope||document,scope?scope.nodeType===9?scope.getElementById(id):scope.nodeType===1?scope.id===id?scope:typeof scope.querySelector=="function"?scope.querySelector("#"+id):null:null:null}function collectActionButtons(scope,selector){scope=scope||document;var list=[];if(!scope)return list;if(scope.nodeType===1&&scope.matches&&scope.matches(selector)&&list.push(scope),typeof scope.querySelectorAll=="function")for(var found=scope.querySelectorAll(selector),i=0;i=0?"action-like":selector.indexOf("action-favorite")>=0?"action-favorite":"";if(legacyId){var legacy=findInScope(scope,legacyId);legacy&&list.indexOf(legacy)===-1&&list.push(legacy)}return list}function initInteractionBar(root){var scope=root||document,likeBtns=collectActionButtons(scope,".action-like[data-post-id]"),favBtns=collectActionButtons(scope,".action-favorite[data-post-id]");function paintLike(btn,isActive){btn.dataset.initialActive=isActive?"1":"0",btn.classList.toggle("is-active",isActive);var icon=btn.querySelector("i");icon&&(icon.className="fa fas fa-heart")}function paintFavorite(btn,isActive){btn.dataset.initialActive=isActive?"1":"0",btn.classList.toggle("is-active",isActive);var icon=btn.querySelector("i");icon&&(icon.className="fa fas fa-star")}function applyLikeState(isActive,count){for(var i=0;i '+loadingText,loadingText)}else isSubmitting=!1,submitBtn.classList.remove("is-loading"),submitBtn.classList.remove("countdown-active"),submitBtn.disabled=!1,setSubmitBtnContent(originalBtnHTML,originalBtnHTML)}function collectFormData(){var formData=new FormData(form),postId=document.querySelector('input[name="comment_post_ID"]');return postId&&!formData.get("comment_post_ID")&&formData.append("comment_post_ID",postId.value),formData}function startCountdown(seconds){countdownTimer&&clearInterval(countdownTimer),submitBtn.classList.add("countdown-active"),submitBtn.disabled=!0;var remaining=seconds;countdownTimer=setInterval(function(){setSubmitBtnContent(' 请等待 '+remaining+"s","请等待 "+remaining+"s"),--remaining<=0&&(clearInterval(countdownTimer),countdownTimer=null,submitBtn.classList.remove("countdown-active","is-loading"),submitBtn.disabled=!1,setSubmitBtnContent(originalBtnHTML,originalBtnHTML),isSubmitting=!1)},1e3)}function updateCommentCount(delta){var countEl=document.querySelector("#comments .title-theme small");if(countEl){var text=countEl.textContent||"",match=text.match(/(\d+)/);if(match){var nextCount=Math.max(0,parseInt(match[1],10)+delta);countEl.textContent=text.replace(match[1],String(nextCount))}}}function performSubmit(captchaPayload){setLoading(!0);var formData=collectFormData(),restRoot=window.aksrtData&&aksrtData.siteUrl?String(aksrtData.siteUrl).replace(/\/$/,""):"",editId=form.querySelector('[name="edit_comment_ID"]'),isEdit=editId&&parseInt(editId.value,10)>0,restBase=(restRoot||"")+"/wp-json/aksrt/v1/comment/"+(isEdit?"edit":"submit"),restBody={};formData.forEach(function(v,k){restBody[k]=v}),Object.assign(restBody,captchaPayload||{}),isEdit&&(restBody.comment_id=parseInt(editId.value,10),restBody.content=restBody.comment||restBody.content||""),fetch(restBase,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.aksrtData&&aksrtData.restNonce||""},credentials:"same-origin",body:JSON.stringify(restBody)}).then(function(r){return r.json()}).then(function(json){if(isEdit&&json&&json.success){var cid=restBody.comment_id,contentEl=document.querySelector("#comment-content-"+cid+', [data-comment-id="'+cid+'"] .comment-content'),rendered=json.data&&json.data.content||json.content||"";contentEl&&rendered&&(contentEl.innerHTML=rendered);var textarea=form.querySelector("#comment");textarea&&(textarea.value=""),editId&&editId.remove(),restoreRespondPosition(),setLoading(!1),notyf(json.message||"评论已更新","success");var respondEl=document.getElementById("respond");respondEl&&window.AksrtFixedInput&&window.AksrtFixedInput(respondEl,"hide");return}if(json&&json.success&&json.html){localInsertComment(json.html,json.is_reply,json.parent_id,json.needs_moderation);var textarea=form.querySelector("#comment");textarea&&(textarea.value="");var replyInfo=document.getElementById("comment-reply-info");replyInfo&&(replyInfo.style.display="none"),json.wait_time&&json.wait_time>0?startCountdown(json.wait_time):setLoading(!1),restoreRespondPosition();var respondEl=document.getElementById("respond");respondEl&&window.AksrtFixedInput?window.AksrtFixedInput(respondEl,"hide"):respondEl&&respondEl.classList.remove("show");var editField=form.querySelector('[name="edit_comment_ID"]');editField&&editField.remove();return}if(json&&json.code){notyf(json.message||"评论提交失败","danger"),json.wait_time?startCountdown(json.wait_time):setLoading(!1);return}notyf("评论已提交","success"),setLoading(!1),setTimeout(function(){reloadCommentList()},500)}).catch(function(error){console.error("[AKSRT Comment] 提交失败:",error),notyf(error&&error.message||"网络连接失败,请检查网络后重试","danger"),setLoading(!1)}).finally(function(){window.AKSRTCaptcha&&window.AKSRTCaptcha.reset("comment",form),!countdownTimer&&isSubmitting&&setLoading(!1)})}function localInsertComment(html,isReply,parentId,needsModeration){var temp=document.createElement("div");temp.innerHTML=html;var newComment=temp.firstElementChild;if(!newComment){reloadCommentList();return}if(newComment.style.overflow="hidden",newComment.style.maxHeight="0",newComment.style.opacity="0",newComment.style.transition="max-height 0.4s ease, opacity 0.3s ease",isReply&&parentId){var parentComment=document.querySelector("#comment-"+parentId);if(parentComment){var children=parentComment.querySelector(":scope > .children");children||(children=document.createElement("ol"),children.className="children",parentComment.appendChild(children)),children.insertBefore(newComment,children.firstChild)}else prependToCommentList(newComment)}else prependToCommentList(newComment);requestAnimationFrame(function(){newComment.style.maxHeight=newComment.scrollHeight+100+"px",newComment.style.opacity="1",setTimeout(function(){newComment.style.maxHeight="",newComment.style.overflow="",newComment.style.transition=""},500)}),needsModeration?notyf("评论已提交,等待管理员审核","info"):notyf("评论发布成功","success"),newComment.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun(),updateCommentCount(1)}function prependToCommentList(el){var list=document.querySelector("#comments .commentlist");if(list){var filter=list.querySelector(".comment-filter");filter&&filter.nextSibling?list.insertBefore(el,filter.nextSibling):list.insertBefore(el,list.firstChild)}}function restoreRespondPosition(){var respond=document.getElementById("respond"),placeholder=document.getElementById("wp-temp-form-div");respond&&placeholder&&placeholder.parentNode&&(placeholder.parentNode.insertBefore(respond,placeholder),placeholder.remove())}function handleSubmit(e){if(isSubmitting||countdownTimer)return e.preventDefault(),e.stopImmediatePropagation(),!1;e.preventDefault(),e.stopImmediatePropagation();var captcha=window.AKSRTCaptcha;return setLoading(!0),(captcha?captcha.run("comment",form):Promise.resolve({})).then(function(captchaPayload){if(captchaPayload===null){notyf("人机验证未通过,请重试","warning"),setLoading(!1);return}performSubmit(captchaPayload)}).catch(function(){notyf("人机验证未通过,请重试","warning"),setLoading(!1),captcha&&captcha.reset("comment",form)}),!1}form.addEventListener("submit",handleSubmit,!0)}function getCommentsRestBase(){var root=window.aksrtData&&aksrtData.siteUrl?String(aksrtData.siteUrl).replace(/\/$/,""):"";return root+"/wp-json/aksrt/v1"}function getCurrentCommentPostId(){var input=document.querySelector('input[name="comment_post_ID"]');if(input&&input.value)return parseInt(input.value,10)||0;var comments=document.getElementById("comments");return comments&&comments.dataset.postId&&parseInt(comments.dataset.postId,10)||0}function getCurrentCommentOrder(){var active=document.querySelector("#comments .comment-order-box li.active .comment-orderby");if(active&&active.dataset&&active.dataset.order)return active.dataset.order;var url=new URL(window.location.href);return url.searchParams.get("aksrt_comment_order")||"newest"}function getCurrentAuthorOnly(){var btn=document.querySelector("#comments .btn-only-author");return!!(btn&&btn.classList.contains("active")&&btn.dataset.authorOnly==="0")}var COMMENT_URL_PARAMS=["cpage","aksrt_comment_order","aksrt_author_only"],commentUrlStateCleaned=!1;function stripCommentUrlParams(){if(!(commentUrlStateCleaned||!window.history||typeof window.history.replaceState!="function")){commentUrlStateCleaned=!0;var url=new URL(window.location.href),changed=!1;COMMENT_URL_PARAMS.forEach(function(key){url.searchParams.has(key)&&(url.searchParams.delete(key),changed=!0)}),changed&&window.history.replaceState(null,"",url.toString())}}function getMaxCommentPages(){var pagenav=document.querySelector("#comments .pagenav[data-max-pages]");if(pagenav){var max=parseInt(pagenav.dataset.maxPages,10);if(max>0)return max}var jumpInput=document.querySelector("#comments .jump-input[max]");if(jumpInput){var maxAttr=parseInt(jumpInput.getAttribute("max"),10);if(maxAttr>0)return maxAttr}return 1}function parseCommentPageFromHref(href){if(!href||href==="#"||href.indexOf("javascript:")===0)return 0;try{var url=new URL(href,window.location.href),cpage=parseInt(url.searchParams.get("cpage"),10);if(cpage>0)return cpage;var match=url.pathname.match(/\/comment-page-([0-9]{1,})\/?$/);return match?parseInt(match[1],10):0}catch{return 0}}function scrollCommentsIntoView(){var commentsArea=document.getElementById("comments");if(!(!commentsArea||typeof commentsArea.scrollIntoView!="function")){var rect=commentsArea.getBoundingClientRect();rect.top>=0&&rect.top1&&(page=Math.min(page,maxPages)),showListLoading(commentsArea),fetchCommentFragment({order:getCurrentCommentOrder(),authorOnly:getCurrentAuthorOnly(),page}).then(function(json){if(json&&json.success&&json.data)return applyFragmentPayload(commentsArea,json.data),opts.noScroll||scrollCommentsIntoView(),!0;throw new Error("comment fragment failed")})}function applyFragmentPayload(commentsArea,data){if(!(!commentsArea||!data||!data.html)){var tempList=document.createElement("div");tempList.innerHTML=data.html;var newListWrap=tempList.querySelector("#postcomments");if(newListWrap){var currentListWrap=commentsArea.querySelector("#postcomments");currentListWrap?currentListWrap.replaceWith(newListWrap):commentsArea.appendChild(newListWrap);var currentCount=commentsArea.querySelector(".title-theme small");currentCount&&data.count_text&&(currentCount.textContent=data.count_text),newListWrap.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun()}}}function fetchCommentFragment(opts){opts=opts||{};var postId=opts.postId||getCurrentCommentPostId();if(!postId)return Promise.reject(new Error("missing post id"));var order=opts.order||getCurrentCommentOrder()||"newest",authorOnly=!!opts.authorOnly,page=opts.page||1,qs=new URLSearchParams;qs.set("post_id",String(postId)),qs.set("order",order),qs.set("page",String(page)),authorOnly&&qs.set("author_only","1");var url=getCommentsRestBase()+"/comment/list?"+qs.toString();return fetch(url,{method:"GET",credentials:"same-origin",headers:{"X-WP-Nonce":window.aksrtData&&aksrtData.restNonce||""}}).then(function(r){return r.json()})}function showListLoading(commentsArea){var list=commentsArea.querySelector(".commentlist");if(list){var filter=list.querySelector(".comment-filter"),loader=list.querySelector(".post_ajax_loader"),skeleton=loader?loader.cloneNode(!0):null;Array.prototype.slice.call(list.children).forEach(function(child){child!==filter&&child!==loader&&child.remove()}),skeleton&&(skeleton.style.display="block",skeleton.removeAttribute("hidden"),list.appendChild(skeleton))}}function reloadCommentList(){loadCommentPage(1,{noScroll:!0}).catch(function(error){console.error("[AKSRT Comment] 刷新评论列表失败:",error),window.location.reload()})}function findInScope(scope,id){return scope=scope||document,scope?scope.nodeType===9?scope.getElementById(id):scope.nodeType===1?scope.id===id?scope:typeof scope.querySelector=="function"?scope.querySelector("#"+id):null:null:null}function initCommentOrder(root){var scope=root||document,commentsArea=findInScope(scope,"comments");if(!commentsArea||commentsArea.dataset.orderInit==="1")return;commentsArea.dataset.orderInit="1";function renderLoadingState(){showListLoading(commentsArea)}function applyCommentOrder(order){order!=="newest"&&order!=="oldest"&&order!=="hottest"&&(order="newest"),renderLoadingState();var authorOnly=getCurrentAuthorOnly();fetchCommentFragment({order,authorOnly,page:1}).then(function(json){if(json&&json.success&&json.data){applyFragmentPayload(commentsArea,json.data);return}throw new Error("order fragment failed")}).catch(function(error){console.error("[AKSRT Comment] 排序刷新失败:",error),window.location.reload()})}function applyAuthorFilter(authorOnlyFlag){renderLoadingState();var authorOnly=authorOnlyFlag==="1"||authorOnlyFlag===1||authorOnlyFlag===!0,order=getCurrentCommentOrder();fetchCommentFragment({order,authorOnly,page:1}).then(function(json){if(json&&json.success&&json.data){applyFragmentPayload(commentsArea,json.data);return}throw new Error("author fragment failed")}).catch(function(error){console.error("[AKSRT Comment] Author filter failed:",error),window.location.reload()})}commentsArea.addEventListener("click",function(e){var target=e.target;if(!(!target||typeof target.closest!="function")){var authorBtn=target.closest(".btn-only-author");if(authorBtn&&commentsArea.contains(authorBtn)){e.preventDefault(),applyAuthorFilter(authorBtn.getAttribute("data-author-only")||"0");return}var orderBtn=target.closest(".comment-orderby[data-order]");if(orderBtn&&commentsArea.contains(orderBtn)){e.preventDefault(),applyCommentOrder(orderBtn.getAttribute("data-order")||"newest");return}var pageLink=target.closest(".pagenav a.page-numbers");if(pageLink&&commentsArea.contains(pageLink)&&!pageLink.classList.contains("pag-jump")){var page=parseCommentPageFromHref(pageLink.getAttribute("href"));page>0&&(e.preventDefault(),loadCommentPage(page).catch(function(error){console.error("[AKSRT Comment] 分页刷新失败:",error),window.location.href=pageLink.href}))}}})}var commentPageJumpBound=!1;function jumpToCommentPage(page){loadCommentPage(page).catch(function(error){console.error("[AKSRT Comment] 跳页失败:",error),window.location.reload()})}function initCommentPageJump(){commentPageJumpBound||(commentPageJumpBound=!0,document.addEventListener("click",function(e){var jump=e.target.closest?e.target.closest("#comments .pag-jump"):null;if(jump){e.preventDefault();var input=jump.querySelector(".jump-input");input&&jumpToCommentPage(input.value)}}),document.addEventListener("keydown",function(e){if(e.key==="Enter"){var input=e.target;!input||!input.classList||!input.classList.contains("jump-input")||input.closest("#comments .pagenav")&&(e.preventDefault(),jumpToCommentPage(input.value))}}))}function init(){stripCommentUrlParams(),initCommentSystem(),initCommentPageJump(),initCommentOrder()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init),window.AksrtComments={loadPage:function(page,opts){return loadCommentPage(page,opts)},reload:function(){reloadCommentList()}}})(),(function(){"use strict";function FixedInput(el,action){if(el){if(el.dataset.fixedBound||(el.addEventListener("click",function(e){e.target&&e.target.closest&&e.target.closest(".fixed-body")&&FixedInput(el,"hide")}),el.dataset.fixedBound="1"),action==="show"){el.classList.add("show"),window.setTimeout(function(){var field=el.querySelector("textarea, input");field&&field.focus()},100);return}if(action==="hide"){var cancel=el.querySelector("#cancel-comment-reply-link");cancel&&cancel.click(),el.querySelectorAll("input,textarea").forEach(function(n){try{n.blur()}catch{}}),el.querySelectorAll(".dropup.open, .open").forEach(function(n){n.classList.remove("open")}),el.classList.remove("show")}}}document.addEventListener("click",function(e){var trigger=e.target&&e.target.closest?e.target.closest("[fixed-input]"):null;if(trigger){e.preventDefault();var targetSel=trigger.getAttribute("fixed-input")||"#respond",panel=document.querySelector(targetSel),comments=document.getElementById("comments");comments&&comments.scrollIntoView&&comments.scrollIntoView({behavior:"smooth",block:"start"}),FixedInput(panel,"show")}});function bindAutoheight(ta){if(!(!ta||ta.dataset.autoheightBound)){ta.dataset.autoheightBound="1";var max=parseInt(ta.getAttribute("maxheight")||"188",10)||188,resize=function(){ta.style.height="auto";var h=Math.min(ta.scrollHeight,max);ta.style.height=h+"px",ta.style.overflowY=ta.scrollHeight>max?"auto":"hidden"};ta.addEventListener("input",resize),resize()}}function scan(){document.querySelectorAll("textarea[autoheight], textarea.grin").forEach(bindAutoheight)}function init(){scan();var respond=document.getElementById("respond");respond&&(respond.aksrtFixedInput=function(action){FixedInput(respond,action)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init),window.AksrtFixedInput=FixedInput})(),(function(){"use strict";var respondId="respond",tempId="aksrt-wp-temp-form-div",editingId=0;function getRespond(){return document.getElementById(respondId)}function restRoot(){var d=window.aksrtData||{};return(d.restUrl||d.rest_url||"/wp-json/aksrt/v1").replace(/\/$/,"")}function nonce(){var d=window.aksrtData||{};return d.restNonce||d.nonce||""}function setActionText(text){var el=document.querySelector("#"+respondId+" .action-text");el&&(text?(el.style.display="",el.textContent=text):(el.style.display="none",el.textContent=""))}function ensureParentField(respond){var form=respond.querySelector("#commentform")||respond,parent=form.querySelector('[name="comment_parent"]');return parent||(parent=document.createElement("input"),parent.type="hidden",parent.name="comment_parent",parent.id="comment_parent",parent.value="0",form.appendChild(parent)),parent}function ensureEditField(respond,commentId){var form=respond.querySelector("#commentform")||respond,existing=form.querySelector('[name="edit_comment_ID"]');if(commentId){existing||(existing=document.createElement("input"),existing.type="hidden",existing.name="edit_comment_ID",existing.id="edit_comment_ID",form.appendChild(existing)),existing.value=String(commentId);var parent=form.querySelector('[name="comment_parent"]');parent&&(parent.name="comment_parent_bak")}else if(existing){existing.remove();var bak=form.querySelector('[name="comment_parent_bak"]');bak&&(bak.name="comment_parent")}}function moveForm(commId,parentId,isEdit){var respond=getRespond();if(!respond)return!1;var comm=document.getElementById(commId),parent=ensureParentField(respond),cancel=document.getElementById("cancel-comment-reply-link"),submit=respond.querySelector("#submit"),textarea=respond.querySelector("#comment");if(!document.getElementById(tempId)){var temp=document.createElement("div");temp.id=tempId,temp.style.display="none",respond.parentNode.insertBefore(temp,respond)}if(comm&&comm.parentNode&&comm.parentNode.insertBefore(respond,comm.nextSibling),parent.value=isEdit?"0":String(parentId||"0"),editingId=isEdit&&parseInt(parentId,10)||0,cancel&&(cancel.style.display="",cancel.onclick=function(){var t=document.getElementById(tempId),r=getRespond();return t&&r&&t.parentNode&&(t.parentNode.insertBefore(r,t),t.parentNode.removeChild(t)),ensureEditField(r,0),parent&&(parent.value="0"),setActionText(""),textarea&&(textarea.value=""),editingId=0,cancel.style.display="none",window.AksrtFixedInput?window.AksrtFixedInput(r,"hide"):r&&r.classList.remove("show"),!1}),isEdit&&editingId)setActionText("编辑评论"),ensureEditField(respond,editingId),textarea&&(textarea.disabled=!0,textarea.value="加载中…"),submit&&(submit.disabled=!0),fetch(restRoot()+"/comment/get?comment_id="+encodeURIComponent(String(editingId)),{headers:{"X-WP-Nonce":nonce()},credentials:"same-origin"}).then(function(r){return r.json()}).then(function(json){var content=json&&(json.content||json.data&&json.data.content)||"";textarea&&(textarea.disabled=!1,textarea.value=content,textarea.dispatchEvent(new Event("input"))),submit&&(submit.disabled=!1)}).catch(function(){notyf("加载评论失败","danger"),textarea&&(textarea.disabled=!1,textarea.value=""),submit&&(submit.disabled=!1)});else{var nameEl=comm?comm.querySelector(".comment-header name"):null,author=nameEl?(nameEl.textContent||"").trim():"";setActionText(author?"回复 @"+author:"回复评论"),ensureEditField(respond,0),textarea&&textarea.focus()}return window.AksrtFixedInput?window.AksrtFixedInput(respond,"show"):respond.classList.add("show"),comm&&comm.scrollIntoView&&comm.scrollIntoView({behavior:"smooth",block:"center"}),!1}document.addEventListener("click",function(e){var reply=e.target&&e.target.closest?e.target.closest(".comment-reply-link"):null,edit=e.target&&e.target.closest?e.target.closest('.comment-edit-link, [data-comment-action="edit"]'):null;if(reply){e.preventDefault();var cid=reply.getAttribute("data-commentid")||reply.getAttribute("data-comment-id")||"",postid=reply.getAttribute("data-postid")||"";if(!cid){var li=reply.closest("[data-comment-id], #comment-"+(cid||""));li&&li.getAttribute("data-comment-id")&&(cid=li.getAttribute("data-comment-id"))}if(!cid){var m=(reply.closest('li[id^="comment-"]')||{}).id||"",mm=/comment-(\d+)/.exec(m);mm&&(cid=mm[1])}moveForm("div-comment-"+cid,cid,!1);return}if(edit){e.preventDefault();var eid=edit.getAttribute("data-commentid")||edit.getAttribute("data-comment-id")||"";if(!eid){var row=edit.closest("[data-comment-id]");row&&(eid=row.getAttribute("data-comment-id"))}if(!eid)return;moveForm("div-comment-"+eid,eid,!0)}}),document.addEventListener("click",function(e){var t=e.target&&e.target.closest?e.target.closest('[data-toggle-class="open"], span.dropup > a.but, [data-toggle="dropdown"]'):null;if(t){var wrap=t.closest("span.dropup, span.dropdown");wrap&&(wrap.classList.contains("open")&&t.parentElement!==wrap||(e.preventDefault(),wrap.classList.toggle("open")))}}),document.addEventListener("click",function(e){e.target.closest&&e.target.closest("span.dropup.open, span.dropdown.open")||document.querySelectorAll("span.dropup.open, span.dropdown.open").forEach(function(n){n.classList.remove("open")})}),document.addEventListener("click",function(e){var a=e.target&&e.target.closest?e.target.closest("[data-scroll-to]"):null;if(a){e.preventDefault();var sel=a.getAttribute("data-scroll-to"),el=sel?document.querySelector(sel):null;el&&el.scrollIntoView({behavior:"smooth",block:"center"})}}),window.aksrtCommentMoveForm=moveForm,window.aksrtGetEditingCommentId=function(){return editingId}})(),(function(window2,document2){"use strict";var loadingMap=new WeakMap;function restHeaders(){var h={Accept:"application/json, text/html","X-AKSRT-Ajax":"list"};return window2.aksrtData&&aksrtData.restNonce&&(h["X-WP-Nonce"]=aksrtData.restNonce),h}function closestPager(el){return el?el.closest(".ajaxpager")||el.closest("[data-aksrt-ajaxpager]")||el.closest(".aksrt-ajaxpager"):null}function dispatch(container,name,detail){if(container)try{container.dispatchEvent(new CustomEvent(name,{bubbles:!0,detail:detail||{}}))}catch{}}function showLoader(container){if(container){var loader=container.querySelector(".post_ajax_loader, .post-ajax-loader, [data-aksrt-ajax-loader]");if(loader){loader.classList.add("is-loading"),loader.hidden=!1,loader.style.display="";return}container.classList.add("is-ajax-loading")}}function hideLoader(container){if(container){var loader=container.querySelector(".post_ajax_loader, .post-ajax-loader, [data-aksrt-ajax-loader]");loader&&(loader.classList.remove("is-loading"),loader.hasAttribute("data-aksrt-ajax-loader-hide")&&(loader.hidden=!0,loader.style.display="none")),container.classList.remove("is-ajax-loading")}}function parseHtml(html){var wrap=document2.createElement("div");return wrap.innerHTML=html||"",wrap}function extractFromHtml(html,container){var doc=parseHtml(html),pager=doc.querySelector(".ajaxpager")||doc.querySelector("[data-aksrt-ajaxpager]")||doc.querySelector(".aksrt-ajaxpager"),items=[],scope=pager||doc;scope.querySelectorAll(".ajax-item").forEach(function(n){items.push(n.outerHTML)}),!items.length&&pager&&items.push(pager.innerHTML);var pag=scope.querySelector(".ajax-pag"),headerBits={};doc.querySelectorAll("[win-ajax-replace]").forEach(function(n){var key=n.getAttribute("win-ajax-replace");key&&(headerBits[key]=n.outerHTML)});var titleEl=doc.querySelector("title");return{itemsHtml:items.join(""),paginateHtml:pag?pag.outerHTML:"",headerBits,title:titleEl?titleEl.textContent:"",fullHtml:pager?pager.innerHTML:html}}function syncWinReplace(bits){bits&&Object.keys(bits).forEach(function(key){var live=document2.querySelector('[win-ajax-replace="'+key+'"]');if(live){var tmp=document2.createElement("div");tmp.innerHTML=bits[key];var next=tmp.firstElementChild;next&&live.replaceWith(next)}})}function applyRoute(link,title){if(link){var route=link.getAttribute("route")||link.getAttribute("data-route");if(route==="1"||route==="true"||link.hasAttribute("route")){var href=link.getAttribute("href")||link.getAttribute("ajax-href")||"";if(href){try{window2.history.replaceState({},"",href)}catch{}var rt=title||link.getAttribute("route-title")||link.getAttribute("data-route-title")||"";if(rt)try{document2.title=rt}catch{}}}}}function replacePaginate(container,paginateHtml){if(!(!container||!paginateHtml)){var old=container.querySelector(".ajax-pag");if(!old){container.insertAdjacentHTML("beforeend",paginateHtml);return}var tmp=document2.createElement("div");tmp.innerHTML=paginateHtml;var next=tmp.firstElementChild;next&&old.replaceWith(next)}}function findItemHost(container){if(!container||!container.children)return container;for(var i=0;i"+html+"");itemsHtml=parsed.itemsHtml||html}else itemsHtml=html;return{itemsHtml,html,paginateHtml:data.paginate_html||data.paginateHtml||"",headerHtml:data.header_html||data.headerHtml||"",headerBits:data.header_bits||null,title:data.title||"",emptyHtml:data.empty_html||"",hasMore:typeof data.has_more<"u"?!!data.has_more:null}}function loadFromLink(link,override){if(override=override||{},!link)return Promise.resolve();var container=override.container||(link.getAttribute("ajaxpager-target")?document2.querySelector(link.getAttribute("ajaxpager-target")):null)||closestPager(link);if(container||(container=link.closest("[data-aksrt-ajax-list]")),!container||loadingMap.get(container))return Promise.resolve();loadingMap.set(container,!0);var replaceAttr=link.getAttribute("ajax-replace"),replace=typeof override.replace=="boolean"?override.replace:replaceAttr==="true"||replaceAttr==="1"||replaceAttr==="replace",href=override.url||link.getAttribute("data-aksrt-ajax-url")||link.getAttribute("ajax-href")||link.getAttribute("href")||"";return dispatch(container,"post_ajax.before",{link,replace,url:href}),showLoader(container),replace&&container.querySelectorAll(".ajax-item").forEach(function(n){n.classList.add("is-fading")}),fetch(href,{method:override.method||"GET",credentials:"same-origin",headers:restHeaders()}).then(function(res){var type=(res.headers.get("content-type")||"").toLowerCase();return type.indexOf("application/json")!==-1?res.json().then(function(json){if(!res.ok||json&&json.success===!1)throw new Error(json&&(json.message||json.data&&json.data.message)||"加载失败");return normalizeJson(json)}):res.text().then(function(text){if(!res.ok)throw new Error("加载失败");return extractFromHtml(text,container)})}).then(function(payload){if(!payload)throw new Error("空响应");return replace&&!payload.itemsHtml&&payload.emptyHtml?inject(container,{itemsHtml:payload.emptyHtml,paginateHtml:payload.paginateHtml},{replace:!0}):inject(container,payload,{replace}),applyRoute(link,payload.title),hideLoader(container),loadingMap.set(container,!1),dispatch(container,"post_ajax.ed",{link,replace,url:href,payload}),typeof window2.auto_fun=="function"&&window2.auto_fun(),document2.dispatchEvent(new CustomEvent("aksrt:posts:rendered",{bubbles:!0,detail:{container,replace}})),payload}).catch(function(err){throw hideLoader(container),loadingMap.set(container,!1),container.querySelectorAll(".ajax-item.is-fading").forEach(function(n){n.classList.remove("is-fading")}),notyf(err&&err.message||"加载失败","danger"),dispatch(container,"post_ajax.error",{link,error:err}),err})}document2.addEventListener("click",function(e){var link=e.target.closest("a.ajax-next, .ajax-next a, button.ajax-next, [data-aksrt-ajax-next]");if(link&&!link.closest("[data-aksrt-ajax-list='off']")&&!link.closest("[data-aksrt-pagination], .aksrt-comment-pagination")){var href=link.getAttribute("href")||link.getAttribute("ajax-href")||link.getAttribute("data-aksrt-ajax-url");!href&&!link.getAttribute("data-aksrt-ajax-url")||(e.preventDefault(),loadFromLink(link.tagName==="A"||link.classList.contains("ajax-next")?link:link.closest(".ajax-next")||link))}}),window2.AksrtAjaxList={load:loadFromLink,inject,extractFromHtml,closestPager}})(window,document),(function(){"use strict";function hasAjaxConfig(){return!!(window.aksrtData&&aksrtData.ajaxUrl&&aksrtData.nonce)}function initAjaxPagination(root){var containers=(root||document).querySelectorAll("[data-aksrt-pagination], .aksrt-comment-pagination");if(containers.length){var triggerText=window.aksrtData&&aksrtData.ajaxTrigger||"加载更多",nomoreText=window.aksrtData&&aksrtData.ajaxNomore||"没有更多了",loadingText=window.aksrtData&&aksrtData.ajaxLoading||"正在加载...",errorText=window.aksrtData&&aksrtData.ajaxLoadError||"加载失败,请重试";containers.forEach(function(container){if(container.dataset.aksrtPaginationBound==="1")return;container.dataset.aksrtPaginationBound="1";var mode=container.dataset.mode||"load_more",nextPage=parseInt(container.dataset.nextPage,10)||2,maxPages=parseInt(container.dataset.maxPages,10)||1,isComment=container.classList.contains("aksrt-comment-pagination"),postId=container.dataset.postId||"",commentOrder=container.dataset.commentOrder||"newest",loading=!1,failed=!1,clickTarget=container.querySelector(".next-page.ajax-next, .ias-btn")||container,loadMoreBtn=container.querySelector("[data-aksrt-load-more]")||clickTarget,indicator=container.querySelector(".post_ajax_loader"),successfulAutoLoads=0,iasMax=isComment?window.aksrtData&&typeof aksrtData.commentIasMax<"u"?parseInt(aksrtData.commentIasMax,10):0:window.aksrtData&&typeof aksrtData.iasMax<"u"?parseInt(aksrtData.iasMax,10):0,homepagePanel=container.closest("[data-home-tab-panel]"),target=homepagePanel||container.previousElementSibling;if(!homepagePanel&&target&&target.classList&&target.classList.contains("content-stream__footer")&&(target=target.previousElementSibling),isComment){var commentList=container.closest("#comment-list, .commentlist, ol.commentlist")||document.getElementById("comment-list");commentList&&(target=commentList)}!target&&container.parentElement&&(target=container.parentElement.querySelector(".post-grid, .comment-list, .commentlist, .content-stream__list"));function showSkeleton(){if(target){var loader=target.querySelector(".post-ajax-loader");loader&&loader.classList.add("is-loading")}}function hideSkeleton(){if(target){var loader=target.querySelector(".post-ajax-loader");loader&&loader.classList.remove("is-loading")}}function stopInfinite(markNomore){if(container.classList.remove("ias-pending"),markNomore&&loadMoreBtn){loadMoreBtn.innerHTML=nomoreText,loadMoreBtn.classList.remove("is-loading"),loadMoreBtn.classList.add("ajax-nomore");var nextWrap=loadMoreBtn.closest(".next-page");nextWrap&&nextWrap.classList.add("no-more"),loadMoreBtn.style.pointerEvents="none"}else loadMoreBtn&&!loadMoreBtn.classList.contains("ajax-nomore")&&(loadMoreBtn.classList.remove("is-loading"),failed?loadMoreBtn.textContent=errorText:loadMoreBtn.innerHTML=triggerText,loadMoreBtn.style.pointerEvents="")}function markFailed(message){failed=!0,stopInfinite(!1),loadMoreBtn&&(loadMoreBtn.textContent=message||errorText,loadMoreBtn.classList.remove("is-loading"),loadMoreBtn.classList.remove("ajax-nomore"),loadMoreBtn.style.pointerEvents="")}function loadNextPage(fromAuto){if(loading||failed||nextPage>maxPages||!target)return Promise.resolve(!1);if(!hasAjaxConfig())return markFailed(errorText),Promise.resolve(!1);loading=!0,indicator&&(indicator.style.display="flex"),loadMoreBtn&&(loadMoreBtn.classList.add("is-loading"),loadMoreBtn.textContent=loadingText),showSkeleton();var action=isComment?"aksrt_load_more_comments":"aksrt_load_more_posts",queryContext=container.dataset.queryContext||"",queryVars=container.dataset.queryVars||"",renderConfig=container.dataset.renderConfig||"",body=new URLSearchParams;if(body.set("action",action),body.set("nonce",aksrtData.nonce),body.set("page",String(nextPage)),queryContext&&body.set("query_context",queryContext),!isComment&&queryVars&&body.set("query_vars",queryVars),!isComment&&renderConfig&&body.set("render_config",renderConfig),isComment&&postId){body.set("post_id",postId),body.set("comment_order",commentOrder);var authorOnly=container.dataset.authorOnly||"0";authorOnly==="1"&&body.set("author_only","1")}return fetch(aksrtData.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},credentials:"same-origin",body:body.toString()}).then(function(r){if(!r.ok)throw new Error("HTTP "+r.status);return r.text().then(function(text){try{return JSON.parse(text)}catch{throw new Error("Invalid JSON")}})}).then(function(res){if(!(res&&res.success&&res.data&&typeof res.data.html=="string")){var msg=res&&res.data&&res.data.message?res.data.message:errorText;return markFailed(msg),!1}var temp=document.createElement("div");temp.innerHTML=res.data.html;for(var newItems=temp.children;newItems.length>0;)homepagePanel&&container.parentNode===target||container.parentNode===target?target.insertBefore(newItems[0],container):target.appendChild(newItems[0]);return target.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun(),nextPage++,container.dataset.nextPage=String(nextPage),fromAuto&&successfulAutoLoads++,(nextPage>maxPages||!res.data.has_more)&&(stopInfinite(!0),loadMoreBtn||(container.innerHTML=''+nomoreText+"")),!0}).catch(function(){return markFailed(errorText),!1}).finally(function(){if(loading=!1,hideSkeleton(),indicator&&(indicator.style.display="none"),loadMoreBtn&&!loadMoreBtn.classList.contains("ajax-nomore")&&!failed&&(loadMoreBtn.classList.remove("is-loading"),loadMoreBtn.innerHTML=triggerText,mode==="infinite")){var lazyTrigger=clickTarget.closest(".next-page")||clickTarget;iasMax>0&&successfulAutoLoads>=iasMax?(container.classList.remove("ias-pending"),lazyTrigger.classList.remove("lazyload","lazyloaded","lazyloading"),lazyTrigger.removeAttribute("lazyload-action")):(lazyTrigger.classList.remove("lazyloaded","lazyloading"),lazyTrigger.classList.add("lazyload"),window.lazySizes&&lazySizes.loader&&lazySizes.loader.checkElems())}})}if(loadMoreBtn&&clickTarget.addEventListener("click",function(e){if(e.preventDefault(),loadMoreBtn.dataset.jumpComments==="1"){var jumpInput=container.querySelector(".jump-input");if(!jumpInput)return;var targetPage=parseInt(jumpInput.value,10)||1,max=parseInt(jumpInput.dataset.maxPages||String(maxPages),10)||maxPages;if(targetPage=Math.max(1,Math.min(max,targetPage)),window.AksrtComments&&typeof window.AksrtComments.loadPage=="function"){e.preventDefault(),window.AksrtComments.loadPage(targetPage);return}window.location.hash="comments",window.location.reload();return}if(loadMoreBtn.dataset.jumpArchive==="1"){var archiveJumpInput=container.querySelector(".jump-input");if(!archiveJumpInput)return;var archiveTargetPage=parseInt(archiveJumpInput.value,10)||1,archiveMax=parseInt(archiveJumpInput.dataset.maxPages||String(maxPages),10)||maxPages;archiveTargetPage=Math.max(1,Math.min(archiveMax,archiveTargetPage));var archiveUrl=new URL(window.location.href);archiveUrl.searchParams.set(loadMoreBtn.dataset.pageVar||"paged",String(archiveTargetPage)),window.location.href=archiveUrl.toString();return}var fromAuto=clickTarget.dataset.lazyAuto==="1";if(delete clickTarget.dataset.lazyAuto,fromAuto&&iasMax>0&&successfulAutoLoads>=iasMax){container.classList.remove("ias-pending");return}failed=!1,loadNextPage(fromAuto)}),(container.classList.contains("lazyload")||clickTarget.classList.contains("lazyload"))&&container.addEventListener("lazybeforeunveil",function(e){e.target!==container&&e.target!==clickTarget||(clickTarget.dataset.lazyAuto="1",clickTarget.click())}),mode==="infinite"){if(isComment&&window.aksrtData&&aksrtData.commentIasAuto===!1||!hasAjaxConfig()){var autoTrigger=clickTarget.closest(".next-page")||clickTarget;autoTrigger.classList.remove("lazyload"),autoTrigger.removeAttribute("lazyload-action");return}container.classList.add("ias-pending")}})}}function init(root){initAjaxPagination(root)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){init()}):init(),window.jQuery&&window.jQuery(document).on("auto_fun",function(){init()})})(),(function(){"use strict";function initArchiveFilter(root){var scope=root||document,bar=scope.querySelector(".archive-filter-bar--ajax[data-ajax-archive]");if(!bar||bar.dataset.aksrtArchiveInit==="1")return;bar.dataset.aksrtArchiveInit="1";var archiveType=bar.dataset.ajaxArchive||"category",termId=parseInt(bar.dataset.termId,10)||0,wrap=scope.querySelector("[data-ajax-wrap]");if(!wrap)return;var loading=wrap.querySelector(".archive__ajax-loading"),REST_BASE="/wp-json/aksrt/v1/archive/posts",emptyText=archiveType==="tag"?"该标签下暂无文章":"该分类下暂无文章",state={filter_cat:"",filter_tag:"",sort:"date",page:1},activeCat=bar.querySelector("[data-filter-cat].is-active");activeCat&&(state.filter_cat=activeCat.dataset.filterCat||"");var activeTag=bar.querySelector("[data-filter-tag].is-active");activeTag&&(state.filter_tag=activeTag.dataset.filterTag||"");var activeSort=bar.querySelector("[data-filter-sort].is-active");activeSort&&(state.sort=activeSort.dataset.filterSort||"date");function buildUrl(){var params=new URLSearchParams;return params.set("archive_type",archiveType),params.set("term_id",String(termId)),state.filter_cat&¶ms.set("filter_cat",state.filter_cat),state.filter_tag&¶ms.set("filter_tag",state.filter_tag),params.set("sort",state.sort||"date"),params.set("page",String(state.page)),REST_BASE+"?"+params.toString()}function updateActiveChips(){bar.querySelectorAll("[data-filter-cat]").forEach(function(el){el.classList.toggle("is-active",(el.dataset.filterCat||"")===state.filter_cat)}),bar.querySelectorAll("[data-filter-tag]").forEach(function(el){el.classList.toggle("is-active",(el.dataset.filterTag||"")===state.filter_tag)}),bar.querySelectorAll("[data-filter-sort]").forEach(function(el){el.classList.toggle("is-active",(el.dataset.filterSort||"date")===state.sort)})}function showLoading(){loading&&loading.classList.add("is-loading"),wrap.classList.add("is-loading")}function hideLoading(){loading&&loading.classList.remove("is-loading"),wrap.classList.remove("is-loading")}function rebuildEmptyState(){var noResults=document.createElement("div");noResults.className="no-results content-stream__empty",noResults.innerHTML="

    "+emptyText+"

    ",wrap.appendChild(noResults)}function fetchPosts(pushState){showLoading(),fetch(buildUrl(),{method:"GET",headers:{Accept:"application/json"},credentials:"same-origin"}).then(function(r){if(!r.ok)throw new Error("HTTP "+r.status);return r.json()}).then(function(data){if(hideLoading(),data.html!==void 0){var children=Array.from(wrap.children);if(children.forEach(function(child){child!==loading&&wrap.removeChild(child)}),data.html){var temp=document.createElement("div");for(temp.innerHTML=data.html;temp.firstChild;)wrap.appendChild(temp.firstChild)}else rebuildEmptyState();wrap.dispatchEvent(new CustomEvent("post_ajax.ed",{bubbles:!0})),typeof window.auto_fun=="function"&&window.auto_fun()}if(pushState!==!1){var url=new URL(window.location.href);url.searchParams.delete("orderby"),url.searchParams.delete("order"),url.searchParams.delete("paged"),url.searchParams.delete("aksrt_filter_cat"),url.searchParams.delete("aksrt_filter_tag"),state.filter_cat&&url.searchParams.set("aksrt_filter_cat",state.filter_cat),state.filter_tag&&url.searchParams.set("aksrt_filter_tag",state.filter_tag),state.sort&&url.searchParams.set("orderby",state.sort),state.page>1&&url.searchParams.set("paged",String(state.page)),history.pushState({aksrtArchive:!0,state:Object.assign({},state)},"",url.toString())}}).catch(function(){hideLoading()})}bar.addEventListener("click",function(e){var chip=e.target.closest("[data-filter-cat], [data-filter-tag], [data-filter-sort]");if(chip){e.preventDefault();var changed=!1;if(chip.dataset.filterCat!==void 0){var newCat=chip.dataset.filterCat;newCat!==state.filter_cat&&(state.filter_cat=newCat,changed=!0)}if(chip.dataset.filterTag!==void 0){var newTag=chip.dataset.filterTag;newTag!==state.filter_tag&&(state.filter_tag=newTag,changed=!0)}if(chip.dataset.filterSort!==void 0){var newSort=chip.dataset.filterSort||"date";newSort!==state.sort&&(state.sort=newSort,changed=!0)}changed&&(state.page=1,updateActiveChips(),fetchPosts(!0))}}),wrap.addEventListener("click",function(e){var pageLink=e.target.closest(".pagination a, .nav-links a, a.page-numbers");if(!(!pageLink||!wrap.contains(pageLink))){var href=pageLink.getAttribute("href");if(href){var match=href.match(/[?&]paged=(\d+)/);match&&(e.preventDefault(),state.page=parseInt(match[1],10)||1,fetchPosts(!0))}}}),window.addEventListener("popstate",function(e){e.state&&e.state.aksrtArchive&&(state=Object.assign(state,e.state.state),updateActiveChips(),fetchPosts(!1))})}function init(root){initArchiveFilter(root)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){init()}):init(),window.jQuery&&window.jQuery(document).on("auto_fun",function(){init()})})(),(function(){"use strict";function initFooterTabbar(){var tabbar=document.getElementById("footer-tabbar");if(!tabbar||tabbar.dataset.aksrtTabbarInit==="1")return;tabbar.dataset.aksrtTabbarInit="1";var addBackdrop=document.getElementById("tabbar-add-backdrop"),ticking=!1,scrollThreshold=100,isHidden=!1;function handleScrollDownHide(){var body=document.body,scrollTop=window.pageYOffset||document.documentElement.scrollTop;scrollTop>scrollThreshold?body.classList.contains("scroll-down")&&!isHidden?(tabbar.classList.add("is-hidden"),isHidden=!0):body.classList.contains("scroll-up")&&isHidden&&(tabbar.classList.remove("is-hidden"),isHidden=!1):(tabbar.classList.remove("is-hidden"),isHidden=!1)}function handleOntopWrap(){var ontopWraps=tabbar.querySelectorAll(".tabbar-ontop-wrap"),scrollTop=window.pageYOffset||document.documentElement.scrollTop;ontopWraps.forEach(function(wrap){scrollTop>scrollThreshold?wrap.classList.add("is-scrolled"):wrap.classList.remove("is-scrolled")})}function onScroll(){ticking||(requestAnimationFrame(function(){tabbar.classList.contains("scroll-down-hide")&&handleScrollDownHide(),handleOntopWrap(),ticking=!1}),ticking=!0)}window.addEventListener("scroll",onScroll,{passive:!0});function closeAddPanels(){document.querySelectorAll(".tabbar-add-panel").forEach(function(panel){panel.setAttribute("hidden","")}),addBackdrop&&addBackdrop.setAttribute("hidden",""),document.body.classList.remove("tabbar-add-open")}function openAddPanel(panelId){closeAddPanels();var panel=document.getElementById(panelId);panel&&(panel.removeAttribute("hidden"),addBackdrop&&addBackdrop.removeAttribute("hidden"),document.body.classList.add("tabbar-add-open"))}addBackdrop&&addBackdrop.addEventListener("click",closeAddPanels),document.addEventListener("keydown",function(e){e.key==="Escape"&&closeAddPanels()});var homeClickTimer=null;tabbar.addEventListener("click",function(e){var addBtn=e.target.closest('.tabbar-item[data-type="add"]');if(addBtn){e.preventDefault(),openAddPanel(addBtn.getAttribute("data-panel-id"));return}var searchBtn=e.target.closest('.tabbar-item[data-type="search"]');if(searchBtn){e.preventDefault(),typeof window.__aksrtOpenSearchPanel=="function"&&window.__aksrtOpenSearchPanel();return}var ontopBtn=e.target.closest(".tabbar-ontop-btn");if(ontopBtn){e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"});return}var homeBtn=e.target.closest('.tabbar-item[data-type="home"]');if(homeBtn&&tabbar.classList.contains("has-animation")){if(homeClickTimer){clearTimeout(homeClickTimer),homeClickTimer=null,window.location.reload();return}homeClickTimer=setTimeout(function(){homeClickTimer=null},350)}}),document.addEventListener("click",function(e){e.target.closest("[data-close-tabbar-add-panel]")&&closeAddPanels()})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initFooterTabbar):initFooterTabbar()})(),(function(){"use strict";function renderGradientBackground(container){if(!(!container||container.dataset.aksrtGradientState||typeof window.Grade!="function")){var source=container.querySelector("img");!source||!source.classList.contains("lazyloaded")&&!(source.complete&&source.naturalWidth>0)||(container.dataset.aksrtGradientState="loading",window.Grade(container,null,function(result){var gradientData=result&&result[0],colors=gradientData&&gradientData.gradientData;if(!gradientData||!colors||!colors[0]||!colors[1]){delete container.dataset.aksrtGradientState;return}var opacity=container.getAttribute("data-opacity"),colorName=opacity?"rgba":"rgb",alpha=opacity?","+opacity:"",color1=colorName+"("+colors[0].rgba.slice(0,3).join(",")+alpha+") 10%",color2=colorName+"("+colors[1].rgba.slice(0,3).join(",")+alpha+") 80%";gradientData.element.classList.add("gradient-bg-loaded"),gradientData.element.style.backgroundImage="linear-gradient(135deg, "+color1+", "+color2+")",container.dataset.aksrtGradientState="loaded"}))}}function initGradientBackgrounds(root){var scope=root||document;scope.nodeType===1&&scope.matches(".gradient-bg")&&renderGradientBackground(scope),scope.querySelectorAll(".gradient-bg").forEach(renderGradientBackground)}document.addEventListener("lazyloaded",function(event){!(event.target instanceof Element)||!event.target.matches(".gradient-bg img")||renderGradientBackground(event.target.closest(".gradient-bg"))},!0);function initPostThumbMedia(root){var scope=root||document;scope.querySelectorAll("[data-post-thumb-video]").forEach(function(box){if(box.dataset.aksrtThumbVideoBound==="1")return;box.dataset.aksrtThumbVideoBound="1";var video=box.querySelector("video");if(!video)return;function loadVideo(){!video.getAttribute("src")&&video.dataset.src&&(video.setAttribute("src",video.dataset.src),video.load())}function playVideo(){loadVideo();var result=video.play(),postItem=box.closest(".posts-item");postItem&&postItem.classList.add("thumb-dplayer-playing"),result&&typeof result.catch=="function"&&result.catch(function(){})}function pauseVideo(){video.pause();var postItem=box.closest(".posts-item");postItem&&postItem.classList.remove("thumb-dplayer-playing")}var item=box.closest(".item-thumbnail")||box;item.addEventListener("mouseenter",playVideo),item.addEventListener("mouseleave",pauseVideo),item.addEventListener("focusin",playVideo),item.addEventListener("focusout",pauseVideo)})}function init(root){initPostThumbMedia(root),initGradientBackgrounds(root)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){init()}):init(),window.jQuery&&window.jQuery(document).on("auto_fun",function(){init()})})(),(function(){"use strict";function initSlideCovers(){var covers=document.querySelectorAll(".single-cover--slide");covers.forEach(function(cover){var slides=cover.querySelectorAll(".single-cover__slide"),dots=cover.querySelectorAll(".single-cover__dot");if(slides.length<2)return;var current=0,interval=5e3;function goTo(idx){slides[current].classList.remove("is-active"),dots[current]&&dots[current].classList.remove("is-active"),current=idx,slides[current].classList.add("is-active"),dots[current]&&dots[current].classList.add("is-active")}var timer=setInterval(function(){goTo((current+1)%slides.length)},interval);dots.forEach(function(dot,i){dot.addEventListener("click",function(){clearInterval(timer),goTo(i),timer=setInterval(function(){goTo((current+1)%slides.length)},interval)})})})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initSlideCovers):initSlideCovers()})(),(function(){"use strict";function initHiddenContent(){document.addEventListener("click",function(e){var btn=e.target.closest(".aksrt-hidden-content__submit-btn");if(btn){e.preventDefault();var wrapper=btn.closest(".aksrt-hidden-content--locked");if(wrapper){var mode=wrapper.getAttribute("data-aksrt-visibility-mode"),pid=wrapper.getAttribute("data-aksrt-visibility-pid"),input=wrapper.querySelector(".aksrt-hidden-content__password-input"),password=input?input.value.trim():"";if(mode==="password"&&!password){input&&input.focus();return}var formData=new FormData;formData.append("action","aksrt_check_visibility"),formData.append("_nonce",window.aksrtData&&aksrtData.visibilityNonce||""),formData.append("mode",mode),formData.append("pid",pid),password&&formData.append("password",password),btn.disabled=!0,btn.textContent="...",fetch(window.aksrtData&&aksrtData.ajaxUrl||"/wp-admin/admin-ajax.php",{method:"POST",body:formData,credentials:"same-origin"}).then(function(res){return res.json()}).then(function(data){if(data.success)window.location.reload();else{var msg=data.data&&data.data.message?data.data.message:"验证失败";alert(msg),btn.disabled=!1,btn.textContent="验证"}}).catch(function(){alert("网络错误,请重试"),btn.disabled=!1,btn.textContent="验证"})}}}),document.addEventListener("keydown",function(e){if(e.key==="Enter"&&e.target.classList.contains("aksrt-hidden-content__password-input")){e.preventDefault();var wrapper=e.target.closest(".aksrt-hidden-content--locked");if(wrapper){var btn=wrapper.querySelector(".aksrt-hidden-content__submit-btn");btn&&btn.click()}}})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initHiddenContent):initHiddenContent()})(),(function(){"use strict";var THEME_KEY="aksrt-theme",THEME_COOKIE_KEY="theme_mode";function normalizeStoredTheme(value){return value==="dark"||value==="dark-theme"?"dark":value==="light"||value==="white-theme"?"light":null}function toCookieTheme(value){return value==="dark"?"dark-theme":"white-theme"}function getCookie(name){for(var parts=document.cookie?document.cookie.split("; "):[],i=0;i=20||hour<8?"dark":"light"}function resolveConfiguredTheme(mode){var normalized=normalizeStoredTheme(mode);return normalized||(mode==="time-auto"||mode==="auto"?getTimeAutoTheme():"light")}function syncBrandLogos(isDark){document.querySelectorAll("[data-logo-light]").forEach(function(img){var lightSrc=img.getAttribute("data-logo-light")||"",darkSrc=img.getAttribute("data-logo-dark")||"";lightSrc&&img.setAttribute("src",isDark&&darkSrc?darkSrc:lightSrc)})}function syncThemeColorMeta(isDark){var meta=document.querySelector('meta[name="theme-color"]');meta||(meta=document.createElement("meta"),meta.setAttribute("name","theme-color"),document.head.appendChild(meta)),meta.setAttribute("content",isDark?"#2F3135":"#FDFCFE")}function getThemeImageAttr(img,name){return img.getAttribute(name)||img.getAttribute("data-"+name)||""}function setThemeImageSource(img,src){!src||img.getAttribute("src")===src||img.setAttribute("src",src)}function syncThemeImages(isDark){document.querySelectorAll("img[switch-src], img[data-switch-src]").forEach(function(img){var darkSrc=getThemeImageAttr(img,"switch-src");img.dataset.aksrtThemeLightSrc||(img.dataset.aksrtThemeLightSrc=img.getAttribute("src")||""),setThemeImageSource(img,isDark&&darkSrc?darkSrc:img.dataset.aksrtThemeLightSrc)}),document.querySelectorAll("img[white-src], img[dark-src], img[data-white-src], img[data-dark-src]").forEach(function(img){var lightSrc=getThemeImageAttr(img,"white-src")||img.dataset.aksrtThemeLightSrc||img.getAttribute("src")||"",darkSrc=getThemeImageAttr(img,"dark-src");!img.dataset.aksrtThemeLightSrc&&lightSrc&&(img.dataset.aksrtThemeLightSrc=lightSrc),setThemeImageSource(img,isDark&&darkSrc?darkSrc:lightSrc)})}function syncCodeHighlightTheme(isDark){if(typeof window.AksrtPrecodeApplyTheme=="function"){window.AksrtPrecodeApplyTheme(isDark);return}var settings=window.aksrtData&&window.aksrtData.codeHighlight||{},theme=isDark?settings.darkTheme||"monokai":settings.lightTheme||"enlighter";document.querySelectorAll(".enlighter-default").forEach(function(el){el.className=el.className.replace(/\benlighter-t-[\w-]+\b/g,"").replace(/\s+/g," ").trim(),el.classList.add("enlighter-t-"+theme)})}function dispatchThemeChange(isDark){try{document.dispatchEvent(new CustomEvent("aksrt:theme-change",{detail:{theme:isDark?"dark":"light",isDark}}))}catch{}}function applyTheme(mode){var isDark=mode==="dark";document.documentElement.classList.toggle("dark",isDark),document.documentElement.setAttribute("data-theme",isDark?"dark":"light"),document.body.classList.toggle("theme-dark",isDark),document.body.classList.toggle("dark-theme",isDark),document.body.classList.toggle("white-theme",!isDark),document.body.setAttribute("data-theme",isDark?"dark":"light"),syncBrandLogos(isDark),syncThemeColorMeta(isDark),syncThemeImages(isDark),syncCodeHighlightTheme(isDark),dispatchThemeChange(isDark),document.querySelectorAll("#theme-toggle, #theme-toggle-desktop, #theme-toggle-mobile, #dropdown-theme-toggle, #float-theme-toggle, .toggle-theme, .theme-toggle-btn, [data-action='toggle-theme']").forEach(function(btn){if(btn){btn.setAttribute("aria-pressed",isDark?"true":"false"),btn.classList.toggle("is-dark",isDark);var moon=btn.querySelector(".theme-icon-moon, .float-btn__icon-moon"),sun=btn.querySelector(".theme-icon-sun, .float-btn__icon-sun");moon&&(moon.removeAttribute("style"),moon.setAttribute("aria-hidden",isDark?"true":"false")),sun&&(sun.removeAttribute("style"),sun.setAttribute("aria-hidden",isDark?"false":"true"))}});var floatBtn=document.getElementById("float-theme-toggle");floatBtn&&floatBtn.setAttribute("aria-pressed",isDark?"true":"false");var ddBtn=document.getElementById("dropdown-theme-toggle");ddBtn&&ddBtn.setAttribute("aria-pressed",isDark?"true":"false")}var themeInitialized=!1;function initTheme(){if(themeInitialized)return;themeInitialized=!0;var stored=getStoredTheme(),configuredMode=window.aksrtData&&window.aksrtData.themeMode||"light";applyTheme(stored==="dark"||stored==="light"?stored:resolveConfiguredTheme(configuredMode));function prefersReducedMotion(){return window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function getThemeTransitionPoint(event){return event&&typeof event.clientX=="number"&&typeof event.clientY=="number"?{x:event.clientX,y:event.clientY}:{x:window.innerWidth/2,y:window.innerHeight/2}}function runThemeTransition(next,event){if(!document.startViewTransition||prefersReducedMotion()){applyTheme(next);return}var point=getThemeTransitionPoint(event),endRadius=Math.hypot(Math.max(point.x,window.innerWidth-point.x),Math.max(point.y,window.innerHeight-point.y)),clipPath=["circle(0px at "+point.x+"px "+point.y+"px)","circle("+endRadius+"px at "+point.x+"px "+point.y+"px)"],enteringDark=next==="dark";try{var transition=document.startViewTransition(function(){applyTheme(next)});transition.ready.then(function(){try{document.documentElement.animate({clipPath:enteringDark?clipPath:clipPath.slice().reverse()},{duration:500,easing:enteringDark?"ease-in":"ease-out",fill:"both",pseudoElement:enteringDark?"::view-transition-new(root)":"::view-transition-old(root)"})}catch{}}).catch(function(){})}catch{applyTheme(next)}}function bindToggle(id){var el=document.getElementById(id);el&&el.addEventListener("click",function(event){var next=document.body.classList.contains("theme-dark")?"light":"dark";setStoredTheme(next),runThemeTransition(next,event)})}bindToggle("theme-toggle"),bindToggle("theme-toggle-desktop"),bindToggle("dropdown-theme-toggle"),bindToggle("float-theme-toggle"),bindToggle("theme-toggle-mobile")}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initTheme):initTheme()})(),(function(){"use strict";var API_ROOT=(function(){var data=window.aksrtData||{},raw=data.apiUrl||data.restUrl||data.rest_url||"/index.php?rest_route=/aksrt/v1";return String(raw).replace(/\/$/,"")})(),NONCE=window.aksrtData&&window.aksrtData.restNonce||"";function buttonsFor(userId){return Array.prototype.slice.call(document.querySelectorAll('[data-aksrt-follow="'+userId+'"]'))}function setLoading(buttons,loading){buttons.forEach(function(button){button.disabled=loading,button.classList.toggle("is-loading",loading)})}function updateButton(button,isFollowing){var icon=button.querySelector("i"),label=button.querySelector("[data-aksrt-follow-label]");label&&(button.classList.toggle("is-following",isFollowing),icon&&(icon.className=isFollowing?"fa fas fa-heart em09":"fa far fa-heart em09"),label.textContent=isFollowing?"已关注":"关注",button.title=isFollowing?"点击取消关注":"关注该用户")}function updateFollowerCount(count){var countEl=document.querySelector(".aksrt-user-home__stat-value[data-followers]");countEl&&count!==void 0&&(countEl.textContent=count)}document.addEventListener("click",function(event){var button=event.target.closest("[data-aksrt-follow]");if(button){event.preventDefault();var targetUserId=parseInt(button.getAttribute("data-aksrt-follow"),10);if(!(!targetUserId||button.disabled)){var matchingButtons=buttonsFor(targetUserId);setLoading(matchingButtons,!0),fetch(API_ROOT+"/follow/toggle",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":NONCE},body:JSON.stringify({target_user_id:targetUserId})}).then(function(response){return response.json()}).then(function(result){if(!result.success||!result.data){notyf(result.message||"操作失败","danger");return}var isFollowing=!!result.data.is_following;if(matchingButtons.forEach(function(matchingButton){updateButton(matchingButton,isFollowing)}),updateFollowerCount(result.data.follower_count),!isFollowing){var managementItem=button.closest(".uc-follow-management__item");managementItem&&managementItem.remove()}notyf(isFollowing?"关注成功":"已取消关注","success")}).catch(function(){notyf("网络错误,请重试","danger")}).finally(function(){setLoading(matchingButtons,!1)})}}})})(),(function(){"use strict";var initialized=!1;function initScrollDirection(){var body=document.body;function sync(){body.classList.toggle("aksrt-body-scroll",body.classList.contains("body-scroll")),body.classList.toggle("aksrt-scroll-down",body.classList.contains("scroll-down")),body.classList.toggle("aksrt-scroll-up",body.classList.contains("scroll-up")),body.classList.add("aksrt-scrolling"),clearTimeout(body._aksrtScrollTimer),body._aksrtScrollTimer=setTimeout(function(){body.classList.remove("aksrt-scrolling")},300)}function onScroll(){requestAnimationFrame(sync)}window.addEventListener("scroll",onScroll,{passive:!0})}function init(){initialized||(initialized=!0,initScrollDirection())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init()})(),(function(){"use strict";function initTilt(){document.querySelectorAll("[data-aksrt-tilt]").forEach(function(el){if(!el.dataset.tiltInit){el.dataset.tiltInit="1";var maxTilt=parseInt(el.dataset.aksrtTiltMax||"15",10),perspective=parseInt(el.dataset.aksrtTiltPerspective||"1000",10),scale=parseFloat(el.dataset.aksrtTiltScale||"1.03"),speed=parseInt(el.dataset.aksrtTiltSpeed||"400",10),glare=el.dataset.aksrtTiltGlare==="1";el.style.transformStyle="preserve-3d",el.style.transition="transform "+speed+"ms ease";var glareEl=null;glare&&(glareEl=document.createElement("div"),glareEl.style.cssText="position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity "+speed+"ms;",el.style.position=el.style.position||"relative",el.style.overflow="hidden",el.appendChild(glareEl)),el.addEventListener("mousemove",function(e){var rect=el.getBoundingClientRect(),x=(e.clientX-rect.left)/rect.width,y=(e.clientY-rect.top)/rect.height,tiltX=(.5-y)*maxTilt,tiltY=(x-.5)*maxTilt;el.style.transform="perspective("+perspective+"px) rotateX("+tiltX+"deg) rotateY("+tiltY+"deg) scale3d("+scale+","+scale+","+scale+")",glareEl&&(glareEl.style.opacity="1",glareEl.style.background="linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%)",glareEl.style.transform="translate("+(x-.5)*100+"%, "+(y-.5)*100+"%)")}),el.addEventListener("mouseleave",function(){el.style.transform="perspective("+perspective+"px) rotateX(0deg) rotateY(0deg) scale3d(1,1,1)",glareEl&&(glareEl.style.opacity="0")})}})}function initScrollAnimations(){if(!("IntersectionObserver"in window)){document.querySelectorAll("[data-aksrt-animate]").forEach(function(el){el.style.opacity="1",el.style.transform="none"});return}var observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){var el=entry.target,animation=el.dataset.aksrtAnimate||"fadeInUp",delay=parseInt(el.dataset.aksrtAnimateDelay||"0",10),duration=parseInt(el.dataset.aksrtAnimateDuration||"600",10);setTimeout(function(){el.style.transition="opacity "+duration+"ms ease, transform "+duration+"ms ease",el.style.opacity="1",el.style.transform="translateY(0) translateX(0) scale(1)",el.classList.add("aksrt-animated")},delay),observer.unobserve(el)}})},{threshold:.1,rootMargin:"0px 0px -50px 0px"});document.querySelectorAll("[data-aksrt-animate]").forEach(function(el){if(!el.dataset.aksrtAnimateInit){el.dataset.aksrtAnimateInit="1";var animation=el.dataset.aksrtAnimate||"fadeInUp";switch(el.style.opacity="0",animation){case"fadeIn":el.style.transform="none";break;case"fadeInUp":el.style.transform="translateY(30px)";break;case"fadeInDown":el.style.transform="translateY(-30px)";break;case"fadeInLeft":el.style.transform="translateX(-30px)";break;case"fadeInRight":el.style.transform="translateX(30px)";break;case"zoomIn":el.style.transform="scale(0.9)";break;default:el.style.transform="translateY(30px)"}observer.observe(el)}})}function initSticky(){document.querySelectorAll("[data-aksrt-sticky]").forEach(function(el){if(el.dataset.aksrtStickyInit)return;el.dataset.aksrtStickyInit="1";var top=parseInt(el.dataset.aksrtStickyTop||"80",10),offset=parseInt(el.dataset.aksrtStickyOffset||"0",10);function update(){var rect=el.getBoundingClientRect(),parentRect=el.parentElement.getBoundingClientRect();parentRect.topel.offsetHeight+top&&(el.style.position="sticky",el.style.top=top+"px")}window.addEventListener("scroll",update,{passive:!0})})}var parallaxScrollBound=!1;function initParallax(){if(!document.querySelector("[data-aksrt-parallax]")||parallaxScrollBound)return;parallaxScrollBound=!0;var ticking=!1;function update(){document.querySelectorAll("[data-aksrt-parallax]").forEach(function(el){var speed=parseFloat(el.dataset.aksrtParallax||"0.3"),rect=el.getBoundingClientRect(),center=rect.top+rect.height/2,windowCenter=window.innerHeight/2,offset=(center-windowCenter)*speed;el.style.transform="translateY("+offset+"px)"}),ticking=!1}window.addEventListener("scroll",function(){ticking||(requestAnimationFrame(update),ticking=!0)},{passive:!0})}var rippleBound=!1;function initRipple(){rippleBound||(rippleBound=!0,document.addEventListener("click",function(e){var el=e.target.closest(".aksrt-ripple");if(el){var rect=el.getBoundingClientRect(),x=e.clientX-rect.left,y=e.clientY-rect.top,size=Math.max(rect.width,rect.height)*2,wave=document.createElement("span");wave.className="aksrt-ripple__wave",wave.style.width=wave.style.height=size+"px",wave.style.left=x-size/2+"px",wave.style.top=y-size/2+"px",el.appendChild(wave),wave.addEventListener("animationend",function(){wave.remove()})}}))}function initFloatLabels(){document.querySelectorAll(".aksrt-float-label__input").forEach(function(input){input.dataset.aksrtFloatInit||(input.dataset.aksrtFloatInit="1",input.value&&input.setAttribute("data-has-value","1"),input.addEventListener("input",function(){this.value?this.setAttribute("data-has-value","1"):this.removeAttribute("data-has-value")}))})}function initSigninCalendar(){var calendar=document.querySelector("[data-aksrt-signin-calendar]");if(calendar){var data=[];try{data=JSON.parse(calendar.dataset.aksrtSigninCalendar||"[]")}catch{}for(var today=new Date,html='",calendar.innerHTML=html}}function init(){initTilt(),initScrollAnimations(),initRipple(),initSticky(),initParallax(),initFloatLabels(),initSigninCalendar()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init),window.AksrtEnhancements={initTilt,initScrollAnimations,initRipple}})(),(function(){"use strict";var canvas=null,ctx=null;function getCanvas(){return canvas||(canvas=document.createElement("canvas"),canvas.width=40,canvas.height=40,ctx=canvas.getContext("2d",{willReadFrequently:!0})),{canvas,ctx}}function extractColor(img){try{var c=getCanvas();c.ctx.drawImage(img,0,0,40,40);for(var data=c.ctx.getImageData(0,0,40,40).data,r=0,g=0,b=0,count=0,step=4,i=0;i240||data[i+3]<128||(r+=pr,g+=pg,b+=pb,count++)}return count===0?null:(r=Math.round(r/count),g=Math.round(g/count),b=Math.round(b/count),{r,g,b,hex:rgbToHex(r,g,b)})}catch{return null}}function rgbToHex(r,g,b){return"#"+((1<<24)+(r<<16)+(g<<8)+b).toString(16).slice(1)}function lighten(r,g,b,amount){return rgbToHex(Math.min(255,r+amount),Math.min(255,g+amount),Math.min(255,b+amount))}function darken(r,g,b,amount){return rgbToHex(Math.max(0,r-amount),Math.max(0,g-amount),Math.max(0,b-amount))}function applyColor(target,color){if(!(!target||!color)){var r=color.r,g=color.g,b=color.b;target.style.setProperty("--aksrt-dynamic-color",color.hex),target.style.setProperty("--aksrt-dynamic-color-rgb",r+","+g+","+b),target.style.setProperty("--aksrt-dynamic-color-light",lighten(r,g,b,60)),target.style.setProperty("--aksrt-dynamic-color-dark",darken(r,g,b,40)),!target.style.background&&!target.style.backgroundColor&&target.style.setProperty("--aksrt-dynamic-bg","rgba("+r+","+g+","+b+",0.05)")}}function processImage(img){if(img.dataset.aksrtColorDone)return;!img.crossOrigin&&img.src.indexOf(window.location.origin)!==0&&(img.crossOrigin="anonymous");function extract(){var color=extractColor(img);if(color){img.dataset.aksrtColorDone="1";var targetSelector=img.dataset.aksrtColorTarget,target=targetSelector?img.closest(targetSelector)||document.querySelector(targetSelector):img.parentElement;applyColor(target,color)}}img.complete&&img.naturalWidth>0?extract():img.addEventListener("load",extract,{once:!0})}function init(){document.querySelectorAll("[data-aksrt-color-extract]").forEach(processImage)}window.AksrtColorExtract={extract:extractColor,apply:applyColor,process:processImage,init},document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init)})(),(function(){"use strict";var reducedMotion=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function initCountUp(){if(!reducedMotion&&"IntersectionObserver"in window){var els=document.querySelectorAll("[data-aksrt-countup]:not([data-aksrt-countup-init])");if(els.length){var observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(!entry.isIntersecting)return;var el=entry.target;observer.unobserve(el);var target=parseFloat(el.dataset.target||"0"),duration=parseInt(el.dataset.duration||"2000",10),decimals=(el.dataset.decimals||"0|").split("|"),prefix=decimals[1]||"",dec=parseInt(decimals[0],10)||0,start=0,startTime=null;function step(timestamp){startTime||(startTime=timestamp);var progress=Math.min((timestamp-startTime)/duration,1),eased=1-Math.pow(1-progress,3),current=start+(target-start)*eased;el.textContent=prefix+current.toFixed(dec).replace(/\B(?=(\d{3})+(?!\d))/g,","),progress<1?requestAnimationFrame(step):el.textContent=prefix+target.toFixed(dec).replace(/\B(?=(\d{3})+(?!\d))/g,",")}requestAnimationFrame(step)})},{threshold:.3});els.forEach(function(el){el.dataset.aksrtCountupInit="1",observer.observe(el)})}}}function initCountdown(){var els=document.querySelectorAll("[data-aksrt-countdown]:not([data-aksrt-countdown-init])");if(!els.length)return;function pad(n){return n<10?"0"+n:""+n}function update(el){var now=Date.now(),end=new Date(el.dataset.end).getTime(),diff=end-now;if(diff<=0){el.textContent=el.dataset.expired||"已结束";return}var d=Math.floor(diff/864e5),h=Math.floor(diff%864e5/36e5),m=Math.floor(diff%864e5/6e4),s=Math.floor(diff%6e4/1e3),format=el.dataset.format||"dhms";format==="dhms"?el.textContent=(d>0?d+"天 ":"")+pad(h)+":"+pad(m)+":"+pad(s):format==="hms"?el.textContent=pad(h+d*24)+":"+pad(m)+":"+pad(s):el.textContent=(d>0?d+"天 ":"")+pad(h)+"时"+pad(m)+"分"+pad(s)+"秒"}els.forEach(function(el){el.dataset.aksrtCountdownInit="1",update(el),setInterval(function(){update(el)},1e3)})}function initTilt(){reducedMotion||document.querySelectorAll("[data-aksrt-tilt]").forEach(function(el){if(!el.dataset.tiltBound){el.dataset.tiltBound="1";var maxDeg=parseFloat(el.dataset.tiltMax||"10"),perspective=parseFloat(el.dataset.tiltPerspective||"800"),scale=parseFloat(el.dataset.tiltScale||"1.03"),glare=el.dataset.tiltGlare==="1",glareEl=null;glare&&(glareEl=document.createElement("div"),glareEl.style.cssText="position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(135deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.25) 100%);opacity:0;transition:opacity 0.2s;",el.style.position=el.style.position||"relative",el.style.overflow="hidden",el.appendChild(glareEl)),el.addEventListener("mousemove",function(e){var rect=el.getBoundingClientRect(),x=(e.clientX-rect.left)/rect.width,y=(e.clientY-rect.top)/rect.height,rotateX=(.5-y)*maxDeg,rotateY=(x-.5)*maxDeg;el.style.transform="perspective("+perspective+"px) rotateX("+rotateX+"deg) rotateY("+rotateY+"deg) scale3d("+scale+","+scale+","+scale+")",glareEl&&(glareEl.style.opacity="1")}),el.addEventListener("mouseleave",function(){el.style.transform="perspective("+perspective+"px) rotateX(0deg) rotateY(0deg) scale3d(1,1,1)",glareEl&&(glareEl.style.opacity="0")})}})}var fpsDetected=!1;function initFpsDetection(){if(fpsDetected||!("requestAnimationFrame"in window))return;fpsDetected=!0;var frames=0,startTime=performance.now();function countFrames(){frames++;var elapsed=performance.now()-startTime;if(elapsed>=1e3){var fps=Math.round(frames*1e3/elapsed);fps<24&&document.body.classList.add("fps-accelerat");return}requestAnimationFrame(countFrames)}requestAnimationFrame(countFrames)}function init(){initCountUp(),initCountdown(),typeof initMarquee=="function"&&initMarquee(),initTilt(),initFpsDetection()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),window.jQuery&&window.jQuery(document).on("auto_fun",init)})(),(function(){"use strict";var TOKEN_FIELDS=Object.freeze(["captcha_verified","aksrt_captcha_challenge","aksrt_captcha_proof","cf_turnstile_response","tencent_ticket","tencent_randstr","geetest_lot_number","geetest_captcha_output","geetest_pass_token","geetest_gen_time","aliyun_captcha_verify_param"]),loaders={},instances={},scenes={};function asElement(scope){if(!scope)return null;if(scope.nodeType===1||scope.nodeType===9)return scope;if(typeof scope!="string")return null;if(instances[scope])return instances[scope].box;try{return document.querySelector(scope)}catch{return null}}function scopeBoundary(box,config){if(config.scope)try{var configured=document.querySelector(config.scope);if(configured)return configured}catch{}return box.closest("[data-aksrt-captcha-scope], form, [data-aksrt-download-box], [data-aksrt-auth], .aksrt-modal, [data-signin-captcha], #comments")||box.parentElement}function register(instance){instances[instance.uid]=instance,scenes[instance.scene]=scenes[instance.scene]||[],scenes[instance.scene].indexOf(instance)===-1&&scenes[instance.scene].push(instance)}function resolve(scene,scope){if(scan(),typeof scope=="string"&&instances[scope]&&instances[scope].scene===scene)return instances[scope];var candidates=scenes[scene]||[],element=asElement(scope);if(element&&element.getAttribute){var uid=element.getAttribute("data-aksrt-captcha-uid")||element.getAttribute("data-captcha-uid");if(uid&&instances[uid]&&instances[uid].scene===scene)return instances[uid]}if(!element)return scope?null:candidates.length===1?candidates[0]:null;var matches=candidates.filter(function(instance){var boundary=instance.scope;return element===instance.box||element===instance.mount||element===boundary||instance.box.contains(element)||instance.mount.contains(element)||boundary&&boundary.contains(element)||element.contains&&(element.contains(instance.box)||boundary&&element.contains(boundary))});return matches.length===1?matches[0]:matches.length?(matches.sort(function(a,b){return a.scope===b.scope?0:a.scope&&b.scope&&a.scope.contains(b.scope)?1:a.scope&&b.scope&&b.scope.contains(a.scope)?-1:0}),matches[0]):null}function verify(scene,scope){var instance=resolve(scene,scope);return instance?instance.verify():Promise.resolve(!0)}function collect(scene,scope){var instance=resolve(scene,scope);return instance?instance.collect():{}}function reset(scene,scope){var instance=resolve(scene,scope);instance&&instance.reset()}function releaseRunLock(instance){instance.runLocked=!1;var waiters=instance.lockWaiters.slice();instance.lockWaiters=[],waiters.forEach(function(resolveWaiter){resolveWaiter(null)})}function run(scene,scope){var instance=resolve(scene,scope);return instance?instance.runLocked?new Promise(function(resolveWaiter){instance.lockWaiters.push(resolveWaiter)}):(instance.runLocked=!0,instance.verify().then(function(passed){return passed||releaseRunLock(instance),passed?instance.collect():null}).catch(function(error){throw releaseRunLock(instance),error})):Promise.resolve({})}window.AKSRTCaptcha=Object.freeze({verify,collect,reset,run,TOKEN_FIELDS});function scan(){var mounts=document.querySelectorAll("[data-aksrt-captcha-config]");Array.prototype.forEach.call(mounts,function(mount){if(!mount.dataset.aksrtCaptchaBound){var config;try{config=JSON.parse(mount.getAttribute("data-aksrt-captcha-config"))}catch{return}!config||!config.scene||!config.uid||!config.vid||(mount.dataset.aksrtCaptchaBound="1",initMount(config,mount))}})}function initMount(C,mount){var box=document.getElementById(C.uid),hField=document.getElementById(C.vid);if(!box||!hField)return;var container=box.closest("form")||mount;mount.setAttribute("data-aksrt-captcha-uid",C.uid);var verified=!1,pending=[],refreshingChallenge=null,providerReset=function(){},triggerCaptcha=function(){showTip("验证码加载中,请稍候","#e67e22"),finishPending(!1)};function loadScriptOnce(key,src,readyCheck){return typeof readyCheck=="function"&&readyCheck()?Promise.resolve():(loaders[key]||(loaders[key]=new Promise(function(resolveLoad,rejectLoad){var existing=document.querySelector('script[data-aksrt-sdk="'+key+'"]');if(existing){if(typeof readyCheck=="function"&&readyCheck()){resolveLoad();return}existing.addEventListener("load",resolveLoad,{once:!0}),existing.addEventListener("error",function(){rejectLoad(new Error(key+" load failed"))},{once:!0});return}var script=document.createElement("script");script.src=src,script.async=!0,script.setAttribute("data-aksrt-sdk",key),script.onload=resolveLoad,script.onerror=function(){rejectLoad(new Error(key+" load failed"))},document.head.appendChild(script)})),loaders[key])}function setField(name,value){var field=container.querySelector('input[name="'+name+'"]');field||(field=document.createElement("input"),field.type="hidden",field.name=name,container.appendChild(field)),field.value=value??""}function collectFields(){var payload={};return TOKEN_FIELDS.forEach(function(name){var field=container.querySelector('input[name="'+name+'"]');field&&field.value!==""&&(payload[name]=field.value)}),payload}function refreshChallenge(){return!C.challenge_url||typeof window.fetch!="function"?Promise.resolve():refreshingChallenge||(refreshingChallenge=window.fetch(C.challenge_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({scene:C.scene})}).then(function(response){return response.json().catch(function(){return{}}).then(function(body){if(!response.ok||!body||body.success===!1)throw new Error(body.message||"challenge refresh failed");var data=body.data||body;if(!data.challenge)throw new Error("challenge missing");setField("aksrt_captcha_challenge",data.challenge)})}).catch(function(){showTip("无法刷新人机验证会话,请刷新页面重试","#e74c3c")}).finally(function(){refreshingChallenge=null}),refreshingChallenge)}function clearProviderTokens(){TOKEN_FIELDS.forEach(function(name){name==="captcha_verified"||name==="aksrt_captcha_challenge"||name==="aksrt_captcha_proof"||Array.prototype.forEach.call(container.querySelectorAll('input[name="'+name+'"]'),function(field){field.remove()})})}function resetVerificationState(){verified=!1,releaseRunLock(instance),hField.value="0",setField("aksrt_captcha_proof",""),clearProviderTokens();try{providerReset()}catch{}refreshChallenge()}function finishPending(ok){var callbacks=pending.slice();pending=[],callbacks.forEach(function(callback){callback(!!ok)})}function cancelPending(message){message&&showTip(message,"#e67e22"),finishPending(!1)}function providerPayload(){var payload=collectFields();return payload.scene=C.scene,payload}function exchangeVerification(){if(!C.exchange_url||typeof window.fetch!="function"){cancelPending("人机验证服务不可用,请刷新页面重试");return}window.fetch(C.exchange_url,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(providerPayload())}).then(function(response){return response.json().catch(function(){return{}}).then(function(body){if(!response.ok||!body||body.success===!1)throw new Error(body.message||"人机验证失败");var data=body.data||body;if(!data.proof)throw new Error("人机验证凭证缺失");setField("aksrt_captcha_proof",data.proof),clearProviderTokens(),completeVerification()})}).catch(function(error){cancelPending(error.message||"人机验证失败,请重试"),resetVerificationState()})}function completeProviderVerification(){hField.value="1",exchangeVerification()}function completeVerification(){verified=!0,hField.value="1",finishPending(!0)}function showTip(message,color){var tip=box.querySelector(".captcha-tip");tip||(tip=document.createElement("div"),tip.className="captcha-tip",tip.style.cssText="font-size:12px;margin-top:4px;text-align:left;",box.appendChild(tip)),tip.style.color=color||"#e74c3c",tip.textContent=message,setTimeout(function(){tip.parentNode&&tip.remove()},4e3)}function showLoading(){box.innerHTML='
    验证码加载中...
    '}function clearLoading(){box.innerHTML=""}var instance={uid:C.uid,scene:C.scene,box,mount,scope:scopeBoundary(box,C),runLocked:!1,lockWaiters:[],collect:collectFields,reset:resetVerificationState,verify:function(){var challengeField=container.querySelector('input[name="aksrt_captcha_challenge"]'),preparation=challengeField&&challengeField.value?Promise.resolve():refreshChallenge();return preparation.then(function(){return challengeField=container.querySelector('input[name="aksrt_captcha_challenge"]'),!challengeField||!challengeField.value?(showTip("人机验证会话未就绪,请稍后重试","#e74c3c"),!1):verified||hField.value==="1"?!0:new Promise(function(resolveVerify){pending.push(resolveVerify),pending.length===1&&triggerCaptcha()})})}};register(instance),refreshingChallenge=refreshChallenge();function loadTencent(){showLoading(),loadScriptOnce("tencent","https://turing.captcha.qcloud.com/TJCaptcha.js",function(){return typeof window.TencentCaptcha<"u"}).then(function(){clearLoading();var captchaInstance=null;triggerCaptcha=function(){captchaInstance||(captchaInstance=new window.TencentCaptcha(C.tc.app_id,function(result){if(result.ret===2){cancelPending("已取消验证");return}if(result.ret===0&&result.ticket){if(result.ticket.indexOf("trerror_")===0){cancelPending("验证码服务异常,请刷新页面重试");return}setField("tencent_ticket",result.ticket),setField("tencent_randstr",result.randstr),completeProviderVerification();return}var errorMap={1001:"验证码组件加载失败",1002:"验证码超时",1006:"验证码配置拉取失败",1008:"验证码页面加载异常",1012:"验证码刷新次数过多",1013:"验证码网络异常"};cancelPending(errorMap[result.errorCode]||"验证码异常,请重试")},{userLanguage:"zh-cn"})),captchaInstance.show()}}).catch(function(){clearLoading(),cancelPending("验证码组件加载失败,请刷新重试")})}function loadCloudflare(){var widgetId=null,verifying=!1,modal=null;function closeModal(){if(widgetId!==null&&typeof window.turnstile<"u")try{window.turnstile.remove(widgetId)}catch{}widgetId=null,modal&&modal.parentNode&&modal.parentNode.removeChild(modal),modal=null}function renderWidget(){if(typeof window.turnstile>"u"){setTimeout(renderWidget,200);return}widgetId=window.turnstile.render("#modalWidget_"+C.uid,{sitekey:C.cf.site_key,theme:C.cf.theme,size:C.cf.size,action:"aksrt-verify",cdata:C.scene,callback:function(token){verifying&&(verifying=!1,setField("cf_turnstile_response",token),closeModal(),completeProviderVerification())},"error-callback":function(){verifying=!1,closeModal(),cancelPending("验证码失败,请重试")},"expired-callback":function(){verifying=!1,closeModal(),cancelPending("验证码已过期,请重新验证")}})}function createModal(){modal=document.createElement("div"),modal.className="aksrt-captcha-modal-overlay",modal.innerHTML='
    人机验证

    请完成验证后继续操作

    ',document.body.appendChild(modal);var cancel=function(){verifying=!1,closeModal(),cancelPending("已取消验证")};modal.querySelector(".aksrt-captcha-modal-backdrop").addEventListener("click",cancel),modal.querySelector(".aksrt-captcha-modal-close").addEventListener("click",cancel),renderWidget()}window["onTurnstileLoad_"+C.uid]=function(){},typeof window.turnstile>"u"&&loadScriptOnce("cloudflare","https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onTurnstileLoad_"+C.uid+"&render=explicit",function(){return typeof window.turnstile<"u"}).catch(function(){cancelPending("验证码组件加载失败,请刷新重试")}),triggerCaptcha=function(){verifying||(verifying=!0,createModal())},providerReset=closeModal}function loadGeetest(){showLoading();var captchaId=C.gt&&C.gt.captcha_id?String(C.gt.captcha_id).trim():"",product=C.gt&&C.gt.product?String(C.gt.product):"bind";if(!captchaId){clearLoading(),cancelPending("极验 Captcha ID 未配置");return}function render(){clearLoading(),window.initGeetest4({captchaId,product,hideSuccess:!0},function(captchaInstance){function onSuccess(){var result=captchaInstance.getValidate();if(!result){cancelPending("验证码失败,请重试");return}setField("geetest_lot_number",result.lot_number),setField("geetest_captcha_output",result.captcha_output),setField("geetest_pass_token",result.pass_token),setField("geetest_gen_time",result.gen_time),completeProviderVerification()}captchaInstance.onReady(function(){}).onSuccess(onSuccess).onClose(function(){cancelPending("已取消验证")}),product!=="bind"&&product!=="popup"&&captchaInstance.appendTo("#"+C.uid),triggerCaptcha=function(){product==="bind"||product==="popup"?captchaInstance.showCaptcha():showTip("请先完成人机验证","#e67e22")},providerReset=function(){typeof captchaInstance.reset=="function"&&captchaInstance.reset()}})}typeof window.initGeetest4>"u"?loadScriptOnce("geetest","https://static.geetest.com/v4/gt4.js",function(){return typeof window.initGeetest4<"u"}).then(render).catch(function(){clearLoading(),cancelPending("极验组件加载失败")}):render()}function loadAliyun(){showLoading(),window.AliyunCaptchaConfig={region:C.al.region||"cn",prefix:C.al.prefix};function render(){clearLoading();var captchaInstance=null;window.initAliyunCaptcha({SceneId:C.al.scene_id,mode:"popup",element:"#"+C.uid,success:function(verifyParam){setField("aliyun_captcha_verify_param",verifyParam),completeProviderVerification()},fail:function(){cancelPending("验证码失败,请重试")},getInstance:function(value){captchaInstance=value},slideStyle:{width:360,height:40},language:"cn"}),triggerCaptcha=function(){captchaInstance&&captchaInstance.show?captchaInstance.show():cancelPending("验证码组件加载中,请稍候再试")},providerReset=function(){captchaInstance&&typeof captchaInstance.reset=="function"&&captchaInstance.reset()}}typeof window.initAliyunCaptcha>"u"?loadScriptOnce("aliyun","https://o.alicdn.com/captcha-frontend/aliyunCaptcha/AliyunCaptcha.js",function(){return typeof window.initAliyunCaptcha<"u"}).then(render).catch(function(){clearLoading(),cancelPending("验证码组件加载失败,请刷新重试")}):render()}switch(C.provider){case"tencent":loadTencent();break;case"cloudflare":loadCloudflare();break;case"geetest":loadGeetest();break;case"aliyun":loadAliyun();break}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",scan):setTimeout(scan,0),window.jQuery&&window.jQuery(document).on("auto_fun",scan),window.MutationObserver&&new MutationObserver(function(mutations){var shouldScan=mutations.some(function(mutation){return mutation.addedNodes&&mutation.addedNodes.length});shouldScan&&scan()}).observe(document.documentElement,{childList:!0,subtree:!0})})(),(function(){"use strict";if("connection"in navigator){var conn=navigator.connection;if(conn.saveData||conn.effectiveType&&conn.effectiveType.indexOf("2g")!==-1)return}var hasHoverSupport=window.matchMedia("(hover: hover) and (pointer: fine)").matches;if(!hasHoverSupport)return;var prefetcher=document.createElement("link"),isPrefetched={},timer=null,DELAY=65,MAX_PREFETCH=3,prefetchedCount=0;if(!prefetcher.relList||!prefetcher.relList.supports||!prefetcher.relList.supports("prefetch"))return;function prefetch(url){if(!(isPrefetched[url]||prefetchedCount>=MAX_PREFETCH)&&url.indexOf("#")===-1){try{var link=new URL(url,window.location.origin);if(link.origin!==window.location.origin||link.pathname===window.location.pathname&&link.search===window.location.search)return}catch{return}if(!/\.(pdf|zip|rar|7z|tar|gz|exe|dmg|apk|mp[34]|avi|mov|wmv|flv|webm|ogg|wav|bmp|gif|ico|svg|woff2?|ttf|eot)(\?|$)/i.test(url)){isPrefetched[url]=!0,prefetchedCount++;var linkEl=document.createElement("link");linkEl.rel="prefetch",linkEl.href=url,linkEl.as="document",document.head.appendChild(linkEl)}}}function onHoverStart(e){var link=e.target.closest("a");!link||!link.href||link.target!=="_blank"&&(link.hasAttribute("download")||link.getAttribute("rel")!=="nofollow"&&(link.closest(".no-prefetch,[data-no-prefetch]")||(clearTimeout(timer),timer=setTimeout(function(){prefetch(link.href)},DELAY))))}function onHoverEnd(){clearTimeout(timer)}document.addEventListener("mouseover",onHoverStart,{passive:!0,capture:!0}),document.addEventListener("mouseout",onHoverEnd,{passive:!0,capture:!0}),document.addEventListener("focusin",function(e){var link=e.target.closest("a");link&&link.href&&prefetch(link.href)},{passive:!0,capture:!0}),window.addEventListener("pagehide",function(){isPrefetched={},prefetchedCount=0})})(),jQuery.cookie=function(e,o,t){if(o===void 0){var i=null;if(document.cookie&&document.cookie!="")for(var r=document.cookie.split(";"),n=0;n-1||text.indexOf("致命错误")>-1)}function aksrt_sprintf(key){var args=Array.prototype.slice.call(arguments,1),str=aksrt__(key),autoIndex=0;return str.replace(/%(\d+\$)?s/g,function(match,num){var idx=num?parseInt(num,10)-1:autoIndex++;return args[idx]!==void 0&&args[idx]!==null?args[idx]:match})}(function(window2,factory){var lazySizes2=factory(window2,window2.document,Date);window2.lazySizes=lazySizes2,typeof module=="object"&&module.exports&&(module.exports=lazySizes2)})(typeof window<"u"?window:{},function(window2,document2,Date2){"use strict";var lazysizes,lazySizesCfg;if((function(){var prop,lazySizesDefaults={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",loadafterClass:"lazyloadafter",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};lazySizesCfg=window2.lazySizesConfig||window2.lazysizesConfig||{};for(prop in lazySizesDefaults)prop in lazySizesCfg||(lazySizesCfg[prop]=lazySizesDefaults[prop])})(),!document2||!document2.getElementsByClassName)return{init:function(){},cfg:lazySizesCfg,noSupport:!0};var docElem=document2.documentElement,supportPicture=window2.HTMLPictureElement,_addEventListener="addEventListener",_getAttribute="getAttribute",addEventListener=window2[_addEventListener].bind(window2),setTimeout2=window2.setTimeout,requestAnimationFrame2=window2.requestAnimationFrame||setTimeout2,requestIdleCallback=window2.requestIdleCallback,regPicture=/^picture$/i,loadEvents=["load","error","lazyincluded","_lazyloaded"],regClassCache={},forEach=Array.prototype.forEach,hasClass=function(ele,cls){return regClassCache[cls]||(regClassCache[cls]=new RegExp("(\\s|^)"+cls+"(\\s|$)")),regClassCache[cls].test(ele[_getAttribute]("class")||"")&®ClassCache[cls]},addClass=function(ele,cls){hasClass(ele,cls)||ele.setAttribute("class",(ele[_getAttribute]("class")||"").trim()+" "+cls)},removeClass=function(ele,cls){var reg2;(reg2=hasClass(ele,cls))&&ele.setAttribute("class",(ele[_getAttribute]("class")||"").replace(reg2," "))},addRemoveLoadEvents=function(dom,fn,add){var action=add?_addEventListener:"removeEventListener";add&&addRemoveLoadEvents(dom,fn),loadEvents.forEach(function(evt){dom[action](evt,fn)})},triggerEvent=function(elem,name,detail,noBubbles,noCancelable){var event=document2.createEvent("Event");return detail||(detail={}),detail.instance=lazysizes,event.initEvent(name,!noBubbles,!noCancelable),event.detail=detail,elem.dispatchEvent(event),event},updatePolyfill=function(el,full){var polyfill;!supportPicture&&(polyfill=window2.picturefill||lazySizesCfg.pf)?(full&&full.src&&!el[_getAttribute]("srcset")&&el.setAttribute("srcset",full.src),polyfill({reevaluate:!0,elements:[el]})):full&&full.src&&(el.src=full.src)},getCSS=function(elem,style){return(getComputedStyle(elem,null)||{})[style]},getWidth=function(elem,parent,width){for(width=width||elem.offsetWidth;width49?function(){requestIdleCallback(run,{timeout:rICTimeout}),rICTimeout!==lazySizesCfg.ricTimeout&&(rICTimeout=lazySizesCfg.ricTimeout)}:rAFIt(function(){setTimeout2(run)},!0);return function(isPriority){var delay;(isPriority=isPriority===!0)&&(rICTimeout=33),!running&&(running=!0,delay=gDelay-(Date2.now()-lastTime),delay<0&&(delay=0),isPriority||delay<9?idleCallback():setTimeout2(idleCallback,delay))}},debounce2=function(func){var timeout,timestamp,wait=99,run=function(){timeout=null,func()},later=function(){var last=Date2.now()-timestamp;last0,visible&&getCSS(parent,"overflow")!="visible"&&(outerRect=parent.getBoundingClientRect(),visible=eLright>outerRect.left&&eLleftouterRect.top-1&&eLtop500&&docElem.clientWidth>500?500:370:lazySizesCfg.expand,lazysizes._defEx=defaultExpand,preloadExpand=defaultExpand*lazySizesCfg.expFactor,hFac=lazySizesCfg.hFac,isBodyHidden=null,currentExpand2&&loadMode>2&&!document2.hidden?(currentExpand=preloadExpand,lowRuns=0):loadMode>1&&lowRuns>1&&isLoading<6?currentExpand=defaultExpand:currentExpand=shrinkExpand),beforeExpandVal!==elemExpand&&(eLvW=innerWidth+elemExpand*hFac,elvH=innerHeight+elemExpand,elemNegativeExpand=elemExpand*-1,beforeExpandVal=elemExpand),rect=lazyloadElems[i].getBoundingClientRect(),(eLbottom=rect.bottom)>=elemNegativeExpand&&(eLtop=rect.top)<=elvH&&(eLright=rect.right)>=elemNegativeExpand*hFac&&(eLleft=rect.left)<=eLvW&&(eLbottom||eLright||eLleft||eLtop)&&(lazySizesCfg.loadHidden||isVisible(lazyloadElems[i]))&&(isCompleted&&isLoading<3&&!elemExpandVal&&(loadMode<3||lowRuns<4)||isNestedVisible(lazyloadElems[i],elemExpand))){if(unveilElement(lazyloadElems[i]),loadedSomething=!0,isLoading>9)break}else!loadedSomething&&isCompleted&&!autoLoadElem&&isLoading<4&&lowRuns<4&&loadMode>2&&(preloadElems[0]||lazySizesCfg.preloadAfterLoad)&&(preloadElems[0]||!elemExpandVal&&(eLbottom||eLright||eLleft||eLtop||lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr)!="auto"))&&(autoLoadElem=preloadElems[0]||lazyloadElems[i])}autoLoadElem&&!loadedSomething&&unveilElement(autoLoadElem)}},throttledCheckElements=throttle2(checkElements),switchLoadingClass=function(e){var elem=e.target;if(elem._lazyCache){delete elem._lazyCache;return}resetPreloading(e),addClass(elem,lazySizesCfg.loadedClass),removeClass(elem,lazySizesCfg.loadingClass),addRemoveLoadEvents(elem,rafSwitchLoadingClass),triggerEvent(elem,"lazyloaded"),setTimeout2(function(){addClass(elem,lazySizesCfg.loadafterClass)},700)},rafedSwitchLoadingClass=rAFIt(switchLoadingClass),rafSwitchLoadingClass=function(e){rafedSwitchLoadingClass({target:e.target})},changeIframeSrc=function(elem,src){try{elem.contentWindow.location.replace(src)}catch{elem.src=src}},handleSources=function(source){var customMedia,sourceSrcset=source[_getAttribute](lazySizesCfg.srcsetAttr);(customMedia=lazySizesCfg.customMedia[source[_getAttribute]("data-media")||source[_getAttribute]("media")])&&source.setAttribute("media",customMedia),sourceSrcset&&source.setAttribute("srcset",sourceSrcset)},lazyUnveil=rAFIt(function(elem,detail,isAuto,sizes,isImg){var src,srcset,parent,isPicture,event,firesLoad;(event=triggerEvent(elem,"lazybeforeunveil",detail)).defaultPrevented||(sizes&&(isAuto?addClass(elem,lazySizesCfg.autosizesClass):elem.setAttribute("sizes",sizes)),srcset=elem[_getAttribute](lazySizesCfg.srcsetAttr),src=elem[_getAttribute](lazySizesCfg.srcAttr),isImg&&(parent=elem.parentNode,isPicture=parent&®Picture.test(parent.nodeName||"")),firesLoad=detail.firesLoad||"src"in elem&&(srcset||src||isPicture),event={target:elem},addClass(elem,lazySizesCfg.loadingClass),firesLoad&&(clearTimeout(resetPreloadingTimer),resetPreloadingTimer=setTimeout2(resetPreloading,2500),addRemoveLoadEvents(elem,rafSwitchLoadingClass,!0)),isPicture&&forEach.call(parent.getElementsByTagName("source"),handleSources),srcset?elem.setAttribute("srcset",srcset):src&&!isPicture&&(regIframe.test(elem.nodeName)?changeIframeSrc(elem,src):elem.src=src),isImg&&(srcset||isPicture)&&updatePolyfill(elem,{src})),elem._lazyRace&&delete elem._lazyRace,removeClass(elem,lazySizesCfg.lazyClass),rAF(function(){var isLoaded=elem.complete&&elem.naturalWidth>1;(!firesLoad||isLoaded)&&(isLoaded&&addClass(elem,"ls-is-cached"),switchLoadingClass(event),elem._lazyCache=!0,setTimeout2(function(){"_lazyCache"in elem&&delete elem._lazyCache},9)),elem.loading=="lazy"&&isLoading--},!0)}),unveilElement=function(elem){if(!elem._lazyRace){var detail,isImg=regImg.test(elem.nodeName),sizes=isImg&&(elem[_getAttribute](lazySizesCfg.sizesAttr)||elem[_getAttribute]("sizes")),isAuto=sizes=="auto";(isAuto||!isCompleted)&&isImg&&(elem[_getAttribute]("src")||elem.srcset)&&!elem.complete&&!hasClass(elem,lazySizesCfg.errorClass)&&hasClass(elem,lazySizesCfg.lazyClass)||(detail=triggerEvent(elem,"lazyunveilread").detail,isAuto&&autoSizer.updateElem(elem,!0,elem.offsetWidth),elem._lazyRace=!0,isLoading++,lazyUnveil(elem,detail,isAuto,sizes,isImg))}},afterScroll=debounce2(function(){lazySizesCfg.loadMode=3,throttledCheckElements()}),altLoadmodeScrollListner=function(){lazySizesCfg.loadMode==3&&(lazySizesCfg.loadMode=2),afterScroll()},onload=function(){if(!isCompleted){if(Date2.now()-started<999){setTimeout2(onload,999);return}isCompleted=!0,lazySizesCfg.loadMode=3,throttledCheckElements(),addEventListener("scroll",altLoadmodeScrollListner,!0)}};return{_:function(){started=Date2.now(),lazysizes.elements=document2.getElementsByClassName(lazySizesCfg.lazyClass),preloadElems=document2.getElementsByClassName(lazySizesCfg.lazyClass+" "+lazySizesCfg.preloadClass),addEventListener("scroll",throttledCheckElements,!0),addEventListener("resize",throttledCheckElements,!0),addEventListener("pageshow",function(e){if(e.persisted){var loadingElements=document2.querySelectorAll("."+lazySizesCfg.loadingClass);loadingElements.length&&loadingElements.forEach&&requestAnimationFrame2(function(){loadingElements.forEach(function(img){img.complete&&unveilElement(img)})})}}),window2.MutationObserver?new MutationObserver(throttledCheckElements).observe(docElem,{childList:!0,subtree:!0,attributes:!0}):(docElem[_addEventListener]("DOMNodeInserted",throttledCheckElements,!0),docElem[_addEventListener]("DOMAttrModified",throttledCheckElements,!0),setInterval(throttledCheckElements,999)),addEventListener("hashchange",throttledCheckElements,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(name){document2[_addEventListener](name,throttledCheckElements,!0)}),/d$|^c/.test(document2.readyState)?onload():(addEventListener("load",onload),document2[_addEventListener]("DOMContentLoaded",throttledCheckElements),setTimeout2(onload,2e4)),lazysizes.elements.length?(checkElements(),rAF._lsFlush()):throttledCheckElements()},checkElems:throttledCheckElements,unveil:unveilElement,_aLSL:altLoadmodeScrollListner}})(),autoSizer=(function(){var autosizesElems,sizeElement=rAFIt(function(elem,parent,event,width){var sources,i,len;if(elem._lazysizesWidth=width,width+="px",elem.setAttribute("sizes",width),regPicture.test(parent.nodeName||""))for(sources=parent.getElementsByTagName("source"),i=0,len=sources.length;i-40&&angle<40&&distanceX>0?distanceX:0),options.direction=="left"&&(distanceY=0,distanceX=(angle>150||angle<-150)&&0>distanceX?distanceX:0),options.direction=="top"&&(distanceX=0,distanceY=angle>-130&&angle<-50&&0>distanceY?distanceY:0),options.direction=="bottom"&&(distanceX=0,distanceY=angle>50&&angle<130&&distanceY>0?distanceY:0),(distanceX!==0||distanceY!==0)&&(a.preventDefault?a.preventDefault():a.returnValue=!1,cssTransition(_move,distanceX,distanceY,dragging,"grab"),jQuery.isFunction(options.onIng)&&options.onIng(_e,_move,distanceX,distanceY)))}).on("touchend touchcancel pointerup MSPointerUp",touch_selector,function(){var _move=options.start_selector?options.selector?_e.find(options.selector):_e.find(options.start_selector):jQuery(this);dragging&&!is_stop&&(cssTransition(_move,0,0,"null",""),jQuery.isFunction(options.inEnd)&&options.inEnd(_e,_move,distanceX,distanceY),(Math.abs(distanceX)>dep||Math.abs(distanceY)>dep)&&jQuery.isFunction(options.onEnd)&&options.onEnd(_e,_move,distanceX,distanceY),startX=startY=endX=endY=angle=distanceX=distanceY=0,dragging=!1)}).data(is_on,!0)}},_win.bd=jQuery("body"),_win.window=jQuery(window),_win.is_signin=!!_win.bd.hasClass("logged-in");var _wid=_win.window.width(),_hei=_win.window.height();_win.bd.on("click","[data-close]",function(){var e=jQuery(this).attr("data-close");return jQuery(e).removeClass("show in"),!1}),_win.bd.on("click","[data-toggle-class]",function(){var c=jQuery(this).attr("data-toggle-class")||"show",e=jQuery(this).attr("data-target")||this;return jQuery(e).toggleClass(c).trigger("toggleClass"),!1}),_win.bd.on("click",only_drop),_win.bd.on("toggleClass",".dropup,.dropdown",only_drop);function only_drop(e){var drop=jQuery(e.target).closest(".dropup,.dropdown");jQuery(".dropup.open,.dropdown.open").not(drop).removeClass("open")}_win.bd.on("click",".alert-dismissible > .close",function(){jQuery(this).parent().slideUp()}),_win.bd.on("click","[data-onclick]",function(){var e=jQuery(this).attr("data-onclick");return jQuery(e).click()}),jQuery.fn.OnlyOn=function(type,selector,data,fun){var rnotwhite=/\S+/g,is_oned=!1;type=type.match(rnotwhite)[0];var events=jQuery._data(this[0],"events");events&&typeof events.type<"u"&&jQuery.each(events[type],function(i,item){if(item.selector==selector&&item.data==data)return is_oned=!0,!1}),is_oned?console.log("事件重复绑定{type:"+type+",selector:"+selector+",data:"+data+"}"):this.on(type,selector,data,fun)},jQuery.fn.aksrt_ajax=function(data,success,noty,no_loading){return aksrt_ajax(jQuery(this),data,success,noty,no_loading)},jQuery.fn.countdown=function(){function getTimeRemaining(endtime,max_unit){var date=new Date,now=date.getTime(),endDate=new Date(endtime),end=endDate.getTime(),total=end-now,seconds=total/1e3%60;seconds=seconds.toFixed(2);var mseconds=~~(total%1e3),minutes=~~(total/1e3/60%60),hours=~~(total/(1e3*60*60)%24),days=~~(total/(1e3*60*60*24));return max_unit==="minute"&&minutes>0&&(hours=0,days=0,minutes=~~(total/1e3/60)),max_unit==="hour"&&hours>0&&(days=0,hours=~~(total/(1e3*60*60))),seconds=seconds<10?"0"+seconds:seconds,minutes=minutes<10?"0"+minutes:minutes,{total,days,hours,minutes,seconds,mseconds}}jQuery(this).each(function(){var _this=jQuery(this),endtime=_this.attr("data-countdown");if(!endtime)return;var int_second=_this.attr("int-second"),max_unit=_this.attr("max-unit");if(_this.attr("title",aksrt__("countdown_end_time")+endtime),int_second==="auto"){var t=getTimeRemaining(endtime,max_unit);int_second=t.days>0}function updateClock(){var t2=getTimeRemaining(endtime,max_unit);if(int_second&&(t2.seconds=t2.seconds.toString().replace(/\.\d+$/,"")),_this.find(".day").length&&_this.find(".day").html(t2.days),_this.find(".hour").length&&_this.find(".hour").html(t2.hours),_this.find(".minute").length&&_this.find(".minute").html(t2.minutes),_this.find(".second").length)_this.find(".second").html(t2.seconds);else{var html="";t2.days>0&&(html+=''+t2.days+''+aksrt__("countdown_day")+""),(t2.hours>0||t2.days>0)&&(html+=''+t2.hours+''+aksrt__("countdown_hour")+""),(t2.minutes>0||t2.hours>0||t2.days>0)&&(html+=''+t2.minutes+''+aksrt__("countdown_minute")+""),html+=''+t2.seconds+''+aksrt__("countdown_second")+"",_this.html(html)}if(t2.total<=0){clearInterval(timeinterval);var over_text=_this.attr("data-over-text")||aksrt__("countdown_ended");_this.html(over_text).trigger("countdown-over")}}updateClock();var timeinterval=setInterval(updateClock,int_second?1e3:20);_this.removeAttr("data-countdown").addClass("countdown-box")})},_win.dplayer={tbquire:["dplayer"],obj:{}};function new_dplayer(){var selector=".new-dplayer:not(.dplayer-initialized),[data-dplayer]:not(.dplayer-initialized)";jQuery(selector).length&&jQuery(selector).each(function(){var _this=jQuery(this);get_new_dplayer(_this,function(dplayer){_this.addClass("dplayer-initialized").siblings(".dplayer-featured").find(".switch-video").each(function(){var _this2=jQuery(this),video_url=_this2.attr("video-url"),video_pic=_this2.attr("video-pic");_this2.data({"video-url":video_url,"video-pic":video_pic}),_this2.attr({"dplayer-id":dplayer.container.id}),setTimeout(function(){_this2.removeAttr("video-url").removeAttr("video-pic")},50)})})})}function get_new_dplayer(_this,func){var option={},video_url=_this.attr("video-url")||_this.data("video-url"),data_volume=_this.attr("data-volume"),i=parseInt((Math.random()+1)*Math.pow(10,4));if(!(_this.find(".dplayer-video-wrap").length||!video_url)){_this.attr("id","dplayer-"+i),option.container=document.getElementById("dplayer-"+i),option.theme="#f04494",option.video={url:video_url,pic:_this.attr("video-pic")||"",type:_this.attr("video-type")||"auto"},_this.attr("data-loop")&&(option.loop=!0),_this.attr("data-autoplay")&&(option.autoplay=!0),data_volume&&data_volume<1&&(option.volume=data_volume),data_volume==="none"&&(option.volume=0);var option_attr=_this.attr("video-option");if(option_attr){try{option_attr=JSON.parse(option_attr)}catch(e){console.log(e)}jQuery.extend(option,option_attr)}var v_u=video_url.toLowerCase();return v_u.indexOf(".m3u")!=-1&&_win.dplayer.tbquire.push("hls"),v_u.indexOf(".mpd")!=-1&&_win.dplayer.tbquire.push("dash"),v_u.indexOf(".flv")!=-1&&_win.dplayer.tbquire.push("flv"),jQuery("link#dplayer").length||jQuery("dplayer").append(''),_win.dplayer.tbquire.push("dplayer"),tbquire(_win.dplayer.tbquire,function(){try{var newDPlayer=new DPlayer(option);newDPlayer.on("play",function(){_win.dplayer.play=newDPlayer}),_this.data("dplayer",newDPlayer),_win.dplayer.obj[i]=newDPlayer,_this.attr({"video-url":"","video-pic":""}),jQuery.isFunction(func)&&func(newDPlayer)}catch(e){console.error(e)}}),i}}_win.bd.on("click",".swiper-slide.slide-dplayer:not(.slide-dplayer-played) > *",function(){var _this=jQuery(this),dplayer=_this.find(".new-dplayer").data("dplayer");dplayer&&(dplayer.play(),_this.parent().addClass("slide-dplayer-played"))});function thumb_dplayer(mouseenter_e,box_e){var $body=jQuery("body"),thumb_dplayer_data_text="thumb_dplayer_data",thumb_dplayer_data=$body.data(thumb_dplayer_data_text)||{};if(thumb_dplayer_data[mouseenter_e+box_e])return;var ing_class="thumb-dplayer-playing",thumb_hide_class="dplayer-thumb-hide";function to_play(_this_m,_this,dplayer){_this.find(".dplayer-thumb").removeClass(thumb_hide_class),_win.dplayer.thumb_play=dplayer,_this.find(".progress").show(),_this_m.addClass(ing_class)}function to_pause(_this_m,_this,dplayer){dplayer.pause(),_this.find(".dplayer-thumb").addClass(thumb_hide_class),_win.dplayer.thumb_play=!1,_this.find(".progress").hide(),_this_m.removeClass(ing_class)}function video_thumb_stop(){if(_win.dplayer.thumb_play){var _this=jQuery(_win.dplayer.thumb_play.container).closest(box_e),_this_m=_this.closest(mouseenter_e);to_pause(_this_m,_this,_win.dplayer.thumb_play)}}function video_thumb_play(){var _this_m=jQuery(this),_this=_this_m.find(box_e);if(!_this.length)return;var dplayer=_this.find(".dplayer-thumb").data("dplayer");if(dplayer)return to_play(_this_m,_this,dplayer),dplayer.play();function dplayer_init(dplayer2){dplayer2.on("loadeddata",function(){setTimeout(function(){_this.find(".progress-bar").css({width:"100%",opacity:"0",transition:"width .2s, opacity .3s .3s"})},100),setTimeout(function(){_this.find(".progress").remove()},800)}),setTimeout(function(){to_play(_this_m,_this,dplayer2),dplayer2.play()},200)}if(!_this.find(".dplayer-thumb").length){var video_url=_this.attr("video-url"),video_volume=_this.attr("data-volume")||"none",video_pic="",scale_height=~~_this.attr("scale-height"),progress='
    ',_dplayer=jQuery('
    ');_this.find(".video-thumb").html(_dplayer).after(progress),setTimeout(function(){_this.find(".progress-bar").css({transition:"width 6s",width:"80%"})},50),_this.attr("video-url",""),get_new_dplayer(_dplayer,dplayer_init)}}$body.on("mouseenter touchstart",mouseenter_e,video_thumb_play),$body.on("mouseleave",mouseenter_e,video_thumb_stop);var thumb_dplayer_init="thumb_dplayer_init";$body.data(thumb_dplayer_init)||$body.on("touchstart",function(e){var _target=jQuery(e.target);!_target.parents("."+ing_class).length&&_win.dplayer.thumb_play&&video_thumb_stop()}).data(thumb_dplayer_init,!0),thumb_dplayer_data[mouseenter_e+box_e]=!0,$body.data(thumb_dplayer_data_text,thumb_dplayer_data)}_win.bd.on("click",".switch-video",function(){var _this=jQuery(this),dplayer=jQuery("#"+_this.attr("dplayer-id")).data("dplayer"),video_url=_this.data("video-url"),video_pic=_this.data("video-pic");if(!(!video_url||!dplayer||_this.hasClass("active"))){_this.addClass("active").siblings().removeClass("active");var v_u=video_url.toLowerCase();v_u.indexOf(".m3u")!=-1&&_win.dplayer.tbquire.push("hls"),v_u.indexOf(".mpd")!=-1&&_win.dplayer.tbquire.push("dash"),v_u.indexOf(".flv")!=-1&&_win.dplayer.tbquire.push("flv"),tbquire(_win.dplayer.tbquire,function(){try{var op={url:video_url,type:"auto"};video_pic&&(op.pic=video_pic),dplayer.switchVideo(op),setTimeout(function(){dplayer.play()},100)}catch(e){console.log(e)}})}}),_win.bd.on("click",".switch-iframe",function(){var _this=jQuery(this),video_url=_this.attr("iframe-url"),$iframe=_this.closest(".iframe-series").find("iframe");if(!(!video_url||_this.hasClass("active"))){try{$iframe[0].contentWindow.location.replace(video_url)}catch{$iframe.attr("src",video_url)}_this.addClass("active").siblings().removeClass("active")}}),_win.bd.on("click",".post-tab-toggle",function(){var _this=jQuery(this),tab_id=_this.attr("tab-id");if(!_this.parent().hasClass("active")){var _con=_this.parent().addClass("active").siblings().removeClass("active").parent().next().find('[tab-id="'+tab_id+'"]');_con.siblings().removeClass("in"),setTimeout(function(){_con.addClass("active").siblings().removeClass("active")},150),setTimeout(function(){_con.addClass("in")},160)}}),_win.swiper=[],_win.swiper.tab={},_win.swiper.scroll={},_win.swiper.new={};function new_swiper(){jQuery(".swiper-scroll:not(.swiper-container-initialized),.new-swiper:not(.swiper-container-initialized),.swiper-tab:not(.swiper-container-initialized)").length&&(jQuery("link#swiper").length||jQuery("head").append(''),tbquire(["swiper"],function(){jQuery(".swiper-scroll").each(function(e){if(!jQuery(this).hasClass("swiper-container-initialized")){var option={},_this=jQuery(this),_eq="swiper-scroll-eq-"+e,slideClass=_this.attr("data-slideClass")||!1;if(slideClass&&(option.slideClass=slideClass),!_this.attr("scroll-nogroup")){var c_w=_this.width(),i_w=_this.find(".swiper-wrapper>*:eq(0)").outerWidth(),slidesPerGroup=~~(c_w/i_w);option.slidesPerGroup=slidesPerGroup||1}option.autoplay=_this.attr("data-autoplay")?{delay:~~_this.attr("data-interval")||4e3,disableOnInteraction:!1}:!1,option.loop=_this.attr("data-loop"),option.slidesPerView="auto",option.mousewheel={forceToAxis:!0},option.freeMode=!0,option.freeModeSticky=!0,option.navigation={nextEl:".swiper-scroll."+_eq+" .swiper-button-next",prevEl:".swiper-scroll."+_eq+" .swiper-button-prev"},_this.addClass(_eq).attr("swiper-scroll-index",e),_win.swiper.scroll[e]=new Swiper(".swiper-scroll."+_eq,option)}}),jQuery(".swiper-tab").each(function(e){if(!jQuery(this).hasClass("swiper-container-initialized")){var _eq="swiper-eq-"+e,_this=jQuery(this),speed=~~_this.attr("data-speed")||~~((_this.width()+1200)/170)*50,initialSlide=~~_this.attr("active-index");speed=speed<300?300:speed;var option={loop:!1,initialSlide,autoHeight:!0,spaceBetween:20,autoplay:!1,speed,pagination:{el:".swiper-tab."+_eq+" .swiper-pagination",clickable:!0},on:{init:function(){auto_maxHeight()},slideChangeTransitionEnd:function(bvv){var b=jQuery(".swiper-tab."+_eq+" .swiper-slide-active .post_ajax_trigger .ajax-open");b.length&&(scrollTopTo(jQuery(".swiper-tab."+_eq),-40),b.attr("no-scroll",!0).click());var r=bvv.onStart&&jQuery('[swiper-scroll-index="'+e+'"] .swiper-slide-thumb-active [data-route]');r&&r.length&&history.replaceState(null,document.title,r.attr("data-route")),bvv.onStart=!0}}},tab_id=_this.attr("swiper-tab"),tab_nav=jQuery('[swiper-tab-nav="'+tab_id+'"]');if(tab_nav.length){var tab_nav_index=tab_nav.attr("swiper-scroll-index");option.thumbs={swiper:_win.swiper.scroll[tab_nav_index],autoScrollOffset:2},tab_nav.on("click","a[data-route]",function(e2){e2.preventDefault()})}_this.addClass(_eq).attr("swiper-tab-index",e),_win.swiper.tab[e]=new Swiper(".swiper-tab."+_eq,option)}}),jQuery(".new-swiper").each(function(e){if(!jQuery(this).hasClass("swiper-container-initialized")){var _eq="swiper-eq-"+e,_this=jQuery(this),delay=~~_this.attr("data-interval")||6e3,autoplay=_this.attr("data-autoplay")?{delay,disableOnInteraction:!1}:!1,auto_h=!!_this.attr("auto-height"),speed=~~_this.attr("data-speed")||~~((_this.width()+1e3)/22)*10;speed=speed<400?400:speed,speed=autoplay===!1?speed/1.6:speed;var loop=!!_this.attr("data-loop"),parallax=!!_this.find("[data-swiper-parallax],[data-swiper-parallax-scale]").length,effect=_this.attr("data-effect")||"slide",direction=_this.attr("data-direction")||"horizontal",spaceBetween=~~_this.attr("data-spaceBetween")||0,pagination_type=_this.attr("data-pagination-type")||"bullets";_this.addClass(_eq).attr("swiper-new-index",e);var swiper_args={loop,autoHeight:auto_h,direction,spaceBetween,parallax,effect,lazy:{loadPrevNext:!0},autoplay,speed,pagination:{el:".new-swiper."+_eq+" .swiper-pagination",type:pagination_type,clickable:!0},navigation:{nextEl:".new-swiper."+_eq+" .swiper-button-next",prevEl:".new-swiper."+_eq+" .swiper-button-prev"},on:{lazyImageReady:function(slideEl,imageEl){jQuery(imageEl).addClass("lazyloaded")},slideChange:function(){_this.find(".new-dplayer").each(function(index,item){var dplayer=jQuery(item).data("dplayer");dplayer&&dplayer.pause()})},init:function(){loop&&_this.find(".swiper-slide-duplicate img").addClass("no-imgbox")}}};pagination_type==="thumbnail"&&(swiper_args.pagination.type="bullets",swiper_args.pagination.bulletClass="pagination-thumbnail-item",swiper_args.pagination.bulletActiveClass="pagination-thumbnail-item-active",swiper_args.pagination.renderBullet=function(index,className){var imgsrc,thumbnail,_img=jQuery(this.slides[index]).find("img");return _img.length&&(_img=jQuery(_img[0]),imgsrc=_img.attr("data-src")||_img.attr("src")),imgsrc?(thumbnail='
    ',thumbnail):""}),_win.swiper.new[e]=new Swiper(".new-swiper."+_eq,swiper_args)}})}))}window.swiper_tab_AutoHeight=debounce(function($con){var tab=$con.closest("[swiper-tab-index]");if(tab.length){var tab_index=tab.attr("swiper-tab-index");_win.swiper.tab[tab_index].updateAutoHeight(500)}},100),jQuery.fn.scrollX=function(){return this.each(function(){var _this=jQuery(this),is_on="is-on";if(!_this.data(is_on)){_this.data(is_on,!0);var btn_class="scroll-x-",prev_btn_class=btn_class+"prev",next_btn_class=btn_class+"next",prev=jQuery(''),next=jQuery('');init()}function scroll(type){var data=get_data();_this.animate({scrollLeft:type==="prev"?data[0]:data[1]},300,"linear",hover_show)}function init(){_this.after(prev).after(next),prev.on("click",function(){scroll("prev")}),next.on("click",scroll),_this.parent().hover(hover_show,function(){prev.hide(),next.hide()})}function hover_show(){var data=get_data();data[3]?prev.show():prev.hide(),data[3]0?prev_scroll:0;var next_scroll=~~(_this_scrollLeft+_this_w);return next_scroll=next_scroll>max?max:next_scroll,[prev_scroll,next_scroll,max,_this_scrollLeft]}})},jQuery.fn.Tabcenter=function(){return this.each(function(){var _this=jQuery(this),_active=_this.find(".active");if(_active.length){var _this_w=_this.innerWidth(),_active_w=_active.innerWidth(),_this_scrollLeft=_this.scrollLeft(),_active_left=_active.position().left,max=~~(_this.prop("scrollWidth")-_this_w),_yd=~~(_this_scrollLeft+_active_left-_this_w/2+_active_w/2);_yd=_yd>0?_yd:0,_yd=_yd>max?max:_yd,_yd!=_this_scrollLeft&&_this.animate({scrollLeft:_yd},300)}})},_win.bd.on("shown.bs.tab","a[data-ajax]",function(){jQuery(this).closest("ul.list-inline").Tabcenter()}),jQuery(".tab-nav-theme,.tab-nav-but,.index-tab ul.list-inline").Tabcenter();function post_ajax(_this,con,jcon,item,loader,pag,next,trigger,replace,nomore,top,ajax_trigger){var $con=_this.closest(con);if($con.attr("ing"))return!1;var $item=find(item),href=_this.attr("ajax-href")||_this.attr("href")||_this.find("a").attr("ajax-href")||_this.find("a").attr("href");jcon=jcon||con,ajax_trigger=ajax_trigger||(_win.ajax_trigger?_win.ajax_trigger:''+aksrt__("load_more")),replace=_this.attr("ajax-replace")||replace,nomore=nomore||_win.ajax_nomore;var $loader=find(".post_ajax_loader");$loader.length||(loader=loader||'

    ',$loader=jQuery('
    '+loader+"
    "));function find(selector,$parent,con_selector){$parent=$parent&&$parent.length?$parent:$con,con_selector=con_selector||con;var $element=$parent.find(">"+selector);return $element.length||($element=$parent.find(">*:not("+con_selector+")>"+selector),$element.length)||($element=$parent.find(">*:not("+con_selector+")>*:not("+con_selector+")>"+selector),$element.length)||($element=$parent.find(">*:not("+con_selector+")>*:not("+con_selector+")>*:not("+con_selector+")>"+selector),$element.length)?$element:jQuery("null#null")}return href&&jQuery.ajax({type:"POST",url:href,dataType:"html",beforeSend:function(){replace&&$item.length&&$item.remove(),$con.attr("ing",!0),find(".post_ajax_trigger").remove(),find(".no-more").remove(),find(".post_ajax_loader").remove(),find(".noajax-pag").remove(),find(pag).remove(),$item=find(item),$item.length?top?$item.first().before($loader):$item.last().after($loader):$con.append($loader),$loader.fadeIn(),swiper_tab_AutoHeight($con)},success:function(a){a=jQuery.parseHTML("
    "+a+"
    ");var $a=jQuery(a);$a.find("[win-ajax-replace]").each(function(){var replace_key=jQuery(this).attr("win-ajax-replace"),replace_e=jQuery('[win-ajax-replace="'+replace_key+'"]');replace_e.length&&(replace_e.html(jQuery(this).html()),jQuery(this).remove())});var $jcon=$a.find(jcon),c_c=find(item,$jcon,jcon),c_p=find(pag,$jcon,jcon),n_h=c_p.find(next).attr("href")||c_p.find(next).find("a").attr("href");c_p=c_p.length?c_p:'
    '+nomore+"
    ",c_p=$jcon.find(".noajax-pag").length?$jcon.find(".noajax-pag"):c_p,trigger&&(c_p=typeof n_h<"u"?''+ajax_trigger+"":c_p);var $item_header=find(".ajax-item-header",$jcon,jcon);if($item_header.length&&(find(".ajax-item-header").remove(),$con.prepend($item_header)),$item=find(item),$item.length?top?$item.first().before(c_p).before(c_c):$item.last().after(c_p).after(c_c):top?$con.append(c_p).append(c_c):$con.append(c_c).append(c_p),$con.removeAttr("ing").trigger("post_ajax.ed",jQuery(a)),find(".post_ajax_loader",$con).hide(),_this.attr("no-scroll"))_win.auto_scroll=!0,setTimeout(function(){_win.window.trigger("scroll"),_win.auto_scroll=!1},20);else{var _scroll_To=replace?$con:jQuery(c_c[0]);setTimeout(function(){scrollTopTo(_scroll_To,-40)},100)}if(_this.attr("route")){var route_title=_this.attr("route-title")||$a.find("title").text();history.replaceState(null,route_title,href),route_title&&jQuery("head title").text(route_title)}swiper_tab_AutoHeight($con),auto_fun()}}),!1}if(_win.bd.on("click","[remote-box]",function(){var _this=jQuery(this),remote=_this.attr("remote-box");remote&&jQuery.post(remote,null,function(data){_this.html(data).removeAttr("remote-box"),auto_fun(),_this.trigger("aksrt:remote-loaded")})}),_win.bd.on("show.bs.tab","a[data-ajax]",function(){var _this=jQuery(this),a=_this.data("target")||_this.attr("href"),selector=a+" .post_ajax_trigger .ajax-next",b=jQuery(selector).attr("ajax-replace",!0);if(b.length)b.click();else{var href=_this.attr("data-ajax");if(href){var trigger='';jQuery(a).append(trigger),jQuery(selector).click()}}_this.attr("only-one")&&_this.removeAttr("data-ajax")}),_win.bd.on("click","[ajax-tab],[ajax-target]",function(){var _this=jQuery(this),replace=_this.attr("ajax-replace")?' ajax-replace="true"':"",target=_this.attr("ajax-tab")||_this.attr("ajax-target"),href=_this.attr("data-ajax"),trigger='";console.log(target),jQuery(target).find(".post_ajax_trigger").remove(),jQuery(target).append(trigger),jQuery(target+" .post_ajax_trigger .ajax-next").click(),jQuery('a[href="'+target+'"]').click()}),_win.bd.on("click",".ajax-next",function(e){e.preventDefault();var _this=jQuery(this);if(_this.hasClass("pag-jump"))return!1;var _loader='
    '+aksrt__("loading")+"
    ";_this.attr("ajax-replace")&&(_loader='

    ',_loader+=_loader,_loader+=_loader),_loader='
    '+_loader+"
    ";var t_con=_this.attr("ajaxpager-target")||".ajaxpager",t_item=_this.attr("ajaxitem-target")||".ajax-item",$item1=_this.parents(t_con+":eq(0)").find(t_item+":first"),$item1_class=$item1.attr("class");if($item1_class&&$item1_class.indexOf("posts-item")>-1)if($item1_class.indexOf("card")>-1){var loader_class=$item1_class.replace("ajax-item","");_loader='

    ',_loader=_loader.repeat(_wid>766?_wid>992&&!jQuery(".sidebar").length?8:6:4)}else $item1_class.indexOf("list")>-1&&(_loader='

    ',_loader=_loader.repeat(_wid>766?4:3));return post_ajax(_this,t_con,t_con,t_item,_loader,".ajax-pag")}),_wid<769&&jQuery(".drawer-sm").length){_win.bd.on("click","[data-drawer]",function(){var _this=jQuery(this),title=_this.attr("drawer-title")||"",drawer_selector=_this.attr("drawer-selector")||".drawer-sm",action=_this.attr("data-drawer"),route=_this.attr("route"),route_back=_this.attr("route-back");jQuery(drawer_selector).Drawer(action,title,route,route_back)});var this_url=(window.parent.location.origin+window.parent.location.pathname).replace(/(\/*$)/g,"");_win.url_request=window.parent.location.search,setTimeout(function(){jQuery('[data-drawer][route="'+this_url+'"]').click()},20)}else _win.bd.on("shown.bs.tab","[data-drawer][route]",tabOnRoute),_win.bd.on("hide.bs.tab","[data-drawer][route]",tabOnRoute_hidden);_win.bd.on("shown.bs.tab","[data-route]",tabOnRoute),_win.bd.on("hide.bs.tab","[data-route]",tabOnRoute_hidden);function tabOnRoute_hidden(){var _this=jQuery(this);if(!history.state){var route=_this.attr("route")||_this.attr("data-route"),tab_id=_this.attr("data-target");route&&history.replaceState({tab_id},null,route)}}function tabOnRoute(){var _this=jQuery(this);if(_this.attr("onpopstate"))_this.attr("onpopstate",!1);else{var route=_this.attr("route")||_this.attr("data-route"),tab_id=_this.attr("data-target");route&&routeGo(route,{tab_id})}}window.onpopstate=function(event){var tab=event.state&&jQuery('[data-toggle="tab"][data-target="'+event.state.tab_id+'"]');tab&&tab.length&&tab.attr("onpopstate",!0).click()};function routeGo(url,data,title){title=title||document.title,url&&history.pushState(data,title,url)}if(jQuery.fn.loading=function(action){var _this=jQuery(this);action=action=="show"||action=="hide"?action:_this.hasClass("loading-show")?"hide":"show";var loading_class="loading-backdrop",loading_html='';return action=="show"?_this.addClass("loading-show").append(loading_html).find("."+loading_class).fadeIn(200):_this.removeClass("loading-show").find("."+loading_class).fadeOut(200,function(){jQuery(this).remove()}),_this},jQuery.fn.Drawer=function(action,title,route,route_back){title=title||"";var _this=jQuery(this);if(!_this.length)return;action=action=="show"||action=="hide"?action:_this.hasClass("show")?"hide":"show";var _body=jQuery("body");_this.attr("on-start")||_this.attr("on-start",!0).minitouch({direction:"right",onEnd:function(){_this.Drawer("hide")}});function urlTo(url){history.replaceState(null,document.title,url)}switch(action){case"show":var header=jQuery('
    '+title+"
    ").on("click",".drawer-close",function(){_this.Drawer("hide")});return _body.append(header),setTimeout(function(){_body.addClass("drawer-show")},10),route_back&&_this.data("route_back",route_back),route&&urlTo(route),_this.addClass("show");case"hide":return _body.removeClass("drawer-show"),setTimeout(function(){jQuery(".drawer-header").remove()},400),urlTo(_this.data("route_back")),_this.removeClass("show");default:}},jQuery(".wp-block-carousel").length){jQuery("link#swiper").length||jQuery("head").append('');var _sc=jQuery(".wp-block-carousel"),Sw=[];tbquire(["swiper"],function(){_sc.each(function(si){var _this=jQuery(this),_eq="swiper-post-"+si;_this.find(".wp-block-gallery>.blocks-gallery-grid").length&&_this.find(".wp-block-gallery").html(_this.find(".wp-block-gallery>.blocks-gallery-grid").html()),_this.find(".wp-block-gallery").removeClass().addClass("swiper-wrapper").find(".blocks-gallery-item,>.wp-block-image").addClass("swiper-slide"),_this.find(".carousel-control.left").replaceWith('
    '),_this.find(".carousel-control.right").replaceWith('
    ');var _ss=_this.find(".carousel"),proportion=_ss.attr("proportion")||.6,style=_ss.attr("style");_ss.addClass(_eq+" new-swiper scale-height").attr("style","--scale-height:"+proportion*100+"%;"),_this.attr("style",style);var delay=~~_ss.attr("data-interval")||6e3,loop=_ss.attr("data-jyloop")||!1,effect=_ss.attr("data-effect")||"slide",speed=~~((_ss.width()+1200)/250)*100;Sw["swiper_wz_"+si]=new Swiper(".wp-block-carousel ."+_eq,{spaceBetween:10,speed,loop,effect,autoplay:{delay,disableOnInteraction:!1},pagination:{el:"."+_eq+" .swiper-pagination",clickable:!0},navigation:{nextEl:"."+_eq+" .swiper-button-next",prevEl:"."+_eq+" .swiper-button-prev"}})})})}_win.bd.on("show.bs.modal loaded.bs.modal",".modal:not(.flex)",function(){var o=jQuery(this),i=o.find(".modal-dialog");o.css("display","block"),i.css({"margin-top":Math.max(0,(_hei-i.height())/2)})}),_win.bd.on("show.bs.modal loaded.bs.modal",".modal",function(){auto_fun()}),_win.modal_z_index=1050,_win.bd.on("show.bs.modal",".modal",function(){_win.modal_z_index++,jQuery(".modal.in").addClass("modal-parent"),jQuery(this).css("z-index",_win.modal_z_index).removeClass("modal-parent")}),_win.bd.on("hide.bs.modal",".modal",function(){jQuery(".modal.modal-parent").removeClass("modal-parent")}),_win.bd.on("click",".oauth-untying",function(){if(confirm(aksrt__("confirm_unbind"))==!0){var _this=jQuery(this),data={action:"user_oauth_untying",user_id:_this.attr("user-id"),type:_this.attr("untying-type"),_wpnonce:_this.attr("_wpnonce")};return aksrt_ajax(_this,data),!1}}),_win.bd.on("click",".medal-add-link",function(){if(confirm(aksrt__("confirm_grant_badge"))==!0)return aksrt_ajax(jQuery(this)),!1}),_win.bd.on("click",".medal-remove-link",function(){if(window.confirm(aksrt__("confirm_revoke_badge")))return aksrt_ajax(jQuery(this)),!1}),_win.bd.on("click","[tab-id]",function(e){var tab=jQuery(this).attr("tab-id");if(tab){var _tab=jQuery('a[data-target="#'+tab+'"]');_tab.length||(_tab=jQuery('a[href="#'+tab+'"]')),_tab.length&&(e.preventDefault(),_tab.tab("show"))}}),_win.bd.on("click",'[data-toggle="RefreshModal"]',function(e){e.preventDefault();var _this=jQuery(this),remote=_this.attr("data-remote");if(!remote){var action=_this.attr("data-action");action&&(remote=_win.ajax_url+"?action="+action)}return refresh_modal({class:_this.attr("data-class")||"",height:_this.attr("data-height")||300,mobile_from_bottom:!!_this.attr("mobile-bottom"),new:_this.attr("new"),touch_close:!_this.attr("no-touch"),remote}),!1});function refresh_modal(_config){_config.mobile_from_bottom=typeof _config.mobile_from_bottom>"u"?!0:_config.mobile_from_bottom;var id="refresh_modal",is_new=_config.new,dataclass=_config.class||"",height=_config.height||200,mobile_bottom=_config.mobile_from_bottom&&_wid<769?" bottom":"",touch_close=typeof _config.touch_close>"u"?!0:_config.touch_close,modal_class="modal flex jc fade"+mobile_bottom,remote=_config.remote||"",content=_config.content||"";dataclass+=" modal-dialog",id+=is_new?parseInt((Math.random()+1)*Math.pow(10,4)):"";var _id="#"+id,_modal=jQuery(_id);if(_modal.length){var is_in=_modal.hasClass("in");is_in&&(modal_class+=" in");var $modal_content=_modal.find(".modal-content");_modal.removeClass().addClass(modal_class),_modal.find(".modal-dialog").removeClass().addClass(dataclass),_modal.find(".loading-mask").fadeIn(200),_modal.find(".modal-body").fadeOut(200),$modal_content.css({overflow:"hidden",height:is_in?$modal_content.height():100}).animate({height})}else{var modal_html='',loading='
    ';_win.bd.append(modal_html),_modal=jQuery(_id),_modal.on("hidden.bs.modal",function(){is_new?jQuery(this).remove():jQuery(this).find(".modal-content").html(loading)}),_modal.find(".modal-content").html(loading).css({height,overflow:"hidden"}),_wid<769&&_modal.minitouch({direction:"bottom",selector:".modal-dialog",start_selector:".modal-colorful-header,.touch-close,.touch",onEnd:function(){_modal.modal("hide")},stop:function(){return!_modal.hasClass("bottom")}})}_modal.find(".touch-close").remove(),mobile_bottom&&touch_close&&_modal.find(".modal-dialog").append('
    '),_modal.modal("show"),content?(_modal.find(".modal-body").html(content),_modal_content_open()):remote&&jQuery.post(remote,null,function(data){_modal.find(".modal-body").html(data),setTimeout(function(){_modal.trigger("loaded.bs.modal")},20),_modal_content_open()});function _modal_content_open(){_modal.find(".modal-body").fadeIn(50,function(){var b_height=jQuery(this).outerHeight(!0);_modal.find(".loading-mask").fadeOut(300),_modal.find(".modal-content").animate({height:b_height},300,"swing",function(){_modal.find(".modal-content").css({height:"",overflow:"",transition:""})})})}return _modal}window.auto_maxHeight=debounce(z_auto,100);function z_auto(){if(_win.do_hh=document.documentElement.clientHeight,_win.do_hh>document.body.clientHeight){var min_h=_win.do_hh-jQuery(".footer").outerHeight()-jQuery(".header").outerHeight()-20;jQuery("main").animate({"min-height":min_h})}}window.auto_fun=debounce(z_auto_fun,100);function z_auto_fun(){jQuery(document).trigger("auto_fun"),jQuery(".auto-search").AutoSearch(),jQuery(".dependency-box").dependency(),jQuery(".cloneable").cloneable(),jQuery("[data-countdown]").countdown(),auto_maxHeight(),jQuery("img[data-src]:not(.lazyload,.lazyloaded,.lazyloading,.swiper-lazy)").addClass("lazyload"),jQuery("[data-toggle='tooltip']").tooltip({container:"body"}),jQuery("[data-clipboard-text]").length&&tbquire(["clipboard"]),jQuery("[data-toggle='popover']").popover({sanitize:!1}),_wid>768?(jQuery(".fixed-wrap-nav").autoAffix(20,38),jQuery(".relative>.scroll-x.no-scrollbar").scrollX()):jQuery(".affix-header-sm").autoAffix(0,20),_wid>900&&jQuery(".sidebar").sidebarAffix(),new_swiper(),new_dplayer(),tbquire(["svg-icon"],()=>{show_svg()});var _h_e=_win.highlight_kg?"pre code:not(.enlighter-origin)":"pre code.gl:not(.enlighter-origin),pre code.special:not(.enlighter-origin)";jQuery(_h_e).length&&tbquire(["enlighterjs"],function(){var lin=!!_win.highlight_hh;jQuery("link#enlighterjs").length||jQuery("head").append(''),jQuery(_h_e).enlight({linenumbers:lin,indent:2,textOverflow:"scroll",rawcodeDbclick:!0,rawButton:!1,infoButton:!1,windowButton:!1,theme:_win.highlight_zt})}),_win.imgbox&&jQuery(".alone-imgbox-img,a[data-imgbox],.comment-content .box-img,.wp-posts-content img,.imgbox-container").length&&tbquire(["imgbox"])}(function(){var scroll_throttle=throttle(function(){var h=document.documentElement.scrollTop+document.body.scrollTop,ontop=jQuery(".ontop");h>100?_win.bd.addClass("body-scroll"):_win.bd.removeClass("body-scroll"),h>400?ontop.addClass("show"):ontop.removeClass("show")},100);_win.window.scroll(scroll_throttle);var debounce_scroll_end=debounce(function(){jQuery("[data-toggle='tooltip']").tooltip("hide")},500,!0);_win.window.scroll(debounce_scroll_end);var debounce_scrolling_hide=debounce(function(){_win.bd.addClass("scroll-ing")},500,!0),debounce_scrolling_hide_end=debounce(function(){_win.bd.removeClass("scroll-ing")},500);jQuery(".scrolling-hide").length&&_win.window.scroll(debounce_scrolling_hide).scroll(debounce_scrolling_hide_end);var _last_scroll_top=0,debounce_scroll_down=debounce(function(){var _scroll_top=document.documentElement.scrollTop+document.body.scrollTop;_last_scroll_top>100&&_scroll_top>_last_scroll_top?_win.auto_scroll||_win.bd.removeClass("scroll-up").addClass("scroll-down"):(!_win.auto_scroll||_last_scroll_top<=100)&&_win.bd.removeClass("scroll-down").addClass("scroll-up"),_last_scroll_top=_scroll_top},10,!0);jQuery(".scroll-down-hide").length&&_win.window.scroll(debounce_scroll_down)})();function scrollTopTo(element,offset){var scrollTop=0,body=jQuery("body,html"),duration=duration||300;if(offset=offset||0,element){var target=element instanceof jQuery?element:jQuery(element);scrollTop=target.length?target.offset().top+offset-(body.hasClass("nav-fixed")?jQuery(".header").innerHeight()+20:0):0}Math.abs(scrollTop-body.scrollTop())<80||(_win.auto_scroll=!0,body.animate({scrollTop},duration,"swing",function(){setTimeout(function(){_win.auto_scroll=!1},20)}))}_win.bd.on("click",".toggle-radius,.float-right a,.but-ripple,.but,.item-thumbnail,.menu-item >a,.yiyan-box,.relates-thumb li a",function(e){var _th=jQuery(this);if(!_th.hasClass("nowave")&&!_th.hasClass("is-disabled")){_th.css({overflow:"hidden",position:"relative"});var R,waveWidth=~~_th.outerWidth(),waveHeight=~~_th.outerHeight();waveWidth").css({display:"block",background:cllor,"border-radius":"50%",position:" absolute","-webkit-transform":"scale(0)",transform:"scale(0)",opacity:".3","-webkit-transition":"all 1.5s cubic-bezier(0.22, 0.61, 0.36, 1)",transition:"all 1.5s cubic-bezier(0.22, 0.61, 0.36, 1)","z-index":"1",overflow:"hidden","pointer-events":"none"});_th.append(wave),wave.css({width:R*2+"px",height:R*2+"px",top:e.pageY-_th.offset().top-R+"px",left:e.pageX-_th.offset().left-R+"px",transform:"scale(1)","-webkit-transform":"scale(1)",opacity:0}),setTimeout(function(){wave.remove()},2e3)}}),jQuery.fn.sidebarAffix=function(){var _this=jQuery(this),_affix=_this.find("[data-affix]"),sidebar_class="sidebar-affix";if(!_affix.length||_this.children("."+sidebar_class).length)return _this;var _body=jQuery("body"),affix_width=_affix.innerWidth(),_header=jQuery(".header");function nav_Height(){return _body.hasClass("nav-fixed")&&(!_header.hasClass("scroll-down-hide")||!_body.hasClass("scroll-down"))?_header.outerHeight(!0):20}var sidebarAffix_con=jQuery('
    ');_this.prepend(sidebarAffix_con);function top_css(){sidebarAffix_con.css({top:nav_Height()})}var last_top=0;return sidebarAffix_con.affix({offset:{top:function(){var new_top=_this.outerHeight(!0)+_this.offset().top-nav_Height();return new_top!==last_top&&sidebarAffix_con.hasClass("affix")&&top_css(),last_top=new_top,new_top},bottom:function(){var _wrap=_this.parent();return document.body.clientHeight-_wrap.outerHeight()-_wrap.offset().top}}}).on("affix-top.bs.affix",function(){sidebarAffix_con.html("")}).on("affix.bs.affix",function(){sidebarAffix_con.find("[data-affix]").length||sidebarAffix_con.append(_this.find("[data-affix]").clone()),top_css()}).find("[lazyload-action]:not(.lazyload)").addClass("lazyload"),sidebarAffix_con.hasClass("affix")&&sidebarAffix_con.trigger("affix.bs.affix"),sidebarAffix_con.hasClass("affix-bottom")&&sidebarAffix_con.trigger("affix-bottom.bs.affix"),_this},jQuery.fn.autoAffix=function(top,bottom){top=~~top,bottom=~~bottom;var _this=jQuery(this);if(_this.data("bs.affix"))return _this;var _body=jQuery("body"),offset_top=~~_this.attr("offset-top"),offset_bottom=~~_this.attr("offset-bottom"),_wrap_attr=_this.attr("data-wrap"),_wrap=_wrap_attr?jQuery(_wrap_attr):_this.parent(),_header=jQuery(".header");function get_nav_Height(){return(_body.hasClass("nav-fixed")&&(!_header.hasClass("scroll-down-hide")||!_body.hasClass("scroll-down"))?_header.outerHeight():0)+top}function remove_clone(){_this.next(".affix-clone").remove()}function top_css(){_this.css({top:get_nav_Height()})}function this_clone(){_this.next(".affix-clone").length||_this.after(_this.clone().removeClass("affix-top affix affix-bottom").addClass("affix-clone").css("opacity","0"))}_wrap.css("min-height",_this.outerHeight()+bottom);var last_top=0;return _this.affix({offset:{top:function(){var new_top=_this.parent().offset().top-get_nav_Height()+offset_top;return new_top!==last_top&&_this.hasClass("affix")&&top_css(),last_top=new_top,new_top},bottom:function(){return document.body.clientHeight-_wrap.outerHeight()-_wrap.offset().top+bottom+offset_bottom}}}).on("affix-top.bs.affix",function(){_this.css({top:"",width:""}),remove_clone()}).on("affix.bs.affix",function(){this_clone(),top_css()}).on("affix-bottom.bs.affix",function(){this_clone()}),_this.hasClass("affix")&&_this.trigger("affix.bs.affix"),_this.hasClass("affix-bottom")&&_this.trigger("affix-bottom.bs.affix"),_this.hasClass("affix-top")&&_this.trigger("affix-top.bs.affix"),_this},_win.bd.on("click",".toggle-theme",function(event){var isDark=jQuery("body").hasClass("dark-theme");if(!document.startViewTransition){toggle();return}const transition=document.startViewTransition(()=>{toggle()}),{clientX,clientY}=event,endRadius=Math.hypot(Math.max(clientX,innerWidth-clientX),Math.max(clientY,innerHeight-clientY)),clipPath=[`circle(0px at ${clientX}px ${clientY}px)`,`circle(${endRadius}px at ${clientX}px ${clientY}px)`];transition.ready.then(()=>{document.documentElement.animate({clipPath:isDark?[...clipPath].reverse():clipPath},{duration:500,easing:isDark?"ease-out":"ease-in",fill:"both",pseudoElement:isDark?"::view-transition-old(root)":"::view-transition-new(root)"})});function toggle(){var highlight_white_zt="enlighter-t-"+_win.highlight_white_zt,highlight_dark_zt="enlighter-t-"+_win.highlight_dark_zt;jQuery("img[switch-src]").each(function(){var _this=jQuery(this),_src=_this.attr("data-src")||_this.attr("src"),_s_src=_this.attr("switch-src");_this.attr("src",_s_src).attr("switch-src",_src).attr("data-src","")}),jQuery("img[white-src],img[dark-src]").each(function(){var _this=jQuery(this),_s_src=isDark?_this.attr("white-src"):_this.attr("dark-src");_s_src&&_this.attr("src",_s_src)});var _enlighter=jQuery(".enlighter-default"),_body=jQuery("body"),_tinymce_body=jQuery("#post_content_ifr").contents().find("body");isDark?(jQuery('meta[name="theme-color"]').attr("content","#FDFCFE"),document.documentElement.classList.remove("dark"),_tinymce_body.removeClass("dark-theme"),_enlighter.removeClass(highlight_dark_zt).addClass(highlight_white_zt),_body.removeClass("dark-theme"),jQuery.cookie("theme_mode","white-theme",{path:"/"})):(jQuery('meta[name="theme-color"]').attr("content","#2F3135"),document.documentElement.classList.add("dark"),_tinymce_body.addClass("dark-theme"),_enlighter.removeClass(highlight_white_zt).addClass(highlight_dark_zt),_body.addClass("dark-theme"),jQuery.cookie("theme_mode","dark-theme",{path:"/"}))}}),_win.bd.on("click","[ajax-action]",function(){var _this=jQuery(this);if(_this.attr("disabled"))return!1;var id=_this.attr("data-id"),action=_this.attr("ajax-action"),_text=_this.find("text");_text=_text.length?_text:_this.siblings("text");var _this_html=_text.html();_this.attr("disabled",!0),_text.html(''),jQuery.ajax({type:"POST",url:_win.ajax_url,dataType:"json",data:{id,action,_wpnonce:_this.attr("data-nonce")},error:function(n){var _msg=aksrt_sprintf("ajax_error",n.status,n.statusText);aksrt_is_fatal_error_response(n.responseText)&&(_msg=aksrt__("ajax_fatal_error")),notyf(_msg,"danger"),_this.attr("disabled",!1),_text.html(_this_html)},success:function(n){if(_this.attr("disabled",!1),!n.data||!n.success)_text.html(_this_html),n.data&&n.data.msg&¬yf(n.data.msg,n.data.ys||"danger");else{if(n=n.data,n.show_modal&&n.modal){var modal_config={class:"modal-mini full-sm",height:330,mobile_from_bottom:!0,touch_close:!0,content:n.modal};n.modal_config&&(modal_config=jQuery.extend(modal_config,n.modal_config)),modal_config.content=n.modal,refresh_modal(modal_config),_text.html(_this_html);return}jQuery('[ajax-action="'+action+'"][data-id="'+id+'"]').each(function(){var _this2=jQuery(this),_text2=_this2.find("text");_text2=_text2.length?_text2:_this2.siblings("text"),_text2.html(n.text||_this_html).addClass("ajaxed"),n.active?_this2.addClass("active").siblings(".active").removeClass("active"):_this2.removeClass("active")})}}})});function throttle(fn,delay){let valid=!0;return function(...args){if(!valid)return!1;valid=!1,setTimeout(function(){fn.apply(this,args),valid=!0},delay)}}function debounce(callback,delay,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||callback.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,delay),callNow&&callback.apply(context,args)}}if(_win.bd.on("input focus","textarea[autoHeight]",function(){var elem=this,border=~~getComputedStyle(elem).getPropertyValue("border-top-width").replace("px","")+~~getComputedStyle(elem).getPropertyValue("border-bottom-width").replace("px",""),max=~~jQuery(elem).attr("maxHeight");elem.style.height="auto",max>elem.scrollHeight?(elem.style.height=elem.scrollHeight+border+"px",elem.style.overflow="hidden"):(elem.style.height=max+"px",elem.style.overflow="auto")}),_win.bd.on("click",".rewards",function(){jQuery("#rewards-popover").modal("show")}),_win.bd.hasClass("search")){var val=jQuery(".search-desc-text .search-key").text();try{var reg=eval("/"+val+"/i");jQuery(".search-tab .item-heading a,.search-tab .item-excerpt,.search-tab .forum-title a,.search-tab .excerpt,#search-tab-user .display-name").each(function(){var $this=jQuery(this);$this.text().search(reg)!=-1&&$this.html($this.html().replace(reg,function(w){return''+w+""}))})}catch(e){}}_win.bd.on("click",".pag-jump .jump-icon",function(){var _input=jQuery(this).siblings(".jump-input");pag_jump_go(_input)}),_win.bd.on("input",".pag-jump .jump-input",debounce(function(){pag_jump(jQuery(this))},200)),_win.bd.on("keydown",".pag-jump .jump-input",function(event){event.keyCode==13&&pag_jump_go(jQuery(this))});function pag_jump(_input){var max=_input.attr("max"),current=_input.attr("current"),val2=~~_input.val();return(!val2||val2<1||val2>max)&&(val2=val2>max?max:"",_input.val(val2)),val2==current?0:val2}function pag_jump_go(_input){var val2=pag_jump(_input);if(val2){var base=_input.attr("base"),url=base.replace("%#%",val2),parent=_input.parent();if(parent.hasClass("ajax-next")){_input.val("");var _ajax_link=parent.clone().removeClass("pag-jump").addClass("hide").attr("href",url);parent.append(_ajax_link),_ajax_link.click(),_ajax_link.remove()}else location.href=url,location.reload}else _input.focus()}jQuery.fn.cloneable=function(){var cloneable_text="cloneable",cloneable_add_e="."+cloneable_text+"-add",cloneable_remove_e="."+cloneable_text+"-remove",cloneable_item_e="."+cloneable_text+"-item";function max_min(_this,max,min){var count=_this.children(cloneable_item_e).length;max&&max<=count?_this.nextAll(cloneable_add_e).hide():_this.nextAll(cloneable_add_e).show(),min&&min>=count?_this.find(cloneable_remove_e).hide():_this.find(cloneable_remove_e).show()}return this.each(function(){var _this=jQuery(this),_item=_this.children(cloneable_item_e),is_on="is-on",click="click",max=_this.data("max")||0,min=_this.data("min")||0;if(max_min(_this,max,min),!(!_item.length||_this.attr(is_on))){var add_item=jQuery(_item[0]).clone(!1);add_item.find("input,textarea").val(""),_this.attr(is_on,!0).on(click,cloneable_remove_e,function(){jQuery(jQuery(this).parents(cloneable_item_e)[0]).remove(),max_min(_this,max,min)}).nextAll(cloneable_add_e).on(click,function(){var _add_item=add_item.clone(!1),count=_this.children(cloneable_item_e).length;_add_item.find("[name]").each(function(){var $this=jQuery(this),name=$this.attr("name");name=="_pseudo"||!name.includes("[0]")||$this.attr("name",$this.attr("name").replace("[0]","["+count+"]"))}),_this.append(_add_item),max_min(_this,max,min)})}})},jQuery.fn.dependency=function(){function _number(val2){return Number(val2)}function checkBoolean(v){switch(v){case!0:case"true":case 1:case"1":return!0;case null:case!1:case"false":case 0:case"0":return!1;default:return v}}function evalCondition(condition,val1,val2){switch(condition){case"==":return checkBoolean(val1)==checkBoolean(val2);case"!=":return checkBoolean(val1)!=checkBoolean(val2);case">=":return _number(val2)>=_number(val1);case"<=":return _number(val2)<=_number(val1);case">":return _number(val2)>_number(val1);case"<":return _number(val2)<_number(val1);case"any":if(jQuery.isArray(val2)){for(let i=val2.length-1;i>=0;i--)if(jQuery.inArray(val2[i],val1.split(","))!==-1)return!0}else if(jQuery.inArray(val2,val1.split(","))!==-1)return!0;return!1;case"not-any":if(jQuery.isArray(val2)){for(let i=val2.length-1;i>=0;i--)if(jQuery.inArray(val2[i],val1.split(","))==-1)return!0}else if(jQuery.inArray(val2,val1.split(","))==-1)return!0;return!1;default:return!1}}return this.each(function(){var $this=jQuery(this),$fields=$this.find("[data-controller]");if($fields.length){var is_on="is-on";$fields.each(function(){var $field=jQuery(this);if(!$field.attr(is_on)){var controllers=$field.attr(is_on,!0).data("controller").split("|"),conditions=$field.data("condition").split("|"),values=$field.data("value").toString().split("|");jQuery.each(controllers,function(index,depend_id){var value=values[index]||"",condition=conditions[index]||conditions[0]||"==";$this.on("change","[name='"+depend_id+"']",function(){var $elem=jQuery(this),_type=$elem.attr("type"),val2=_type=="checkbox"?$elem.is(":checked"):$elem.val(),is_show=evalCondition(condition,value,val2);$field.trigger("controller.change",is_show),is_show?$field.show():$field.hide()})})}})}})},_win.bd.on("click","[data-for]",function(){var _this=jQuery(this),_tt=_this.html(),_for=_this.attr("data-for"),_form=_this.parents("form"),_v=_this.attr("data-value"),multiple=~~_this.attr("data-multiple"),_group=_this.closest("[for-group]"),active_outerHTML=_this.prop("outerHTML");if(_group.length||(_group=_this.parent()),multiple>1){_tt="",active_outerHTML="";var active_array=[],_input="",is_active=_this.hasClass("active");if(is_active)_group.find('[data-for="'+_for+'"][data-value="'+_v+'"]').removeClass("active");else{var ii={};if(_group.find('[data-for="'+_for+'"].active').each(function(){ii[jQuery(this).attr("data-value")]=1}),Object.keys(ii).length>=multiple)return notyf(aksrt_sprintf("select_max",multiple),"danger");_group.find('[data-for="'+_for+'"][data-value="'+_v+'"]').addClass("active")}_group.find('[data-for="'+_for+'"].active').each(function(){var _this_value=jQuery(this).attr("data-value");active_array.indexOf(_this_value)==-1&&(_tt+=jQuery(this).html(),_input+='',active_array.push(_this_value),active_outerHTML+=jQuery(this).clone().addClass("outerhtml-copy").prop("outerHTML"))}),jQuery.each(active_array,function(index,value){_group.find('[data-for="'+_for+'"][data-value="'+value+'"]').addClass("active")}),_form.find("input[name='"+_for+"[]']").remove(),_form.append(_input)}else _group.find('[data-for="'+_for+'"]').removeClass("active"),_group.find('[data-for="'+_for+'"][data-value="'+_v+'"]').addClass("active"),_form.find("input[name='"+_for+"']").val(_v).trigger("change");_form.find("span[name='"+_for+"']").html(_tt),_form.find("input[name=s]").focus(),_form.find(".active-outerhtml[name='"+_for+"']").html(active_outerHTML)}),_win.bd.on("input","input[limit-min],input[limit-max]",debounce(function(){var _this=jQuery(this),min=Number(_this.attr("limit-min")),max=Number(_this.attr("limit-max")),val2=Number(_this.val()),text,warning_class="limit-warning";_this.next("."+warning_class).length||_this.after('');var _warning=_this.next("."+warning_class);_this.val().length<1?_warning.html("").hide():val2>max?(text=_this.attr("warning-max")||aksrt__("input_max"),_warning.html(text.replace("1$",max)).fadeIn(150)):val2',loading_remind=loading_icon+''+aksrt__("search_loading")+"",is_on="is-on";if(_this.data(is_on))return;function ajax(){var data={},serializeObject=_this.serializeObject();jQuery.each(serializeObject,function(key,val2){data[key]=val2}),_this.find("input[name]").each(function(){var _th=jQuery(this),v=_th.val()||"";data[_th.attr("name")]=v}),_this.addClass(loading),_remind.html(loading_remind),_icon.html(loading_icon),_container.css({height:_container.outerHeight(),overflow:"hidden"}),jQuery.post(ajax_url,data,function(result){var data_html=result.data;data_html&&_container.html('
    '+data_html+"
    ").animate({height:_container.children("."+centent).outerHeight()},200,"swing",function(){_container.css({height:"",overflow:"",transition:""})}),_this.removeClass(loading),_remind.html(result.remind||""),_icon.html(_icon_html),auto_fun()},"json")}function submitted(_input){_input.val().length>=min_length?ajax():_remind.html(min_length_remind)}_this.data(is_on,!0).find(input).on("input",debounce(function(){submitted(jQuery(this))},500)).on("keydown",function(event){event.keyCode==13&&(event.preventDefault(),submitted(jQuery(this)))})})},_win.bd.on("click",".main-search [data-for]",function(){var _placeholder=jQuery(".main-search").find(".scale-placeholder");_placeholder.length&&_placeholder.text(_placeholder.attr("default"))}),_win.bd.on("submit",".main-search form",function(){var _this=jQuery(this),inputs=_this.serializeObject();jQuery.each(inputs,function(k,v){(!v||v=="null")&&k!="s"&&_this.find('input[name="'+k+'"]').remove()})}),_win.bd.on("click",".main-search-btn",function(){var _this=jQuery(this);jQuery(".main-search").addClass("show");var _remote_search=jQuery(".main-search [remote-box]").first();if(_remote_search.length){_remote_search.one("aksrt:remote-loaded",function(){_this.trigger("click")}),_remote_search.trigger("click");return}var _search_form=jQuery(".main-search form");if(_search_form.length){var attr_="search-",obj={type:_this.attr(attr_+"type"),user:_this.attr(attr_+"user"),trem:_this.attr(attr_+"trem")};jQuery.each(obj,function(k,v){if(v){var _k=_search_form.find('input[name="'+k+'"]').val(v),_data_for=_search_form.find('[data-for="'+k+'"][data-value="'+v+'"]').click();if(!_data_for.length&&k=="trem"){var cat_name=_this.attr("trem-name"),_cat_drop=_search_form.find(".cat-drop");cat_name&&_cat_drop.length&&(_cat_drop.append('
  • '+cat_name+"
  • "),_cat_drop.find('[data-value="'+v+'"]').click())}_k.length||_search_form.append('')}});var placeholder=_this.attr(attr_+"placeholder")||_search_form.find(".scale-placeholder").attr("default");_search_form.find(".scale-placeholder").text(placeholder),setTimeout(function(){_search_form.find('[name="s"]').focus()},100)}}),jQuery(".search-page-ajaxpager").length&&(_win.bd.on("click",".page-search-box a.search_keywords",function(){var $this=jQuery(this).clone();return $this.addClass("ajax-next").attr("ajax-replace","true").attr("route","true"),jQuery(".search-page-ajaxpager").append($this),$this.click().remove(),!1}),_win.bd.on("submit",".page-search-box .search-form",function(){var $this=jQuery(this),data=$this.serializeObject(),url=new URL($this.attr("action"));url.search=new URLSearchParams(data).toString();var $link=jQuery('');return jQuery(".search-page-ajaxpager").append($link),$link.click().remove(),!1}));function nav_folding(){var navbar_nav_t=".navbar-nav",sub_menu_t="sub-menu",_collapse=jQuery(".navbar-collapse"),surplus_width=_collapse.width();_collapse.find(">:not("+navbar_nav_t+")").each(function(){surplus_width-=jQuery(this).outerWidth()}),surplus_width-=jQuery(".navbar-header").outerWidth()+40;var navs_width=66,_folding=jQuery('');jQuery(navbar_nav_t+">li").each(function(){navs_width+=jQuery(this).outerWidth(),navs_width>surplus_width&&_folding.find(">."+sub_menu_t).append(jQuery(this))}),_folding.find(">."+sub_menu_t+" li").length&&jQuery(navbar_nav_t).append(_folding)}window.debounce_notyf=debounce(notyf,100,!0);function notyf(str,ys,time,id){jQuery(".notyn").length||_win.bd.append('
    '),ys=ys||"success",ys=="error"&&(ys="danger"),time=time||5e3,time=time<100?time*1e3:time;var id_attr=id?' id="'+id+'"':"",_html=jQuery('
    '+str+"
    "),is_close=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+ys).html(str),_html=jQuery("#"+id),is_close=!0):jQuery(".notyn").append(_html),is_close&&setTimeout(function(){notyf_close(_html)},time)}function notyf_close(_e){_e.addClass("notyn-out"),setTimeout(function(){_e.remove()},1e3)}_win.bd.on("click",".noty1",function(){notyf_close(jQuery(this))}),_win.passw=1,_win.bd.on("click",".passw",function(){var _this=jQuery(this);_win.passw==1?(_this.find(".fa").addClass("fa-eye-slash"),_this.siblings("input").attr("type","text"),_win.passw=2):(_this.find(".fa").removeClass("fa-eye-slash"),_this.siblings("input").attr("type","password"),_win.passw=1)}),_win.bd.on("input change focus",".line-form-input",debounce(function(){placeholder_scale(jQuery(this))},100));function placeholder_scale(_this){var val2=_this.val(),placeholder=_this.siblings(".scale-placeholder");val2.length>0?placeholder.addClass("is-focus"):placeholder.removeClass("is-focus")}function aksrt_is_url(str){try{return new URL(str),!0}catch{return!1}}function is_mail(str){return/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/.test(str)}jQuery.fn.serializeObject=function(){var o={},a=this.serializeArray();return jQuery.each(a,function(){o[this.name]!==void 0?(o[this.name].push||(o[this.name]=[o[this.name]]),o[this.name].push(this.value||"")):o[this.name]=this.value||""}),o},_win.bd.on("click",".trash-history-search",function(){confirm(aksrt__("confirm_clear_search"))==!0&&(jQuery(".history-search").slideUp().delay(1e3,function(){jQuery(this).remove()}),jQuery.cookie("history_search",""))}),_win.bd.on("click",".initiate-checkin",function(){aksrt_ajax(jQuery(this),0,function(data){data.details_link&&jQuery(".initiate-checkin").each(function(){var $link=jQuery(data.details_link),_this=jQuery(this),_class=_this.attr("class"),_text=_this.attr("ed-text");$link.addClass(_class).removeClass("initiate-checkin").html(_text),_this.prop("outerHTML",$link.prop("outerHTML"))})},aksrt__("checkin_loading"))}),_win.bd.on("click",".single-pay-tabbar",function(){scrollTo("#posts-pay",-50),jQuery("#posts-pay .cashier-link").click()}),_win.bd.on("submit","[ajax-submit]",function(){var _this=jQuery(this),but=_this.attr("ajax-submit")||'.wp-ajax-submit,[zibajax="submit"]';return _this.find(but).click(),!1}),_win.bd.on("click",'.wp-ajax-submit,[zibajax="submit"]',function(){var _this=jQuery(this),confirm_text=_this.attr("data-confirm");return confirm_text&&!confirm(confirm_text)||aksrt_ajax(jQuery(this)),!1});function aksrt_ajax(_this,data,success,noty,no_loading){if(_this.attr("disabled"))return!1;if(!data){var _data=_this.attr("form-data");if(_data)try{data=jQuery.parseJSON(_data)}catch{}if(!data){var form=_this.parents("form");data=form.serializeObject()}}var _action=_this.attr("form-action");_action&&(data.action=_action);var _text=_this.html(),_loading=no_loading?_text:''+aksrt__("please_wait")+"";noty!="stop"&¬yf(noty||aksrt__("processing"),"load","","wp_ajax"),_this.attr("disabled",!0).html(_loading);var _url=_this.attr("ajax-href")||_win.ajax_url;jQuery.ajax({type:"POST",url:_url,data,dataType:"json",error:function(n){var _msg=aksrt_sprintf("ajax_error",n.status,n.statusText);aksrt_is_fatal_error_response(n.responseText)&&(_msg=aksrt__("ajax_fatal_error")),console.error("ajax请求错误,错误信息如下:",n),notyf(_msg,"danger","",noty!="stop"?"wp_ajax":""),_this.attr("disabled",!1).html(_text)},success:function(n){var ys=n.ys?n.ys:n.error?"danger":"";noty!="stop"?notyf(n.msg||aksrt__("done"),ys,"","wp_ajax"):n.msg&¬yf(n.msg,ys),_this.attr("disabled",!1).html(_text).trigger("zib_ajax.success",n),jQuery.isFunction(success)&&success(n,_this,data),n.hide_modal&&_this.closest(".modal").modal("hide"),n.reload&&(n.goto?(window.location.href=n.goto,window.location.reload):window.location.reload())}})}_win.bd.on("zib_ajax.success","[next-tab]",function(e,n){var _next=jQuery(this).attr("next-tab");_next&&n&&!n.error&&jQuery('a[href="#'+_next+'"]').tab("show")}),jQuery(".erphp-login-must").each(function(){jQuery(this).addClass("signin-loader")}),_win.window.resize(debounce(function(){_wid=_win.window.width(),auto_fun()},500)),jQuery(".collapse").on("shown.bs.collapse",function(){auto_fun()}),_win.bd.on("click",".read-more-open",function(){jQuery(this).parents(".limit-height").css({height:"","max-height":""}).find(".read-more").remove()});function posts_limit_height(){if(jQuery(".limit-height").length){var r=jQuery(".limit-height");if(r.data("posts-limit-ison"))return;var r_h=r.height(),r_m=r.attr("data-maxheight");if(~~r_h>=~~r_m+79){var nn='';r.append(nn).data("posts-limit-ison",!0)}}}auto_fun(),thumb_dplayer(_wid>640?".posts-item .item-thumbnail,.forum-lists-cover":".posts-item,.forum-posts",".video-thumb-box[video-url]"),jQuery("[load-click]").attr("no-scroll",!0).click(),jQuery(document).on("lazybeforeunveil",function(e){var _this=jQuery(e.target),lazyload_action=_this.attr("lazyload-action");setTimeout(function(){if(lazyload_action==="ias")if(_this.attr("remote-box"))_this.click();else{var _a=_this.is(".ajax-next,.ias-btn")?_this:_this.find(".ajax-next,.ias-btn");_a.attr("no-scroll",!0).click()}if(lazyload_action=="animated"){var animated=_this.attr("data-animated");animated&&_this.addClass("animated "+animated).css("visibility","unset")}},200);var bg=_this.attr("data-bg");bg&&_this.css("background-image","url("+bg+")")});function fps_yh(){var lastTime=0,frames=0,fps=0,fps_average=0,currentTime,stop=0;function updateFPS(){currentTime=performance.now(),frames++,currentTime-lastTime>=300&&(fps=Math.round(frames*1e3/(currentTime-lastTime)),frames=0,lastTime=currentTime,fps>5&&lastTime>1600&&(fps_average=fps_average||fps,fps_average=(fps_average+fps)/2,fps_average<20&&stop++,stop>5&&jQuery("body").addClass("fps-accelerat"))),stop<=5&&lastTime<15e3?requestAnimationFrame(updateFPS):setCookie()}function setCookie(){jQuery.cookie("fps_accelerat",~~fps_average,{path:"/",expires:604800})}requestAnimationFrame(updateFPS)}!jQuery.cookie("fps_accelerat")&&!jQuery("body").hasClass("fps-accelerat")&&fps_yh();function partners_scroll_init(){function init(widget){if(!(!widget||widget.dataset.zpsReady==="1")){var speed=parseFloat(widget.style.getPropertyValue("--zps-speed"))||3,rows=widget.querySelectorAll("[data-zps-row]");rows.forEach(function(row){var track=row.querySelector("[data-zps-track]");if(track){var seed=track.querySelector(".zps-group");if(seed){var setup=function(){var extras=track.querySelectorAll(".zps-group.zps-clone");extras.forEach(function(el){el.remove()});var groupWidth=seed.scrollWidth;if(!(groupWidth<10)){var rowWidth=row.clientWidth||widget.clientWidth||window.innerWidth,needTotal=Math.max(groupWidth*2,rowWidth+groupWidth),copies=Math.ceil(needTotal/groupWidth);copies<2&&(copies=2);for(var i=1;i0)){pending++;var done=function(){pending--,pending<=0&&setup()};img.addEventListener("load",done,{once:!0}),img.addEventListener("error",done,{once:!0})}});var resizeTimer;window.addEventListener("resize",function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(setup,200)})}}}),widget.dataset.zpsReady="1"}}function initAll(){document.querySelectorAll(".aksrt-partners-scroll").forEach(init)}initAll()}function translate_init(){var translate_config=_win.translate_config;translate_config.s&&tbquire(["translate"],function(){translate.selectLanguageTag.show=!1,translate.language.setLocal(translate_config.local||"chinese_simplified"),translate_config.service_url&&translate.request.setHost(translate_config.service_url),translate_config.ignore_text&&(translate.ignore.text=translate_config.ignore_text),translate_config.nomenclature&&translate_config.nomenclature.length>0&&jQuery.each(translate_config.nomenclature,function(index,item){var from=item.from,to=item.to,value=item.value;from=="auto"&&(from=""),value&&to&&translate.nomenclature.append(from,to,value)}),translate_config.auto_discriminate_local&&translate.setAutoDiscriminateLocalLanguage(),translate_config.range&&translate_config.range.length>0&&(translate.language.translateLanguagesRange=translate_config.range),translate_config.loading&&translate.progress.api.startUITip();var $language_dropdown=jQuery(".language-dropdown .dropdown-menu"),translateStart=debounce(function(){jQuery("[data-language]").removeClass("active"),$language_dropdown.loading("show")},400,!0);translate.lifecycle.changeLanguage.trigger.push(translateStart);var renderFinish=debounce(function(uuid){$language_dropdown.loading("hide"),jQuery("[data-language='"+uuid.to+"']").addClass("active")},400);translate.lifecycle.execute.finally.push(renderFinish),_wid>996&&jQuery(".navbar-top .nav>li>a>.menu-item-title").each(function(){var _this=jQuery(this);_this.css({"max-width":~~_this.outerWidth(!0)+5+"px"})}),translate.ignore.class.push("translate-ignore"),translate.ignore.tag.push("svg"),translate.service.use(translate_config.service_use||"client.edge"),translate.listener.start(),translate.execute()})}_win.bd.on("click",".translate-button",function(){var _this=jQuery(this),language=_this.attr("data-language");translate&&translate.changeLanguage(language)}),(function(){var SELECTOR_class="obs-animate",SELECTOR="."+SELECTOR_class,BASE_CLS="in-view",OBS_FLAG="__zaniObserved",REPEAT_CLS="obs-animate-repeat",noAnim=!("IntersectionObserver"in window)||window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(noAnim){removeAnimation(SELECTOR);return}var rootMargin="100px 0px 0px 0px",c_i=0;function execute(entries){c_i=0;for(var isIntersecting_count=0,j=0;j8&&(delay=delay/(isIntersecting_count/8)),$el.css("transition-delay",delay+"s"),$el.addClass(BASE_CLS),c_i++,is_repeat||stop(el)}else is_repeat&&$el.removeClass(BASE_CLS)}}var io=new IntersectionObserver(execute,{root:null,rootMargin,threshold:.01});function stop(el){!el||el.nodeType!==1||!el[OBS_FLAG]||(el[OBS_FLAG]=!1,io.unobserve(el),setTimeout(function(){removeAnimation(el)},50))}function removeAnimation(el){var animation=jQuery(el).attr("data-animation"),animation_class="ani-"+animation;jQuery(el).removeClass(BASE_CLS+" "+SELECTOR_class+" "+animation_class+" "+REPEAT_CLS).removeAttr("data-animation").removeAttr("data-animation-repeat").css("transition-delay","")}function register(el){!el||el.nodeType!==1||el[OBS_FLAG]||(el[OBS_FLAG]=!0,io.observe(el))}function scan(){jQuery(SELECTOR).each(function(){register(this)})}scan()})();function number_stats_init(){function animateCount(el,duration){var target=parseFloat(el.getAttribute("data-target"))||0;if(target===0){el.textContent="0";return}var raw=el.getAttribute("data-target")||"0",decimals=(raw.split(".")[1]||"").length,_duration=~~el.getAttribute("data-duration");duration=_duration>10?_duration:duration;var start=0,startTs=null;duration=duration||1500;function step(ts){startTs||(startTs=ts);var progress=Math.min((ts-startTs)/duration,1),eased=1-Math.pow(1-progress,1.5),value=start+(target-start)*eased;el.textContent=decimals>0?value.toFixed(decimals):Math.floor(value).toString(),progress<1?requestAnimationFrame(step):el.textContent=decimals>0?target.toFixed(decimals):target.toString()}requestAnimationFrame(step)}var wraps=document.querySelectorAll(".stat-number-wrap");if(wraps.length){if(!("IntersectionObserver"in window)){wraps.forEach(function(wrap){wrap.querySelectorAll(".stat-number").forEach(function(el){el.textContent=el.getAttribute("data-target")||""})});return}var io=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){var wrap=entry.target;wrap.dataset.counted!=="1"&&(wrap.dataset.counted="1",wrap.querySelectorAll(".stat-number").forEach(function(el){animateCount(el,1500)}),io.unobserve(wrap))}})},{threshold:.3});wraps.forEach(function(wrap){io.observe(wrap)})}}_win.bd.on("click",".produck-wid-feature-intro .fi-tab",function(){var _this=jQuery(this);if(!_this.hasClass("is-active")){_this.addClass("is-active"),_this.siblings().removeClass("is-active");var panels=_this.closest(".produck-wid-feature-intro").find(".fi-panel");panels.removeClass("is-active"),panels.eq(_this.index()).addClass("is-active")}});function tilt_cases_init(){function isTouchOrMobile(){var isTouch="ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0,isSmall=window.matchMedia&&window.matchMedia("(max-width: 768px)").matches;return isTouch||isSmall}if(isTouchOrMobile())return;var cases=jQuery(".vanilla-tilt:not(.is-initialized)");if(!cases.length)return;function setTranslate3d(imgs,translate3d){var transform=imgs[0].style.transform;transform.includes("translate3d")&&(transform=transform.replace(/translate3d\(.*?\)/g,"").trim()),transform=transform+" "+translate3d,imgs.css("transform",transform)}tbquire(["tilt"],function(){cases.each(function(){var _this=jQuery(this),imgs=_this.find("img"),maxTilt=parseFloat(_this.attr("data-tilt-max"))||10,n=imgs.length,gain=1.22,hoverZone=_this.closest(".tilt-cases-container")||_this,mes=_this.data("tilt-mouse-event-element");if(mes){_this.removeAttr("data-tilt-mouse-event-element");var elZone=_this.closest(mes);hoverZone=elZone.length?elZone:hoverZone}var opt={};hoverZone.length&&(opt["mouse-event-element"]=hoverZone[0]),_this.addClass("is-initialized"),VanillaTilt.init(this,opt),!(n<=1)&&(this.addEventListener("tiltChange",function(e){var detail=e.detail||{},tx=parseFloat(detail.tiltX)||0,ty=parseFloat(detail.tiltY)||0;imgs.each(function(i){var $img=jQuery(this),base=parseFloat($img.attr("data-tilt-depth"));if(isNaN(base)&&(base=20),base===0){setTranslate3d($img,"translate3d(0,0,0)");return}var layerMul=1;n>1&&(layerMul=.48+i/(n-1)*1.14);var effective=base*gain*layerMul,dx=tx/maxTilt*effective*-1,dy=ty/maxTilt*effective;setTranslate3d($img,"translate3d("+dx+"px, "+dy+"px, 0)")})}),hoverZone&&hoverZone.on("mouseleave",function(){imgs.each(function(){setTranslate3d(jQuery(this),"translate3d(0,0,0)")})}))})})}_win.bd.on("click",".customize-preview-widget-edit",function(e){if(!(!wp||!wp.customize||!wp.customize.widgetsPreview)){var _this=jQuery(this),box=_this.closest(".customize-preview-widget-box");e.preventDefault(),wp.customize.widgetsPreview.preview.send("focus-widget-control",box.prop("id"))}}),jQuery(document).ready(function(){if(setTimeout(function(){jQuery(".line-form-input").each(function(){placeholder_scale(jQuery(this))}),_win.views&&jQuery.post(_win.ajax_url,{action:"views_record",id:_win.views}),posts_limit_height(),_win.window.trigger("scroll")},1e3),number_stats_init(),translate_init(),partners_scroll_init(),tilt_cases_init(),jQuery(".navbar-top li.menu-item-has-children>a").each(function(){jQuery(this).append('')}),_wid>996&&jQuery(".header").height()>81&&nav_folding(),posts_limit_height(),auto_maxHeight(),jQuery(".feature").length){var _feh=0,_fehm=0;jQuery(".feature").each(function(){var _th=jQuery(this);(_feh=_th.find(".feature-icon").innerHeight()+_th.find(".feature-title").innerHeight()+_th.find(".feature-note").innerHeight())>_fehm&&(_fehm=_feh)}),jQuery(".feature").css("height",_fehm)}jQuery(".qrcode").length&&tbquire(["qrcode"],function(){jQuery(".qrcode").each(function(){var _this=jQuery(this),text=_this.attr("data-qrcode"),size=_this.attr("data-size")||160;_this.qrcode({width:size,height:size,correctLevel:0,text:text||document.URL,background:"#fff",foreground:"#333"})})}),jQuery(document).on("lazyloaded",function(e){var _this=jQuery(e.target);swiper_tab_AutoHeight(_this)}),jQuery(document).on("lazyloaded",".gradient-bg img",function(e){var _this=jQuery(e.target),_parent=_this.closest(".gradient-bg"),opacity=_parent.attr("data-opacity"),c_11=opacity?"a":"",c_12=opacity?","+opacity:"";tbquire(["grade"],function(){Grade(_parent[0],null,function(gradientData){gradientData=gradientData[0];var rgba=gradientData.gradientData,c_1="rgb"+c_11+"("+rgba[0].rgba.slice(0,3).join(",")+c_12+") 10%",c_2="rgb"+c_11+"("+rgba[1].rgba.slice(0,3).join(",")+c_12+") 80%";jQuery(gradientData.element).addClass("gradient-bg-loaded").css("background-image","linear-gradient(135deg, "+c_1+", "+c_2+")")})})}),_win.qj_loading&&jQuery(".qj_loading").fadeOut(500).delay(1e3,function(){jQuery(this).remove(),jQuery("#qj_dh_css").remove()});function yiyan_nr(n){var yylink=_win.uri+"/yiyan/qv-yiyan.php",y_nr;jQuery.ajax({type:"POST",url:yylink}).done(function(i){var lines=i.replace(/\r\n|\r/g,"/&/").trim().split("/&/");if(lines){var type=n.attr("type");type?y_nr=type==="en"?lines[0]:lines[1]:y_nr='
    '+lines[0]+'
    '+lines[1]+"
    ",n.html(y_nr)}})}jQuery(".yiyan").each(function(){yiyan_nr(jQuery(this))}),setInterval(function(){jQuery(".yiyan").each(function(){yiyan_nr(jQuery(this))})},3e4),jQuery(".yiyan").on("click",function(){yiyan_nr(jQuery(this))}),jQuery("[mini-touch]").each(function(){var _this=jQuery(this),fx=_this.attr("touch-direction");_this.minitouch({direction:fx,onEnd:function(e){_this.attr("mini-touch")==="mobile-nav"?jQuery("body").removeClass("mobile-navbar-show"):e.removeClass("show")}})})}); diff --git a/inc/helpers/aksrt-pay.php b/inc/helpers/aksrt-pay.php index 7f504992..af699176 100644 --- a/inc/helpers/aksrt-pay.php +++ b/inc/helpers/aksrt-pay.php @@ -821,59 +821,6 @@ if (!function_exists('aksrt_can_access_content')) { } } -if (!function_exists('aksrt_can_download')) { - /** - * 下载授权门禁 —— 单一合同。 - * - * 实际判定交给 \AKSRT\Content\Visibility::can_download_resource()。 - * 不再使用 download_credit 做按次扣积分门禁。 - * - * @param int|WP_Post|null $post - * @param int $user_id 0 表示当前用户 - * @return true|WP_Error - */ - function aksrt_can_download($post = null, int $user_id = 0) { - if (class_exists('\AKSRT\Content\Visibility')) { - return \AKSRT\Content\Visibility::can_download_resource($post, $user_id); - } - - $p = get_post($post); - if (!($p instanceof WP_Post)) { - return new WP_Error('aksrt_invalid', __('无效内容。', 'aksrt')); - } - - $meta = aksrt_get_pay_meta($p); - if (($meta['pay_type'] ?? '') !== AKSRT_PAY_TYPE_DOWNLOAD) { - return new WP_Error('aksrt_not_downloadable', __('该内容不是可下载资源。', 'aksrt')); - } - - $uid = $user_id > 0 ? $user_id : get_current_user_id(); - if (!function_exists('aksrt_user_can') || !aksrt_user_can('resource_download', $uid, (int) $p->ID)) { - $login_url = wp_login_url(get_permalink($p)); - return new WP_Error('aksrt_need_login', __('请先登录。', 'aksrt'), ['login_url' => $login_url]); - } - - if ($uid > 0 && function_exists('aksrt_has_paid_access') && aksrt_has_paid_access($p, $uid)) { - return true; - } - if ($uid > 0 && function_exists('aksrt_is_vip_exempt') && aksrt_is_vip_exempt($uid)) { - return true; - } - - // Fallback without Content_Visibility: require purchase when priced. - $cost = function_exists('aksrt_get_download_cost') ? aksrt_get_download_cost($p) : 0; - if ($cost > 0) { - return new WP_Error('aksrt_need_purchase', __('请先购买后再下载。', 'aksrt'), [ - 'status' => 402, - 'cost' => $cost, - 'post_id'=> (int) $p->ID, - ]); - } - - return true; - } -} - if (!function_exists('aksrt_get_download_cost')) { function aksrt_get_download_cost($post = null): int { if (function_exists('aksrt_resource_download_cost')) { diff --git a/src/Core/DomainModel.php b/src/Core/DomainModel.php index 7c874097..e7cc2517 100644 --- a/src/Core/DomainModel.php +++ b/src/Core/DomainModel.php @@ -69,6 +69,7 @@ class DomainModel { 'cover_image' => '', 'featured_slide' => '', 'featured_video' => '', + 'featured_video_attachment_id' => 0, 'featured_video_title' => '', 'featured_video_episode' => [], 'subtitle' => '', @@ -173,7 +174,7 @@ class DomainModel { /** * @param mixed $value - * @return array> + * @return array */ public static function sanitize_downloads($value): array { if (!is_array($value)) { @@ -237,10 +238,11 @@ class DomainModel { 'type' => $type, 'extract_code' => $extract_code, 'copy_key' => isset($row['copy_key']) ? sanitize_text_field((string) $row['copy_key']) : '', - 'copy_val' => isset($row['copy_val']) ? sanitize_text_field((string) $row['copy_val']) : '', - 'class' => isset($row['class']) && in_array($row['class'], $allowed_classes, true) - ? (string) $row['class'] - : '', + 'copy_val' => isset($row['copy_val']) ? sanitize_text_field((string) $row['copy_val']) : '', + 'class' => isset($row['class']) && in_array($row['class'], $allowed_classes, true) + ? (string) $row['class'] + : '', + 'attachment_id' => is_scalar($row['attachment_id'] ?? null) ? max(0, (int) $row['attachment_id']) : 0, ]; } diff --git a/src/Core/FrontSubmit.php b/src/Core/FrontSubmit.php index 3eb4efaf..d641f131 100644 --- a/src/Core/FrontSubmit.php +++ b/src/Core/FrontSubmit.php @@ -16,6 +16,7 @@ class FrontSubmit { use FrontSubmitSave; use FrontSubmitPay; use FrontSubmitFeatured; + use FrontSubmitMedia; private static $instance = null; @@ -37,6 +38,8 @@ class FrontSubmit { add_action('wp_ajax_nopriv_aksrt_submit_post', [$this, 'ajax_submit_post']); add_action('rest_api_init', [$this, 'register_rest_routes']); + add_action('aksrt_new_add_posts', [$this, 'sync_post_attachments']); + add_action('aksrt_new_edit_posts', [$this, 'sync_post_attachments']); add_filter('body_class', [$this, 'body_class']); add_filter('wp_robots', [$this, 'robots_noindex']); @@ -45,6 +48,38 @@ class FrontSubmit { } public function register_rest_routes(): void { + register_rest_route('aksrt/v1', '/front-submit/media/(?Pimage|video|file)', [ + 'methods' => \WP_REST_Server::READABLE, + 'callback' => [$this, 'rest_list_attachments'], + 'permission_callback' => [$this, 'can_list_attachments'], + 'args' => [ + 'type' => [ + 'validate_callback' => static function ($value): bool { + return in_array((string) $value, ['image', 'video', 'file'], true); + }, + ], + 'post_id' => [ + 'default' => 0, + 'sanitize_callback' => 'absint', + ], + 'paged' => [ + 'default' => 1, + 'sanitize_callback' => 'absint', + 'validate_callback' => static function ($value): bool { + return absint($value) > 0; + }, + ], + 'search' => [ + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ], + 'exclude' => [ + 'default' => [], + 'sanitize_callback' => [$this, 'sanitize_attachment_ids'], + ], + ], + ]); + register_rest_route('aksrt/v1', '/front-submit/upload/(?Pimage|video|resource)', [ 'methods' => 'POST', 'callback' => [$this, 'rest_upload_attachment'], @@ -55,6 +90,10 @@ class FrontSubmit { return in_array((string) $value, ['image', 'video', 'resource'], true); }, ], + 'post_id' => [ + 'default' => 0, + 'sanitize_callback' => 'absint', + ], ], ]); } @@ -64,7 +103,7 @@ class FrontSubmit { if ($user_id <= 0) { return false; } - if (!$this->can_submit($user_id)) { + if (!$this->can_use_media($request, $user_id)) { return false; } @@ -173,23 +212,18 @@ class FrontSubmit { return new \WP_Error('aksrt_upload_failed', $attachment_id->get_error_message(), ['status' => 400]); } - $attachment_id = (int) $attachment_id; - wp_update_post(['ID' => $attachment_id, 'post_author' => $user_id]); + $attachment_id = (int) $attachment_id; + wp_update_post(['ID' => $attachment_id, 'post_author' => $user_id]); + update_post_meta($attachment_id, '_aksrt_front_submit_media', $kind); - $url = wp_get_attachment_url($attachment_id); - if (!$url) { + $attachment = $this->prepare_attachment_response($attachment_id); + if ($attachment === null) { wp_delete_attachment($attachment_id, true); return new \WP_Error('aksrt_upload_failed', __('上传后无法读取文件。', 'aksrt'), ['status' => 500]); } - return new \WP_REST_Response([ - 'success' => true, - 'attachment_id' => $attachment_id, - 'url' => $url, - 'name' => get_the_title($attachment_id), - 'filename' => wp_basename((string) get_attached_file($attachment_id)), - 'mime' => $mime, - ], 201); + $attachment['success'] = true; + return new \WP_REST_Response($attachment, 201); } /** diff --git a/src/Core/FrontSubmitFeatured.php b/src/Core/FrontSubmitFeatured.php index 63a64f1c..34de8cb8 100644 --- a/src/Core/FrontSubmitFeatured.php +++ b/src/Core/FrontSubmitFeatured.php @@ -44,12 +44,20 @@ trait FrontSubmitFeatured { return; } $video = esc_url_raw((string) ($payload['url'] ?? '')); + $video_id = absint($payload['id'] ?? 0); + if ($video_id > 0 && !$this->can_use_front_submit_video($video_id, $user_id)) { + $video_id = 0; + } $pic = esc_url_raw((string) ($payload['pic'] ?? '')); if ($pic !== '' && !$this->user_can_cap('upload_submit_image', $user_id)) { $pic = ''; } $post_meta['featured_video'] = $video; + $post_meta['featured_video_attachment_id'] = $video_id; $post_meta['featured_slide'] = ''; + $post_meta['thumbnail_url'] = ''; + $post_meta['cover_image'] = ''; + delete_post_thumbnail($post_id); if ($pic !== '' && $this->can_use_front_submit_image_url($pic, $user_id)) { $post_meta['thumbnail_url'] = $pic; $post_meta['cover_image'] = $pic; @@ -100,6 +108,10 @@ trait FrontSubmitFeatured { } $post_meta['featured_slide'] = implode(',', array_values(array_unique($attachment_ids))); $post_meta['featured_video'] = ''; + $post_meta['featured_video_attachment_id'] = 0; + $post_meta['thumbnail_url'] = ''; + $post_meta['cover_image'] = ''; + delete_post_thumbnail($post_id); if (!empty($urls[0]) && $this->can_use_front_submit_image_url((string) $urls[0], $user_id)) { $post_meta['thumbnail_url'] = $urls[0]; $post_meta['cover_image'] = $urls[0]; @@ -123,6 +135,7 @@ trait FrontSubmitFeatured { } } $post_meta['featured_video'] = ''; + $post_meta['featured_video_attachment_id'] = 0; $post_meta['featured_slide'] = ''; if ($url !== '' && $this->can_use_front_submit_image_url($url, $user_id)) { $post_meta['thumbnail_url'] = $url; @@ -139,6 +152,7 @@ trait FrontSubmitFeatured { case 'none': case 'clear': $post_meta['featured_video'] = ''; + $post_meta['featured_video_attachment_id'] = 0; $post_meta['featured_slide'] = ''; $post_meta['thumbnail_url'] = ''; $post_meta['cover_image'] = ''; @@ -181,4 +195,16 @@ trait FrontSubmitFeatured { $attachment_id = attachment_url_to_postid($url); return $attachment_id > 0 && $this->can_use_front_submit_image($attachment_id, $user_id); } + + private function can_use_front_submit_video(int $attachment_id, int $user_id): bool { + if ($attachment_id <= 0 || !$this->user_can_cap('new_post_video_cover', $user_id)) { + return false; + } + $attachment = get_post($attachment_id); + return $attachment instanceof \WP_Post + && $attachment->post_type === 'attachment' + && (int) $attachment->post_author === $user_id + && in_array($attachment->post_status, ['inherit', 'private'], true) + && strpos((string) $attachment->post_mime_type, 'video/') === 0; + } } diff --git a/src/Core/FrontSubmitMedia.php b/src/Core/FrontSubmitMedia.php new file mode 100644 index 00000000..fcb0ce75 --- /dev/null +++ b/src/Core/FrontSubmitMedia.php @@ -0,0 +1,294 @@ + 0 && $this->can_use_media($request, $user_id); + } + + /** + * Check whether a user may use the submit media routes for this post. + */ + private function can_use_media(\WP_REST_Request $request, int $user_id): bool { + $post_id = absint($request->get_param('post_id')); + if ($post_id > 0) { + return $this->can_edit_post($post_id, $user_id); + } + return $this->can_submit($user_id); + } + + + /** + * Sanitize a REST attachment exclusion list. + * + * @param mixed $value Comma-separated or array attachment IDs. + * @return int[] + */ + public function sanitize_attachment_ids($value): array { + if (!is_array($value)) { + $value = preg_split('/[,\s]+/', (string) $value) ?: []; + } + return array_values(array_unique(array_filter(array_map(static function ($id): int { + return is_scalar($id) ? absint($id) : 0; + }, $value)))); + } + + /** + * Return the current user's front-submit attachments. + */ + public function rest_list_attachments(\WP_REST_Request $request): \WP_REST_Response { + $user_id = get_current_user_id(); + $type = sanitize_key((string) $request->get_param('type')); + $page = max(1, absint($request->get_param('paged'))); + $search = sanitize_text_field((string) $request->get_param('search')); + $exclude = $this->sanitize_attachment_ids($request->get_param('exclude')); + + if ($user_id <= 0 || !in_array($type, ['image', 'video', 'file'], true)) { + return new \WP_REST_Response([ + 'items' => [], + 'total' => 0, + 'total_pages' => 0, + 'page' => $page, + 'per_page' => 48, + ], 200); + } + + $args = [ + 'post_type' => 'attachment', + 'post_status' => ['inherit', 'private'], + 'author' => $user_id, + 'posts_per_page' => 48, + 'paged' => $page, + 'orderby' => 'ID', + 'order' => 'DESC', + 'no_found_rows' => false, + ]; + if ($type === 'image') { + $args['post_mime_type'] = 'image'; + } elseif ($type === 'video') { + $args['post_mime_type'] = 'video'; + } + if ($exclude !== []) { + $args['post__not_in'] = $exclude; + } + + if ($search !== '') { + $args['s'] = $search; + add_filter('wp_allow_query_attachment_by_filename', '__return_true'); + } + + $query = new \WP_Query($args); + if ($search !== '') { + remove_filter('wp_allow_query_attachment_by_filename', '__return_true'); + } + $items = []; + foreach ($query->posts as $attachment) { + $prepared = $this->prepare_attachment_response($attachment); + if ($prepared !== null) { + $items[] = $prepared; + } + } + + $total = (int) $query->found_posts; + return new \WP_REST_Response([ + 'items' => $items, + 'total' => $total, + 'total_pages' => $total > 0 ? (int) ceil($total / 48) : 0, + 'page' => $page, + 'per_page' => 48, + ], 200); + } + + /** + * Normalize an attachment with WordPress's media response model. + * + * Only fields needed by the front-submit picker are returned. In + * particular, admin links, icons, nonces, and author data are omitted. + * + * @param int|\WP_Post $attachment Attachment object or ID. + * @return array|null + */ + private function prepare_attachment_response($attachment): ?array { + $attachment = $attachment instanceof \WP_Post ? $attachment : get_post(absint($attachment)); + if (!$attachment || $attachment->post_type !== 'attachment') { + return null; + } + if (!function_exists('wp_prepare_attachment_for_js')) { + require_once ABSPATH . 'wp-admin/includes/media.php'; + } + $data = wp_prepare_attachment_for_js($attachment->ID); + if (!is_array($data)) { + return null; + } + $sizes = is_array($data['sizes'] ?? null) ? $data['sizes'] : []; + $size_url = static function (array $sizes, string $size, string $fallback): string { + return !empty($sizes[$size]['url']) ? (string) $sizes[$size]['url'] : $fallback; + }; + $url = (string) ($data['url'] ?? wp_get_attachment_url($attachment->ID) ?? ''); + $filename = (string) ($data['filename'] ?? wp_basename((string) get_attached_file($attachment->ID))); + $mime = (string) ($data['mime'] ?? get_post_mime_type($attachment->ID)); + return [ + 'attachment_id' => (int) $attachment->ID, + 'id' => (int) $attachment->ID, + 'title' => (string) ($data['title'] ?? get_the_title($attachment->ID)), + 'name' => (string) ($data['name'] ?? $filename), + 'filename' => $filename, + 'type' => (string) ($data['type'] ?? (strpos($mime, '/') !== false ? strtok($mime, '/') : '')), + 'subtype' => (string) ($data['subtype'] ?? (strpos($mime, '/') !== false ? substr($mime, strpos($mime, '/') + 1) : '')), + 'url' => $url, + 'large_url' => $size_url($sizes, 'large', $url), + 'medium_url' => $size_url($sizes, 'medium', $url), + 'thumbnail_url' => $size_url($sizes, 'thumbnail', $url), + 'filesizeInBytes' => (int) ($data['filesizeInBytes'] ?? (@filesize((string) get_attached_file($attachment->ID)) ?: 0)), + 'mime' => $mime, + ]; + } + + /** + * Attach IDs referenced by a saved submission to that post. + * + * @param mixed $post Saved post passed by the existing submission hooks. + */ + public function sync_post_attachments($post): void { + if (!$post instanceof \WP_Post || $post->post_type !== 'post') { + return; + } + $user_id = get_current_user_id(); + $post_id = (int) $post->ID; + if ($user_id <= 0 || (int) $post->post_author !== $user_id) { + return; + } + + $image_ids = $this->extract_attachment_ids((string) $post->post_content, 'image'); + $video_ids = $this->extract_attachment_ids((string) $post->post_content, 'video'); + $file_ids = $this->extract_attachment_ids((string) $post->post_content, 'file'); + $desired = []; + foreach ($image_ids as $id) { + if ($this->attachment_can_attach($id, $user_id, $post_id, 'image')) { + $desired[$id] = 'image'; + } + } + foreach ($video_ids as $id) { + if ($this->attachment_can_attach($id, $user_id, $post_id, 'video')) { + $desired[$id] = 'video'; + } + } + foreach ($file_ids as $id) { + if ($this->attachment_can_attach($id, $user_id, $post_id, 'file')) { + $desired[$id] = 'file'; + } + } + + $pay_meta = function_exists('aksrt_get_pay_meta') + ? aksrt_get_pay_meta($post_id) + : get_post_meta($post_id, DomainModel::PAY_META_KEY, true); + $pay_meta = is_array($pay_meta) ? $pay_meta : []; + foreach (is_array($pay_meta['downloads'] ?? null) ? $pay_meta['downloads'] : [] as $download) { + $id = absint($download['attachment_id'] ?? 0); + if ($id > 0 && $this->attachment_can_attach($id, $user_id, $post_id, 'file')) { + $desired[$id] = 'file'; + } + } + + $post_meta = get_post_meta($post_id, DomainModel::POST_META_KEY, true); + $post_meta = is_array($post_meta) ? $post_meta : []; + $featured_ids = []; + $video_id = absint($post_meta['featured_video_attachment_id'] ?? 0); + if ($video_id > 0 && $this->attachment_can_attach($video_id, $user_id, $post_id, 'video')) { + $desired[$video_id] = 'video'; + } + $thumb_id = get_post_thumbnail_id($post_id); + if ($thumb_id > 0) { + $featured_ids[] = $thumb_id; + } + foreach (preg_split('/[\\s,]+/', (string) ($post_meta['featured_slide'] ?? '')) ?: [] as $token) { + $id = absint($token); + if ($id > 0) $featured_ids[] = $id; + } + foreach ($featured_ids as $id) { + if ($this->attachment_can_attach($id, $user_id, $post_id, 'image')) { + $desired[$id] = 'image'; + } + } + + global $wpdb; + $existing = get_posts([ + 'post_type' => 'attachment', + 'post_status' => ['inherit', 'private'], + 'post_parent' => $post_id, + 'author' => $user_id, + 'posts_per_page' => -1, + 'fields' => 'ids', + 'no_found_rows' => true, + 'meta_key' => '_aksrt_front_submit_media', + ]); + foreach (array_map('absint', $existing) as $attachment_id) { + if (!isset($desired[$attachment_id])) { + $wpdb->update($wpdb->posts, ['post_parent' => 0], ['ID' => $attachment_id], ['%d'], ['%d']); + clean_post_cache($attachment_id); + delete_post_meta($attachment_id, '_aksrt_front_submit_media'); + } + } + foreach ($desired as $attachment_id => $kind) { + $attachment_id = (int) $attachment_id; + update_post_meta($attachment_id, '_aksrt_front_submit_media', $kind); + $wpdb->update($wpdb->posts, ['post_parent' => $post_id], ['ID' => $attachment_id], ['%d'], ['%d']); + clean_post_cache($attachment_id); + } + } + + /** + * Extract IDs from image/video edit markers or attachment relation markers. + * + * @return int[] + */ + private function extract_attachment_ids(string $content, string $type): array { + $ids = []; + if ($type === 'file') { + preg_match_all('/data-aksrt-file-id\s*=\s*["\']([^"\']+)["\']/i', $content, $matches); + } elseif ($type === 'image') { + preg_match_all('/]*data-edit-file-id\s*=\s*["\']([^"\']+)["\'][^>]*>/i', $content, $matches); + } else { + preg_match_all('/<(?:div|video)\b[^>]*data-edit-file-id\s*=\s*["\']([^"\']+)["\'][^>]*data-video-url[^>]*>/i', $content, $matches); + if (empty($matches[1])) { + preg_match_all('/<(?:div|video)\b[^>]*data-video-url[^>]*data-edit-file-id\s*=\s*["\']([^"\']+)["\'][^>]*>/i', $content, $matches); + } + } + return array_values(array_unique(array_filter(array_map('absint', $matches[1] ?? [])))); + } + + private function attachment_can_attach(int $attachment_id, int $user_id, int $post_id, string $type): bool { + $attachment = get_post($attachment_id); + if (!$attachment || $attachment->post_type !== 'attachment' || (int) $attachment->post_author !== $user_id) { + return false; + } + if (!in_array($attachment->post_status, ['inherit', 'private'], true)) { + return false; + } + if ((int) $attachment->post_parent !== 0 && (int) $attachment->post_parent !== $post_id) { + return false; + } + $mime = (string) $attachment->post_mime_type; + if ($type === 'image') { + return wp_attachment_is_image($attachment_id); + } + if ($type === 'video') { + return strpos($mime, 'video/') === 0; + } + return $mime !== ''; + } +} diff --git a/src/Core/FrontSubmitPay.php b/src/Core/FrontSubmitPay.php index 16c5a923..26adba81 100644 --- a/src/Core/FrontSubmitPay.php +++ b/src/Core/FrontSubmitPay.php @@ -49,10 +49,14 @@ trait FrontSubmitPay { } $downloads = DomainModel::sanitize_downloads($raw['downloads'] ?? []); - if (!empty($downloads) && $this->user_can_cap('new_post_pay_download', $user_id)) { - $pay_type = DomainModel::PAY_TYPE_DOWNLOAD; + if ($this->user_can_cap('new_post_pay_download', $user_id)) { $meta['downloads'] = $downloads; - } elseif ($pay_type === DomainModel::PAY_TYPE_DOWNLOAD && !$this->user_can_cap('new_post_pay_download', $user_id)) { + if ($downloads !== []) { + $pay_type = DomainModel::PAY_TYPE_DOWNLOAD; + } elseif ($pay_type === DomainModel::PAY_TYPE_DOWNLOAD) { + $pay_type = DomainModel::PAY_TYPE_READING; + } + } elseif ($pay_type === DomainModel::PAY_TYPE_DOWNLOAD) { $pay_type = DomainModel::PAY_TYPE_READING; $meta['downloads'] = []; } diff --git a/templates/pages/page-submit.php b/templates/pages/page-submit.php index 6d188039..09515c5c 100644 --- a/templates/pages/page-submit.php +++ b/templates/pages/page-submit.php @@ -53,41 +53,53 @@ if (file_exists($css)) { ); } $js = get_template_directory() . '/assets/js/front-submit.js'; -if (file_exists($js)) { - $pay_download_js = get_template_directory() . '/assets/js/front-submit-pay-download.js'; +$editor_js = get_template_directory() . '/assets/js/front-submit-editor.js'; +if (file_exists($editor_js)) { + wp_enqueue_script( + 'aksrt-front-submit-editor', + get_template_directory_uri() . '/assets/js/front-submit-editor.js', + ['editor'], + (string) filemtime($editor_js), + true + ); +} +$pay_download_js = get_template_directory() . '/assets/js/front-submit-pay-download.js'; +if (file_exists($pay_download_js)) { wp_enqueue_script( 'aksrt-front-submit-pay-download', get_template_directory_uri() . '/assets/js/front-submit-pay-download.js', - [], + ['aksrt-front-submit-editor'], (string) filemtime($pay_download_js), true ); +} +if (file_exists($js)) { wp_enqueue_script( 'aksrt-front-submit', get_template_directory_uri() . '/assets/js/front-submit.js', - ['loader_js', 'aksrt-front-submit-pay-download'], + ['loader_js', 'aksrt-front-submit-editor', 'aksrt-front-submit-pay-download'], (string) filemtime($js), true ); - $mini = get_template_directory() . '/assets/js/mini-upload.js'; - if (file_exists($mini)) { - wp_enqueue_script( - 'aksrt-mini-upload', - get_template_directory_uri() . '/assets/js/mini-upload.js', - [], - (string) filemtime($mini), - true - ); - } $submit_image_max_size = \AKSRT\Core\FrontSubmit::upload_limit_bytes('image'); $submit_video_max_size = \AKSRT\Core\FrontSubmit::upload_limit_bytes('video'); $resource_max_size = \AKSRT\Core\FrontSubmit::upload_limit_bytes('resource'); - wp_localize_script('aksrt-front-submit', 'aksrtSubmitData', [ + wp_localize_script('aksrt-front-submit-editor', 'aksrtSubmitData', [ 'ajaxUrl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('aksrt_submit'), 'restUrl' => esc_url_raw(rest_url('aksrt/v1')), - 'restNonce' => wp_create_nonce('wp_rest'), + 'restNonce' => wp_create_nonce('wp_rest'), + 'postId' => (int) ($ctx['edit_id'] ?? 0), + + 'mediaUrl' => esc_url_raw(rest_url('aksrt/v1/front-submit/media')), + 'media' => [ + 'image' => ['url' => esc_url_raw(rest_url('aksrt/v1/front-submit/media/image'))], + 'video' => ['url' => esc_url_raw(rest_url('aksrt/v1/front-submit/media/video'))], + 'file' => ['url' => esc_url_raw(rest_url('aksrt/v1/front-submit/media/file'))], + ], + + 'leaveWarning' => !empty($ctx['settings']['leave_warning']), 'ai' => [ 'available' => !empty($ctx['ai_available']), @@ -167,7 +179,29 @@ if (file_exists($js)) { 'invalidVideoUrl' => __('请填写有效的视频嵌入地址', 'aksrt'), 'invalidFile' => __('请选择有效文件', 'aksrt'), 'uploadUnavailable' => __('当前账号不能上传此类文件', 'aksrt'), + 'mine' => __('我的媒体', 'aksrt'), + 'mineImage' => __('我的图片', 'aksrt'), + 'mineVideo' => __('我的视频', 'aksrt'), + 'mineFile' => __('我的文件', 'aksrt'), + 'search' => __('搜索', 'aksrt'), + 'searchMedia' => __('搜索媒体(至少 2 个字符)', 'aksrt'), + 'searchMin' => __('请输入至少 2 个字符进行搜索', 'aksrt'), + 'clear' => __('清除', 'aksrt'), + 'loadMore' => __('加载更多', 'aksrt'), + 'loading' => __('加载中…', 'aksrt'), + 'empty' => __('暂无媒体文件', 'aksrt'), + 'emptyMedia' => __('暂无媒体文件', 'aksrt'), + 'mediaError' => __('媒体加载失败', 'aksrt'), + 'mediaUnavailable' => __('媒体库暂不可用', 'aksrt'), + 'confirmSelected' => __('确认选择(%d)', 'aksrt'), + 'maxItems' => __('最多选择 %d 个文件', 'aksrt'), + 'maxMediaItems' => __('最多选择 %d 个文件', 'aksrt'), + 'uploadingClose' => __('上传中,请稍候再关闭', 'aksrt'), + 'mediaPickerUnavailable' => __('媒体选择器加载失败,请刷新页面后重试', 'aksrt'), + 'pickVideoResource' => __('选择视频资源', 'aksrt'), + 'pickVideoCover' => __('选择视频封面(可选)', 'aksrt'), 'download' => __('下载', 'aksrt'), + 'quote' => __('引言', 'aksrt'), 'quoteGray' => __('灰色引言', 'aksrt'), 'quoteRed' => __('红色引言', 'aksrt'), diff --git a/templates/parts/submit/context.php b/templates/parts/submit/context.php index 09bcda36..e7db305e 100644 --- a/templates/parts/submit/context.php +++ b/templates/parts/submit/context.php @@ -60,10 +60,12 @@ $featured_args = ['type' => '', 'data' => new stdClass(), 'options' => [ if ($edit_post) { if (!empty($post_meta['featured_video'])) { $featured_args['type'] = 'video'; - $featured_args['data'] = [ - 'url' => (string) $post_meta['featured_video'], - 'pic' => (string) ($post_meta['thumbnail_url'] ?? ''), - ]; + $featured_args['data'] = [ + 'url' => (string) $post_meta['featured_video'], + 'pic' => (string) ($post_meta['thumbnail_url'] ?? ''), + 'id' => absint($post_meta['featured_video_attachment_id'] ?? 0), + ]; + } elseif (!empty($post_meta['featured_slide'])) { $slides = array_filter(array_map('trim', explode(',', (string) $post_meta['featured_slide']))); $slide_data = []; diff --git a/templates/parts/submit/sidebar-pay.php b/templates/parts/submit/sidebar-pay.php index 23e42322..4478601d 100644 --- a/templates/parts/submit/sidebar-pay.php +++ b/templates/parts/submit/sidebar-pay.php @@ -70,7 +70,8 @@ if (!function_exists('aksrt_submit_pay_line')) {
    - + +
    diff --git a/tests/widget-system/front-submit-attachment-contract.test.cjs b/tests/widget-system/front-submit-attachment-contract.test.cjs new file mode 100644 index 00000000..8e2eabce --- /dev/null +++ b/tests/widget-system/front-submit-attachment-contract.test.cjs @@ -0,0 +1,158 @@ +'use strict'; + +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const test = require('node:test'); + +const root = path.resolve(__dirname, '..', '..'); +const read = (file) => fs.readFileSync(path.join(root, file), 'utf8'); + +const frontSubmit = read('src/Core/FrontSubmit.php'); +const mediaTrait = read('src/Core/FrontSubmitMedia.php'); +const page = read('templates/pages/page-submit.php'); +const editor = read('assets/js/front-submit-editor.js'); +const submit = read('assets/js/front-submit.js'); +const payDownload = read('assets/js/front-submit-pay-download.js'); +const domainModel = read('src/Core/DomainModel.php'); +const featured = read('src/Core/FrontSubmitFeatured.php'); +const frontSubmitPay = read('src/Core/FrontSubmitPay.php'); + +const runtimeFiles = [ + 'assets/js/runtime/main.js', + 'assets/js/runtime/main.min.js', +]; + +test('front submit owns the typed media REST routes and media trait wiring', () => { + assert.match(frontSubmit, /use FrontSubmitMedia\s*;/); + assert.match(frontSubmit, /add_action\('rest_api_init', \[\$this, 'register_rest_routes'\]\)/); + assert.match(frontSubmit, /add_action\('aksrt_new_add_posts', \[\$this, 'sync_post_attachments'\]\)/); + assert.match(frontSubmit, /add_action\('aksrt_new_edit_posts', \[\$this, 'sync_post_attachments'\]\)/); + + assert.match(frontSubmit, /register_rest_route\('aksrt\/v1', '\/front-submit\/media\/\(\?Pimage\|video\|file\)'/); + assert.match(frontSubmit, /'methods'\s*=>\s*\\WP_REST_Server::READABLE/); + assert.match(frontSubmit, /'callback'\s*=>\s*\[\$this, 'rest_list_attachments'\]/); + assert.match(frontSubmit, /'post_id'\s*=>\s*\[/); + assert.match(frontSubmit, /'permission_callback'\s*=>\s*\[\$this, 'can_list_attachments'\]/); + + assert.match(frontSubmit, /register_rest_route\('aksrt\/v1', '\/front-submit\/upload\/\(\?Pimage\|video\|resource\)'/); + assert.match(frontSubmit, /'methods'\s*=>\s*'POST'/); + assert.match(frontSubmit, /'callback'\s*=>\s*\[\$this, 'rest_upload_attachment'\]/); + assert.match(frontSubmit, /'permission_callback'\s*=>\s*\[\$this, 'can_upload_attachment'\]/); +}); + +test('front submit media listing freezes ownership, visibility, ordering, paging, search, and MIME semantics', () => { + assert.match(mediaTrait, /\$user_id\s*=\s*get_current_user_id\(\)/); + assert.match(mediaTrait, /'post_type'\s*=>\s*'attachment'/); + assert.match(mediaTrait, /'post_status'\s*=>\s*\['inherit', 'private'\]/); + assert.match(mediaTrait, /'author'\s*=>\s*\$user_id/); + assert.match(mediaTrait, /'posts_per_page'\s*=>\s*48/); + assert.match(mediaTrait, /'paged'\s*=>\s*\$page/); + assert.match(mediaTrait, /'orderby'\s*=>\s*'ID'/); + assert.match(mediaTrait, /'order'\s*=>\s*'DESC'/); + assert.match(mediaTrait, /\$request->get_param\('search'\)/); + assert.match(mediaTrait, /\$request->get_param\('exclude'\)/); + assert.match(mediaTrait, /\$args\['post__not_in'\]\s*=\s*\$exclude/); + assert.match(mediaTrait, /\$args\['s'\]\s*=\s*\$search/); + assert.match(mediaTrait, /add_filter\('wp_allow_query_attachment_by_filename', '__return_true'\)/); + assert.match(mediaTrait, /remove_filter\('wp_allow_query_attachment_by_filename', '__return_true'\)/); + assert.match(mediaTrait, /\$args\['post_mime_type'\]\s*=\s*'image'/); + assert.match(mediaTrait, /\$args\['post_mime_type'\]\s*=\s*'video'/); + assert.doesNotMatch(mediaTrait, /\$args\['post_mime_type'\]\s*=\s*'file'/); + assert.match(mediaTrait, /return \$mime !== '';/); + assert.match(mediaTrait, /!in_array\(\$type, \['image', 'video', 'file'\], true\)/); + assert.match(frontSubmit, /\['image', 'video', 'file'\]/); +}); + +test('front submit media responses and uploads use the attachment contract', () => { + for (const field of ['attachment_id', 'id', 'url', 'filename', 'type', 'subtype', 'thumbnail_url', 'filesizeInBytes']) { + assert.match(mediaTrait, new RegExp(`['"]${field}['"]`), `missing normalized field ${field}`); + } + assert.match(mediaTrait, /wp_prepare_attachment_for_js/); + assert.match(mediaTrait, /'attachment_id'\s*=>\s*\(int\) \$attachment->ID/); + assert.match(mediaTrait, /'id'\s*=>\s*\(int\) \$attachment->ID/); + assert.match(mediaTrait, /'thumbnail_url'\s*=>/); + assert.match(mediaTrait, /'filesizeInBytes'\s*=>/); + + assert.match(frontSubmit, /\$files\['file'\]/); + assert.match(frontSubmit, /media_handle_upload\('aksrt_front_submit_file'/); + assert.match(frontSubmit, /update_post_meta\(\$attachment_id, '_aksrt_front_submit_media', \$kind\)/); + assert.match(frontSubmit, /\$attachment\['success'\]\s*=\s*true/); + assert.match(editor, /body\.append\('file', file\)/); + assert.match(editor, /method:\s*'POST'/); + assert.match(editor, /payload\.success/); +}); + +test('saved submission media sync enforces ownership and cleans stale parent/meta relations', () => { + assert.match(mediaTrait, /if \(\$user_id <= 0 \|\| \(int\) \$post->post_author !== \$user_id\)/); + assert.match(mediaTrait, /'post_parent'\s*=>\s*0/); + assert.match(mediaTrait, /\(int\) \$attachment->post_author !== \$user_id/); + assert.match(mediaTrait, /\['inherit', 'private'\]/); + assert.match(mediaTrait, /\(int\) \$attachment->post_parent !== 0/); + assert.match(mediaTrait, /'meta_key'\s*=>\s*'_aksrt_front_submit_media'/); + assert.match(mediaTrait, /delete_post_meta\(\$attachment_id, '_aksrt_front_submit_media'\)/); + assert.match(mediaTrait, /update_post_meta\(\$attachment_id, '_aksrt_front_submit_media', \$kind\)/); + assert.match(mediaTrait, /featured_video_attachment_id/); + assert.match(mediaTrait, /data-aksrt-file-id/); + assert.match(mediaTrait, /\['post_parent'\s*=>\s*\$post_id\]/); +}); + +test('submit page configures media URLs, REST nonce, and the three media copy groups without mini-upload', () => { + assert.match(page, /'restNonce'\s*=>\s*wp_create_nonce\('wp_rest'\)/); + assert.match(page, /'mediaUrl'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media'\)\)/); + assert.match(page, /'image'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media\/image'\)\)\]/); + assert.match(page, /'video'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media\/video'\)\)\]/); + assert.match(page, /'file'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media\/file'\)\)\]/); + for (const copy of ['mineImage', 'mineVideo', 'mineFile', 'uploadImage', 'uploadVideo', 'uploadFile']) { + assert.match(page, new RegExp(`['"]${copy}['"]`), `missing copy ${copy}`); + } + assert.doesNotMatch(page, /aksrt-mini-upload/); + assert.equal(fs.existsSync(path.join(root, 'assets/js/mini-upload.js')), false, 'mini-upload.js must stay removed'); +}); + +test('shared submit media picker exposes mine search paging selection and nonce-backed upload', () => { + assert.match(editor, /window\.AksrtSubmitMedia\s*=\s*\{\s*open:/); + assert.match(editor, /data-editor-media-tab="mine"/); + assert.match(editor, /data-editor-media-search/); + assert.match(editor, /state\.search\.length >= 2/); + assert.match(editor, /state\.search\.length === 1/); + assert.match(editor, /state\.searchTimer = window\.setTimeout/); + assert.match(editor, /state\.searchTimer[\s\S]*?600\)/); + assert.match(editor, /params\.set\('paged', String\(page\)\)/); + assert.match(editor, /data-editor-media-more/); + assert.match(editor, /params\.set\('exclude', state\.exclude\.join\(','\)\)/); + assert.match(editor, /multiple\s*=\s*options\.multiple/); + assert.match(editor, /if \(!multiple\) maxItems = 1/); + assert.match(editor, /state\.selected\.length >= maxItems/); + assert.match(editor, /headers:\s*\{\s*'X-WP-Nonce': cfg\.restNonce \|\| ''\s*\}/); + assert.match(editor, /data-aksrt-file-id/); + assert.doesNotMatch(editor, /data-download-file/); + assert.match(submit, /data-aksrt-submit-ready/); +}); + +test('paid downloads and featured covers use the shared picker and attachment IDs', () => { + assert.match(payDownload, /window\.AksrtSubmitMedia\.open\(/); + assert.match(payDownload, /type:\s*'file'/); + assert.match(payDownload, /item\.attachment_id \|\| item\.id/); + assert.match(payDownload, /data-pay-resource-field="attachment_id"/); + assert.match(domainModel, /'attachment_id'\s*=>\s*is_scalar\(\$row\['attachment_id'\]/); + assert.match(domainModel, /max\(0, \(int\) \$row\['attachment_id'\]\)/); + + assert.match(submit, /openMediaPicker:\s*function \(options\)/); + assert.match(submit, /window\.AksrtSubmitMedia\.open\(options\)/); + assert.match(submit, /type:\s*'image'/); + assert.match(submit, /type:\s*'video'/); + assert.match(submit, /item\.attachment_id \|\| item\.id/); + assert.match(domainModel, /'featured_video_attachment_id'\s*=>\s*0/); + assert.match(payDownload, /attachment_id/); + assert.match(frontSubmitPay, /\$meta\['downloads'\]\s*=\s*\$downloads/); + assert.match(featured, /featured_video_attachment_id/); +}); + +test('runtime bundles contain no legacy download-file action handler', () => { + for (const file of runtimeFiles) { + const source = read(file); + assert.doesNotMatch(source, /action=download_file/); + assert.doesNotMatch(source, /download-nonce/); + } +}); diff --git a/tests/widget-system/front-submit-editor-contract.test.cjs b/tests/widget-system/front-submit-editor-contract.test.cjs index 48790c53..61738424 100644 --- a/tests/widget-system/front-submit-editor-contract.test.cjs +++ b/tests/widget-system/front-submit-editor-contract.test.cjs @@ -47,7 +47,7 @@ test('front submit uses the registered local jQuery runtime', () => { assert.doesNotMatch(source, /jquery-migrate/); const page = read('templates/pages/page-submit.php'); - assert.match(page, /\['loader_js', 'aksrt-front-submit-pay-download'\]/); + assert.match(page, /\['loader_js', 'aksrt-front-submit-editor', 'aksrt-front-submit-pay-download'\]/); }); test('legacy runtime modules use jQuery explicitly without a dollar alias', () => { diff --git a/tests/widget-system/post-editor-reference-contract.test.cjs b/tests/widget-system/post-editor-reference-contract.test.cjs index 78b499c7..acfa1152 100644 --- a/tests/widget-system/post-editor-reference-contract.test.cjs +++ b/tests/widget-system/post-editor-reference-contract.test.cjs @@ -87,7 +87,7 @@ test('front submit paid resources use the reference modal editor and compact lis assert.match(pay, /class="hidden-input"/); assert.doesNotMatch(pay, /data-pay-download-upload|data-pay-download-tpl/); - ['url', 'extract_code', 'copy_key', 'copy_val', 'label', 'class'].forEach((field) => { + ['url', 'attachment_id', 'extract_code', 'copy_key', 'copy_val', 'label', 'class'].forEach((field) => { assert.match(downloads, new RegExp(`['"]${field}['"]`)); assert.match(model, new RegExp(`['"]${field}['"]`)); }); diff --git a/tests/widget-system/runtime-action-hard-cut-contract.test.cjs b/tests/widget-system/runtime-action-hard-cut-contract.test.cjs index 518cf7c0..75361988 100644 --- a/tests/widget-system/runtime-action-hard-cut-contract.test.cjs +++ b/tests/widget-system/runtime-action-hard-cut-contract.test.cjs @@ -17,6 +17,8 @@ test('legacy theme action endpoint stays removed from runtime bundles', () => { assert.doesNotMatch(source, /_win\.bd\.on\(['"]click['"],\s*['"]\[data-action\]['"]/, file) assert.doesNotMatch(source, /\baction_ajax\s*\(/, file) assert.doesNotMatch(source, /\/action\/action\.php/, file) + assert.doesNotMatch(source, /action=download_file/, `${file} must not restore the legacy download-file handler`) + assert.doesNotMatch(source, /download-nonce/, `${file} must not restore the legacy download nonce attribute`) } })