"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const uniShared = require("@dcloudio/uni-shared"); const Vue = require("vue"); const shared = require("@vue/shared"); const vueRouter = require("vue-router"); const uniI18n = require("@dcloudio/uni-i18n"); function _interopNamespaceDefault(e2) { const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } }); if (e2) { for (const k in e2) { if (k !== "default") { const d = Object.getOwnPropertyDescriptor(e2, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e2[k] }); } } } n.default = e2; return n; } const Vue__namespace = /* @__PURE__ */ _interopNamespaceDefault(Vue); const realGlobal = uniShared.getGlobal(); realGlobal.UTS = uniShared.UTS; realGlobal.UTSJSONObject = uniShared.UTSJSONObject; realGlobal.UTSValueIterable = uniShared.UTSValueIterable; realGlobal.UniError = uniShared.UniError; function defineComponent(options) { const setup = options.setup; if (setup) { options.setup = (props2, context) => { const result = setup(props2, context); return typeof result === "function" ? result() : result; }; } return Vue.defineVaporComponent(options); } function createUnsupportedRender$1(name) { const element = Vue.createPlainElement("div", null, null, true); element.setAttribute("uni-" + name, ""); element.setAttribute("uni-view", ""); element.textContent = name + " is unsupported"; return element; } function converPx(value) { if (/^-?\d+[ur]px$/i.test(value)) { return value.replace(/(^-?\d+)[ur]px$/i, (text, num) => { return `${uni.upx2px(parseFloat(num))}px`; }); } else if (/^-?[\d\.]+$/.test(value)) { return `${value}px`; } return value || ""; } function converType(type) { return type.replace(/[A-Z]/g, (text) => { return `-${text.toLowerCase()}`; }).replace("webkit", "-webkit"); } function getStyle(action) { const animateTypes1 = [ "matrix", "matrix3d", "scale", "scale3d", "rotate3d", "skew", "translate", "translate3d" ]; const animateTypes2 = [ "scaleX", "scaleY", "scaleZ", "rotate", "rotateX", "rotateY", "rotateZ", "skewX", "skewY", "translateX", "translateY", "translateZ" ]; const animateTypes3 = ["opacity", "background-color"]; const animateTypes4 = ["width", "height", "left", "right", "top", "bottom"]; const animates = action.animates; const option = action.option; const transition = option.transition; const style = {}; const transform = []; animates.forEach((animate) => { let type = animate.type; let args = [...animate.args]; if (animateTypes1.concat(animateTypes2).includes(type)) { if (type.startsWith("rotate") || type.startsWith("skew")) { args = args.map((value) => parseFloat(value) + "deg"); } else if (type.startsWith("translate")) { args = args.map(converPx); } if (animateTypes2.indexOf(type) >= 0) { args.length = 1; } transform.push(`${type}(${args.join(",")})`); } else if (animateTypes3.concat(animateTypes4).includes(args[0])) { type = args[0]; const value = args[1]; style[type] = animateTypes4.includes(type) ? converPx(value) : value; } }); style.transform = style.webkitTransform = transform.join(" "); style.transition = style.webkitTransition = Object.keys(style).map( (type) => `${converType(type)} ${transition.duration}ms ${transition.timingFunction} ${transition.delay}ms` ).join(","); style.transformOrigin = style.webkitTransformOrigin = option.transformOrigin; return style; } function startAnimation(context) { const animation2 = context.animation; if (!animation2 || !animation2.actions || !animation2.actions.length) { return; } let index2 = 0; const actions = animation2.actions; const length = animation2.actions.length; function animate() { const action = actions[index2]; const transition = action.option.transition; const style = getStyle(action); Object.keys(style).forEach((key) => { context.$el.style[key] = style[key]; }); index2 += 1; if (index2 < length) { setTimeout(animate, transition.duration + transition.delay); } } setTimeout(() => { animate(); }, 0); } const animation = { props: ["animation"], watch: { animation: { deep: true, handler() { startAnimation(this); } } }, mounted() { startAnimation(this); } }; const defineRuntimeComponent = defineComponent; const createUnsupportedRender = createUnsupportedRender$1; const defineBuiltInComponent = (options) => { options.__reserved = true; const { props: props2, mixins } = options; if (!props2 || !props2.animation) { (mixins || (options.mixins = [])).push(animation); } return defineSystemComponent(options); }; const defineSystemComponent = (options) => { options.__reserved = true; options.compatConfig = { MODE: 3 // 标记为vue3 }; return defineRuntimeComponent(options); }; const defineUnsupportedComponent = (name) => { return defineBuiltInComponent({ name: shared.capitalize(shared.camelize(name)), setup() { return createUnsupportedRender(name); } }); }; let UniElement$1 = class UniElement extends Object { getPage() { return uniShared.getUniElementPage(this); } get uniPage() { return this.getPage(); } getBoundingClientRectAsync(callback) { var _a, _b; if (callback) { const domRect = this.getBoundingClientRect(); try { (_a = callback.success) == null ? void 0 : _a.call(callback, domRect); } catch (error) { console.error(error); } try { (_b = callback.complete) == null ? void 0 : _b.call(callback, domRect); } catch (error) { console.error(error); } return; } return new Promise((resolve, reject) => { const domRect = this.getBoundingClientRect(); resolve(domRect); }); } }; const UniElement2 = UniElement$1; const _UniCanvasElement = class _UniCanvasElement extends UniElement2 { static [Symbol.hasInstance](value) { const el = value; return this === _UniCanvasElement && (el == null ? void 0 : el.nodeType) === 1 && el.localName === "canvas" && el.hasAttribute("uni-canvas") || Function.prototype[Symbol.hasInstance].call(this, value); } }; _UniCanvasElement.__uniElement = {}; let UniCanvasElement = _UniCanvasElement; const canvasProps = { disableScroll: { type: [Boolean, String], default: false } }; const _t0$e = Vue.template("", 3); const indexVapor$a = /* @__PURE__ */ defineBuiltInComponent({ name: "Canvas", props: canvasProps, rootElement: { name: "uni-canvas", class: UniCanvasElement }, setup() { const root = (() => { const _n0 = _t0$e(); return _n0; })(); return root; } }); const selectionProperty = "--uni-selection-background-color"; const selectionAttribute = "data-uni-selection"; const probeBackgroundProperty = "--uni-selection-probe-background-color"; const fieldSelectionProps = { selectionClass: { type: String, default: "" } }; const fieldSelectionProbeStyle = "display: none !important;"; function clearSelection(field) { field.style.removeProperty(selectionProperty); field.removeAttribute(selectionAttribute); } function resolveSelectionColor(probe) { const color = getComputedStyle(probe).backgroundColor; if (color === "transparent" || color.replace(/\s/g, "") === "rgba(0,0,0,0)") { probe.style.setProperty(probeBackgroundProperty, "#000000"); try { return getComputedStyle(probe).backgroundColor === color ? color : ""; } finally { probe.style.removeProperty(probeBackgroundProperty); } } return color; } function updateSelection(field, color) { if (!color) { clearSelection(field); return; } if (field.style.getPropertyValue(selectionProperty) !== color) { field.style.setProperty(selectionProperty, color); } if (!field.hasAttribute(selectionAttribute)) { field.setAttribute(selectionAttribute, ""); } } function observeSelection(probe, field) { let refreshFrame = null; function refreshSelection() { refreshFrame = null; if (!field.isConnected || field.ownerDocument.activeElement !== field) { return; } updateSelection(field, resolveSelectionColor(probe)); refreshFrame = requestAnimationFrame(refreshSelection); } function startRefresh() { if (refreshFrame === null) { refreshSelection(); } } function stopRefresh() { if (refreshFrame !== null) { cancelAnimationFrame(refreshFrame); refreshFrame = null; } } field.addEventListener("focus", startRefresh); field.addEventListener("blur", stopRefresh); startRefresh(); return () => { field.removeEventListener("focus", startRefresh); field.removeEventListener("blur", stopRefresh); stopRefresh(); clearSelection(field); }; } function useFieldSelection(props2, fieldRef) { const selectionRef = Vue.ref(null); Vue.watch( [() => props2.selectionClass, fieldRef, selectionRef], ([className, field, probe], _, onCleanup) => { if (className && field && probe) { onCleanup(observeSelection(probe, field)); } }, { immediate: true, flush: "post" } ); return selectionRef; } const nativeHasInstance = Function.prototype[Symbol.hasInstance]; function isUniNativeElement(value, tag, marker) { const el = value; return (el == null ? void 0 : el.nodeType) === 1 && el.localName === tag && el.hasAttribute(marker); } const NativeUniElement = UniElement2; class UniViewElement extends NativeUniElement { static [Symbol.hasInstance](value) { return this === UniViewElement && isUniNativeElement(value, "div", "uni-view") || nativeHasInstance.call(this, value); } } class UniTextElement extends NativeUniElement { // Web 直接读取 DOM 文字,不缓存、不触发布局;不提供会删除 Vue 子节点的 setter。 // 类上保留 getter,供 Button 等复合 Element 的 super.value 复用。 get value() { return this.textContent ?? ""; } static [Symbol.hasInstance](value) { return this === UniTextElement && isUniNativeElement(value, "span", "uni-text") || nativeHasInstance.call(this, value); } } class UniImageElement extends NativeUniElement { static [Symbol.hasInstance](value) { return this === UniImageElement && isUniNativeElement(value, "img", "uni-image") || nativeHasInstance.call(this, value); } } const _UniInputElement = class _UniInputElement extends UniViewElement { static [Symbol.hasInstance](value) { return this === _UniInputElement && value instanceof UniViewElement && value.hasAttribute("uni-input") || Function.prototype[Symbol.hasInstance].call(this, value); } focus(options) { var _a; (_a = this.querySelector("input")) == null ? void 0 : _a.focus(options); } get value() { return this.querySelector("input").value; } set value(value) { this.querySelector("input").value = value; } }; _UniInputElement.__uniElement = {}; let UniInputElement = _UniInputElement; const descriptors$1 = { uniTagName: { value: "INPUT" }, focus: Object.getOwnPropertyDescriptor(UniInputElement.prototype, "focus"), value: Object.getOwnPropertyDescriptor(UniInputElement.prototype, "value") }; function initInputElement(root) { Object.defineProperties(root, descriptors$1); } const isEnableLocale = /* @__PURE__ */ uniShared.once( () => typeof __uniConfig !== "undefined" && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length ); let i18n; function getLocaleMessage() { const locale = uni.getLocale(); const locales = __uniConfig.locales; return locales[locale] || locales[__uniConfig.fallbackLocale] || locales.en || {}; } function formatI18n(message) { if (uniI18n.isI18nStr(message, uniShared.I18N_JSON_DELIMITERS)) { return useI18n().f(message, getLocaleMessage(), uniShared.I18N_JSON_DELIMITERS); } return message; } function resolveJsonObj(jsonObj, names) { if (names.length === 1) { if (jsonObj) { const _isI18nStr = (value2) => shared.isString(value2) && uniI18n.isI18nStr(value2, uniShared.I18N_JSON_DELIMITERS); const _name = names[0]; let filterJsonObj = []; if (shared.isArray(jsonObj) && (filterJsonObj = jsonObj.filter((item) => _isI18nStr(item[_name]))).length) { return filterJsonObj; } const value = jsonObj[names[0]]; if (_isI18nStr(value)) { return jsonObj; } } return; } const name = names.shift(); return resolveJsonObj(jsonObj && jsonObj[name], names); } function defineI18nProperties(obj, names) { return names.map((name) => defineI18nProperty(obj, name)); } function defineI18nProperty(obj, names) { const jsonObj = resolveJsonObj(obj, names); if (!jsonObj) { return false; } const prop = names[names.length - 1]; if (shared.isArray(jsonObj)) { jsonObj.forEach((item) => defineI18nProperty(item, [prop])); } else { let value = jsonObj[prop]; Object.defineProperty(jsonObj, prop, { get() { return formatI18n(value); }, set(v2) { value = v2; } }); } return true; } function useI18n() { if (!i18n) { let locale; { { locale = uniShared.getEnvLocale(); } } i18n = uniI18n.initVueI18n(locale); if (isEnableLocale()) { const localeKeys = Object.keys(__uniConfig.locales || {}); if (localeKeys.length) { localeKeys.forEach( (locale2) => i18n.add(locale2, __uniConfig.locales[locale2]) ); } i18n.setLocale(locale); } } return i18n; } function normalizeMessages(module2, keys, values) { return keys.reduce((res, name, index2) => { res[module2 + name] = values[index2]; return res; }, {}); } const initI18nAppVmMsgsOnce = /* @__PURE__ */ uniShared.once(() => { const name = "uni.appVm."; const keys = ["methodWarning"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( uniI18n.LOCALE_EN, normalizeMessages(name, keys, [ 'Method "{methodName}" should not be called directly on UniApp. Use "{methodCall}" instead.' ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( uniI18n.LOCALE_ES, normalizeMessages(name, keys, [ 'El método "{methodName}" no debe llamarse directamente en UniApp. Use "{methodCall}" en su lugar.' ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( uniI18n.LOCALE_FR, normalizeMessages(name, keys, [ 'La méthode "{methodName}" ne doit pas être appelée directement sur UniApp. Utilisez "{methodCall}" à la place.' ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( uniI18n.LOCALE_ZH_HANS, normalizeMessages(name, keys, [ "不应直接通过 UniApp 调用方法“{methodName}”,请改用“{methodCall}”。" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( uniI18n.LOCALE_ZH_HANT, normalizeMessages(name, keys, [ "不應直接透過 UniApp 呼叫方法「{methodName}」,請改用「{methodCall}」。" ]), false ); } }); const initI18nAsyncMsgsOnce = /* @__PURE__ */ uniShared.once(() => { const name = "uni.async."; const keys = ["error"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( uniI18n.LOCALE_EN, normalizeMessages(name, keys, [ "The connection timed out, click the screen to try again." ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( uniI18n.LOCALE_ES, normalizeMessages(name, keys, [ "Se agotó el tiempo de conexión, haga clic en la pantalla para volver a intentarlo." ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( uniI18n.LOCALE_FR, normalizeMessages(name, keys, [ "La connexion a expiré, cliquez sur l'écran pour réessayer." ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( uniI18n.LOCALE_ZH_HANS, normalizeMessages(name, keys, ["连接服务器超时,点击屏幕重试"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( uniI18n.LOCALE_ZH_HANT, normalizeMessages(name, keys, ["連接服務器超時,點擊屏幕重試"]), false ); } }); const initI18nVideoMsgsOnce = /* @__PURE__ */ uniShared.once(() => { const name = "uni.video."; const keys = ["danmu", "volume"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( uniI18n.LOCALE_EN, normalizeMessages(name, keys, ["Danmu", "Volume"]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( uniI18n.LOCALE_ES, normalizeMessages(name, keys, ["Danmu", "Volumen"]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( uniI18n.LOCALE_FR, normalizeMessages(name, keys, ["Danmu", "Le Volume"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( uniI18n.LOCALE_ZH_HANS, normalizeMessages(name, keys, ["弹幕", "音量"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( uniI18n.LOCALE_ZH_HANT, normalizeMessages(name, keys, ["彈幕", "音量"]), false ); } }); function initNavigationBarI18n(navigationBar) { if (isEnableLocale()) { return defineI18nProperties(navigationBar, [ ["titleText"], ["searchInput", "placeholder"], ["buttons", "text"] ]); } } function initTabBarI18n(tabBar) { if (isEnableLocale() && tabBar.list) { tabBar.list.forEach((item) => { defineI18nProperty(item, ["text"]); }); } if (isEnableLocale() && tabBar.midButton) { defineI18nProperty(tabBar.midButton, ["text"]); } return tabBar; } function initBridge(subscribeNamespace) { const emitter = new uniShared.Emitter(); return { on(event, callback) { return emitter.on(event, callback); }, once(event, callback) { return emitter.once(event, callback); }, off(event, callback) { return emitter.off(event, callback); }, emit(event, ...args) { return emitter.emit(event, ...args); }, subscribe(event, callback, once = false) { emitter[once ? "once" : "on"](`${subscribeNamespace}.${event}`, callback); }, unsubscribe(event, callback) { emitter.off(`${subscribeNamespace}.${event}`, callback); }, subscribeHandler(event, args, pageId) { emitter.emit(`${subscribeNamespace}.${event}`, args, pageId); } }; } const INVOKE_VIEW_API = "invokeViewApi"; const INVOKE_SERVICE_API = "invokeServiceApi"; let invokeServiceMethodId = 1; const invokeServiceMethod = (name, args, callback) => { const { subscribe, publishHandler } = UniViewJSBridge; const id2 = callback ? invokeServiceMethodId++ : 0; callback && subscribe(INVOKE_SERVICE_API + "." + id2, callback, true); publishHandler(INVOKE_SERVICE_API, { id: id2, name, args }); }; const viewMethods = /* @__PURE__ */ Object.create(null); function normalizeViewMethodName(pageId, name) { return pageId + "." + name; } function registerViewMethod(pageId, name, fn) { name = normalizeViewMethodName(pageId, name); if (!viewMethods[name]) { viewMethods[name] = fn; } } const ViewJSBridge = /* @__PURE__ */ shared.extend( /* @__PURE__ */ initBridge("service"), { invokeServiceMethod } ); function getDefaultExportFromCjs(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } var attrs = ["top", "left", "right", "bottom"]; var inited; var elementComputedStyle = {}; var support; function getSupport() { if (!("CSS" in window) || typeof CSS.supports != "function") { support = ""; } else if (CSS.supports("top: env(safe-area-inset-top)")) { support = "env"; } else if (CSS.supports("top: constant(safe-area-inset-top)")) { support = "constant"; } else { support = ""; } return support; } function init() { support = typeof support === "string" ? support : getSupport(); if (!support) { attrs.forEach(function(attr2) { elementComputedStyle[attr2] = 0; }); return; } function setStyle(el, style) { var elStyle = el.style; Object.keys(style).forEach(function(key) { var val = style[key]; elStyle[key] = val; }); } var cbs = []; function parentReady(callback) { if (callback) { cbs.push(callback); } else { cbs.forEach(function(cb) { cb(); }); } } var passiveEvents = false; try { var opts = Object.defineProperty({}, "passive", { get: function() { passiveEvents = { passive: true }; } }); window.addEventListener("test", null, opts); } catch (e2) { } function addChild(parent, attr2) { var a1 = document.createElement("div"); var a2 = document.createElement("div"); var a1Children = document.createElement("div"); var a2Children = document.createElement("div"); var W = 100; var MAX = 1e4; var aStyle = { position: "absolute", width: W + "px", height: "200px", boxSizing: "border-box", overflow: "hidden", paddingBottom: support + "(safe-area-inset-" + attr2 + ")" }; setStyle(a1, aStyle); setStyle(a2, aStyle); setStyle(a1Children, { transition: "0s", animation: "none", width: "400px", height: "400px" }); setStyle(a2Children, { transition: "0s", animation: "none", width: "250%", height: "250%" }); a1.appendChild(a1Children); a2.appendChild(a2Children); parent.appendChild(a1); parent.appendChild(a2); parentReady(function() { a1.scrollTop = a2.scrollTop = MAX; var a1LastScrollTop = a1.scrollTop; var a2LastScrollTop = a2.scrollTop; function onScroll() { if (this.scrollTop === (this === a1 ? a1LastScrollTop : a2LastScrollTop)) { return; } a1.scrollTop = a2.scrollTop = MAX; a1LastScrollTop = a1.scrollTop; a2LastScrollTop = a2.scrollTop; attrChange(attr2); } a1.addEventListener("scroll", onScroll, passiveEvents); a2.addEventListener("scroll", onScroll, passiveEvents); }); var computedStyle = getComputedStyle(a1); Object.defineProperty(elementComputedStyle, attr2, { configurable: true, get: function() { return parseFloat(computedStyle.paddingBottom); } }); } var parentDiv = document.createElement("div"); setStyle(parentDiv, { position: "absolute", left: "0", top: "0", width: "0", height: "0", zIndex: "-1", overflow: "hidden", visibility: "hidden" }); attrs.forEach(function(key) { addChild(parentDiv, key); }); document.body.appendChild(parentDiv); parentReady(); inited = true; } function getAttr(attr2) { if (!inited) { init(); } return elementComputedStyle[attr2]; } var changeAttrs = []; function attrChange(attr2) { if (!changeAttrs.length) { setTimeout(function() { var style = {}; changeAttrs.forEach(function(attr3) { style[attr3] = elementComputedStyle[attr3]; }); changeAttrs.length = 0; callbacks.forEach(function(callback) { callback(style); }); }, 0); } changeAttrs.push(attr2); } var callbacks = []; function onChange(callback) { if (!getSupport()) { return; } if (!inited) { init(); } if (typeof callback === "function") { callbacks.push(callback); } } function offChange(callback) { var index2 = callbacks.indexOf(callback); if (index2 >= 0) { callbacks.splice(index2, 1); } } var safeAreaInsets = { get support() { return (typeof support === "string" ? support : getSupport()).length != 0; }, get top() { return getAttr("top"); }, get left() { return getAttr("left"); }, get right() { return getAttr("right"); }, get bottom() { return getAttr("bottom"); }, onChange, offChange }; var out = safeAreaInsets; const safeAreaInsets$1 = /* @__PURE__ */ getDefaultExportFromCjs(out); function updateCssVar(cssVars) { const style = document.documentElement.style; Object.keys(cssVars).forEach((name) => { style.setProperty(name, cssVars[name]); }); } function updatePageCssVar(cssVars) { return updateCssVar(cssVars); } function PolySymbol(name) { return Symbol(process.env.NODE_ENV !== "production" ? "[uni-app]: " + name : name); } function rpx2px(str, replace = false) { if (replace) { return rpx2pxWithReplace(str); } { return parseInt(str + ""); } } function rpx2pxWithReplace(str) { { return str; } } function get$pageByPage(page) { return page.vm.$basePage; } let svgIcon = () => { svgIcon = Vue.template('', 0, 1); return svgIcon(); }; function createSvgIcon(path, color = "#000", size = 27, stroke = false) { const svg = svgIcon(); Vue.setAttr(svg, "width", size, true); Vue.setAttr(svg, "height", size, true); Vue.setAttr(svg.firstChild, "d", path, true); Vue.setAttr(svg.firstChild, "fill", stroke ? "none" : color, true); if (stroke) { Vue.setAttr(svg.firstChild, "stroke", color, true); Vue.setAttr(svg.firstChild, "stroke-width", 2, true); Vue.setAttr(svg.firstChild, "stroke-linecap", "round", true); } return svg; } const createSvgIconVNode = createSvgIcon; const ICON_PATH_CANCEL = "M20.928 10.176l-4.928 4.928-4.928-4.928-0.896 0.896 4.928 4.928-4.928 4.928 0.896 0.896 4.928-4.928 4.928 4.928 0.896-0.896-4.928-4.928 4.928-4.928-0.896-0.896zM16 2.080q-3.776 0-7.040 1.888-3.136 1.856-4.992 4.992-1.888 3.264-1.888 7.040t1.888 7.040q1.856 3.136 4.992 4.992 3.264 1.888 7.040 1.888t7.040-1.888q3.136-1.856 4.992-4.992 1.888-3.264 1.888-7.040t-1.888-7.040q-1.856-3.136-4.992-4.992-3.264-1.888-7.040-1.888zM16 28.64q-3.424 0-6.4-1.728-2.848-1.664-4.512-4.512-1.728-2.976-1.728-6.4t1.728-6.4q1.664-2.848 4.512-4.512 2.976-1.728 6.4-1.728t6.4 1.728q2.848 1.664 4.512 4.512 1.728 2.976 1.728 6.4t-1.728 6.4q-1.664 2.848-4.512 4.512-2.976 1.728-6.4 1.728z"; const ICON_PATH_CLEAR = "M16 0q-4.352 0-8.064 2.176-3.616 2.144-5.76 5.76-2.176 3.712-2.176 8.064t2.176 8.064q2.144 3.616 5.76 5.76 3.712 2.176 8.064 2.176t8.064-2.176q3.616-2.144 5.76-5.76 2.176-3.712 2.176-8.064t-2.176-8.064q-2.144-3.616-5.76-5.76-3.712-2.176-8.064-2.176zM22.688 21.408q0.32 0.32 0.304 0.752t-0.336 0.736-0.752 0.304-0.752-0.32l-5.184-5.376-5.376 5.184q-0.32 0.32-0.752 0.304t-0.736-0.336-0.304-0.752 0.32-0.752l5.376-5.184-5.184-5.376q-0.32-0.32-0.304-0.752t0.336-0.752 0.752-0.304 0.752 0.336l5.184 5.376 5.376-5.184q0.32-0.32 0.752-0.304t0.752 0.336 0.304 0.752-0.336 0.752l-5.376 5.184 5.184 5.376z"; const ICON_PATH_DOWNLOAD = "M15.808 1.696q-3.776 0-7.072 1.984-3.2 1.888-5.088 5.152-1.952 3.392-1.952 7.36 0 3.776 1.952 7.072 1.888 3.2 5.088 5.088 3.296 1.952 7.072 1.952 3.968 0 7.36-1.952 3.264-1.888 5.152-5.088 1.984-3.296 1.984-7.072 0-4-1.984-7.36-1.888-3.264-5.152-5.152-3.36-1.984-7.36-1.984zM20.864 18.592l-3.776 4.928q-0.448 0.576-1.088 0.576t-1.088-0.576l-3.776-4.928q-0.448-0.576-0.24-0.992t0.944-0.416h2.976v-8.928q0-0.256 0.176-0.432t0.4-0.176h1.216q0.224 0 0.4 0.176t0.176 0.432v8.928h2.976q0.736 0 0.944 0.416t-0.24 0.992z"; const ICON_PATH_INFO = "M15.808 0.128q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.176 3.776-2.176 8.16 0 4.224 2.176 7.872 2.080 3.552 5.632 5.632 3.648 2.176 7.872 2.176 4.384 0 8.16-2.176 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.416-2.176-8.16-2.112-3.616-5.728-5.728-3.744-2.176-8.16-2.176zM16.864 23.776q0 0.064-0.064 0.064h-1.568q-0.096 0-0.096-0.064l-0.256-11.328q0-0.064 0.064-0.064h2.112q0.096 0 0.064 0.064l-0.256 11.328zM16 10.88q-0.576 0-0.976-0.4t-0.4-0.96 0.4-0.96 0.976-0.4 0.976 0.4 0.4 0.96-0.4 0.96-0.976 0.4z"; const ICON_PATH_SEARCH = "M20.928 22.688q-1.696 1.376-3.744 2.112-2.112 0.768-4.384 0.768-3.488 0-6.464-1.728-2.88-1.696-4.576-4.608-1.76-2.976-1.76-6.464t1.76-6.464q1.696-2.88 4.576-4.576 2.976-1.76 6.464-1.76t6.464 1.76q2.912 1.696 4.608 4.576 1.728 2.976 1.728 6.464 0 2.272-0.768 4.384-0.736 2.048-2.112 3.744l9.312 9.28-1.824 1.824-9.28-9.312zM12.8 23.008q2.784 0 5.184-1.376 2.304-1.376 3.68-3.68 1.376-2.4 1.376-5.184t-1.376-5.152q-1.376-2.336-3.68-3.68-2.4-1.408-5.184-1.408t-5.152 1.408q-2.336 1.344-3.68 3.68-1.408 2.368-1.408 5.152t1.408 5.184q1.344 2.304 3.68 3.68 2.368 1.376 5.152 1.376zM12.8 23.008v0z"; const ICON_PATH_SUCCESS_NO_CIRCLE = "M1.952 18.080q-0.32-0.352-0.416-0.88t0.128-0.976l0.16-0.352q0.224-0.416 0.64-0.528t0.8 0.176l6.496 4.704q0.384 0.288 0.912 0.272t0.88-0.336l17.312-14.272q0.352-0.288 0.848-0.256t0.848 0.352l-0.416-0.416q0.32 0.352 0.32 0.816t-0.32 0.816l-18.656 18.912q-0.32 0.352-0.8 0.352t-0.8-0.32l-7.936-8.064z"; const ICON_PATH_SUCCESS = "M15.808 0.16q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.144 3.744-2.144 8.128 0 4.192 2.144 7.872 2.112 3.52 5.632 5.632 3.68 2.144 7.872 2.144 4.384 0 8.128-2.144 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.384-2.176-8.128-2.112-3.616-5.728-5.728-3.744-2.176-8.128-2.176zM24.832 11.328l-11.264 11.104q-0.032 0.032-0.112 0.032t-0.112-0.032l-5.216-5.376q-0.096-0.128 0-0.288l0.704-0.96q0.032-0.064 0.112-0.064t0.112 0.032l4.256 3.264q0.064 0.032 0.144 0.032t0.112-0.032l10.336-8.608q0.064-0.064 0.144-0.064t0.112 0.064l0.672 0.672q0.128 0.128 0 0.224z"; const ICON_PATH_WAITING = "M15.84 0.096q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.144 3.744-2.144 8.128 0 4.192 2.144 7.872 2.112 3.52 5.632 5.632 3.68 2.144 7.872 2.144 4.384 0 8.128-2.144 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.384-2.176-8.128-2.112-3.616-5.728-5.728-3.744-2.176-8.128-2.176zM23.008 21.92l-0.512 0.896q-0.096 0.128-0.224 0.064l-8-3.808q-0.096-0.064-0.16-0.128-0.128-0.096-0.128-0.288l0.512-12.096q0-0.064 0.048-0.112t0.112-0.048h1.376q0.064 0 0.112 0.048t0.048 0.112l0.448 10.848 6.304 4.256q0.064 0.064 0.080 0.128t-0.016 0.128z"; const ICON_PATH_WARN = "M15.808 0.16q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.144 3.744-2.144 8.128 0 4.192 2.144 7.872 2.112 3.52 5.632 5.632 3.68 2.144 7.872 2.144 4.384 0 8.128-2.144 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.384-2.176-8.128-2.112-3.616-5.728-5.728-3.744-2.176-8.128-2.176zM15.136 8.672h1.728q0.128 0 0.224 0.096t0.096 0.256l-0.384 10.24q0 0.064-0.048 0.112t-0.112 0.048h-1.248q-0.096 0-0.144-0.048t-0.048-0.112l-0.384-10.24q0-0.16 0.096-0.256t0.224-0.096zM16 23.328q-0.48 0-0.832-0.352t-0.352-0.848 0.352-0.848 0.832-0.352 0.832 0.352 0.352 0.848-0.352 0.848-0.832 0.352z"; const ICON_PATH_BACK = "M20 25L11 16L20 7"; const ICON_PATH_CLOSE = "M17.25 16.156l7.375-7.313q0.281-0.281 0.281-0.641t-0.281-0.641q-0.25-0.25-0.625-0.25t-0.625 0.25l-7.375 7.344-7.313-7.344q-0.25-0.25-0.625-0.25t-0.625 0.25q-0.281 0.25-0.281 0.625t0.281 0.625l7.313 7.344-7.375 7.344q-0.281 0.25-0.281 0.625t0.281 0.625q0.125 0.125 0.281 0.188t0.344 0.063q0.156 0 0.328-0.063t0.297-0.188l7.375-7.344 7.375 7.406q0.125 0.156 0.297 0.219t0.328 0.063q0.188 0 0.344-0.078t0.281-0.203q0.281-0.25 0.281-0.609t-0.281-0.641l-7.375-7.406z"; function useCurrentPageId() { { const { $pageInstance } = Vue.getCurrentInstance(); return $pageInstance && getPageProxyId($pageInstance.proxy); } } function getCurrentPage() { const pages = getCurrentPages(); const len = pages.length; if (len) { return pages[len - 1]; } } function getCurrentPageMeta() { var _a, _b; const $page = (_b = (_a = getCurrentPage()) == null ? void 0 : _a.vm) == null ? void 0 : _b.$basePage; if ($page) { return $page.meta; } } function getCurrentPageId() { const meta = getCurrentPageMeta(); if (meta) { return meta.id; } return -1; } function getCurrentPageVm() { var _a; const page = (_a = getCurrentPage()) == null ? void 0 : _a.vm; if (page) { return page.$vm; } } const PAGE_META_KEYS = ["navigationBar", "pullToRefresh"]; function initGlobalStyle() { return JSON.parse(JSON.stringify(__uniConfig.globalStyle || {})); } function initRouteMeta(pageMeta, id2) { const globalStyle = initGlobalStyle(); const res = shared.extend({ id: id2 }, globalStyle, pageMeta); PAGE_META_KEYS.forEach((name) => { res[name] = shared.extend({}, globalStyle[name], pageMeta[name]); }); const { navigationBar } = res; navigationBar.titleText && navigationBar.titleImage && (navigationBar.titleText = ""); return res; } function normalizePullToRefreshRpx(pullToRefresh) { if (pullToRefresh.offset) { pullToRefresh.offset = rpx2px(pullToRefresh.offset); } if (pullToRefresh.height) { pullToRefresh.height = rpx2px(pullToRefresh.height); } if (pullToRefresh.range) { pullToRefresh.range = rpx2px(pullToRefresh.range); } return pullToRefresh; } function initPageInternalInstance(openType, url, pageQuery, meta, eventChannel, themeMode) { const { id: id2, route } = meta; const titleColor = uniShared.normalizeStyles( meta.navigationBar, __uniConfig.themeConfig, themeMode ).titleColor; return { id: id2, path: uniShared.addLeadingSlash(route), route, fullPath: url, options: pageQuery, meta, openType, eventChannel, statusBarStyle: titleColor === "#ffffff" ? "light" : "dark" }; } function getPageProxyId(proxy) { var _a, _b; return ((_a = proxy.$page) == null ? void 0 : _a.id) || ((_b = proxy.$basePage) == null ? void 0 : _b.id); } function invokeHook(vm, name, args) { if (shared.isString(vm)) { args = name; name = vm; vm = getCurrentPageVm(); } else if (typeof vm === "number") { const page = getCurrentPages().find( (page2) => get$pageByPage(page2).id === vm ); if (page) { vm = page.$vm; } else { vm = getCurrentPageVm(); } } if (!vm) { return; } const hooks = vm.$[name]; if (name === uniShared.ON_BACK_PRESS) { return hooks && uniShared.invokeArrayFnsWithResults(hooks, args).some((ret) => ret === true); } return hooks && uniShared.invokeArrayFns(hooks, args); } function normalizeRoute(toRoute) { if (toRoute.indexOf("/") === 0 || toRoute.indexOf("uni:") === 0) { return toRoute; } let fromRoute = ""; const pages = getCurrentPages(); if (pages.length) { fromRoute = get$pageByPage(pages[pages.length - 1]).route; } return getRealRoute(fromRoute, toRoute); } function getRealRoute(fromRoute, toRoute) { if (toRoute.indexOf("/") === 0) { return toRoute; } if (toRoute.indexOf("./") === 0) { return getRealRoute(fromRoute, toRoute.slice(2)); } const toRouteArray = toRoute.split("/"); const toRouteLength = toRouteArray.length; let i = 0; for (; i < toRouteLength && toRouteArray[i] === ".."; i++) { } toRouteArray.splice(0, i); toRoute = toRouteArray.join("/"); const fromRouteArray = fromRoute.length > 0 ? fromRoute.split("/") : []; fromRouteArray.splice(fromRouteArray.length - i - 1, i + 1); return uniShared.addLeadingSlash(fromRouteArray.concat(toRouteArray).join("/")); } function getRouteOptions(path, alias = false) { if (alias) { return __uniRoutes.find( (route) => route.path === path || route.alias === path ); } return __uniRoutes.find((route) => route.path === path); } function getPageInstanceByChild(child) { var _a; let pageInstance = child; while (pageInstance && ((_a = pageInstance.type) == null ? void 0 : _a.name) !== "Page") { pageInstance = pageInstance.parent; } return pageInstance; } const DIALOG_TAG = "dialog"; const SYSTEM_DIALOG_TAG = "systemDialog"; function isDialogPageInstance(vm) { if (!vm) return false; return isNormalDialogPageInstance(vm) || isSystemDialogPageInstance(vm); } function isNormalDialogPageInstance(vm) { return vm.attrs["data-type"] === DIALOG_TAG; } function isSystemDialogPageInstance(vm) { return vm.attrs["data-type"] === SYSTEM_DIALOG_TAG; } function warnUniAppVmMethod(methodName) { initI18nAppVmMsgsOnce(); const methodCall = `getApp().vm?.${methodName}()`; Vue.warn( useI18n().t("uni.appVm.methodWarning", { methodName, methodCall }) ); } function createInitUniAppVmMethodWarnings() { const VM_METHOD_WARNING_GETTER = Symbol.for( "uni-app.vm-method-warning-getter" ); const UNI_APP_METHODS = /* @__PURE__ */ new Set([ "$vm", "globalData", "getAndroidApplication", "getHarmonyAbility", "restart", "vm" ]); function getMethodSources(vm) { var _a; const instance = vm.$; if (instance.exposed) { return [instance.exposed]; } return [ instance.ctx, ((_a = instance.setupState) == null ? void 0 : _a.__isScriptSetup) ? void 0 : instance.setupState ]; } function getVmMethodNames(vm) { const methodNames = /* @__PURE__ */ new Set(); getMethodSources(vm).forEach((source) => { if (!source) { return; } Object.getOwnPropertyNames(source).forEach((name) => { const descriptor = Object.getOwnPropertyDescriptor(source, name); if (typeof Vue.unref(descriptor == null ? void 0 : descriptor.value) === "function") { methodNames.add(name); } }); }); return methodNames; } function createWarningGetter(methodName, getter) { const warningGetter = function() { warnUniAppVmMethod(methodName); return Reflect.apply(getter, this, []); }; Object.defineProperty(warningGetter, VM_METHOD_WARNING_GETTER, { value: { methodName } }); return warningGetter; } function findPropertyDescriptor(target, methodName) { try { let owner = target; while (owner) { const descriptor = Object.getOwnPropertyDescriptor(owner, methodName); if (descriptor) { return { descriptor, own: owner === target }; } owner = Object.getPrototypeOf(owner); } } catch { return; } } function defineProperty(target, methodName, descriptor) { try { Object.defineProperty(target, methodName, descriptor); } catch { } } function wrapAccessor(uniApp, methodName, descriptor, own) { var _a; const getter = descriptor.get; if (!getter || ((_a = getter[VM_METHOD_WARNING_GETTER]) == null ? void 0 : _a.methodName) === methodName || own && !descriptor.configurable) { return; } defineProperty(uniApp, methodName, { configurable: own ? descriptor.configurable : true, enumerable: descriptor.enumerable, get: createWarningGetter(methodName, getter), set: descriptor.set }); } function wrapDataProperty(uniApp, methodName, value, descriptor, own = false) { if (own && !(descriptor == null ? void 0 : descriptor.configurable)) { return; } let currentValue = value; defineProperty(uniApp, methodName, { configurable: own ? descriptor == null ? void 0 : descriptor.configurable : true, enumerable: (descriptor == null ? void 0 : descriptor.enumerable) ?? false, get: createWarningGetter(methodName, () => currentValue), set: (descriptor == null ? void 0 : descriptor.writable) === false ? void 0 : (value2) => { currentValue = value2; } }); } function wrapUniAppMethod(uniApp, methodName, wrapMissingProperty = false) { if (UNI_APP_METHODS.has(methodName)) { return; } const property = findPropertyDescriptor(uniApp, methodName); if (property) { const { descriptor, own } = property; if (descriptor.get) { wrapAccessor(uniApp, methodName, descriptor, own); } else if (typeof descriptor.value === "function") { wrapDataProperty(uniApp, methodName, descriptor.value, descriptor, own); } return; } let method; try { method = uniApp[methodName]; } catch { return; } if (typeof method === "function" || wrapMissingProperty) { wrapDataProperty(uniApp, methodName, method); } } return function initUniAppVmMethodWarnings2(uniApp) { if (!uniApp.vm) { return /* @__PURE__ */ new Set(); } const methodNames = getVmMethodNames(uniApp.vm); UNI_APP_METHODS.forEach((methodName) => methodNames.delete(methodName)); methodNames.forEach((methodName) => { wrapUniAppMethod(uniApp, methodName, false); }); return methodNames; }; } const initUniAppVmMethodWarnings = process.env.NODE_ENV !== "production" ? createInitUniAppVmMethodWarnings() : () => /* @__PURE__ */ new Set(); const invokeOnCallback = (name, res) => UniServiceJSBridge.emit("api." + name, res); let invokeViewMethodId = 1; function publishViewMethodName(pageId) { return (pageId || getCurrentPageId()) + "." + INVOKE_VIEW_API; } const invokeViewMethod = (name, args, pageId, callback) => { const { subscribe, publishHandler } = UniServiceJSBridge; const id2 = callback ? invokeViewMethodId++ : 0; callback && subscribe(INVOKE_VIEW_API + "." + id2, callback, true); publishHandler(publishViewMethodName(pageId), { id: id2, name, args }, pageId); }; const invokeViewMethodKeepAlive = (name, args, callback, pageId) => { const { subscribe, unsubscribe, publishHandler } = UniServiceJSBridge; const id2 = invokeViewMethodId++; const subscribeName = INVOKE_VIEW_API + "." + id2; subscribe(subscribeName, callback); publishHandler(publishViewMethodName(pageId), { id: id2, name, args }, pageId); return () => { unsubscribe(subscribeName); }; }; const ServiceJSBridge = /* @__PURE__ */ shared.extend( /* @__PURE__ */ initBridge( "view" /* view 指的是 service 层订阅的是 view 层事件 */ ), { invokeOnCallback, invokeViewMethod, invokeViewMethodKeepAlive } ); function initAppVm(appVm2) { appVm2.$vm = appVm2; appVm2.$mpType = "app"; const locale = Vue.ref(useI18n().getLocale()); Object.defineProperty(appVm2, "$locale", { get() { return locale.value; }, set(v2) { locale.value = v2; } }); } function initPageVm(pageVm, page) { pageVm.route = page.route; pageVm.$vm = pageVm; { pageVm.$basePage = page; } pageVm.$mpType = "page"; pageVm.$fontFamilySet = /* @__PURE__ */ new Set(); if (page.meta.isTabBar) { pageVm.$.__isTabBar = true; pageVm.$.__isActive = true; } } function defineGlobalData(app, defaultGlobalData) { const options = app.$options || {}; options.globalData = shared.extend(options.globalData || {}, defaultGlobalData); Object.defineProperty(app, "globalData", { get() { return options.globalData; }, set(newGlobalData) { options.globalData = newGlobalData; } }); } function throttle(fn, wait) { let last = 0; let timeout; let waitCallback; const newFn = function(...arg) { const now = Date.now(); clearTimeout(timeout); waitCallback = () => { waitCallback = null; last = now; fn.apply(this, arg); }; if (now - last < wait) { timeout = setTimeout(waitCallback, wait - (now - last)); return; } waitCallback(); }; newFn.cancel = function() { clearTimeout(timeout); waitCallback = null; }; newFn.flush = function() { clearTimeout(timeout); waitCallback && waitCallback(); }; return newFn; } function withWebEvent(fn) { return fn.__wwe = true, fn; } function useCustomEvent(ref, emit2) { return (name, evt, detail) => { if (ref.value) { emit2(name, normalizeCustomEvent(name, evt, ref.value, detail || {})); } }; } function normalizeCustomEvent(name, domEvt, el, detail) { const target = uniShared.normalizeTarget(el); return { type: domEvt.__evName || detail.type || name, timeStamp: domEvt.timeStamp || 0, target, currentTarget: target, detail }; } function useUserAction() { const state = Vue.reactive({ /** * 是否用户激活 */ userAction: false }); return { state }; } let resetTimer; function iosHideKeyboard() { } const props$a = { cursorSpacing: { type: [Number, String], default: 0 }, showConfirmBar: { type: [Boolean, String], default: "auto" }, adjustPosition: { type: [Boolean, String], default: true }, autoBlur: { type: [Boolean, String], default: false } }; const emit$1 = ["keyboardheightchange"]; function useKeyboard(props2, elRef, trigger) { function initKeyboard(el) { const isApple = Vue.computed( () => String(navigator.vendor).indexOf("Apple") === 0 ); el.addEventListener("focus", () => { clearTimeout(resetTimer); document.addEventListener("click", iosHideKeyboard, false); }); const onKeyboardHide = () => { document.removeEventListener("click", iosHideKeyboard, false); if (isApple.value) { document.documentElement.scrollTo( document.documentElement.scrollLeft, document.documentElement.scrollTop ); } }; el.addEventListener("blur", () => { if (isApple.value) { el.blur(); } onKeyboardHide(); }); } Vue.watch( () => elRef.value, (el) => el && initKeyboard(el) ); } function useScopedAttrs() { const state = Vue.reactive({ attrs: {} }); return { state }; } function useVaporFormField(props2, state) { const form = Vue.inject("UNI_FORM_CTX", null); if (!form) return; const initialValue = state.value; const getValue = () => state.value; const reset = () => { state.value = initialValue; }; Vue.watch( () => props2.name, (name, oldName) => { if (oldName) form.unregisterField(oldName); if (name) form.registerField({ name, getValue, reset }); }, { immediate: true, flush: "sync" } ); } function getSelectedTextRange(_, resolve) { const activeElement = document.activeElement; if (!activeElement) { return resolve({}); } const data = {}; if (["input", "textarea"].includes(activeElement.tagName.toLowerCase())) { data.start = activeElement.selectionStart; data.end = activeElement.selectionEnd; } resolve(data); } const UniViewJSBridgeSubscribe = function() { registerViewMethod( getCurrentPageId(), "getSelectedTextRange", getSelectedTextRange ); }; function getValueString(value, type, maxlength) { if (type === "number" && isNaN(Number(value))) { value = ""; } const valueStr = value === null || value === void 0 ? "" : String(value); if (maxlength == void 0) { return valueStr; } return valueStr.slice(0, maxlength); } const INPUT_MODES = [ "none", "text", "decimal", "numeric", "tel", "search", "email", "url" ]; const props$9 = /* @__PURE__ */ shared.extend( {}, { name: { type: String, default: "" }, modelValue: { type: [String, Number] }, value: { type: [String, Number] }, disabled: { type: [Boolean, String], default: false }, /** * 已废弃属性,用于历史兼容 */ autoFocus: { type: [Boolean, String], default: false }, focus: { type: [Boolean, String], default: false }, cursor: { type: [Number, String], default: -1 }, selectionStart: { type: [Number, String], default: -1 }, selectionEnd: { type: [Number, String], default: -1 }, type: { type: String, default: "text" }, password: { type: [Boolean, String], default: false }, placeholder: { type: String, default: "" }, placeholderStyle: { type: String, default: "" }, placeholderClass: { type: String, default: "" }, maxlength: { type: [Number, String], default: Infinity }, confirmType: { type: String, default: "done" }, confirmHold: { type: Boolean, default: false }, ignoreCompositionEvent: { type: Boolean, default: true }, step: { type: String, default: "0.000000000000000001" }, inputmode: { type: String, default: void 0, validator: (value) => !!~INPUT_MODES.indexOf(value) }, cursorColor: { type: String, default: "" } }, props$a ); const emit = [ "input", "focus", "blur", "update:value", "update:modelValue", "update:focus", "compositionstart", "compositionupdate", "compositionend", ...emit$1 ]; function useBase(props2, rootRef, emit2) { const fieldRef = Vue.ref(null); const trigger = useCustomEvent(rootRef, emit2); const selectionStart = Vue.computed(() => { const selectionStart2 = Number(props2.selectionStart); return isNaN(selectionStart2) ? -1 : selectionStart2; }); const selectionEnd = Vue.computed(() => { const selectionEnd2 = Number(props2.selectionEnd); return isNaN(selectionEnd2) ? -1 : selectionEnd2; }); const cursor = Vue.computed(() => { const cursor2 = Number(props2.cursor); return isNaN(cursor2) ? -1 : cursor2; }); const maxlength = Vue.computed(() => { var maxlength2 = Number(props2.maxlength); { return isNaN(maxlength2) || maxlength2 < 0 ? Infinity : Math.floor(maxlength2); } }); let value = ""; { const modelValueString = getValueString( props2.modelValue, props2.type, maxlength.value ); const valueString = getValueString(props2.value, props2.type, maxlength.value); value = props2.modelValue !== void 0 ? modelValueString !== null && modelValueString !== void 0 ? modelValueString : valueString : valueString; } const state = Vue.reactive({ value, valueOrigin: value, maxlength, focus: props2.focus, composing: false, selectionStart, selectionEnd, cursor }); Vue.watch( () => state.focus, (val) => emit2("update:focus", val) ); Vue.watch( () => state.maxlength, (val) => { if (val >= 0) { state.value = state.value.slice(0, val); } }, { immediate: true } ); return { fieldRef, state, trigger }; } function useValueSync(props2, state, emit2, trigger, fieldRef) { let valueChangeFn = null; { valueChangeFn = throttle((val) => { state.value = getValueString(val, props2.type, state.maxlength); }, 100); } Vue.watch(() => props2.modelValue, valueChangeFn); Vue.watch(() => props2.value, valueChangeFn); const triggerInputFn = throttle((event, detail) => { valueChangeFn.cancel(); emit2("update:modelValue", detail.value); emit2("update:value", detail.value); trigger("input", event, detail); }, 100); const triggerInput = (event, detail, force) => { valueChangeFn.cancel(); detail.value; triggerInputFn(event, detail); if (force) { triggerInputFn.flush(); } }; return { trigger, triggerInput }; } function useAutoFocus(props2, fieldRef) { useUserAction(); const needFocus = Vue.computed(() => props2.autoFocus || props2.focus); function focus() { if (!needFocus.value) { return; } const field = fieldRef.value; if (!field || false) { setTimeout(focus, 100); return; } { field.focus(); } } function blur() { const field = fieldRef.value; if (field) { field.blur(); } } Vue.watch( () => props2.focus, (value) => { if (value) { focus(); } else { blur(); } } ); } function useEvent(fieldRef, state, props2, trigger, triggerInput, beforeInput) { function checkSelection() { const field = fieldRef.value; if (field && state.focus && state.selectionStart > -1 && state.selectionEnd > -1 && typeof field.selectionStart === "number") { field.selectionStart = state.selectionStart; field.selectionEnd = state.selectionEnd; } } function checkCursor() { const field = fieldRef.value; if (field && state.focus && state.selectionStart < 0 && state.selectionEnd < 0 && state.cursor > -1 && typeof field.selectionStart === "number") { field.selectionEnd = field.selectionStart = state.cursor; } } function getFieldSelectionEnd(field) { if (field.type === "number") { return null; } else { return field.selectionEnd; } } function initField() { const field = fieldRef.value; if (!field) return; const onFocus = function(event) { state.focus = true; trigger("focus", event, { value: state.value }); checkSelection(); checkCursor(); }; const onInput = function(event, force) { event.stopPropagation(); if (shared.isFunction(beforeInput) && beforeInput(event, state) === false) { return; } state.value = field.value; if (!state.composing || !props2.ignoreCompositionEvent) { triggerInput( event, { value: field.value, cursor: getFieldSelectionEnd(field) }, force ); } }; const onBlur = function(event) { if (state.composing) { state.composing = false; onInput(event, true); } state.focus = false; trigger("blur", event, { value: state.value, cursor: getFieldSelectionEnd(event.target) }); }; field.addEventListener("change", (event) => event.stopPropagation()); field.addEventListener("focus", onFocus); field.addEventListener("blur", onBlur); field.addEventListener("input", onInput); field.addEventListener("compositionstart", (event) => { event.stopPropagation(); state.composing = true; _onComposition(event); }); field.addEventListener("compositionend", (event) => { event.stopPropagation(); if (state.composing) { state.composing = false; onInput(event); } _onComposition(event); }); field.addEventListener("compositionupdate", _onComposition); function _onComposition(event) { if (!props2.ignoreCompositionEvent) { trigger(event.type, event, { value: event.data }); } } } Vue.watch([() => state.selectionStart, () => state.selectionEnd], checkSelection); Vue.watch(() => state.cursor, checkCursor); Vue.watch(() => fieldRef.value, initField); } function useField(props2, rootRef, emit2, beforeInput) { UniViewJSBridgeSubscribe(); const { fieldRef, state, trigger } = useBase(props2, rootRef, emit2); const { triggerInput } = useValueSync(props2, state, emit2, trigger); useAutoFocus(props2, fieldRef); useKeyboard(props2, fieldRef); const { state: scopedAttrsState } = useScopedAttrs(); useVaporFormField(props2, state); useEvent(fieldRef, state, props2, trigger, triggerInput, beforeInput); const fixDisabledColor = false; return { fieldRef, state, scopedAttrsState, fixDisabledColor, trigger }; } uniShared.once(() => { }); const webSelectionProps$1 = fieldSelectionProps; const props$8 = /* @__PURE__ */ shared.extend( {}, props$9, { placeholderClass: { type: String, default: "input-placeholder" }, textContentType: { type: String, default: "" } }, webSelectionProps$1 ); function isPaste(event) { return event.inputType === "insertFromPaste"; } function useCache(props2, type) { if (type.value === "number") { const value = typeof props2.modelValue === "undefined" ? props2.value : props2.modelValue; const cache = Vue.ref( typeof value !== "undefined" && value !== null ? value.toLocaleString() : "" ); Vue.watch( () => props2.modelValue, (value2) => { cache.value = typeof value2 !== "undefined" && value2 !== null ? value2.toLocaleString() : ""; } ); Vue.watch( () => props2.value, (value2) => { cache.value = typeof value2 !== "undefined" && value2 !== null ? value2.toLocaleString() : ""; } ); return cache; } else { return Vue.ref(""); } } const emits$2 = ["confirm", ...emit]; function useInput(props2, { emit: emit2, expose }) { const INPUT_TYPES = [ "text", "number", "idcard", "digit", "password", "tel", "search", "email" ]; const AUTOCOMPLETES = ["off", "one-time-code"]; const type = Vue.computed(() => { let type2 = ""; switch (props2.type) { case "text": type2 = "text"; if (props2.confirmType === "search") { type2 = "search"; } break; case "idcard": type2 = "text"; break; case "digit": type2 = "number"; break; case "none": type2 = "text"; break; default: type2 = INPUT_TYPES.includes(props2.type) ? props2.type : "text"; break; } return props2.password ? "password" : type2; }); const autocomplete = Vue.computed(() => { const camelizeIndex = AUTOCOMPLETES.indexOf(props2.textContentType); const kebabCaseIndex = AUTOCOMPLETES.indexOf( shared.hyphenate(props2.textContentType) ); const index2 = camelizeIndex !== -1 ? camelizeIndex : kebabCaseIndex !== -1 ? kebabCaseIndex : 0; return AUTOCOMPLETES[index2]; }); const inputmode = Vue.computed(() => { if (props2.inputmode !== void 0) { return props2.inputmode; } if (INPUT_MODES.includes(props2.type)) { return props2.type; } let inputmodeMap = {}; { inputmodeMap = { number: "numeric", digit: "decimal", idcard: "text" }; } return inputmodeMap[props2.type]; }); let cache = useCache(props2, type); const rootRef = Vue.ref(null); const { fieldRef, state, scopedAttrsState, fixDisabledColor, trigger } = useField(props2, rootRef, emit2, (event, state2) => { { return; } }); const selectionRef = useFieldSelection(props2, fieldRef); Vue.watch( () => state.value, (value) => { if (props2.type === "number" && !(cache.value === "-" && value === "")) { cache.value = value.toString(); } } ); Vue.watch( () => props2.maxlength, (length) => { length = parseInt(length, 10); if (!(length >= 0)) { return; } const realValue = state.value.slice(0, length); realValue !== state.value && (state.value = realValue); } ); const NUMBER_TYPES = ["number", "digit"]; const step = Vue.computed( () => NUMBER_TYPES.includes(props2.type) ? props2.step : "" ); function onKeyUpEnter(event) { if (event.key !== "Enter") { return; } const input = event.target; event.stopPropagation(); trigger("confirm", event, { value: input.value }); !props2.confirmHold && input.blur(); } expose({ $triggerInput: (detail) => { emit2("update:modelValue", detail.value); emit2("update:value", detail.value); state.value = detail.value; } }); function onInput(event) { const value = event.target.value.toString(); if (type.value === "number" && state.maxlength > 0 && value.length > state.maxlength) { if (isPaste(event)) { state.value = value.slice(0, state.maxlength); } return; } if (value.length === 0 && event.inputType === "insertText" && event.data === ".") { return; } state.value = value; } return { rootRef, fieldRef, state, scopedAttrsState, selectionRef, fixDisabledColor, type, autocomplete, inputmode, cache, step, onKeyUpEnter, onInput }; } const createComponent = (type, ...args) => { if (type === Vue.Fragment) { const slots = args[1]; return slots ? typeof slots === "function" ? slots() : typeof slots.default === "function" ? slots.default() : [] : []; } return Vue__namespace.createComponentWithFallback( createProxyComponent(Vue__namespace.resolveDynamicComponent(type)), ...args ); }; const proxyCache = /* @__PURE__ */ new WeakMap(); function createProxyComponent(type, normalizeNode2) { if (typeof type === "function") { const existing = proxyCache.get(type); if (existing) return existing; const i = Vue__namespace.currentInstance || Vue.getCurrentInstance(); const proxy = new Proxy(type, { apply(target, ctx, args) { if (typeof target.__setup === "function") { target.__setup.apply(ctx, args); } const node = Reflect.apply(target, ctx, args); return node; }, get(target, p2, receiver) { const result = Reflect.get(target, p2, receiver); if (p2 === "__vapor" && result === void 0 && i && i.appContext.vapor) { return true; } return result; } }); proxyCache.set(type, proxy); return proxy; } return type; } function createFragment(nodes, anchor = document.createTextNode("")) { const frag = new Vue__namespace.VaporFragment(nodes); frag.anchor = anchor; return frag; } function normalizeBlock(node, anchor, processFunction = false) { if (node instanceof Node || Vue__namespace.isFragment(node)) { return node; } else if (Vue__namespace.isVaporComponent(node)) { return createFragment(node, anchor); } else if (Array.isArray(node)) { return createFragment( node.map((i) => normalizeBlock(i, void 0, processFunction)), anchor ); } else if (processFunction && typeof node === "function") { return resolveValues([node], anchor, true)[0]; } else { const result = node == null || typeof node === "boolean" ? "" : String(node); if (anchor) { anchor.textContent = result; return anchor; } else { return document.createTextNode(result); } } } function resolveValue(current, value, anchor, processFunction = false) { anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0); const node = normalizeBlock(value, anchor, processFunction); if (current) { if (Vue__namespace.isFragment(current)) { if (current.anchor && current.anchor.parentNode) { Vue__namespace.remove(current.nodes, current.anchor.parentNode); Vue__namespace.insert(node, current.anchor.parentNode, current.anchor); if (!anchor) current.anchor.parentNode.removeChild(current.anchor); if (current.scope) current.scope.stop(); } } else if (current instanceof Node) { if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) { current.textContent = ""; } if (Vue__namespace.isFragment(node) && current.parentNode) { Vue__namespace.insert(node, current.parentNode, current); if (!anchor || current.nodeType !== 3) { current.parentNode.removeChild(current); } } else if (node instanceof Node) { if (current.nodeType === 3 && node.nodeType === 3) { current.textContent = node.textContent; return current; } else if (current.parentNode) { current.parentNode.replaceChild(node, current); } } } } return node; } function resolveValues(values = [], _anchor, processFunction = false) { const nodes = []; const scopes = []; for (const [index2, value] of values.entries()) { const anchor = index2 === values.length - 1 ? _anchor : void 0; if (typeof value === "function") { Vue__namespace.renderEffect(() => { if (scopes[index2]) scopes[index2].stop(); scopes[index2] = new Vue.EffectScope(); nodes[index2] = scopes[index2].run( () => resolveValue(nodes[index2], value(), anchor, processFunction) ); }); } else { nodes[index2] = resolveValue(nodes[index2], value, anchor, processFunction); } } return nodes; } function setNodes(anchor, ...values) { const resolvedValues = resolveValues(values, anchor); if (anchor.parentNode) Vue__namespace.insert(resolvedValues, anchor.parentNode, anchor); } function createNodes(...values) { return resolveValues(values); } const _t0$d = Vue.template(""); const _t1$3 = Vue.template(""); const _t2$2 = Vue.template("
"); const _t3$2 = Vue.template("
", 1); const _t4$2 = Vue.template("
", 1); const Input = /* @__PURE__ */ defineBuiltInComponent({ name: "Input", props: props$8, emits: emits$2, rootElement: { name: "uni-input", class: UniInputElement }, setup(props2, context) { const { rootRef, fieldRef, state, scopedAttrsState, selectionRef, fixDisabledColor, type, autocomplete, inputmode, cache, step, onKeyUpEnter, onInput } = useInput(props2, context); const renderInput = () => (() => { const _setTemplateRef = Vue.createTemplateRefSetter(); const _n0 = Vue.createIf(() => props2.disabled && fixDisabledColor, () => { const _n2 = _t0$d(); Vue.setBlockKey(_n2, "disabled-input"); Vue.on( _n2, // fix: 禁止 readonly 状态获取焦点 "focus", (event) => event.target.blur() ); Vue.renderEffect(() => { Vue.setValue(_n2, state.value); Vue.setProp(_n2, "readonly", !!props2.disabled); Vue.setProp(_n2, "type", type.value); Vue.setProp(_n2, "maxlength", state.maxlength); Vue.setProp(_n2, "step", step.value); Vue.setClass(_n2, props2.selectionClass ? "uni-input-input uni-field-selection" : "uni-input-input"); Vue.setStyle(_n2, props2.cursorColor ? { caretColor: props2.cursorColor } : {}); Vue.setProp(_n2, "inputmode", inputmode.value); _setTemplateRef(_n2, fieldRef); }); return _n2; }, () => { const _n4 = _t1$3(); Vue.setBlockKey(_n4, "input"); Vue.on(_n4, "input", Vue.withModifiers(onInput, ["stop"])); Vue.on(_n4, "keyup", onKeyUpEnter); Vue.renderEffect(() => { Vue.setValue(_n4, state.value); Vue.setProp(_n4, "disabled", !!props2.disabled); Vue.setProp(_n4, "type", type.value); Vue.setProp(_n4, "maxlength", state.maxlength); Vue.setProp(_n4, "step", step.value); Vue.setProp(_n4, "enterkeyhint", props2.confirmType); Vue.setProp(_n4, "pattern", props2.type === "number" ? "[0-9]*" : void 0); Vue.setClass(_n4, props2.selectionClass ? "uni-input-input uni-field-selection" : "uni-input-input"); Vue.setStyle(_n4, props2.cursorColor ? { caretColor: props2.cursorColor } : {}); Vue.setProp(_n4, "autocomplete", autocomplete.value); Vue.setProp(_n4, "inputmode", inputmode.value); _setTemplateRef(_n4, fieldRef); }); return _n4; }, 261); return _n0; })(); const root = (() => { const _setTemplateRef = Vue.createTemplateRefSetter(); const _n8 = _t3$2(); const _n7 = Vue.child(_n8); const _n0 = Vue.child(_n7, true); const _n1 = Vue.next(_n0); setNodes(_n0, () => props2.selectionClass && (() => { const _setTemplateRef2 = Vue.createTemplateRefSetter(); const _n02 = _t4$2(); Vue.renderEffect(() => { Vue.setDynamicProps(_n02, [scopedAttrsState.attrs, { class: ["uni-field-selection-probe", props2.selectionClass], "aria-hidden": "true", style: fieldSelectionProbeStyle }]); _setTemplateRef2(_n02, selectionRef); }); return _n02; })()); Vue.applyVShow(_n1, () => !(state.value.length || cache.value === "-" || cache.value.includes("."))); const _x1 = Vue.txt(_n1); setNodes(_x1, () => props2.placeholder); Vue.renderEffect(() => Vue.setDynamicProps(_n1, [scopedAttrsState.attrs, { style: props2.placeholderStyle, class: ["uni-input-placeholder", props2.placeholderClass] }])); Vue.setInsertionState(_n7, 2); Vue.createIf(() => props2.confirmType === "search", () => { const _n4 = _t2$2(); Vue.on(_n4, "submit", (event) => event.preventDefault()); const _x4 = Vue.txt(_n4); setNodes(_x4, () => renderInput()); return _n4; }, () => { const _n6 = createNodes(() => renderInput()); return _n6; }, 265); Vue.renderEffect(() => _setTemplateRef(_n8, rootRef)); return _n8; })(); initInputElement(root); return root; } }); const resizeSensorProps = { initial: { type: Boolean, default: false } }; function useResizeSensor(props2, emit2) { const rootRef = Vue.ref(null); const reset = useResizeSensorReset(rootRef); const update = useResizeSensorUpdate(rootRef, emit2, reset); return { rootRef, update }; } function useResizeSensorUpdate(rootRef, emit2, reset) { const size = Vue.reactive({ width: -1, height: -1 }); Vue.watch( () => shared.extend({}, size), (value) => emit2("resize", value) ); return () => { const rootEl = rootRef.value; if (!rootEl) return; const rect = rootEl.getBoundingClientRect(); size.width = rect.width; size.height = rect.height; reset(); }; } function useResizeSensorReset(rootRef) { return () => { const { firstElementChild, lastElementChild } = rootRef.value; firstElementChild.scrollLeft = 1e5; firstElementChild.scrollTop = 1e5; lastElementChild.scrollLeft = 1e5; lastElementChild.scrollTop = 1e5; }; } const _t0$c = Vue.template("
", 1); const ResizeSensor = /* @__PURE__ */ defineBuiltInComponent({ name: "ResizeSensor", props: resizeSensorProps, emits: ["resize"], setup(props2, { emit: emit2 }) { const { rootRef, update } = useResizeSensor(props2, emit2); const root = (() => { const _setTemplateRef = Vue.createTemplateRefSetter(); const _n2 = _t0$c(); const _n0 = Vue.child(_n2); const _n1 = Vue.next(_n0); Vue.on(_n0, "scroll", update); Vue.on(_n1, "scroll", update); Vue.renderEffect(() => _setTemplateRef(_n2, rootRef)); return _n2; })(); return root; } }); const _UniTextareaElement = class _UniTextareaElement extends UniViewElement { static [Symbol.hasInstance](value) { return this === _UniTextareaElement && value instanceof UniViewElement && value.hasAttribute("uni-textarea") || Function.prototype[Symbol.hasInstance].call(this, value); } focus(options) { var _a; (_a = this.querySelector("textarea")) == null ? void 0 : _a.focus(options); } }; _UniTextareaElement.__uniElement = {}; let UniTextareaElement = _UniTextareaElement; const descriptors = { uniTagName: { value: "TEXTAREA" }, focus: Object.getOwnPropertyDescriptor( UniTextareaElement.prototype, "focus" ) }; function setValue(value) { this.querySelector("textarea").value = value; } function initTextareaElement(root, state) { Object.defineProperties(root, descriptors); Object.defineProperty(root, "value", { get: () => state.value, set: setValue }); } const webSelectionProps = fieldSelectionProps; const props$7 = /* @__PURE__ */ shared.extend( {}, props$9, { placeholderClass: { type: String, default: "input-placeholder" }, autoHeight: { type: [Boolean, String], default: false }, confirmType: { type: String, default: "return", validator(val) { return ConfirmTypes.concat("return").includes(val); } } }, webSelectionProps ); const ConfirmTypes = ["done", "go", "next", "search", "send"]; const emits$1 = ["confirm", "change", "linechange", ...emit]; function useTextarea(props2, { emit: emit2, expose }) { const rootRef = Vue.ref(null); const wrapperRef = Vue.ref(null); const { fieldRef, state, scopedAttrsState, fixDisabledColor, trigger } = useField(props2, rootRef, emit2); const selectionRef = useFieldSelection(props2, fieldRef); const valueCompute = Vue.computed(() => state.value.split(uniShared.LINEFEED)); const isDone = Vue.computed(() => ConfirmTypes.includes(props2.confirmType)); const heightRef = Vue.ref(0); const lineRef = Vue.ref(null); Vue.watch( () => heightRef.value, (height) => { const el = rootRef.value; const lineEl = lineRef.value; const wrapper = wrapperRef.value; let lineHeight = parseFloat(getComputedStyle(el).lineHeight); if (isNaN(lineHeight)) { lineHeight = lineEl.offsetHeight; } var lineCount = Math.round(height / lineHeight); trigger("linechange", {}, { height, heightRpx: 750 / window.innerWidth * height, lineCount }); if (props2.autoHeight) { wrapper.style.height = height + "px"; } } ); Vue.watch( () => props2.autoHeight, (autoHeight) => { const wrapper = wrapperRef.value; if (autoHeight) { wrapper.style.height = heightRef.value + "px"; } else { wrapper.style.height = ""; } } ); function onResize2({ height }) { heightRef.value = height; } function onChange2(event) { { trigger("change", event, { value: state.value }); } } function confirm(event) { trigger("confirm", event, { value: state.value }); } function onKeyDownEnter(event) { if (event.key !== "Enter") { return; } if (isDone.value) { event.preventDefault(); } } function onKeyUpEnter(event) { if (event.key !== "Enter") { return; } if (isDone.value) { confirm(event); const textarea = event.target; !props2.confirmHold && textarea.blur(); } } expose({ $triggerInput: (detail) => { emit2("update:modelValue", detail.value); emit2("update:value", detail.value); state.value = detail.value; } }); return { rootRef, wrapperRef, fieldRef, state, scopedAttrsState, selectionRef, fixDisabledColor, valueCompute, lineRef, onResize: onResize2, onChange: onChange2, onKeyDownEnter, onKeyUpEnter }; } const _t0$b = Vue.template("