@dimina-kit/devtools 0.4.0-dev.20260711141929 → 0.4.0-dev.20260716163758
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main/app/app.js +39 -10
- package/dist/main/app/native-overview.d.ts +1 -1
- package/dist/main/index.bundle.js +189 -172
- package/dist/main/services/simulator-appdata/index.js +1 -1
- package/dist/main/services/views/native-simulator-view.d.ts +6 -0
- package/dist/main/services/views/native-simulator-view.js +16 -0
- package/dist/main/services/views/refresh-styles.d.ts +10 -0
- package/dist/main/services/views/refresh-styles.js +57 -0
- package/dist/main/services/views/view-manager.d.ts +26 -1
- package/dist/main/services/views/view-manager.js +7 -0
- package/dist/main/services/views/workbench-view.d.ts +2 -0
- package/dist/main/services/views/workbench-view.js +87 -7
- package/dist/main/services/workspace/open-project-guards.d.ts +16 -0
- package/dist/main/services/workspace/open-project-guards.js +42 -0
- package/dist/main/services/workspace/rebuild-status.d.ts +24 -0
- package/dist/main/services/workspace/rebuild-status.js +20 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.d.ts +2 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.js +4 -0
- package/dist/main/services/workspace/workspace-service.js +21 -36
- package/dist/native-host/common/common.js +1 -1
- package/dist/native-host/render/render.js +49 -34
- package/dist/native-host/service/service.js +2 -2
- package/dist/preload/instrumentation/app-data.d.ts +2 -2
- package/dist/preload/instrumentation/app-data.js +1 -1
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +1 -1
- package/dist/preload/windows/main.cjs +96 -0
- package/dist/preload/windows/main.cjs.map +2 -2
- package/dist/preload/windows/simulator.cjs +162 -140
- package/dist/preload/windows/simulator.cjs.map +3 -3
- package/dist/preload/windows/simulator.js +162 -140
- package/dist/render-host/render-inspect.js +15 -47
- package/dist/renderer/assets/index-DQnIsRhp.js +49 -0
- package/dist/renderer/assets/{input-COtRON-n.js → input-7P0WbXyg.js} +2 -2
- package/dist/renderer/assets/ipc-transport-BGtDnv6p.css +1 -0
- package/dist/renderer/assets/{ipc-transport-SuI2rOB_.js → ipc-transport-DTEmLpxx.js} +2 -2
- package/dist/renderer/assets/popover-DsOcyIS6.js +2 -0
- package/dist/renderer/assets/{select-Bwb8O0Mf.js → select-Bzbhbg9Z.js} +2 -2
- package/dist/renderer/assets/{settings-BispnvJU.js → settings-CR1TyBWu.js} +2 -2
- package/dist/renderer/assets/{settings-api-HIBz8BFz.js → settings-api-B1wVFAPB.js} +2 -2
- package/dist/renderer/assets/workbenchSettings-CFbToT4Q.js +8 -0
- package/dist/renderer/entries/main/index.html +6 -6
- package/dist/renderer/entries/popover/index.html +5 -5
- package/dist/renderer/entries/settings/index.html +5 -5
- package/dist/renderer/entries/workbench-settings/index.html +4 -4
- package/dist/shared/ipc-channels.d.ts +1 -0
- package/dist/shared/ipc-channels.js +7 -0
- package/dist/simulator/assets/device-shell-C-HZY3bL.css +1 -0
- package/dist/simulator/assets/device-shell-Cu1ZPLfe.js +2 -0
- package/dist/simulator/assets/{simulator-A1vGZVBM.js → simulator-Cy8c-eA2.js} +5 -5
- package/dist/simulator/simulator.html +1 -1
- package/package.json +7 -7
- package/dist/renderer/assets/index-WbvXdhWQ.js +0 -49
- package/dist/renderer/assets/ipc-transport-CNvORIEX.css +0 -1
- package/dist/renderer/assets/popover-B73T3z-m.js +0 -2
- package/dist/renderer/assets/workbenchSettings-CtRBr7gS.js +0 -8
- package/dist/shared/appdata-accumulator.d.ts +0 -95
- package/dist/shared/appdata-accumulator.js +0 -218
- package/dist/simulator/assets/device-shell-C-wcFq3Z.js +0 -2
- package/dist/simulator/assets/device-shell-CS1rqAQz.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var service=(function(){var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function n(e){return typeof e==`function`}function r(e){return typeof e==`string`}function i(e){return e==null}function a(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length
|
|
1
|
+
var service=(function(){var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function n(e){return typeof e==`function`}function r(e){return typeof e==`string`}function i(e){return e==null}function a(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>a(e[n],t[n]))}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){return e===`__proto__`}function c(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function l(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return/^(?:0|[1-9]\d*)$/.test(e)}}function u(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function d(e){return typeof e==`symbol`||Object.prototype.toString.call(e)===`[object Symbol]`}function f(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function p(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function m(e){if(Array.isArray(e))return e.map(p);if(typeof e==`symbol`)return[e];e=h(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&(t.push(``),r++);r<n;){let s=e[r];a?s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s:o?s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s:s===`[`?(o=!0,i&&=(t.push(i),``)):s===`.`?i&&=(t.push(i),``):i+=s,r++}return i&&t.push(i),t}function h(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(h).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function ee(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||d(e)?!0:typeof e==`string`&&(/^\w*$/.test(e)||!/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/.test(e))||t!=null&&o(t,e)}function te(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||s(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function g(e,t){if(e!=null)switch(typeof t){case`string`:{if(s(t))return;let n=e[t];return n===void 0?c(t)?g(e,m(t)):void 0:n}case`number`:case`symbol`:{typeof t==`number`&&(t=p(t));let n=e[t];return n===void 0?void 0:n}default:{if(Array.isArray(t))return te(e,t);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),s(t))return;let n=e[t];return n===void 0?void 0:n}}}function ne(e,t,n){re(e,t,()=>n,()=>void 0)}function re(e,t,n,r){if(e==null&&!u(e))return e;let i;i=ee(t,e)?[t]:Array.isArray(t)?t:m(t);let a=n(g(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=p(i[t]);if(s(n))continue;let c;if(t===i.length-1)c=a;else{let a=o[n],s=r?.(a,n,e);c=s===void 0?u(a)?a:l(i[t+1])?[]:{}:s}ie(o,n,c),o=o[n]}return e}function ie(e,t,n){let r=e[t];(!(o(e,t)&&f(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function _(){return Math.random().toString(36).slice(2,7)}function ae(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function oe(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}var v=typeof window<`u`&&typeof navigator<`u`;v&&/Android/i.test(navigator.userAgent),v&&/iPad|iPhone|iPod/.test(navigator.userAgent),v&&/OpenHarmony|harmony/.test(navigator.userAgent),v&&/Android|iPad|iPhone|iPod|OpenHarmony|harmony|Mobile/.test(navigator.userAgent);var y=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function se(e,t){if(t.startsWith(`/`))return t.slice(1);let n=e.split(`/`),r=t.split(`/`);for(let e of r){let t=e;t===`..`?n.length>0&&n.pop():t!==`.`&&t!==``&&n.push(t)}return n.join(`/`)}function b(e,t){let n=e.split(`/`).slice(0,-1).join(`/`),r=t.split(`?`),i=r[0],a=r[1],o=se(n,i);return a&&(o+=`?${a}`),o}function x(e){return typeof e==`number`&&Number.isFinite(e)&&!Number.isNaN(e)?`${e}px`:e}function ce(e){if(typeof e!=`object`||!e)return e;let t=new WeakMap;function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e)){if(t.has(e))return t.get(e);let r=[];return t.set(e,r),r.push(...e.map(n)),r}if(t.has(e))return t.get(e);let r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.assign(r,...Object.keys(e).map(t=>({[t]:n(e[t])})))}return n(e)}var le={},ue=1,de=2;function fe(e,t){le[e]||(le[e]={factory:t,status:ue,exports:void 0})}function S(e,t,r){if(typeof e!=`string`)throw TypeError(`require args must be a string`);let i=le[e];if(!i)throw Error(`module ${e} not found`);if(i.status===ue){i.status=de;let t={exports:{}},a;try{i.factory&&(a=i.factory.call(null,S,t,t.exports))}catch(t){i.status=ue;let a=`
|
|
2
2
|
name: ${t.name}
|
|
3
3
|
msg: ${t.message}
|
|
4
4
|
stack:
|
|
5
5
|
${t.stack}
|
|
6
|
-
`;console.error(`require ${e} error: ${a}`),n(r)&&r({mod:e,errMsg:t.message})}i.exports=t.exports===void 0?a:t.exports}return n(t)&&t(i.exports),i.exports}S.async=async e=>new Promise((t,n)=>{try{t(S(e))}catch(t){n(Error(`${t.message}: Failed to initialize asynchronous loading for module '${e}'`))}});var C=new class{constructor(){this.callbacks={}}store(e,t,n=_()){if(t){for(let[t,n]of Object.entries(this.callbacks))if(n.callback===e)return t}return this.callbacks[n]={callback:e,keep:t},n}invoke(e,t){if(e===void 0)return;let r=this.callbacks[e];r&&n(r.callback)&&(r.callback(t),r.keep||delete this.callbacks[e])}remove(e){e?Object.keys(this.callbacks).forEach(t=>{e===t&&delete this.callbacks[t]}):Object.entries(this.callbacks).forEach(([e,t])=>{t.keep&&delete this.callbacks[e]})}},w=new class{constructor(){this.reset()}reset(){this.active=!1,this.snapshot={systemInfo:null,menuRect:null}}init(e={}){this.active=!0,this.snapshot={...this.snapshot,...e}}update(e={}){this.snapshot={...this.snapshot,...e}}get(e){return this.active?this.snapshot[e]??null:null}getSystemInfo(){return this.get(`systemInfo`)}getMenuRect(){return this.get(`menuRect`)}};function pe(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var T=new class e{constructor(){this.event=pe(),this.init()}init(){y?globalThis.onmessage=e=>{this.handleMsg(e.data)}:DiminaServiceBridge.onMessage=this.handleMsg.bind(this)}handleMsg(e){console.log(`[service] receive msg: `,y?e:JSON.stringify(e));let{type:t,body:n}=e;this.event.emit(t,n)}on(e,t){this.event.on(e,t)}off(e){this.event.off(e)}send(t){return y?e.prototype.send=function(e){e.method=`publish`,globalThis.postMessage(e)}:e.prototype.send=function(e){return DiminaServiceBridge.publish(e.body.bridgeId||``,e)},this.send(t)}invoke(t){return y?e.prototype.invoke=function(e){e.method=`invoke`,globalThis.postMessage(e)}:e.prototype.invoke=function(e){return DiminaServiceBridge.invoke(e)},this.invoke(t)}},E=new class{#e=[];#t=``;setInitId(e){this.#t=e}push(e,t){this.stack(t).push(e)}pop(){this.stack().length>0&&this.stack().pop()}getPageInfo(){let e=this.stack();return e[e.length-1]||{id:this.#t}}pushStack(e){let t={id:e,pages:[]};return this.#e.push(t),t}popStack(e){if(e){let t=this.#e.findIndex(t=>t.id===e);t!==-1&&this.#e.splice(t,1)}else this.#e.length>0&&this.#e.pop()}stack(e){if(e){let t=this.#e.find(t=>t.id===e);return t||=this.pushStack(e),t.pages}else{let e=this.#e[this.#e.length-1];return e?e.pages:this.pushStack(Date.now()).pages}}};function D(e,t){if(!e)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}var me={getWindowInfo:()=>D(w.getSystemInfo(),[`pixelRatio`,`screenWidth`,`screenHeight`,`windowWidth`,`windowHeight`,`statusBarHeight`,`safeArea`,`screenTop`]),getSystemInfoSync:()=>w.getSystemInfo(),getAppBaseInfo:()=>D(w.getSystemInfo(),[`SDKVersion`,`enableDebug`,`host`,`language`,`version`,`theme`,`fontSizeScaleFactor`,`fontSizeSetting`]),getDeviceInfo:()=>D(w.getSystemInfo(),[`abi`,`benchmarkLevel`,`brand`,`model`,`platform`,`system`]),getMenuButtonBoundingClientRect:()=>w.getMenuRect()},he=new Set([`connectSocket`,`downloadFile`,`loadSubpackage`,`preDownloadSubpackage`,`request`,`uploadFile`]),ge=new Set(`FileSystemManager.getSavedFileList,clearStorage,chooseImage,chooseMedia,chooseVideo,closeBluetoothAdapter,getClipboardData,getBluetoothAdapterState,getBluetoothDevices,getLocation,getNetworkType,getPrivacySetting,getStorageInfo,getSystemInfo,getSystemInfoAsync,getUserInfo,hideKeyboard,hideLoading,hideShareMenu,hideTabBar,hideToast,login,navigateBack,openAppAuthorizeSetting,openBluetoothAdapter,openSetting,openSystemBluetoothSetting,showNavigationBarLoading,showShareMenu,showTabBar,startPullDownRefresh,startRecord,stopPullDownRefresh,stopBluetoothDevicesDiscovery,stopLocationUpdate,stopRecord,vibrateLong,vibrateShort`.split(`,`));function _e(e){return Object.prototype.hasOwnProperty.call(e,`success`)||Object.prototype.hasOwnProperty.call(e,`fail`)||Object.prototype.hasOwnProperty.call(e,`complete`)}function ve(e,t){return he.has(e)||typeof e==`string`&&e.endsWith(`Sync`)?!1:t===void 0?ge.has(e):!0}function ye(e,t,n){let r={type:`invokeAPI`,target:n,body:{name:e,bridgeId:E.getPageInfo().id,params:t}};return n===`container`?T.invoke(r):T.send(r)}function be(e,t,n){return new Promise((r,i)=>{let a,o,s=()=>{C.remove(a),C.remove(o)};a=C.store(e=>{s(),r(e)}),o=C.store(e=>{s(),i(e)}),t.success=a,t.fail=o;try{ye(e,t,n)}catch(e){s(),i(e)}})}function O(e,t,r=`container`){let i=me[e];if(r===`container`&&i){let e=i();if(e)return e}let a;if(t===void 0){if(ve(e,t))return be(e,{},r);a=t}else if(typeof t==`string`||Array.isArray(t))a=t;else if(n(t))a={success:C.store(t,!0)};else if(_e(t)){let{success:e,fail:r,complete:i,keep:o,evtId:s,...c}=t;a=c,n(e)?a.success=C.store(e,o,s):a.success=e,n(r)&&(a.fail=C.store(r,o,s)),n(i)&&(a.complete=C.store(i,o,s))}else{let{keep:n,...i}=t;if(delete i.evtId,!n&&ve(e,t))return a={...i},be(e,a,r);a=i}return ye(e,a,r)}var xe=t({navigateBack:()=>Ee,navigateTo:()=>Te,reLaunch:()=>Ce,redirectTo:()=>we,switchTab:()=>Se});function Se(e){return e.url=b(E.getPageInfo().route,e.url),O(`switchTab`,e)}function Ce(e){return e.url=b(E.getPageInfo().route,e.url),O(`reLaunch`,e)}function we(e){let t=b(E.getPageInfo().route,e.url);if(E.getPageInfo().route!==t)return e.url=t,O(`redirectTo`,e)}function Te(e){return e.url=b(E.getPageInfo().route,e.url),O(`navigateTo`,e)}function Ee(e){return O(`navigateBack`,e)}var De=t({offAppHide:()=>Ne,offAppShow:()=>Me,offError:()=>ke,onAppHide:()=>je,onAppRoute:()=>Ie,onAppShow:()=>Ae,onError:()=>Oe,onPageNotFound:()=>Fe,onUnhandledRejection:()=>Pe});function Oe(e){return O(`onError`,e)}function ke(e){return O(`offError`,e)}function Ae(e){return O(`onAppShow`,e)}function je(e){return O(`onAppHide`,e)}function Me(e){return O(`offAppShow`,e)}function Ne(e){return O(`offAppHide`,e)}function Pe(){}function Fe(){}function Ie(){}var Le=t({USER_DATA_PATH:()=>Re,fileSystemManagerAPINames:()=>Ve,getFileSystemManager:()=>Ue}),Re=`difile://`,ze=`not supported by the dimina runtime`;function k(e){throw Error(`FileSystemManager.${e} ${ze}`)}function A(e,t={}){let{fail:n,complete:r}=t;n?.({errMsg:`${e}:fail ${ze}`}),r?.()}var Be=class{access(e){A(`access`,e)}accessSync(){k(`accessSync`)}stat(e){A(`stat`,e)}statSync(){k(`statSync`)}readFile(e){A(`readFile`,e)}readFileSync(){k(`readFileSync`)}writeFile(e){A(`writeFile`,e)}writeFileSync(){k(`writeFileSync`)}appendFile(e){A(`appendFile`,e)}appendFileSync(){k(`appendFileSync`)}copyFile(e){A(`copyFile`,e)}copyFileSync(){k(`copyFileSync`)}rename(e){A(`rename`,e)}renameSync(){k(`renameSync`)}unlink(e){A(`unlink`,e)}unlinkSync(){k(`unlinkSync`)}mkdir(e){A(`mkdir`,e)}mkdirSync(){k(`mkdirSync`)}rmdir(e){A(`rmdir`,e)}rmdirSync(){k(`rmdirSync`)}readdir(e){A(`readdir`,e)}readdirSync(){k(`readdirSync`)}getFileInfo(e){A(`getFileInfo`,e)}saveFile(e){A(`saveFile`,e)}saveFileSync(){k(`saveFileSync`)}getSavedFileList(e){A(`getSavedFileList`,e)}removeSavedFile(e){A(`removeSavedFile`,e)}truncate(e){A(`truncate`,e)}truncateSync(){k(`truncateSync`)}unzip(e){A(`unzip`,e)}open(e){A(`open`,e)}openSync(){k(`openSync`)}close(e){A(`close`,e)}closeSync(){k(`closeSync`)}read(e){A(`read`,e)}readSync(){k(`readSync`)}write(e){A(`write`,e)}writeSync(){k(`writeSync`)}fstat(e){A(`fstat`,e)}fstatSync(){k(`fstatSync`)}ftruncate(e){A(`ftruncate`,e)}ftruncateSync(){k(`ftruncateSync`)}readCompressedFile(e){A(`readCompressedFile`,e)}readCompressedFileSync(){k(`readCompressedFileSync`)}readZipEntry(e){A(`readZipEntry`,e)}},Ve=Object.getOwnPropertyNames(Be.prototype).filter(e=>e!==`constructor`),He;function Ue(){return He||=new Be,He}var We=[`applyUpdate`,`onCheckForUpdate`,`onUpdateFailed`,`onUpdateReady`],Ge=t({canIUse:()=>Je,env:()=>Ke}),Ke={USER_DATA_PATH:`difile://usr`},qe=new Set([`nextTick`,`getUpdateManager`,`UpdateManager`,...We.map(e=>`UpdateManager.${e}`),`getPerformance`,`getFileSystemManager`,`FileSystemManager`,...Ve.map(e=>`FileSystemManager.${e}`)]);function Je(e){if(qe.has(e))return!0;try{return O(`canIUse`,e)}catch(t){return console.warn(`[canIUse] check ${e} error:`,t),!1}}var Ye=t({getPerformance:()=>Xe});function Xe(){return Ze.getInstance()}var Ze=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one Performance instance.`);this.entryList=new Qe,e.#e=this}static getInstance(){return e.#e||=new e,e.#e}createObserver(e){let t=new $e(e);return e&&O(`addPerformanceObserver`,{success:C.store(e=>{let n=e?.data?.entryList&&JSON.parse(e?.data?.entryList)||[];n&&(this.entryList.push(n),t.notify(n))},!0)},`render`),t}getEntries(){return this.entryList.getEntries()}getEntriesByName(e,t){return this.entryList.getEntriesByName(e,t)}getEntriesByType(e){return this.entryList.getEntriesByType(e)}setBufferSize(e){this.entryList.maxEntrySize=e}},Qe=class{constructor(){this._list=[],this.maxEntrySize=30}push(e){for(let t of e)this._list.length>=this.maxEntrySize&&this._list.shift(),this._list.push(t)}getEntriesByName(e,t){return this._entryFilter(e,t)}getEntriesByType(e){return this._entryFilter(null,e)}_entryFilter(e,t){return this._list.filter(n=>!(e&&e!==n.name||t&&t!==n.entryType))}getEntries(){return this._list}},$e=class{constructor(e){this.entryTypes=[],this.callback=e}observe(e){this.connected=!0,this.entryTypes=e.entryTypes}notify(e){if(this.connected){let t=new Qe;t.push(e.filter(e=>{let t=!1;return this.entryTypes&&this.entryTypes.length>0&&this.entryTypes.forEach(n=>{e.entryType===n&&(t=!0)}),t})),this.callback(t)}}disconnect(){this.connected=!1}},et=t({loadSubpackage:()=>nt,preDownloadSubpackage:()=>tt});function tt(e){return O(`preDownloadSubpackage`,e)}function nt(e){return O(`loadSubpackage`,e)}var rt=t({getAppBaseInfo:()=>ut,getDeviceInfo:()=>dt,getSystemInfo:()=>st,getSystemInfoAsync:()=>lt,getSystemInfoSync:()=>ct,getWindowInfo:()=>at,openAppAuthorizeSetting:()=>ot,openSystemBluetoothSetting:()=>it});function it(e){return O(`openSystemBluetoothSetting`,e)}function at(e){return O(`getWindowInfo`,e)}function ot(e){return O(`openAppAuthorizeSetting`,e)}function st(e){return new Promise(t=>{t(O(`getSystemInfo`,e))})}function ct(){return O(`getSystemInfoSync`)}function lt(e){return O(`getSystemInfoAsync`,e)}function ut(){return O(`getAppBaseInfo`)}function dt(){return O(`getDeviceInfo`)}var ft=t({getUpdateManager:()=>vt}),pt=`onUpdateStatusChange`,mt=`updatefail`,ht=`updateready`,gt=`noupdate`,_t=`updating`;function vt(){return yt.getInstance()}var yt=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one UpdateManager instance.`);this.hasAppliedUpdate=!1,this.updateFailed=!1,this.updateReady=!1,this.checkForUpdateResult=null,this.updateFailedListeners=[],this.updateReadyListeners=[],this.checkForUpdateListeners=[],T.on(pt,e=>this.handleUpdateStatusChange(e)),e.#e=this}handleUpdateStatusChange(e={}){let{event:t}=e;if(t===mt){this.updateFailed=!0,this.emit(this.updateFailedListeners);return}if(t===ht){this.updateReady=!0,this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult),this.emit(this.updateReadyListeners);return}if(t===_t){this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}if(t===gt){this.checkForUpdateResult={hasUpdate:!1},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}typeof e.hasUpdate==`boolean`&&(this.checkForUpdateResult={hasUpdate:e.hasUpdate},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult))}emit(e,...t){e.slice().forEach(e=>{e(...t)})}static getInstance(){return e.#e||=new e,e.#e}applyUpdate(){if(!this.updateReady)console.error(`[applyUpdate]: update is not ready`);else if(this.hasAppliedUpdate)console.error(`[applyUpdate]: applyUpdate has been called`);else return this.hasAppliedUpdate=!0,O(`applyUpdate`)}onCheckForUpdate(e){typeof e==`function`&&(this.checkForUpdateListeners.push(e),this.checkForUpdateResult&&e(this.checkForUpdateResult))}onUpdateFailed(e){typeof e==`function`&&(this.updateFailedListeners.push(e),this.updateFailed&&e())}onUpdateReady(e){typeof e==`function`&&(this.updateReadyListeners.push(e),this.updateReady&&e())}};yt.getInstance();var bt=t({createCameraContext:()=>xt});function xt(){return new St}var St=class{constructor(){this.bridgeId=E.getPageInfo().id}takePhoto(e){return O(`takePhoto`,e)}startRecord(){return O(`startRecord`)}stopRecord(){return O(`stopRecord`)}},Ct=t({reportAnalytics:()=>wt,reportEvent:()=>Tt});function wt(...e){return O(`reportAnalytics`,e)}function Tt(e,t){return O(`reportAnalytics`,{eventId:e,data:t})}var Et=t({closeBluetoothAdapter:()=>Lt,getBluetoothAdapterState:()=>It,getBluetoothDevices:()=>Ft,getConnectedBluetoothDevices:()=>Pt,offBluetoothAdapterStateChange:()=>Nt,offBluetoothDeviceFound:()=>Mt,onBluetoothAdapterStateChange:()=>jt,onBluetoothDeviceFound:()=>At,openBluetoothAdapter:()=>kt,startBluetoothDevicesDiscovery:()=>Ot,stopBluetoothDevicesDiscovery:()=>Dt});function Dt(e){return O(`stopBluetoothDevicesDiscovery`,e)}function Ot(e){return O(`startBluetoothDevicesDiscovery`,e)}function kt(e){return O(`openBluetoothAdapter`,e)}function At(e){return O(`onBluetoothDeviceFound`,e)}function jt(e){return O(`onBluetoothAdapterStateChange`,e)}function Mt(){return O(`offBluetoothDeviceFound`)}function Nt(){return O(`offBluetoothAdapterStateChange`)}function Pt(e){return O(`getConnectedBluetoothDevices`,e)}function Ft(e){return O(`getBluetoothDevices`,e)}function It(e){return O(`getBluetoothAdapterState`,e)}function Lt(e){return O(`closeBluetoothAdapter`,e)}var Rt=t({closeBLEConnection:()=>Zt,createBLEConnection:()=>Xt,getBLEDeviceCharacteristics:()=>Yt,getBLEDeviceRSSI:()=>Jt,getBLEDeviceServices:()=>qt,notifyBLECharacteristicValueChange:()=>Kt,offBLECharacteristicValueChange:()=>Gt,offBLEConnectionStateChange:()=>Wt,onBLECharacteristicValueChange:()=>Ut,onBLEConnectionStateChange:()=>Ht,readBLECharacteristicValue:()=>Vt,setBLEMTU:()=>Bt,writeBLECharacteristicValue:()=>zt});function zt(e){return O(`writeBLECharacteristicValue`,e)}function Bt(e){return O(`setBLEMTU`,e)}function Vt(e){return O(`readBLECharacteristicValue`,e)}function Ht(e){return O(`onBLEConnectionStateChange`,e)}function Ut(e){return O(`onBLECharacteristicValueChange`,e)}function Wt(e){return O(`offBLEConnectionStateChange`,e)}function Gt(){return O(`offBLECharacteristicValueChange`)}function Kt(e){return O(`notifyBLECharacteristicValueChange`,e)}function qt(e){return O(`getBLEDeviceServices`,e)}function Jt(e){return O(`getBLEDeviceRSSI`,e)}function Yt(e){return O(`getBLEDeviceCharacteristics`,e)}function Xt(e){return O(`createBLEConnection`,e)}function Zt(e){return O(`closeBLEConnection`,e)}var Qt=t({getClipboardData:()=>en,setClipboardData:()=>$t});function $t(e){return O(`setClipboardData`,e)}function en(e){return O(`getClipboardData`,e)}var tn=t({addPhoneContact:()=>rn,chooseContact:()=>nn});function nn(e){return O(`chooseContact`,e)}function rn(e){return O(`addPhoneContact`,e)}var an=t({hideKeyboard:()=>on});function on(e){return O(`hideKeyboard`,e)}var sn=t({offMemoryWarning:()=>ln,onMemoryWarning:()=>cn});function cn(e){return O(`onMemoryWarning`,e)}function ln(e){return O(`offMemoryWarning`,e)}var un=t({getNetworkType:()=>dn});function dn(e){return O(`getNetworkType`,e)}var fn=t({makePhoneCall:()=>pn});function pn(e){return O(`makePhoneCall`,e)}var mn=t({scanCode:()=>hn});function hn(e){return O(`scanCode`,e)}var gn=t({vibrateLong:()=>vn,vibrateShort:()=>_n});function _n(e){return O(`vibrateShort`,e)}function vn(e){return O(`vibrateLong`,e)}var yn=t({extBridge:()=>bn,extOffBridge:()=>Sn,extOnBridge:()=>xn,offLoginStatusChanged:()=>wn,onLoginStatusChanged:()=>Cn});function bn({event:e,module:t,data:r={},success:i,fail:a,complete:o},s){let c,l,u;return n(s)?(c=s,l=s):(c=i,l=a,u=o),O(e,{module:t,data:r,keep:r.isSustain??!0,success:c,fail:l,complete:u})}function xn({event:e,module:t,callBack:n,isSustain:r=!0}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOnBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOnBridge 参数 event 为空`);return}if(!n){console.error(`[ERROR]: extOnBridge 参数 callBack 为空`);return}let i=`${t}_${e}`;O(i,{evtId:i,keep:r,success:n})}function Sn({event:e,module:t,callBack:n}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOffBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOffBridge 参数 event 为空`);return}O(`${t}_${e}`,{success:n})}function Cn(e){T.on(`notifyLoginStatusChanged`,t=>{e?.(t)})}function wn(){T.off(`notifyLoginStatusChanged`)}var Tn=[`onLaunch`,`onShow`,`onHide`],En=[`globalData`],Dn=class{constructor(e,t){this.appModule=e,this.options=t,this.init()}init(){this.initGlobalData(),this.initLifecycle(),this.initCustomMethods(),this.invokeSomeLifecycle()}initGlobalData(){this.globalData=this.appModule.moduleInfo.globalData}initLifecycle(){Tn.forEach(e=>{let t=this.appModule.moduleInfo[e];n(t)&&(this[e]=t.bind(this))})}initCustomMethods(){let e=this.appModule.moduleInfo;for(let t in e)Tn.includes(t)||En.includes(t)||(n(e[t])?this[t]=e[t].bind(this):this[t]=e[t])}invokeSomeLifecycle(){this.onLaunch?.(this.options),this.onShow?.(this.options)}appShow(){this.onShow?.(this.options)}appHide(){this.onHide?.()}},On=new Set([`2d`]),kn=new Set([`webgl`,`experimental-webgl`,`webgl2`]),An=new Set([`createLinearGradient`,`createPattern`,`createRadialGradient`]),jn=new Set([`createBuffer`,`createFramebuffer`,`createProgram`,`createRenderbuffer`,`createShader`,`createTexture`]),Mn=new Set([`getAttribLocation`,`getUniformLocation`]),j={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,FALSE:0,TRUE:1,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPILE_STATUS:35713},Nn=1,Pn=1;function M(){let e=E.getPageInfo();return e?.bridgeId||e?.id||``}function N(e,t,n){T.send({type:`invokeAPI`,target:`render`,body:{bridgeId:e,name:t,params:n}})}function Fn(e){Promise.resolve().then(e)}function In(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ln(e){return typeof ArrayBuffer>`u`||!ArrayBuffer.isView(e)?null:e instanceof DataView?{__canvasTypedArray:`DataView`,data:Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}:{__canvasTypedArray:e.constructor.name,data:Array.from(e)}}function P(e){if(e==null)return e;if(e.__canvasResourceId)return{__canvasResourceId:e.__canvasResourceId};if(e.__diminaCanvasNode)return{__canvasNodeId:e.nodeId};let t=Ln(e);if(t)return t;if(typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer)return{__canvasArrayBuffer:!0,data:Array.from(new Uint8Array(e))};if(Array.isArray(e))return e.map(e=>P(e));if(In(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=P(r);return t}return e}function F(e){return Array.from(e).map(e=>P(e))}function I(e=`canvas_resource`){return`${e}_${_()}`}var Rn=class{constructor(e,t){return this.__canvasResourceId=t,this.__canvasProxyValue=Nn++,this.canvas=e,new Proxy(this,{get(e,n){if(n in e)return e[n];if(typeof n!=`symbol`)return(...r)=>{e.canvas.enqueueOperation({op:`resourceCall`,resourceId:t,method:n,args:F(r)})}}})}valueOf(){return this.__canvasProxyValue}toString(){return String(this.__canvasProxyValue)}},zn=class{constructor(e,t){this.__canvasResourceId=t,this.canvas=e,this.imageId=t,this.onload=null,this.onerror=null,this.width=0,this.height=0,this._src=``,this.canvas.enqueueOperation({op:`createImage`,imageId:t})}get src(){return this._src}set src(e){this._src=e;let t=C.store((e={})=>{this.width=e.width||this.width,this.height=e.height||this.height,n(this.onload)&&this.onload(e)}),r=C.store((e={})=>{n(this.onerror)&&this.onerror(e)});this.canvas.enqueueOperation({op:`imageSetSrc`,imageId:this.imageId,src:e,onload:t,onerror:r})}},Bn=class{constructor(e,t){return this.canvas=e,this.contextId=t,this.state={fillStyle:`#000000`,strokeStyle:`#000000`,font:`10px sans-serif`,globalAlpha:1,lineWidth:1},new Proxy(this,{get(e,t){if(t in e)return e[t];if(t in e.state)return e.state[t];if(typeof t!=`symbol`)return(...n)=>e.call(t,n)},set(e,n,r){return e.state[n]=r,e.canvas.enqueueOperation({op:`contextSetProperty`,contextId:t,prop:n,value:P(r)}),!0}})}async getImageData(e,t,n,r){return await this.canvas.getImageData({contextId:this.contextId,x:e,y:t,width:n,height:r})}toDataURL(e,t){return this.canvas.toDataURL(e,t)}call(e,t){if(e===`measureText`)return{width:String(t[0]??``).length*10};if(e===`createImageData`){let e=t[0],n=t[1];return{width:e,height:n,data:new Uint8ClampedArray(e*n*4)}}let n=An.has(e)?I():void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:F(t),resultId:n}),n)return new Rn(this.canvas,n)}},Vn=class{constructor(e,t,n){return this.canvas=e,this.contextId=t,this.contextType=n,new Proxy(this,{get(e,t){if(t in e)return e[t];if(Object.prototype.hasOwnProperty.call(j,t))return j[t];if(t===`drawingBufferWidth`)return e.canvas.width;if(t===`drawingBufferHeight`)return e.canvas.height;if(typeof t!=`symbol`)return(...n)=>e.call(t,n)}})}call(e,t){switch(e){case`getParameter`:return this.getParameter(t[0]);case`getShaderParameter`:case`getProgramParameter`:return!0;case`getShaderInfoLog`:case`getProgramInfoLog`:return``;case`getError`:return j.NO_ERROR;case`isContextLost`:return!1;case`checkFramebufferStatus`:return j.FRAMEBUFFER_COMPLETE;case`getContextAttributes`:return{};case`getSupportedExtensions`:return[];case`getExtension`:return null;default:break}let n=jn.has(e)||Mn.has(e)?I(`webgl_resource`):void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:F(t),resultId:n}),n)return new Rn(this.canvas,n)}getParameter(e){let{width:t,height:n}=this.canvas;switch(e){case j.VERSION:return`WebGL 1.0`;case j.SHADING_LANGUAGE_VERSION:return`WebGL GLSL ES 1.0`;case j.VENDOR:return`Dimina`;case j.RENDERER:return`Dimina WebGL Proxy`;case j.VIEWPORT:return[0,0,t,n];case j.MAX_VIEWPORT_DIMS:return[t||4096,n||4096];case j.ALIASED_POINT_SIZE_RANGE:return[1,64];case j.ALIASED_LINE_WIDTH_RANGE:return[1,1];case j.COLOR_CLEAR_VALUE:return[0,0,0,0];case j.COLOR_WRITEMASK:case j.DEPTH_WRITEMASK:return!0;case j.COMPRESSED_TEXTURE_FORMATS:return[];case j.MAX_TEXTURE_SIZE:case j.MAX_CUBE_MAP_TEXTURE_SIZE:case j.MAX_RENDERBUFFER_SIZE:return 4096;case j.MAX_VERTEX_ATTRIBS:return 16;case j.MAX_TEXTURE_IMAGE_UNITS:case j.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case j.MAX_COMBINED_TEXTURE_IMAGE_UNITS:return 8;case j.MAX_VERTEX_UNIFORM_VECTORS:case j.MAX_FRAGMENT_UNIFORM_VECTORS:case j.MAX_VARYING_VECTORS:return 128;default:return 0}}},Hn=class{constructor({nodeId:e,bridgeId:t=M(),width:n=300,height:r=150,type:i=`2d`,offscreen:a=!1}){this.__diminaCanvasNode=!0,this.nodeId=e,this.bridgeId=t,this.type=i,this.offscreen=a,this.contexts=new Map,this.pendingOperations=[],this.flushScheduled=!1,this._width=n,this._height=r}get width(){return this._width}set width(e){this._width=e,this.enqueueOperation({op:`setCanvasProperty`,prop:`width`,value:e})}get height(){return this._height}set height(e){this._height=e,this.enqueueOperation({op:`setCanvasProperty`,prop:`height`,value:e})}getContext(e=`2d`,t){let n=String(e).toLowerCase();if(!On.has(n)&&!kn.has(n))return null;if(this.contexts.has(n))return this.contexts.get(n);let r=I(`canvas_context`);this.enqueueOperation({op:`getContext`,contextId:r,contextType:n,attributes:P(t)});let i=kn.has(n)?new Vn(this,r,n):new Bn(this,r);return this.contexts.set(n,i),i}createImage(){return new zn(this,I(`canvas_image`))}requestAnimationFrame(e){let t=Pn++,r=C.store(t=>{n(e)&&e(t)});return N(this.bridgeId,`canvasNodeRequestAnimationFrame`,{nodeId:this.nodeId,requestId:t,callback:r}),t}cancelAnimationFrame(e){N(this.bridgeId,`canvasNodeCancelAnimationFrame`,{nodeId:this.nodeId,requestId:e})}getImageData({contextId:e,x:t,y:n,width:r,height:i}){return new Promise((a,o)=>{let s=C.store(e=>{a(e)});this.enqueueOperation({op:`getImageData`,contextId:e,x:t,y:n,width:r,height:i,callback:s})})}toDataURL(e=`image/png`,t){return new Promise(n=>{let r=C.store(e=>{n(e)});this.enqueueOperation({op:`toDataURL`,mimeType:e,quality:t,callback:r})})}enqueueOperation(e){this.pendingOperations.push(e),!this.flushScheduled&&(this.flushScheduled=!0,Fn(()=>this.flushOperations()))}flushOperations(){if(this.flushScheduled=!1,this.pendingOperations.length===0)return;let e=this.pendingOperations;this.pendingOperations=[],N(this.bridgeId,`canvasNodeFlush`,{nodeId:this.nodeId,operations:e})}};function Un(e,t=M()){return!e||e.__diminaNodeType!==`dimina-canvas-node`?e:new Hn({nodeId:e.nodeId,bridgeId:t,width:e.width,height:e.height,type:e.type})}function Wn(e,t=M()){return Array.isArray(e)?e.map(e=>Wn(e,t)):!e||typeof e!=`object`?e:e.node?{...e,node:Un(e.node,t)}:e}function Gn(e={}){let t=Number(e.width)||300,n=Number(e.height)||150,r=e.type||`2d`,i=I(`offscreen_canvas`),a=M();return N(a,`createOffscreenCanvas`,{nodeId:i,width:t,height:n,type:r}),new Hn({nodeId:i,bridgeId:a,width:t,height:n,type:r,offscreen:!0})}var Kn=t({createSelectorQuery:()=>L});function L(){return new Xn}function qn(){return E.getPageInfo()}function Jn(){let e=qn();return e?.__id__||e?.id}function Yn(){let e=qn();return e?.bridgeId||e?.id}var Xn=class{constructor(){this.__componentId=Jn(),this.__taskQueue=[],this.__cbQueue=[]}in(e){return this.__componentId=e.__id__,this}select(e){return new R(this,this.__componentId,e,!0)}selectAll(e){return new R(this,this.__componentId,e,!1)}selectViewport(){return new R(this,Jn(),``,!0)}__push(e,t,n,r,i){this.__taskQueue.push({moduleId:t,selector:e,single:n,fields:r}),this.__cbQueue.push(i)}exec(e){let t=this,r=Yn();O(`selectorQuery`,{tasks:this.__taskQueue,success:i=>{let a=Wn(i,r)||[];a.forEach((e,r)=>{let i=t.__cbQueue[r];n(i)&&i.call(t,e)}),n(e)&&e.call(t,a)}},`render`)}},R=class{constructor(e,t,n,r){this.__selectorQuery=e,this.__moduleId=t,this.__selector=n,this.__single=r}fields(e,t){return this.__selectorQuery.__push(this.__selector,this.__moduleId,this.__single,e,t),this.__selectorQuery}boundingClientRect(e){return this.fields({id:!0,dataset:!0,rect:!0,size:!0},e)}context(e){return this.fields({context:!0},e)}node(e){return this.fields({node:!0},e)}scrollOffset(e){return this.fields({id:!0,dataset:!0,scrollOffset:!0},e)}},Zn=t({createIntersectionObserver:()=>Qn});function Qn(e,t={}){let{thresholds:n=[0],initialRatio:r=0,observeAll:i=!1}=t;return new $n(e,{thresholds:n,initialRatio:r,observeAll:i})}var $n=class{constructor(e,t){this._component=e,this._options=t,this._relativeInfo=[],this._observerId=null,this._disconnected=!1}relativeTo(e,t={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:e,margins:[`left`,`right`,`top`,`bottom`].map(e=>`${t[e]===void 0?0:t[e]}px`).join(` `)}),this}relativeToViewport(e={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:null,margins:[`left`,`right`,`top`,`bottom`].map(t=>`${e[t]===void 0?0:e[t]}px`).join(` `)}),this}observe(e,t){let n=this,r=C.store(e=>{n._disconnected||(n._observerId=e.observerId),e.info&&t.call(n,e.info)},!0);O(`addIntersectionObserver`,{moduleId:this._component.__id__,targetSelector:e,relativeInfo:this._relativeInfo,options:this._options,success:r},`render`)}disconnect(){O(`removeIntersectionObserver`,{observerId:this._observerId},`render`),this._disconnected=!0}},z=new Map;function B(e){return z.has(e)||z.set(e,{depth:0,scheduled:!1,updates:[],byModuleId:new Map,callbackIds:[]}),z.get(e)}function V(e,t){let r=(Array.isArray(t)?t:[t]).filter(n);if(r.length!==0)return C.store(()=>{r.forEach(t=>t.call(e))})}function er(e){let t=B(e);t.depth++}function tr(e){let t=B(e);t.depth>0&&t.depth--,t.depth===0&&nr(e)}function H(e,t,n,r){let i=B(e),a=i.byModuleId.get(t);if(a)Object.assign(a.data,n);else{let e={moduleId:t,data:{...n}};i.byModuleId.set(t,e),i.updates.push(e)}r&&i.callbackIds.push(r),i.depth===0&&!i.scheduled&&(i.scheduled=!0,Promise.resolve().then(()=>{i.scheduled=!1,i.depth===0&&nr(e)}))}function nr(e){let t=z.get(e);if(!t||t.updates.length===0)return;let n=t.updates,r=t.callbackIds;t.updates=[],t.byModuleId=new Map,t.callbackIds=[],t.scheduled=!1,T.send({type:`ub`,target:`render`,body:{bridgeId:e,updates:n,callbackIds:r}})}function rr(e){let t=e.__mpxProxy?.options?.computed;if(t)for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e.data,n)||(e.data[n]=null)}function U(e){return i(e)?e:Object.entries(e).reduce((e,[t,r])=>t.startsWith(`$`)?e:n(r)?(console.warn(`[service] 值不支持函数引用`,t),e):(Array.isArray(r)?e[t]=r.map(e=>typeof e==`object`&&e?e instanceof Date?e.getTime():U(e):e):r&&typeof r==`object`&&!Array.isArray(r)?r instanceof Date?e[t]=r.getTime():e[t]=U(r):e[t]=r,e),{})}function ir(e){if(e){let t={};for(let r in e){let i=e[r];t[r]=t[r]||{};let a=i&&typeof i==`object`&&Object.prototype.hasOwnProperty.call(i,`type`)?W(i.type):W(i),o=null;if(o=Array.isArray(a)?[...a]:[a],i&&i.optionalTypes){let e=W(i.optionalTypes);Array.isArray(e)?o=[...e]:o.push(e)}t[r].type=o,t[r].type.length>0&&(i&&n(i.value)?t[r].default=i.value():i&&(t[r].default=i.value))}return t}}var ar=new Map([[String,`s`],[Number,`n`],[Boolean,`b`],[Object,`o`],[Array,`a`],[Function,`f`]]);function W(e){return Array.isArray(e)?e.map(e=>W(e)):e===null||e===``?null:ar.get(e)||(console.warn(`[service] ignore unknown props type ${e}`),null)}function or(e,t,n,r,i){let a=new Set;for(let o of e)for(let e in t){if(a.has(e))continue;let s=e.split(`,`).map(e=>e.trim());if(s.includes(o)){a.add(e);let c=t[e],l=s.map(e=>g(n,e));s.length===1?c.call(r,...l,i[o]):c.call(r,...l);continue}if(e===`**`){a.add(e),t[e].call(r,n);continue}let c=e.split(`.`),l=o.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u&&c.length>1){a.add(e);let s=n;for(let e of c)e!==`**`&&(s=s?.[e]);e===o?t[e].call(r,s,i[o]):t[e].call(r,s)}}}function sr(e,t,n,r,i){for(let a in t){let o=t[a],s=a.split(`,`).map(e=>e.trim());if(s.includes(e)){let t=s.map(e=>g(n,e));s.length===1&&s[0]===e?o.call(r,...t,i):o.call(r,...t);continue}if(a===`**`){o.call(r,n);continue}let c=a.split(`.`),l=e.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u){let t=n;for(let e of c)e!==`**`&&(t=t[e]);a===e?o.call(r,t,i):o.call(r,t);continue}let d=a.match(/^(.+)\[(\d+)\]$/);if(d){let t=d[1],i=Number.parseInt(d[2],10);if(t===e.split(`[`)[0]&&n[t]&&n[t][i]!==void 0){o.call(r,n[t][i]);continue}}if(e.startsWith(a)){let e=a.split(`.`).reduce((e,t)=>e&&e[t],n);if(e!==void 0){o.call(r,e);continue}}}}function cr(e={},t=``){let n=t.trim();if(!n)return;let r=n.replace(/-/g,``).toLowerCase(),i=[n,ae(n),oe(n),r];for(let t of i)if(t&&e[t]!==void 0)return e[t]}function G(e,t,n){let r=e.__info__||{};if(r.behaviorObservers)for(let i in r.behaviorObservers){let a=r.behaviorObservers[i];if(!(!Array.isArray(a)||a.length===0))for(let r of t)a.forEach(t=>{sr(r,{[i]:t},e.data,e,n[r])})}}function lr(e,t,n){dr(e,t,n)}function ur(e,t,i){let a=[];for(let o of t){let t=e.__info__.properties?.[o]?.observer,s=e.data[o],c=i[o];r(t)?a.push(()=>e[t]?.(s,c)):n(t)&&a.push(()=>t.call(e,s,c))}return a}function dr(e,t,n){ur(e,t,n).reverse().forEach(e=>e())}function fr(e,t){if(!Array.isArray(t))return;let r=new WeakMap;function i(e,t){let n={...e};for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=n[e],a=t[e];r&&typeof r==`object`&&!Array.isArray(r)&&a&&typeof a==`object`&&!Array.isArray(a)?n[e]=i(r,a):n[e]=a}return n}function a(e,t){if(typeof t==`string`){o(e,t);return}if(!t||typeof t!=`object`||r.has(t))return;r.set(t,!0),Array.isArray(t.behaviors)&&t.behaviors.forEach(t=>a(e,t)),t.properties&&(e.properties={...t.properties,...e.properties}),t.data&&(e.data||={},e.data=i(t.data,e.data));let s=[`created`,`attached`,`ready`,`detached`];e.behaviorLifetimes=e.behaviorLifetimes||{};for(let r of s)n(t[r])&&(e.behaviorLifetimes[r]=e.behaviorLifetimes[r]||[],e.behaviorLifetimes[r].push(t[r]));if(t.observers){e.behaviorObservers=e.behaviorObservers||{};for(let n in t.observers)e.behaviorObservers[n]||(e.behaviorObservers[n]=[]),e.behaviorObservers[n].push(t.observers[n])}if(t.methods&&(e.methods={...t.methods,...e.methods}),t.relations&&(e.relations={...e.relations,...t.relations}),t.export&&(e.export=t.export),t.pageLifetimes){e.behaviorPageLifetimes=e.behaviorPageLifetimes||{};for(let r of[`show`,`hide`,`resize`,`routeDone`])n(t.pageLifetimes[r])&&(e.behaviorPageLifetimes[r]=e.behaviorPageLifetimes[r]||[],e.behaviorPageLifetimes[r].push(t.pageLifetimes[r]))}}function o(e,t){switch(t){case`wx://component-export`:break;case`wx://form-field`:break;case`wx://form-field-button`:break;default:console.warn(`[service] 未知的内置 behavior: ${t}`)}}t.forEach(t=>a(e,t))}function K(e,t,n){let r=e;for(;r&&r.__parentId__;){if(r.__parentId__===t)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}function q(e,t){if(!e||!t)return!1;if(e.startsWith(`#`)){let n=e.slice(1);return t.id===n}if(e.startsWith(`.`)){let n=e.slice(1);return t.__targetInfo__?.class&&t.__targetInfo__.class.split(` `).includes(n)}if(e.startsWith(`[`)&&e.endsWith(`]`)){let n=e.slice(1,-1).match(/^(\w+)(?:=["']?([^"']*)["']?)?$/);if(n){let[,e,r]=n,i=t.__targetInfo__?.dataset||{};return r===void 0?Object.prototype.hasOwnProperty.call(i,e):i[e]===r}return!1}return t.is?t.is.split(`/`).pop()===e||t.is===e:!1}function pr(e,t){if(!e||!Array.isArray(e.dependencies))return!1;for(let n of e.dependencies){if(n in t)return!0;for(let e of Object.keys(t))if(e.startsWith(n+`.`)||e.startsWith(n+`[`)||n.startsWith(e+`.`)||n.startsWith(e+`[`))return!0}return!1}function mr(e,t){if(!(!e||!e.expression)){if(e.isSimple)return g(t,e.expression);try{return Function(`data`,`with(data) { return ${e.expression} }`)(t)}catch(t){console.warn(`[service] 计算表达式失败:`,e.expression,t);return}}}function hr(e,t,n){let r=Object.values(t||{}),i=[];for(let t of r){if(!K(t,e.__id__,r)||t.__parentId__!==e.__id__)continue;let a=t.__info__?.properties||{},o={};for(let r in a){let i=e.__childPropsBindings__?.[t.__id__]?.[r];i&&pr(i,n)&&(o[r]=mr(i,e.data))}Object.keys(o).length>0&&(t.tO?.(o),t.__pendingSyncedProps__=t.__pendingSyncedProps__||{},Object.assign(t.__pendingSyncedProps__,o),i.push({child:t,data:o}))}return i}var gr=[`created`,`attached`,`ready`,`moved`,`detached`,`error`],_r=[`show`,`hide`,`resize`,`routeDone`],vr=class{constructor(e,t){this.initd=!1,this.opts=t,t.targetInfo&&(this.id=t.targetInfo.id,this.dataset=t.targetInfo.dataset,this.__targetInfo__=t.targetInfo),this.is=t.path,this.route=t.path,this.query=t.query,this.renderer=`webview`,this.bridgeId=t.bridgeId,this.id||=t.bridgeId,this.behaviors=e.behaviors,this.data=ce(e.noReferenceData),Object.defineProperty(this,"properties",{get(){return this.data},enumerable:!0,configurable:!1}),this.__isComponent__=e.isComponent,this.__type__=e.type,this.__id__=this.opts.moduleId,this.__info__=e.moduleInfo,this.__eventAttr__=t.eventAttr,this.__pageId__=t.pageId,this.__parentId__=t.parentId,this.__relations__=new Map,this.__relationPaths__=new Map,this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[],this.__pendingInitSetDataCallbacks__=[],this.__childPropsBindings__={},this.__pendingSyncedProps__={},this.__initialPropertyObserversInvoked__=!1}init(){if(this.__isComponent__)for(let e in this.__info__.properties)!Object.prototype.hasOwnProperty.call(this.opts.properties,e)||this.opts.properties[e]===void 0?this.data[e]=this.__info__.properties[e]?.value??null:this.data[e]=this.opts.properties[e];return this.#d(),this.#f(),this.#t(),this.#e(),this.#m().then(()=>{rr(this),T.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],H(this.bridgeId,this.__id__,{},V(this,e))}#e(){this.hasBehavior(`wx://component-export`)&&this.__info__.export&&n(this.__info__.export)&&(this.export=this.__info__.export.bind(this))}#t(){let e=this.__info__.relations;if(!(!e||typeof e!=`object`))for(let[t]of Object.entries(e)){let e=this.#n(t);this.__relationPaths__.set(t,e),this.__relations__.has(t)||this.__relations__.set(t,[])}}#n(e){if(e.startsWith(`./`)){let t=this.is.lastIndexOf(`/`);return t===-1?e.substring(2):`${this.is.substring(0,t)}/${e.substring(2)}`}else if(e.startsWith(`../`)){let t=this.is.split(`/`),n=e.split(`/`),r=t.slice(0,-1);for(let e of n)e===`..`?r.pop():e!==`.`&&r.push(e);return r.join(`/`)}else return e}#r(){let e=this.__info__.relations;if(!e)return;let t=Object.values(Z.instances[this.bridgeId]||{});for(let[n,r]of Object.entries(e)){let{type:e,target:i}=r,a=this.__relationPaths__.get(n),o=t.filter(e=>i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`)).filter(t=>this.#o(t,e)||this.#a(t,e));for(let e of o)this.#c(n,e,r)}this.#i()}#i(){let e=Object.values(Z.instances[this.bridgeId]||{});for(let t of e)t!==this&&t._checkRelationsWithTarget&&t._checkRelationsWithTarget(this)}_checkRelationsWithTarget(e){let t=this.__info__.relations;if(t)for(let[n,r]of Object.entries(t)){let{type:t,target:i}=r,a=this.__relationPaths__.get(n),o=!1;o=i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`);let s=this.#o(e,t),c=this.#a(e,t);o&&(s||c)&&this.#c(n,e,r)}}#a(e,t){if(t!==`descendant`&&t!==`ancestor`)return!1;let n=t===`descendant`?`ancestor`:`descendant`,r=e.__info__?.relations;return r?Object.entries(r).some(([t,r])=>{let i=e.__relationPaths__?.get(t);return r.type===n&&(this.is===i||this.is.endsWith(`/${i}`))}):!1}#o(e,t){let n=Object.values(Z.instances[this.bridgeId]||{});switch(t){case`parent`:return e.__id__===this.__parentId__;case`child`:return e.__parentId__===this.__id__;case`ancestor`:return this.#s(e.__id__,this.__id__,n);case`descendant`:return this.#s(this.__id__,e.__id__,n);default:return!1}}#s(e,t,n){let r=n.find(e=>e.__id__===t);for(;r&&r.__parentId__;){if(r.__parentId__===e)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}#c(e,t,r){let i=this.__relations__.get(e)||[];if(!i.includes(t)&&(i.push(t),this.__relations__.set(e,i),n(r.linked)))try{r.linked.call(this,t)}catch(e){console.error(`[service] relation linked error:`,e)}}#l(e,t,r){let i=this.__relations__.get(e)||[],a=i.indexOf(t);if(a!==-1&&(i.splice(a,1),this.__relations__.set(e,i),n(r.unlinked)))try{r.unlinked.call(this,t)}catch(e){console.error(`[service] relation unlinked error:`,e)}}#u(e,t,r){if(n(r.linkChanged))try{r.linkChanged.call(this,t)}catch(e){console.error(`[service] relation linkChanged error:`,e)}}setData(e,t){let r=U(e),i={};for(let e in r)i[e]=this.data[e],ne(this.data,e,r[e]);if(this.__info__.observers&&or(Object.keys(r),this.__info__.observers,this.data,this,i),G(this,Object.keys(r),i),lr(this,Object.keys(r),i),!this.initd){n(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}if(this.__groupSetDataMode__){for(let e in r)this.__groupSetDataBuffer__[e]=r[e];n(t)&&this.__groupSetDataCallbacks__.push(t);return}let a=hr(this,Z.instances[this.bridgeId],r);H(this.bridgeId,this.__id__,r,V(this,t)),a.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}#d(){gr.forEach(e=>{let t=this.__info__.lifetimes?.[e]||this.__info__[e];n(t)&&(this[e]=t.bind(this))}),this.__isComponent__&&_r.forEach(e=>{let t=this.__info__.pageLifetimes?.[e];n(t)&&(e===`show`?e=`onShow`:e===`hide`&&(e=`onHide`),this[e]=t.bind(this))})}#f(){let e=this.__info__.methods;for(let t in e)n(e[t])&&(this[t]=e[t].bind(this))}#p(){if(!this.__isComponent__||!this.__info__.properties||this.__initialPropertyObserversInvoked__)return;let e=[];for(let t of Object.keys(this.__info__.properties)){let i=this.__info__.properties[t]?.observer,a=this.data[t];r(i)?e.push(()=>this[i]?.(a,void 0)):n(i)&&e.push(()=>i.call(this,a,void 0))}e.forEach(e=>e()),this.__initialPropertyObserversInvoked__=!0}async#m(){this.__isComponent__?(await this.componentCreated(),await this.componentAttached()):(await this.componentCreated(),await this.componentAttached(),await this.onLoad?.(this.opts.query||{})),this.initd=!0}tO(e){let t={};for(let[n,r]of Object.entries(e)){if(this.__pendingSyncedProps__&&Object.prototype.hasOwnProperty.call(this.__pendingSyncedProps__,n)&&a(this.__pendingSyncedProps__[n],r)){this.data[n]=r,delete this.__pendingSyncedProps__[n];continue}t[n]=r}if(Object.keys(t).length===0)return;let n=[],r={};for(let[e,i]of Object.entries(t)){let t=this.data[e];r[e]=t,this.data[e]=i,this.__info__.observers&&n.push(()=>sr(e,this.__info__.observers,this.data,this,t))}n.forEach(e=>e()),G(this,Object.keys(t),Object.fromEntries(Object.keys(t).map(e=>[e,void 0]))),dr(this,Object.keys(t),r)}getPageId(){return this.__id__}hasBehavior(e){let t=function(n){if(!Array.isArray(n))return!1;if(n.includes(e))return!0;for(let e of n)if(e&&e.behaviors&&t(e.behaviors))return!0;return!1};return t(this.behaviors)}createSelectorQuery(){return L().in(this)}selectComponent(e){let t=Object.values(Z.instances[this.bridgeId]),n=t.find(n=>K(n,this.__id__,t)&&q(e,n));return n?n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(Z.instances[this.bridgeId]);return t.filter(n=>K(n,this.__id__,t)&&q(e,n))}selectOwnerComponent(){let e=Object.values(Z.instances[this.bridgeId]);for(let t of e)if(t.id===this.__parentId__)return t;return null}createIntersectionObserver(e){return Qn(this,e)}groupSetData(e){if(!n(e)){console.warn(`[service] groupSetData callback must be a function`);return}this.__groupSetDataMode__=!0,er(this.bridgeId),this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];try{e.call(this)}catch(e){console.error(`[service] groupSetData callback error:`,e)}finally{if(this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__&&Object.keys(this.__groupSetDataBuffer__).length>0){let e=this.__groupSetDataBuffer__,t=this.__groupSetDataCallbacks__;this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];let n=hr(this,Z.instances[this.bridgeId],e);H(this.bridgeId,this.__id__,e,V(this,t)),n.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}else this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];tr(this.bridgeId)}}createMediaQueryObserver(){console.warn(`[service] 暂不支持 createMediaQueryObserver`)}getRelationNodes(e){return e?[...this.__relations__.get(e)||[]]:(console.warn(`[service] getRelationNodes 需要传入关系路径参数`),[])}animate(){console.warn(`[service] 暂不支持 animate`)}clearAnimation(){console.warn(`[service] 暂不支持 clearAnimation`)}async triggerEvent(e,t,n={}){if(!e)return;let r=e.trim(),i=cr(this.__eventAttr__,r);i&&await Z.triggerEvent({bridgeId:this.bridgeId,moduleId:this.__pageId__,methodName:i,event:{type:r,detail:t,currentTarget:{id:this.id,dataset:this.dataset},target:{id:this.id,dataset:this.dataset}}}),n.bubbles&&await Z.instances[this.bridgeId][this.__parentId__]?.triggerEvent(e,t),n.composed,n.capturePhase}pageReady(){this.__isComponent__||this.ready?.()}pageUnload(){this.__isComponent__||this.onUnload?.()}pageScrollTop(e){if(!this.__isComponent__){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.resize?.(e)}componentRouteDone(){this.__info__.behaviorPageLifetimes?.routeDone?.forEach(e=>e.call(this)),this.routeDone?.()}async componentCreated(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.()}async componentAttached(){this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),this.#r()}componentReadied(){this.#p(),this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.()}componentMoved(){this.moved?.();let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=this.__relations__.get(t)||[];for(let r of e)this.#u(t,r,n)}}componentDetached(){let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=[...this.__relations__.get(t)||[]];for(let r of e)this.#l(t,r,n)}this.#h(),this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.initd=!1}#h(){let e=Object.values(Z.instances[this.bridgeId]||{});for(let t of e)if(!(t===this||!t.__relations__))for(let[e,r]of t.__relations__.entries()){let i=r.indexOf(this);if(i!==-1){r.splice(i,1),t.__relations__.set(e,r);let a=t.__info__.relations?.[e];if(a&&n(a.unlinked))try{a.unlinked.call(t,this)}catch(e){console.error(`[service] relation unlinked error:`,e)}}}}componentError(e){this.error?.(e)}},J=class e{static type=`component`;constructor(t,n){this.moduleInfo=t,this.extraInfo=n,this.type=e.type,this.isComponent=this.extraInfo.component,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,fr(this.moduleInfo,this.behaviors),this.noReferenceData=U(this.moduleInfo.data||{})}getProps(){let e=ir(this.moduleInfo.properties);if(Array.isArray(this.moduleInfo.externalClasses)&&this.moduleInfo.externalClasses.length>0){e||={};for(let t of this.moduleInfo.externalClasses)e[t]={type:[`s`],cls:!0}}return e}},yr=class{constructor(e,t){this.initd=!1,this.opts=t,this.is=t.path,this.route=t.path,this.bridgeId=t.bridgeId,this.id=t.bridgeId,this.query=t.query,this.data=ce(e.noReferenceData),this.__type__=e.type,this.__id__=t.moduleId,this.__info__=e.moduleInfo,this.__childPropsBindings__={},this.__pendingInitSetDataCallbacks__=[]}init(){return this.#e(),this.#t().then(()=>{rr(this),T.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],H(this.bridgeId,this.__id__,{},V(this,e))}setData(e,t){let r=U(e),i={},a=this.__info__||{};for(let e in r)i[e]=this.data[e],ne(this.data,e,r[e]);if(a.observers&&or(Object.keys(r),a.observers,this.data,this,i),G(this,Object.keys(r),i),!this.initd){n(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}let o=hr(this,Z.instances[this.bridgeId],r);H(this.bridgeId,this.__id__,r,V(this,t)),o.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}createSelectorQuery(){return L().in(this)}selectComponent(e){let t=Object.values(Z.instances[this.bridgeId]||{}),n=t.find(n=>K(n,this.__id__,t)&&q(e,n));return n?n.hasBehavior&&n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(Z.instances[this.bridgeId]||{});return t.filter(n=>K(n,this.__id__,t)&&q(e,n)).map(e=>e.hasBehavior&&e.hasBehavior(`wx://component-export`)&&e.export?e.export():e)}#e(){for(let e in this.__info__){let t=this.__info__[e];n(t)?this[e]=t.bind(this):this[e]=t}}async#t(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.(),this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),await this.onLoad?.(this.opts.query||{}),this.initd=!0}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageReady(){this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.(),this.onReady?.()}pageUnload(){this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.onUnload?.(),this.initd=!1}pageScrollTop(e){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.onResize?.(e)}},Y=class e{static type=`page`;constructor(t,r){if(this.moduleInfo=t,this.extraInfo=r,this.type=e.type,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,fr(this.moduleInfo,this.behaviors),this.moduleInfo.methods)for(let[e,t]of Object.entries(this.moduleInfo.methods))!(e in this.moduleInfo)&&n(t)&&(this.moduleInfo[e]=t);this.noReferenceData=U(this.moduleInfo.data||{})}},br=class{static type=`app`;constructor(e){this.moduleInfo=e}},X=new class{constructor(){this.staticModules={}}loadResource(e){let{appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a}=e;if(y&&(this.isScriptLoaded=this.isScriptLoaded||{},!this.isScriptLoaded[i])){let e=`${a}${t}/${i}/logic.js`;globalThis.importScripts(e),this.isScriptLoaded[i]=!0}E.setInitId(n),S(`app`),S(r),T.invoke({type:`serviceResourceLoaded`,target:`service`,body:{bridgeId:n}})}createAppModule(e){let t=new br(e);this.staticModules[br.type]=t}createModule(e,t,n){let{path:r,usingComponents:i}=t;if(!this.staticModules[r]){if(i)for(let e of Object.values(i))S(e);if(n===Y.type){let n=new Y(e,t);this.staticModules[r]=n}else if(n===J.type){let n=new J(e,t);this.staticModules[r]=n}else console.error(`[service] createModule ${n} error`)}}getPropsByPath(e){let t={};return this.getComponentProps(t,e),t}getComponentProps(e,t){if(t)for(let n of Object.values(t)){let t=this.staticModules[n];!t||e[n]||(e[n]=t.getProps(),this.getComponentProps(e,t.usingComponents))}}getAppModule(){return this.staticModules[br.type]}getModuleByPath(e){return this.staticModules[e]}},Z=new class{constructor(){this.app=null,this.instances={}}queuePendingEvent(e,t){return e.__pendingRuntimeEvents__=e.__pendingRuntimeEvents__||[],new Promise((n,r)=>{e.__pendingRuntimeEvents__.push({...t,resolve:n,reject:r})})}async flushPendingEvents(e){let t=e?.__pendingRuntimeEvents__||[];e.__pendingRuntimeEvents__=[];for(let e of t)try{let t=await this.dispatchEvent(e);e.resolve(t)}catch(t){e.reject(t)}}async dispatchEvent({instance:e,bridgeId:t,moduleId:r,methodName:i,event:a}){if(n(e[i]))return await e[i](a);console.warn(`[service] triggerEvent ${t} ${r}, is: ${e.is}, method: ${i} is not exist`)}createApp(e){if(this.app){console.log(`[service] app instance already existed`);return}let{scene:t,pagePath:n,query:r}=e,i=X.getAppModule();if(!i){console.log(`[service] app instance is not exist`);return}console.log(`[service] create app instance`),this.app=new Dn(i,{scene:t,path:n,query:r})}appShow(){this.app?.appShow()}appHide(){this.app?.appHide()}stackShow(e){E.pushStack(e)}stackHide(e){E.popStack(e)}createInstance(e){let{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l,stackId:u}=e,d=X.getModuleByPath(r);if(!d){console.error(`[service] ${r} not exist`);return}if(console.log(`[service] create instance ${r}`),this.instances[t]=this.instances[t]||{},d.type===J.type){let e=new vr(d,{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l});return this.instances[t][n]=e,d.isComponent||E.push(e,u),e.init(),e}else if(d.type===Y.type){let e=new yr(d,{bridgeId:t,moduleId:n,path:r,query:i});return this.instances[t][n]=e,E.push(e,u),e.init(),e}else console.error(`[service] ${d.type} instance is not exist.`)}moduleReady(e){let{bridgeId:t,moduleId:n,propBindings:r}=e,i=this.instances[t][n];if(i){if(r&&i.__parentId__){let e=this.instances[t]?.[i.__parentId__];e&&(e.__childPropsBindings__||={},e.__childPropsBindings__[n]=r)}if(i.__type__===J.type){i.componentReadied(),i.__componentReadied__=!0,this.flushPendingEvents(i),i.flushInitSetDataCallbacks?.();let e=this.getPageInstance(t);e&&this.checkAndCallPageReady(t,e.__id__)}}}moduleUnmounted(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(r.__type__===J.type&&r.componentDetached(),delete this.instances[t][n])}pageShow(e){let{bridgeId:t}=e,n=this.instances[t];if(!n)return;let r=[];Object.values(n).forEach(e=>{e&&(e.__type__===Y.type?r.push(e):e.__type__===J.type&&(e.__isComponent__?e.pageShow():r.push(e)))}),r.forEach(e=>{e.pageShow()})}pageReady(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(this.pageShow(e),r.__pageReadyPending__=!0,r.flushInitSetDataCallbacks?.(),this.checkAndCallPageReady(t,n))}getPageInstance(e){let t=this.instances[e];return t?Object.values(t).find(e=>e&&(e.__type__===Y.type||e.__type__===J.type&&!e.__isComponent__)):null}checkAndCallPageReady(e,t){let n=this.instances[e][t];if(!n||!n.__pageReadyPending__)return;let r=this.instances[e];if(!r){n.__pageReadyPending__=!1,n.pageReady();return}Object.values(r).filter(e=>e&&e.__type__===J.type&&e.__isComponent__&&e.initd&&!e.__componentReadied__).length===0&&(n.__pageReadyPending__=!1,n.pageReady())}pageHide(e){let{bridgeId:t}=e,n=this.instances[t],r=[];Object.values(n).forEach(e=>{e&&(e.__type__===Y.type?r.push(e):e.__type__===J.type&&(e.__isComponent__?e.pageHide():r.push(e)))}),r.forEach(e=>{e&&e.pageHide()})}pageUnload(e){let{bridgeId:t}=e,n=this.instances[t];n&&(Object.values(n).forEach(e=>{e&&(e.__type__===J.type&&e.componentDetached(),e.pageUnload())}),E.pop(),delete this.instances[t])}pageScroll(e){let{bridgeId:t,moduleId:n,scrollTop:r}=e,i=this.instances[t][n];i&&i.pageScrollTop({scrollTop:r})}pageResize(e){let{bridgeId:t,size:n}=e,r=this.instances[t];r&&Object.values(r).forEach(e=>{e&&(e.__type__===Y.type?e.pageResize(n):e.__type__===J.type&&(e.__isComponent__,e.pageResize(n)))})}componentError(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&r.__type__===J.type&&r.componentError()}componentRouteDone(e){let{bridgeId:t}=e,n=this.instances[t];n&&Object.values(n).forEach(e=>{e?.__type__===J.type&&e.componentRouteDone()})}async triggerEvent(e){let{bridgeId:t,moduleId:n,methodName:r,event:i}=e;if(r===void 0)return;let a=this.instances[t];if(!a){console.warn(`[service] No instances found for bridgeId: ${t}`);return}let o=a[n];if(!o){console.warn(`[service] triggerEvent ${t} ${n} ${r}, instance is not exist`);return}return o.__type__===J.type&&o.__isComponent__&&!o.__componentReadied__?this.queuePendingEvent(o,{instance:o,bridgeId:t,moduleId:n,methodName:r,event:i}):this.dispatchEvent({instance:o,bridgeId:t,moduleId:n,methodName:r,event:i})}},xr=t({getEnterOptionsSync:()=>Cr,getLaunchOptionsSync:()=>Sr});function Sr(){return Z.app?.options}function Cr(){return Z.app?.options}var wr=t({getLocation:()=>Tr,offLocationChange:()=>Ar,onLocationChange:()=>kr,openLocation:()=>Dr,startLocationUpdate:()=>Er,stopLocationUpdate:()=>Or});function Tr(e){return O(`getLocation`,e)}function Er(e){return O(`startLocationUpdate`,e)}function Dr(e){return O(`openLocation`,e)}function Or(e){return O(`stopLocationUpdate`,e)}function kr(e){e&&O(`onLocationChange`,{success:C.store(e,!0)})}function Ar(e){if(e){let t=C.store(e,!0);O(`offLocationChange`,{success:t}),C.remove(t)}else O(`offLocationChange`),C.remove()}var jr=t({createMapContext:()=>Mr});function Mr(e,t){return new Nr({mapId:e,obj:t})}var Nr=class{constructor(e){this.opts=e}addMarkers(e){return O(`addMarkers`,e)}removeMarkers(e){return O(`removeMarkers`,e)}includePoints(e){return O(`includePoints`,e)}setCenterOffset(e){return O(`setCenterOffset`,e)}getCenterLocation(e){return O(`getCenterLocation`,e)}getScale(e){return O(`getScale`,e)}moveToLocation(e){return O(`moveToLocation`,e)}translateMarker(e){return O(`translateMarker`,e)}addArc(e){return O(`addArc`,e)}removeArc(e){return O(`removeArc`,e)}},Pr=t({createInnerAudioContext:()=>Lr}),Fr=1,Ir=class{constructor(){this._audioId=Fr++,this._src=``,this._startTime=0,this._autoplay=!1,this._loop=!1,this._volume=1,this._playbackRate=1,this._currentTime=0,this._duration=0,this._buffered=0,this._paused=!0,this._listeners={},O(`audioCreate`,{audioId:this._audioId}),O(`audioListen`,{audioId:this._audioId,evtId:`audio_${this._audioId}`,keep:!0,success:e=>this._dispatch(e)})}_dispatch(e){if(!e||typeof e!=`object`)return;this._currentTime=e.currentTime||0,this._duration=e.duration||0,this._buffered=e.buffered||0,this._paused=!!e.paused;let t=this._listeners[e.event];if(t)for(let n of t.slice())n(e)}get src(){return this._src}set src(e){this._src=e,O(`audioSetProp`,{audioId:this._audioId,prop:`src`,value:e,startTime:this._startTime,loop:this._loop,volume:this._volume,playbackRate:this._playbackRate,autoplay:this._autoplay})}get startTime(){return this._startTime}set startTime(e){this._startTime=Number(e)||0,O(`audioSetProp`,{audioId:this._audioId,prop:`startTime`,value:this._startTime})}get autoplay(){return this._autoplay}set autoplay(e){this._autoplay=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`autoplay`,value:this._autoplay})}get loop(){return this._loop}set loop(e){this._loop=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`loop`,value:this._loop})}get volume(){return this._volume}set volume(e){this._volume=Math.max(0,Math.min(1,Number(e)||0)),O(`audioSetProp`,{audioId:this._audioId,prop:`volume`,value:this._volume})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=Number(e)||1,O(`audioSetProp`,{audioId:this._audioId,prop:`playbackRate`,value:this._playbackRate})}get duration(){return this._duration}get currentTime(){return this._currentTime}get paused(){return this._paused}get buffered(){return this._buffered}play(){this._paused=!1,O(`audioPlay`,{audioId:this._audioId,src:this._src})}pause(){this._paused=!0,O(`audioPause`,{audioId:this._audioId})}stop(){this._paused=!0,O(`audioStop`,{audioId:this._audioId})}seek(e){O(`audioSeek`,{audioId:this._audioId,position:Number(e)||0})}destroy(){O(`audioDestroy`,{audioId:this._audioId}),this._listeners={}}_on(e,t){typeof t==`function`&&(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t))}_off(e,t){this._listeners[e]&&(t?this._listeners[e]=this._listeners[e].filter(e=>e!==t):this._listeners[e]=[])}onPlay(e){this._on(`play`,e)}onPause(e){this._on(`pause`,e)}onStop(e){this._on(`stop`,e)}onEnded(e){this._on(`ended`,e)}onError(e){this._on(`error`,e)}onTimeUpdate(e){this._on(`timeUpdate`,e)}onWaiting(e){this._on(`waiting`,e)}onSeeking(e){this._on(`seeking`,e)}onSeeked(e){this._on(`seeked`,e)}onCanplay(e){this._on(`canplay`,e)}offPlay(e){this._off(`play`,e)}offPause(e){this._off(`pause`,e)}offStop(e){this._off(`stop`,e)}offEnded(e){this._off(`ended`,e)}offError(e){this._off(`error`,e)}offTimeUpdate(e){this._off(`timeUpdate`,e)}offWaiting(e){this._off(`waiting`,e)}offSeeking(e){this._off(`seeking`,e)}offSeeked(e){this._off(`seeked`,e)}offCanplay(e){this._off(`canplay`,e)}};function Lr(){return new Ir}var Rr=t({chooseImage:()=>Hr,compressImage:()=>Vr,previewImage:()=>Br,saveImageToPhotosAlbum:()=>zr});function zr(e){return O(`saveImageToPhotosAlbum`,e)}function Br(e){return O(`previewImage`,e)}function Vr(e){return O(`compressImage`,e)}function Hr(e){return O(`chooseImage`,e)}var Ur=t({chooseMedia:()=>Kr,chooseVideo:()=>Gr,createVideoContext:()=>Wr});function Wr(e,t){return new qr({videoId:e,obj:t})}function Gr(e){return O(`chooseVideo`,e)}function Kr(e){return O(`chooseMedia`,e)}var qr=class{constructor(e){this.opts=e}play(){this.invoke(`play`)}pause(){this.invoke(`pause`)}stop(){this.invoke(`stop`)}seek(e){this.invoke(`seek`,{position:e})}playbackRate(e){this.invoke(`playbackRate`,{rate:e})}requestFullScreen(e={}){this.invoke(`requestFullScreen`,e)}exitFullScreen(){this.invoke(`exitFullScreen`)}requestBackgroundPlayback(e={}){this.invoke(`requestBackgroundPlayback`,e)}exitBackgroundPlayback(){this.invoke(`exitBackgroundPlayback`)}exitPictureInPicture(e={}){this.invoke(`exitPictureInPicture`,e)}showStatusBar(){this.invoke(`showStatusBar`)}hideStatusBar(){this.invoke(`hideStatusBar`)}invoke(e,t={}){O(`videoContext`,{type:`native/video`,id:this.opts.videoId,command:e,...t},`render`)}},Jr=t({exitMiniProgram:()=>Qr,navigateBackMiniProgram:()=>Zr,navigateToMiniProgram:()=>Xr,restartMiniProgram:()=>Yr});function Yr(e){return O(`restartMiniProgram`,e)}function Xr(e){return O(`navigateToMiniProgram`,e)}function Zr(e){return O(`navigateBackMiniProgram`,e)}function Qr(e){return O(`exitMiniProgram`,e)}var $r=t({downloadFile:()=>ei});function ei(e){return O(`downloadFile`,e)}var ti=t({request:()=>ni});function ni(e){return O(`request`,e)}var ri=t({uploadFile:()=>si}),ii=1;function ai(){return`upload_${Date.now()}_${ii++}`}function oi(){let e=[];return{add(t){typeof t==`function`&&e.push(t)},remove(t){e=typeof t==`function`?e.filter(e=>e!==t):[]},dispatch(t){for(let n of e.slice())n(t)}}}function si(e={}){let t=ai(),n=oi(),r=oi(),i=C.store(e=>n.dispatch(e),!0,`${t}_progress`),a=C.store(e=>r.dispatch(e),!0,`${t}_headers`),o=e.complete,s=!1,c=e=>{s||(s=!0,C.remove(i),C.remove(a),n.remove(),r.remove(),typeof o==`function`&&o(e))};try{O(`uploadFile`,{...e,uploadId:t,progress:i,headersReceived:a,complete:c})}catch(e){throw c({errMsg:`uploadFile:fail ${e&&e.message?e.message:e}`}),e}return{abort(){s||O(`uploadFileAbort`,{uploadId:t})},onProgressUpdate(e){n.add(e)},offProgressUpdate(e){n.remove(e)},onHeadersReceived(e){r.add(e)},offHeadersReceived(e){r.remove(e)}}}var ci=t({closeSocket:()=>fi,connectSocket:()=>ui,onSocketClose:()=>gi,onSocketError:()=>hi,onSocketMessage:()=>mi,onSocketOpen:()=>pi,sendSocketMessage:()=>di}),li=class{constructor(e){this.socketId=e,this._readyState=0}send(e={}){let{data:t,success:r,fail:i,complete:a,...o}=e,s={socketId:this.socketId,data:t,...o};return n(r)&&(s.success=C.store(r)),n(i)&&(s.fail=C.store(i)),n(a)&&(s.complete=C.store(a)),O(`sendSocketMessage`,s)}close(e={}){let{code:t=1e3,reason:r=``,success:i,fail:a,complete:o,...s}=e,c={socketId:this.socketId,code:t,reason:r,...s};return n(i)&&(c.success=C.store(i)),n(a)&&(c.fail=C.store(a)),n(o)&&(c.complete=C.store(o)),O(`closeSocket`,c)}onOpen(e){if(n(e))return O(`onSocketOpen`,{socketId:this.socketId,callback:C.store(e,!0)})}offOpen(e){return O(`offSocketOpen`,{socketId:this.socketId,callback:e})}onMessage(e){if(n(e))return O(`onSocketMessage`,{socketId:this.socketId,callback:C.store(e,!0)})}offMessage(e){return O(`offSocketMessage`,{socketId:this.socketId,callback:e})}onError(e){if(n(e))return O(`onSocketError`,{socketId:this.socketId,callback:C.store(e,!0)})}offError(e){return O(`offSocketError`,{socketId:this.socketId,callback:e})}onClose(e){if(n(e))return O(`onSocketClose`,{socketId:this.socketId,callback:C.store(e,!0)})}offClose(e){return O(`offSocketClose`,{socketId:this.socketId,callback:e})}get readyState(){return this._readyState}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}};function ui(e={}){let{url:t,header:r={},protocols:i=[],tcpNoDelay:a=!1,perMessageDeflate:o=!1,timeout:s,forceCellularNetwork:c=!1,success:l,fail:u,complete:d,...f}=e;if(!t){let e=Error(`url is required`);throw n(u)&&u(e),n(d)&&d(e),e}let p=`socket_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,m=new li(p),h={socketId:p,url:t,header:r,protocols:i,tcpNoDelay:a,perMessageDeflate:o,timeout:s,forceCellularNetwork:c,...f};return n(l)&&(h.success=C.store(e=>{m._readyState=li.OPEN,l(e)})),n(u)&&(h.fail=C.store(e=>{m._readyState=li.CLOSED,u(e)})),n(d)&&(h.complete=C.store(d)),O(`connectSocket`,h),m}function di(e){return O(`sendSocketMessage`,e)}function fi(e){return O(`closeSocket`,e)}function pi(e){return O(`onSocketOpen`,{callback:C.store(e,!0)})}function mi(e){return O(`onSocketMessage`,{callback:C.store(e,!0)})}function hi(e){return O(`onSocketError`,{callback:C.store(e,!0)})}function gi(e){return O(`onSocketClose`,{callback:C.store(e,!0)})}var _i=t({getAccountInfoSync:()=>vi});function vi(){return O(`getAccountInfoSync`)}var yi=t({authorize:()=>bi});function bi(e){return O(`authorize`,e)}var xi=t({login:()=>Si});function Si(e){return O(`login`,e)}var Ci=t({login:()=>wi});function wi(e){return O(`login`,e)}var Ti=t({getPrivacySetting:()=>Ei});function Ei(e){return O(`getPrivacySetting`,e)}var Di=t({getSetting:()=>ki,openSetting:()=>Oi});function Oi(e){return O(`openSetting`,e)}function ki(e){return O(`getSetting`,e)}var Ai=t({getUserInfo:()=>ji});function ji(e){return O(`getUserInfo`,e)}var Mi=t({requestPayment:()=>Ni});function Ni(e){return O(`requestPayment`,e)}var Pi=t({hideShareMenu:()=>Li,showShareImageMenu:()=>Ii,showShareMenu:()=>Fi});function Fi(e){return O(`shareShareMenu`,e)}function Ii(e){return O(`showShareImageMenu`,e)}function Li(e){return O(`hideShareMenu`,e)}var Ri=t({clearStorage:()=>Ki,clearStorageSync:()=>Hi,getStorage:()=>Wi,getStorageInfo:()=>Ji,getStorageInfoSync:()=>qi,getStorageSync:()=>Bi,removeStorage:()=>Gi,removeStorageSync:()=>Vi,setStorage:()=>Ui,setStorageSync:()=>zi});function zi(...e){return O(`setStorageSync`,e)}function Bi(e){return O(`getStorageSync`,e)}function Vi(e){return O(`removeStorageSync`,e)}function Hi(){return O(`clearStorageSync`)}function Ui(e){return O(`setStorage`,e)}function Wi(e){return O(`getStorage`,e)}function Gi(e){return O(`removeStorage`,e)}function Ki(){return O(`clearStorage`)}function qi(){return O(`getStorageInfoSync`)}function Ji(e){return O(`getStorageInfo`,e)}var Yi=t({createAnimation:()=>Xi});function Xi(e={}){return new Zi(e)}var Zi=class{constructor({duration:e=400,timingFunction:t=`linear`,delay:n=0,transformOrigin:r=`50% 50% 0`}={}){this.actions=[],this.currentTransform={},this.currentStepAnimates=[],this.option={transition:{duration:e,timingFunction:t,delay:n},transformOrigin:r}}export(){let e=this.actions;return this.actions=[],{actions:e}}step(e={}){for(let e of this.currentStepAnimates)e.type===`style`?this.currentTransform[`${e.type}.${e.args[0]}`]=e:this.currentTransform[e.type]=e;return this.actions.push({animates:Object.keys(this.currentTransform).reduce((e,t)=>[].concat(...e,[this.currentTransform[t]]),[]),option:{transformOrigin:e.transformOrigin===void 0?this.option.transformOrigin:e.transformOrigin,transition:{duration:e.duration===void 0?this.option.transition.duration:e.duration,timingFunction:e.timingFunction===void 0?this.option.transition.timingFunction:e.timingFunction,delay:e.delay===void 0?this.option.transition.delay:e.delay}}}),this.currentStepAnimates=[],this}backgroundColor(e){return this.currentStepAnimates.push({type:`style`,args:[`background-color`,e]}),this}bottom(e){return this.currentStepAnimates.push({type:`style`,args:[`bottom`,x(e)]}),this}height(e){return this.currentStepAnimates.push({type:`style`,args:[`height`,x(e)]}),this}left(e){return this.currentStepAnimates.push({type:`style`,args:[`left`,x(e)]}),this}matrix(e=1,t=0,n=0,r=1,i=1,a=1){return this.currentStepAnimates.push({type:`matrix`,args:[e,t,n,r,i,a]}),this}matrix3d(e=1,t=0,n=0,r=0,i=0,a=1,o=0,s=0,c=0,l=0,u=1,d=0,f=0,p=0,m=0,h=1){return this.currentStepAnimates.push({type:`matrix3d`,args:[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}),this}opacity(e){return this.currentStepAnimates.push({type:`style`,args:[`opacity`,e]}),this}right(e){return this.currentStepAnimates.push({type:`style`,args:[`right`,x(e)]}),this}rotate(e=0){return this.currentStepAnimates.push({type:`rotate`,args:[e]}),this}rotate3d(e=0,t=0,n=0,r=0){return this.currentStepAnimates.push({type:`rotate3d`,args:[e,t,n,r]}),this}rotateX(e){return this.currentStepAnimates.push({type:`rotateX`,args:[e]}),this}rotateY(e){return this.currentStepAnimates.push({type:`rotateY`,args:[e]}),this}rotateZ(e){return this.currentStepAnimates.push({type:`rotateZ`,args:[e]}),this}scale(e=1,t=1){return this.currentStepAnimates.push({type:`scale`,args:[e,t]}),this}scale3d(e=1,t=1,n=1){return this.currentStepAnimates.push({type:`scale3d`,args:[e,t,n]}),this}scaleX(e=1){return this.currentStepAnimates.push({type:`scaleX`,args:[e]}),this}scaleY(e=1){return this.currentStepAnimates.push({type:`scaleY`,args:[e]}),this}scaleZ(e=1){return this.currentStepAnimates.push({type:`scaleZ`,args:[e]}),this}skew(e=0,t=0){return this.currentStepAnimates.push({type:`skew`,args:[e,t]}),this}skewX(e=0){return this.currentStepAnimates.push({type:`skewX`,args:[e]}),this}skewY(e=0){return this.currentStepAnimates.push({type:`skewY`,args:[e]}),this}top(e){return this.currentStepAnimates.push({type:`style`,args:[`top`,x(e)]}),this}translate(e=0,t=0){return this.currentStepAnimates.push({type:`translate`,args:[e,t]}),this}translate3d(e=0,t=0,n=0){return this.currentStepAnimates.push({type:`translate3d`,args:[e,t,n]}),this}translateX(e=0){return this.currentStepAnimates.push({type:`translateX`,args:[e]}),this}translateY(e=0){return this.currentStepAnimates.push({type:`translateY`,args:[e]}),this}width(e){return this.currentStepAnimates.push({type:`style`,args:[`width`,x(e)]}),this}},Qi=t({setBackgroundColor:()=>ea,setBackgroundTextStyle:()=>$i});function $i(e){return O(`setBackgroundTextStyle`,e)}function ea(e){return O(`setBackgroundColor`,e)}var ta=t({canvasToTempFilePath:()=>aa,createCanvasContext:()=>ra,createContext:()=>na,createOffscreenCanvas:()=>Gn,drawCanvas:()=>ia});function na(){return new sa}function ra(e,t){return new sa(e,oa(t))}function ia(e={}){let t={...e,moduleId:e.moduleId||oa(e.component)};delete t.component,O(`drawCanvas`,t,`render`)}function aa(e={},t){let n={...e,moduleId:e.moduleId||oa(t||e.component)};return delete n.component,O(`canvasToTempFilePath`,n,`render`)}function oa(e){return e?.__id__||E.getPageInfo()?.id}var sa=class{constructor(e=``,t=null){this.canvasId=e,this.moduleId=t,this.actions=[]}pushAction(e,...t){return this.actions.push({type:e,args:t}),this}getActions(){return this.actions.slice()}draw(e=!1,t){this.canvasId&&(ia({canvasId:this.canvasId,moduleId:this.moduleId,actions:this.getActions(),reserve:e,success:t}),this.actions=[])}beginPath(){return this.pushAction(`beginPath`)}closePath(){return this.pushAction(`closePath`)}moveTo(e,t){return this.pushAction(`moveTo`,e,t)}lineTo(e,t){return this.pushAction(`lineTo`,e,t)}rect(e,t,n,r){return this.pushAction(`rect`,e,t,n,r)}arc(e,t,n,r,i,a=!1){return this.pushAction(`arc`,e,t,n,r,i,a)}quadraticCurveTo(e,t,n,r){return this.pushAction(`quadraticCurveTo`,e,t,n,r)}bezierCurveTo(e,t,n,r,i,a){return this.pushAction(`bezierCurveTo`,e,t,n,r,i,a)}fill(){return this.pushAction(`fill`)}stroke(){return this.pushAction(`stroke`)}clearRect(e,t,n,r){return this.pushAction(`clearRect`,e,t,n,r)}fillText(e,t,n,r){return this.pushAction(`fillText`,e,t,n,r)}drawImage(e,...t){return this.pushAction(`drawImage`,e,...t)}save(){return this.pushAction(`save`)}restore(){return this.pushAction(`restore`)}translate(e,t){return this.pushAction(`translate`,e,t)}rotate(e){return this.pushAction(`rotate`,e)}scale(e,t){return this.pushAction(`scale`,e,t)}setShadow(e,t,n,r){return this.pushAction(`setShadow`,e,t,n,r)}setFillStyle(e){return this.pushAction(`setFillStyle`,e)}setStrokeStyle(e){return this.pushAction(`setStrokeStyle`,e)}setGlobalAlpha(e){return this.pushAction(`setGlobalAlpha`,e)}setLineCap(e){return this.pushAction(`setLineCap`,e)}setLineJoin(e){return this.pushAction(`setLineJoin`,e)}setLineWidth(e){return this.pushAction(`setLineWidth`,e)}setMiterLimit(e){return this.pushAction(`setMiterLimit`,e)}setFontSize(e){return this.pushAction(`setFontSize`,e)}},ca=t({nextTick:()=>fa}),la=[],ua=null;function da(){let e=la;la=[],ua=null;for(let t=0;t<e.length;t++)e[t]()}function fa(e){n(e)&&(la.push(e),ua||=setTimeout(da,0))}var pa=t({disableAlertBeforeUnload:()=>xa,enableAlertBeforeUnload:()=>ba,hideLoading:()=>ya,hideToast:()=>ha,showActionSheet:()=>va,showLoading:()=>_a,showModal:()=>ga,showToast:()=>ma});function ma(e){return O(`showToast`,e)}function ha(e){return O(`hideToast`,e)}function ga(e){return O(`showModal`,e)}function _a(e){return O(`showLoading`,e)}function va(e){return O(`showActionSheet`,e)}function ya(e){return O(`hideLoading`,e)}function ba(e){return O(`enableAlertBeforeUnload`,e)}function xa(e){return O(`disableAlertBeforeUnload`,e)}var Sa=t({getMenuButtonBoundingClientRect:()=>Ca,offMenuButtonBoundingClientRectWeightChange:()=>Ta,onMenuButtonBoundingClientRectWeightChange:()=>wa}),Q=new Set;function Ca(){return O(`getMenuButtonBoundingClientRect`)}function wa(e){n(e)&&Q.add(e)}function Ta(e){n(e)?Q.delete(e):Q.clear()}var Ea=t({hideNavigationBarLoading:()=>Aa,setNavigationBarColor:()=>ka,setNavigationBarTitle:()=>Oa,showNavigationBarLoading:()=>Da});function Da(e){return O(`showNavigationBarLoading`,e)}function Oa(e){return O(`setNavigationBarTitle`,e)}function ka(e){return O(`setNavigationBarColor`,e)}function Aa(e){return O(`hideNavigationBarLoading`,e)}var ja=t({startPullDownRefresh:()=>Na,stopPullDownRefresh:()=>Ma});function Ma(e){return O(`stopPullDownRefresh`,e)}function Na(e){return O(`startPullDownRefresh`,e)}var Pa=t({pageScrollTo:()=>Fa});function Fa(e){return O(`pageScrollTo`,e)}var Ia=t({hideTabBar:()=>Ba,hideTabBarRedDot:()=>Wa,removeTabBarBadge:()=>Ha,setTabBarBadge:()=>Va,setTabBarItem:()=>Ra,setTabBarStyle:()=>La,showTabBar:()=>za,showTabBarRedDot:()=>Ua});function La(e){return O(`setTabBarStyle`,e)}function Ra(e){return O(`setTabBarItem`,e)}function za(e){return O(`showTabBar`,e)}function Ba(e){return O(`hideTabBar`,e)}function Va(e){return O(`setTabBarBadge`,e)}function Ha(e){return O(`removeTabBarBadge`,e)}function Ua(e){return O(`showTabBarRedDot`,e)}function Wa(e){return O(`hideTabBarRedDot`,e)}var Ga=t({onWindowResize:()=>Ka});function Ka(e){e&&O(`onWindowResize`,{success:e})}var qa=Object.assign({"./core/base/app-event/index.js":De,"./core/base/index.js":Ge,"./core/base/performance/index.js":Ye,"./core/base/subpackage/index.js":et,"./core/base/system/index.js":rt,"./core/base/update/index.js":ft,"./core/camera/index.js":bt,"./core/data-analysis/index.js":Ct,"./core/device/bluetooth/index.js":Et,"./core/device/bluetooth-ble/index.js":Rt,"./core/device/clipboard/index.js":Qt,"./core/device/contact/index.js":tn,"./core/device/keyboard/index.js":an,"./core/device/memory/index.js":sn,"./core/device/network/index.js":un,"./core/device/phone/index.js":fn,"./core/device/scan/index.js":mn,"./core/device/vibrate/index.js":gn,"./core/ext/index.js":yn,"./core/file/index.js":Le,"./core/life-cycle/index.js":xr,"./core/location/index.js":wr,"./core/map/index.js":jr,"./core/media/audio/index.js":Pr,"./core/media/image/index.js":Rr,"./core/media/video/index.js":Ur,"./core/navigate/index.js":Jr,"./core/network/download/index.js":$r,"./core/network/request/index.js":ti,"./core/network/upload/index.js":ri,"./core/network/websocket/index.js":ci,"./core/open-api/account-info/index.js":_i,"./core/open-api/authorize/index.js":yi,"./core/open-api/index.js":xi,"./core/open-api/login/index.js":Ci,"./core/open-api/privacy/index.js":Ti,"./core/open-api/setting/index.js":Di,"./core/open-api/user-info/index.js":Ai,"./core/payment/index.js":Mi,"./core/route/index.js":xe,"./core/share/index.js":Pi,"./core/storage/index.js":Ri,"./core/ui/animation/index.js":Yi,"./core/ui/background/index.js":Qi,"./core/ui/canvas/index.js":ta,"./core/ui/custom-component/index.js":ca,"./core/ui/interaction/index.js":pa,"./core/ui/menu/index.js":Sa,"./core/ui/navigation-bar/index.js":Ea,"./core/ui/pull-down-refresh/index.js":ja,"./core/ui/scroll/index.js":Pa,"./core/ui/tab-bar/index.js":Ia,"./core/ui/window/index.js":Ga,"./core/wxml/intersection-observer/index.js":Zn,"./core/wxml/selector-query/index.js":Kn}),$={};for(let e of Object.values(qa))for(let[t,n]of Object.entries(e))$[t]=n;function Ja(e){for(let t of e||[])typeof t!=`string`||Object.prototype.hasOwnProperty.call($,t)||t in Object.prototype||Object.defineProperty($,t,{value:(...e)=>O(t,...e),writable:!0,enumerable:!0,configurable:!0})}var Ya=new Proxy($,{get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`||r!==void 0||t===`webpackJsonp`?r:(...e)=>O(t,...e)},set(e,t,n,r){return Reflect.set(e,t,n,r)}}),Xa=new class{constructor(){this.init()}init(){let e=globalThis.__diminaApiNamespaces||[],t=globalThis.__diminaRegisteredApis||[];if(globalThis.name)try{let n=JSON.parse(globalThis.name);e.length===0&&(e=n.apiNamespaces||[]),t.length===0&&(t=n.registeredApis||[])}catch{}Ja(t);for(let t of[`dd`,`wx`,...e])globalThis[t]=Ya;globalThis.modRequire=S,globalThis.modDefine=fe,globalThis.global={},globalThis.App=e=>X.createAppModule(e),globalThis.Page=e=>{X.createModule(e,globalThis.__extraInfo,Y.type)},globalThis.Component=e=>{X.createModule(e,globalThis.__extraInfo,J.type)},globalThis.Behavior=e=>e,globalThis.getApp=e=>{let t=Z.app;return!t&&e?.allowDefault?{}:t},globalThis.getCurrentPages=()=>E.stack()}},Za={navigateBack:Ee,navigateTo:Te,reLaunch:Ce,redirectTo:we,switchTab:Se};return new class{constructor(){console.log(`[service] init`),this.env=Xa,this.message=T,this.init()}init(){this.message.on(`loadResource`,e=>{let{appId:t,bridgeId:n,pagePath:r,root:i=`.`,baseUrl:a=`/`,hostEnv:o}=e;o&&w.init(o),X.loadResource({appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a})}),this.message.on(`t`,async e=>{let{bridgeId:t,moduleId:n,methodName:r,event:i,success:a}=e;if(r===void 0)return;let o=await Z.triggerEvent({bridgeId:t,moduleId:n,methodName:r,event:i});o!==void 0&&this.message.send({type:`triggerCallback`,target:`render`,body:{bridgeId:t,moduleId:n,success:a,data:o}})}),this.message.on(`triggerCallback`,e=>{let{id:t,args:n}=e;C.invoke(t,n)}),this.onAppMsg(),this.onModuleMsg()}onAppMsg(){this.message.on(`resourceLoaded`,e=>{let{bridgeId:t,scene:n,pagePath:r,query:i,stackId:a}=e;Z.createApp({scene:n,pagePath:r,query:i});let o=X.getModuleByPath(r);if(!o){console.error(`[service] resourceLoaded: module not found, pagePath: ${r}`);return}let s=X.getPropsByPath(o.usingComponents),c=`page_${_()}`;Z.createInstance({bridgeId:t,moduleId:c,path:r,query:i,stackId:a}),T.send({type:`firstRender`,target:`render`,body:{bridgeId:t,pageId:c,pagePath:r,initialProps:s,query:i}})}),this.message.on(`appShow`,()=>{Z.appShow()}),this.message.on(`appHide`,()=>{Z.appHide()}),this.message.on(`stackShow`,({stackId:e})=>{Z.stackShow(e)}),this.message.on(`stackHide`,({stackId:e})=>{Z.stackHide(e)})}onModuleMsg(){this.message.on(`mC`,e=>{Z.createInstance(e)}),this.message.on(`mR`,e=>{Z.moduleReady(e)}),this.message.on(`mU`,e=>{Z.moduleUnmounted(e)}),this.message.on(`pageUnload`,e=>{Z.pageUnload(e)}),this.message.on(`pageShow`,e=>{Z.pageShow(e)}),this.message.on(`pageReady`,e=>{Z.pageReady(e)}),this.message.on(`pageHide`,e=>{Z.pageHide(e)}),this.message.on(`pagePullDownRefresh`,()=>{}),this.message.on(`pageReachBottom`,()=>{}),this.message.on(`pageShareAppMessage`,()=>{}),this.message.on(`pageScroll`,e=>{Z.pageScroll(e)}),this.message.on(`pageResize`,e=>{Z.pageResize(e)}),this.message.on(`onTabItemTap`,()=>{}),this.message.on(`pageRouteDone`,e=>{let{bridgeId:t}=e;Z.componentRouteDone({bridgeId:t})}),this.message.on(`componentError`,e=>{Z.componentError(e)}),this.message.on(`h5SdkAction`,async(e={})=>{let t=e?.name?.replace(/h5/i,``),{url:n}=e?.params?.data?.params||{};if(e.params&&(e.params.data={...e.params?.data,...e.params?.data?.params||{}}),t===`postMessage`&&e.parentWebViewId){let{moduleId:t,attrs:n,params:r}=e,i={detail:{data:[r?.data?.params?.data]}},a=n.message,o=e.parentWebViewId,s=await Z.triggerEvent({bridgeId:o,moduleId:t,methodName:a,event:i});s!==void 0&&this.message.send({type:`triggerCallback`,target:`service`,body:{bridgeId:o,moduleId:t,success:r?.success,data:s}})}Za[t]?.({url:n,...e.params})})}}})();
|
|
6
|
+
`;console.error(`require ${e} error: ${a}`),n(r)&&r({mod:e,errMsg:t.message})}i.exports=t.exports===void 0?a:t.exports}return n(t)&&t(i.exports),i.exports}S.async=async e=>new Promise((t,n)=>{try{t(S(e))}catch(t){n(Error(`${t.message}: Failed to initialize asynchronous loading for module '${e}'`))}});var C=new class{constructor(){this.callbacks={}}store(e,t,n=_()){if(t){for(let[t,n]of Object.entries(this.callbacks))if(n.callback===e)return t}return this.callbacks[n]={callback:e,keep:t},n}invoke(e,t){if(e===void 0)return;let r=this.callbacks[e];r&&n(r.callback)&&(r.callback(t),r.keep||delete this.callbacks[e])}remove(e){e?Object.keys(this.callbacks).forEach(t=>{e===t&&delete this.callbacks[t]}):Object.entries(this.callbacks).forEach(([e,t])=>{t.keep&&delete this.callbacks[e]})}},w=new class{constructor(){this.reset()}reset(){this.active=!1,this.snapshot={systemInfo:null,menuRect:null}}init(e={}){this.active=!0,this.snapshot={...this.snapshot,...e}}update(e={}){this.snapshot={...this.snapshot,...e}}get(e){return this.active?this.snapshot[e]??null:null}getSystemInfo(){return this.get(`systemInfo`)}getMenuRect(){return this.get(`menuRect`)}};function pe(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var T=new class e{constructor(){this.event=pe(),this.init()}init(){y?globalThis.onmessage=e=>{this.handleMsg(e.data)}:DiminaServiceBridge.onMessage=this.handleMsg.bind(this)}handleMsg(e){console.log(`[service] receive msg: `,y?e:JSON.stringify(e));let{type:t,body:n}=e;this.event.emit(t,n)}on(e,t){this.event.on(e,t)}off(e){this.event.off(e)}send(t){return y?e.prototype.send=function(e){e.method=`publish`,globalThis.postMessage(e)}:e.prototype.send=function(e){return DiminaServiceBridge.publish(e.body.bridgeId||``,e)},this.send(t)}invoke(t){return y?e.prototype.invoke=function(e){e.method=`invoke`,globalThis.postMessage(e)}:e.prototype.invoke=function(e){return DiminaServiceBridge.invoke(e)},this.invoke(t)}},E=new class{#e=[];#t=``;setInitId(e){this.#t=e}push(e,t){this.stack(t).push(e)}pop(){this.stack().length>0&&this.stack().pop()}getPageInfo(){let e=this.stack();return e[e.length-1]||{id:this.#t}}pushStack(e){let t={id:e,pages:[]};return this.#e.push(t),t}popStack(e){if(e){let t=this.#e.findIndex(t=>t.id===e);t!==-1&&this.#e.splice(t,1)}else this.#e.length>0&&this.#e.pop()}stack(e){if(e){let t=this.#e.find(t=>t.id===e);return t||=this.pushStack(e),t.pages}else{let e=this.#e[this.#e.length-1];return e?e.pages:this.pushStack(Date.now()).pages}}};function D(e,t){if(!e)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}var me={getWindowInfo:()=>D(w.getSystemInfo(),[`pixelRatio`,`screenWidth`,`screenHeight`,`windowWidth`,`windowHeight`,`statusBarHeight`,`safeArea`,`screenTop`]),getSystemInfoSync:()=>w.getSystemInfo(),getAppBaseInfo:()=>D(w.getSystemInfo(),[`SDKVersion`,`enableDebug`,`host`,`language`,`version`,`theme`,`fontSizeScaleFactor`,`fontSizeSetting`]),getDeviceInfo:()=>D(w.getSystemInfo(),[`abi`,`benchmarkLevel`,`brand`,`model`,`platform`,`system`]),getMenuButtonBoundingClientRect:()=>w.getMenuRect()},he=new Set([`connectSocket`,`downloadFile`,`loadSubpackage`,`preDownloadSubpackage`,`request`,`uploadFile`]),ge=new Set(`FileSystemManager.getSavedFileList,clearStorage,chooseImage,chooseMedia,chooseVideo,closeBluetoothAdapter,getClipboardData,getBluetoothAdapterState,getBluetoothDevices,getLocation,getNetworkType,getPrivacySetting,getStorageInfo,getSystemInfo,getSystemInfoAsync,getUserInfo,hideKeyboard,hideLoading,hideShareMenu,hideTabBar,hideToast,login,navigateBack,openAppAuthorizeSetting,openBluetoothAdapter,openSetting,openSystemBluetoothSetting,showNavigationBarLoading,showShareMenu,showTabBar,startPullDownRefresh,startRecord,stopPullDownRefresh,stopBluetoothDevicesDiscovery,stopLocationUpdate,stopRecord,vibrateLong,vibrateShort`.split(`,`));function _e(e){return Object.prototype.hasOwnProperty.call(e,`success`)||Object.prototype.hasOwnProperty.call(e,`fail`)||Object.prototype.hasOwnProperty.call(e,`complete`)}function ve(e,t){return he.has(e)||typeof e==`string`&&e.endsWith(`Sync`)?!1:t!==void 0||ge.has(e)}function ye(e,t,n){let r={type:`invokeAPI`,target:n,body:{name:e,bridgeId:E.getPageInfo().id,params:t}};return n===`container`?T.invoke(r):T.send(r)}function be(e,t,n){return new Promise((r,i)=>{let a,o,s=()=>{C.remove(a),C.remove(o)};a=C.store(e=>{s(),r(e)}),o=C.store(e=>{s(),i(e)}),t.success=a,t.fail=o;try{ye(e,t,n)}catch(e){s(),i(e)}})}function O(e,t,r=`container`){let i=me[e];if(r===`container`&&i){let e=i();if(e)return e}let a;if(t===void 0){if(ve(e,t))return be(e,{},r);a=t}else if(typeof t==`string`||Array.isArray(t))a=t;else if(n(t))a={success:C.store(t,!0)};else if(_e(t)){let{success:e,fail:r,complete:i,keep:o,evtId:s,...c}=t;a=c,n(e)?a.success=C.store(e,o,s):a.success=e,n(r)&&(a.fail=C.store(r,o,s)),n(i)&&(a.complete=C.store(i,o,s))}else{let{keep:n,...i}=t;if(delete i.evtId,!n&&ve(e,t))return a={...i},be(e,a,r);a=i}return ye(e,a,r)}var xe=t({navigateBack:()=>Ee,navigateTo:()=>Te,reLaunch:()=>Ce,redirectTo:()=>we,switchTab:()=>Se});function Se(e){return e.url=b(E.getPageInfo().route,e.url),O(`switchTab`,e)}function Ce(e){return e.url=b(E.getPageInfo().route,e.url),O(`reLaunch`,e)}function we(e){let t=b(E.getPageInfo().route,e.url);if(E.getPageInfo().route!==t)return e.url=t,O(`redirectTo`,e)}function Te(e){return e.url=b(E.getPageInfo().route,e.url),O(`navigateTo`,e)}function Ee(e){return O(`navigateBack`,e)}var De=t({offAppHide:()=>Ne,offAppShow:()=>Me,offError:()=>ke,onAppHide:()=>je,onAppRoute:()=>Ie,onAppShow:()=>Ae,onError:()=>Oe,onPageNotFound:()=>Fe,onUnhandledRejection:()=>Pe});function Oe(e){return O(`onError`,e)}function ke(e){return O(`offError`,e)}function Ae(e){return O(`onAppShow`,e)}function je(e){return O(`onAppHide`,e)}function Me(e){return O(`offAppShow`,e)}function Ne(e){return O(`offAppHide`,e)}function Pe(){}function Fe(){}function Ie(){}var Le=t({USER_DATA_PATH:()=>Re,fileSystemManagerAPINames:()=>Ve,getFileSystemManager:()=>Ue}),Re=`difile://`,ze=`not supported by the dimina runtime`;function k(e){throw Error(`FileSystemManager.${e} ${ze}`)}function A(e,t={}){let{fail:n,complete:r}=t;n?.({errMsg:`${e}:fail ${ze}`}),r?.()}var Be=class{access(e){A(`access`,e)}accessSync(){k(`accessSync`)}stat(e){A(`stat`,e)}statSync(){k(`statSync`)}readFile(e){A(`readFile`,e)}readFileSync(){k(`readFileSync`)}writeFile(e){A(`writeFile`,e)}writeFileSync(){k(`writeFileSync`)}appendFile(e){A(`appendFile`,e)}appendFileSync(){k(`appendFileSync`)}copyFile(e){A(`copyFile`,e)}copyFileSync(){k(`copyFileSync`)}rename(e){A(`rename`,e)}renameSync(){k(`renameSync`)}unlink(e){A(`unlink`,e)}unlinkSync(){k(`unlinkSync`)}mkdir(e){A(`mkdir`,e)}mkdirSync(){k(`mkdirSync`)}rmdir(e){A(`rmdir`,e)}rmdirSync(){k(`rmdirSync`)}readdir(e){A(`readdir`,e)}readdirSync(){k(`readdirSync`)}getFileInfo(e){A(`getFileInfo`,e)}saveFile(e){A(`saveFile`,e)}saveFileSync(){k(`saveFileSync`)}getSavedFileList(e){A(`getSavedFileList`,e)}removeSavedFile(e){A(`removeSavedFile`,e)}truncate(e){A(`truncate`,e)}truncateSync(){k(`truncateSync`)}unzip(e){A(`unzip`,e)}open(e){A(`open`,e)}openSync(){k(`openSync`)}close(e){A(`close`,e)}closeSync(){k(`closeSync`)}read(e){A(`read`,e)}readSync(){k(`readSync`)}write(e){A(`write`,e)}writeSync(){k(`writeSync`)}fstat(e){A(`fstat`,e)}fstatSync(){k(`fstatSync`)}ftruncate(e){A(`ftruncate`,e)}ftruncateSync(){k(`ftruncateSync`)}readCompressedFile(e){A(`readCompressedFile`,e)}readCompressedFileSync(){k(`readCompressedFileSync`)}readZipEntry(e){A(`readZipEntry`,e)}},Ve=Object.getOwnPropertyNames(Be.prototype).filter(e=>e!==`constructor`),He;function Ue(){return He||=new Be,He}var We=[`applyUpdate`,`onCheckForUpdate`,`onUpdateFailed`,`onUpdateReady`],Ge=t({canIUse:()=>Je,env:()=>Ke}),Ke={USER_DATA_PATH:`difile://usr`},qe=new Set([`nextTick`,`getUpdateManager`,`UpdateManager`,...We.map(e=>`UpdateManager.${e}`),`getPerformance`,`getFileSystemManager`,`FileSystemManager`,...Ve.map(e=>`FileSystemManager.${e}`)]);function Je(e){if(qe.has(e))return!0;try{return O(`canIUse`,e)}catch(t){return console.warn(`[canIUse] check ${e} error:`,t),!1}}var Ye=t({getPerformance:()=>Xe});function Xe(){return Ze.getInstance()}var Ze=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one Performance instance.`);this.entryList=new Qe,e.#e=this}static getInstance(){return e.#e||=new e,e.#e}createObserver(e){let t=new $e(e);return e&&O(`addPerformanceObserver`,{success:C.store(e=>{let n=e?.data?.entryList&&JSON.parse(e?.data?.entryList)||[];n&&(this.entryList.push(n),t.notify(n))},!0)},`render`),t}getEntries(){return this.entryList.getEntries()}getEntriesByName(e,t){return this.entryList.getEntriesByName(e,t)}getEntriesByType(e){return this.entryList.getEntriesByType(e)}setBufferSize(e){this.entryList.maxEntrySize=e}},Qe=class{constructor(){this._list=[],this.maxEntrySize=30}push(e){for(let t of e)this._list.length>=this.maxEntrySize&&this._list.shift(),this._list.push(t)}getEntriesByName(e,t){return this._entryFilter(e,t)}getEntriesByType(e){return this._entryFilter(null,e)}_entryFilter(e,t){return this._list.filter(n=>!(e&&e!==n.name||t&&t!==n.entryType))}getEntries(){return this._list}},$e=class{constructor(e){this.entryTypes=[],this.callback=e}observe(e){this.connected=!0,this.entryTypes=e.entryTypes}notify(e){if(this.connected){let t=new Qe;t.push(e.filter(e=>{let t=!1;return this.entryTypes&&this.entryTypes.length>0&&this.entryTypes.forEach(n=>{e.entryType===n&&(t=!0)}),t})),this.callback(t)}}disconnect(){this.connected=!1}},et=t({loadSubpackage:()=>nt,preDownloadSubpackage:()=>tt});function tt(e){return O(`preDownloadSubpackage`,e)}function nt(e){return O(`loadSubpackage`,e)}var rt=t({getAppBaseInfo:()=>ut,getDeviceInfo:()=>dt,getSystemInfo:()=>st,getSystemInfoAsync:()=>lt,getSystemInfoSync:()=>ct,getWindowInfo:()=>at,openAppAuthorizeSetting:()=>ot,openSystemBluetoothSetting:()=>it});function it(e){return O(`openSystemBluetoothSetting`,e)}function at(e){return O(`getWindowInfo`,e)}function ot(e){return O(`openAppAuthorizeSetting`,e)}function st(e){return new Promise(t=>{t(O(`getSystemInfo`,e))})}function ct(){return O(`getSystemInfoSync`)}function lt(e){return O(`getSystemInfoAsync`,e)}function ut(){return O(`getAppBaseInfo`)}function dt(){return O(`getDeviceInfo`)}var ft=t({getUpdateManager:()=>vt}),pt=`onUpdateStatusChange`,mt=`updatefail`,ht=`updateready`,gt=`noupdate`,_t=`updating`;function vt(){return yt.getInstance()}var yt=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one UpdateManager instance.`);this.hasAppliedUpdate=!1,this.updateFailed=!1,this.updateReady=!1,this.checkForUpdateResult=null,this.updateFailedListeners=[],this.updateReadyListeners=[],this.checkForUpdateListeners=[],T.on(pt,e=>this.handleUpdateStatusChange(e)),e.#e=this}handleUpdateStatusChange(e={}){let{event:t}=e;if(t===mt){this.updateFailed=!0,this.emit(this.updateFailedListeners);return}if(t===ht){this.updateReady=!0,this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult),this.emit(this.updateReadyListeners);return}if(t===_t){this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}if(t===gt){this.checkForUpdateResult={hasUpdate:!1},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}typeof e.hasUpdate==`boolean`&&(this.checkForUpdateResult={hasUpdate:e.hasUpdate},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult))}emit(e,...t){e.slice().forEach(e=>{e(...t)})}static getInstance(){return e.#e||=new e,e.#e}applyUpdate(){if(!this.updateReady)console.error(`[applyUpdate]: update is not ready`);else if(this.hasAppliedUpdate)console.error(`[applyUpdate]: applyUpdate has been called`);else return this.hasAppliedUpdate=!0,O(`applyUpdate`)}onCheckForUpdate(e){typeof e==`function`&&(this.checkForUpdateListeners.push(e),this.checkForUpdateResult&&e(this.checkForUpdateResult))}onUpdateFailed(e){typeof e==`function`&&(this.updateFailedListeners.push(e),this.updateFailed&&e())}onUpdateReady(e){typeof e==`function`&&(this.updateReadyListeners.push(e),this.updateReady&&e())}};yt.getInstance();var bt=t({createCameraContext:()=>xt});function xt(){return new St}var St=class{constructor(){this.bridgeId=E.getPageInfo().id}takePhoto(e){return O(`takePhoto`,e)}startRecord(){return O(`startRecord`)}stopRecord(){return O(`stopRecord`)}},Ct=t({reportAnalytics:()=>wt,reportEvent:()=>Tt});function wt(...e){return O(`reportAnalytics`,e)}function Tt(e,t){return O(`reportAnalytics`,{eventId:e,data:t})}var Et=t({closeBluetoothAdapter:()=>Lt,getBluetoothAdapterState:()=>It,getBluetoothDevices:()=>Ft,getConnectedBluetoothDevices:()=>Pt,offBluetoothAdapterStateChange:()=>Nt,offBluetoothDeviceFound:()=>Mt,onBluetoothAdapterStateChange:()=>jt,onBluetoothDeviceFound:()=>At,openBluetoothAdapter:()=>kt,startBluetoothDevicesDiscovery:()=>Ot,stopBluetoothDevicesDiscovery:()=>Dt});function Dt(e){return O(`stopBluetoothDevicesDiscovery`,e)}function Ot(e){return O(`startBluetoothDevicesDiscovery`,e)}function kt(e){return O(`openBluetoothAdapter`,e)}function At(e){return O(`onBluetoothDeviceFound`,e)}function jt(e){return O(`onBluetoothAdapterStateChange`,e)}function Mt(){return O(`offBluetoothDeviceFound`)}function Nt(){return O(`offBluetoothAdapterStateChange`)}function Pt(e){return O(`getConnectedBluetoothDevices`,e)}function Ft(e){return O(`getBluetoothDevices`,e)}function It(e){return O(`getBluetoothAdapterState`,e)}function Lt(e){return O(`closeBluetoothAdapter`,e)}var Rt=t({closeBLEConnection:()=>Zt,createBLEConnection:()=>Xt,getBLEDeviceCharacteristics:()=>Yt,getBLEDeviceRSSI:()=>Jt,getBLEDeviceServices:()=>qt,notifyBLECharacteristicValueChange:()=>Kt,offBLECharacteristicValueChange:()=>Gt,offBLEConnectionStateChange:()=>Wt,onBLECharacteristicValueChange:()=>Ut,onBLEConnectionStateChange:()=>Ht,readBLECharacteristicValue:()=>Vt,setBLEMTU:()=>Bt,writeBLECharacteristicValue:()=>zt});function zt(e){return O(`writeBLECharacteristicValue`,e)}function Bt(e){return O(`setBLEMTU`,e)}function Vt(e){return O(`readBLECharacteristicValue`,e)}function Ht(e){return O(`onBLEConnectionStateChange`,e)}function Ut(e){return O(`onBLECharacteristicValueChange`,e)}function Wt(e){return O(`offBLEConnectionStateChange`,e)}function Gt(){return O(`offBLECharacteristicValueChange`)}function Kt(e){return O(`notifyBLECharacteristicValueChange`,e)}function qt(e){return O(`getBLEDeviceServices`,e)}function Jt(e){return O(`getBLEDeviceRSSI`,e)}function Yt(e){return O(`getBLEDeviceCharacteristics`,e)}function Xt(e){return O(`createBLEConnection`,e)}function Zt(e){return O(`closeBLEConnection`,e)}var Qt=t({getClipboardData:()=>en,setClipboardData:()=>$t});function $t(e){return O(`setClipboardData`,e)}function en(e){return O(`getClipboardData`,e)}var tn=t({addPhoneContact:()=>rn,chooseContact:()=>nn});function nn(e){return O(`chooseContact`,e)}function rn(e){return O(`addPhoneContact`,e)}var an=t({hideKeyboard:()=>on});function on(e){return O(`hideKeyboard`,e)}var sn=t({offMemoryWarning:()=>ln,onMemoryWarning:()=>cn});function cn(e){return O(`onMemoryWarning`,e)}function ln(e){return O(`offMemoryWarning`,e)}var un=t({getNetworkType:()=>dn});function dn(e){return O(`getNetworkType`,e)}var fn=t({makePhoneCall:()=>pn});function pn(e){return O(`makePhoneCall`,e)}var mn=t({scanCode:()=>hn});function hn(e){return O(`scanCode`,e)}var gn=t({vibrateLong:()=>vn,vibrateShort:()=>_n});function _n(e){return O(`vibrateShort`,e)}function vn(e){return O(`vibrateLong`,e)}var yn=t({extBridge:()=>bn,extOffBridge:()=>Sn,extOnBridge:()=>xn,offLoginStatusChanged:()=>wn,onLoginStatusChanged:()=>Cn});function bn({event:e,module:t,data:r={},success:i,fail:a,complete:o},s){let c,l,u;return n(s)?(c=s,l=s):(c=i,l=a,u=o),O(e,{module:t,data:r,keep:r.isSustain??!0,success:c,fail:l,complete:u})}function xn({event:e,module:t,callBack:n,isSustain:r=!0}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOnBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOnBridge 参数 event 为空`);return}if(!n){console.error(`[ERROR]: extOnBridge 参数 callBack 为空`);return}let i=`${t}_${e}`;O(i,{evtId:i,keep:r,success:n})}function Sn({event:e,module:t,callBack:n}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOffBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOffBridge 参数 event 为空`);return}O(`${t}_${e}`,{success:n})}function Cn(e){T.on(`notifyLoginStatusChanged`,t=>{e?.(t)})}function wn(){T.off(`notifyLoginStatusChanged`)}var Tn=[`onLaunch`,`onShow`,`onHide`],En=[`globalData`],Dn=class{constructor(e,t){this.appModule=e,this.options=t,this.init()}init(){this.initGlobalData(),this.initLifecycle(),this.initCustomMethods(),this.invokeSomeLifecycle()}initGlobalData(){this.globalData=this.appModule.moduleInfo.globalData}initLifecycle(){Tn.forEach(e=>{let t=this.appModule.moduleInfo[e];n(t)&&(this[e]=t.bind(this))})}initCustomMethods(){let e=this.appModule.moduleInfo;for(let t in e)Tn.includes(t)||En.includes(t)||(n(e[t])?this[t]=e[t].bind(this):this[t]=e[t])}invokeSomeLifecycle(){this.onLaunch?.(this.options),this.onShow?.(this.options)}appShow(){this.onShow?.(this.options)}appHide(){this.onHide?.()}},On=new Set([`2d`]),kn=new Set([`webgl`,`experimental-webgl`,`webgl2`]),An=new Set([`createLinearGradient`,`createPattern`,`createRadialGradient`]),jn=new Set([`createBuffer`,`createFramebuffer`,`createProgram`,`createRenderbuffer`,`createShader`,`createTexture`]),Mn=new Set([`getAttribLocation`,`getUniformLocation`]),j={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,FALSE:0,TRUE:1,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPILE_STATUS:35713},Nn=1,Pn=1;function M(){let e=E.getPageInfo();return e?.bridgeId||e?.id||``}function N(e,t,n){T.send({type:`invokeAPI`,target:`render`,body:{bridgeId:e,name:t,params:n}})}function Fn(e){Promise.resolve().then(e)}function In(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ln(e){return typeof ArrayBuffer>`u`||!ArrayBuffer.isView(e)?null:e instanceof DataView?{__canvasTypedArray:`DataView`,data:Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}:{__canvasTypedArray:e.constructor.name,data:Array.from(e)}}function P(e){if(e==null)return e;if(e.__canvasResourceId)return{__canvasResourceId:e.__canvasResourceId};if(e.__diminaCanvasNode)return{__canvasNodeId:e.nodeId};let t=Ln(e);if(t)return t;if(typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer)return{__canvasArrayBuffer:!0,data:Array.from(new Uint8Array(e))};if(Array.isArray(e))return e.map(e=>P(e));if(In(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=P(r);return t}return e}function F(e){return Array.from(e).map(e=>P(e))}function I(e=`canvas_resource`){return`${e}_${_()}`}var Rn=class{constructor(e,t){return this.__canvasResourceId=t,this.__canvasProxyValue=Nn++,this.canvas=e,new Proxy(this,{get(e,n){if(n in e)return e[n];if(typeof n!=`symbol`)return(...r)=>{e.canvas.enqueueOperation({op:`resourceCall`,resourceId:t,method:n,args:F(r)})}}})}valueOf(){return this.__canvasProxyValue}toString(){return String(this.__canvasProxyValue)}},zn=class{constructor(e,t){this.__canvasResourceId=t,this.canvas=e,this.imageId=t,this.onload=null,this.onerror=null,this.width=0,this.height=0,this._src=``,this.canvas.enqueueOperation({op:`createImage`,imageId:t})}get src(){return this._src}set src(e){this._src=e;let t=C.store((e={})=>{this.width=e.width||this.width,this.height=e.height||this.height,n(this.onload)&&this.onload(e)}),r=C.store((e={})=>{n(this.onerror)&&this.onerror(e)});this.canvas.enqueueOperation({op:`imageSetSrc`,imageId:this.imageId,src:e,onload:t,onerror:r})}},Bn=class{constructor(e,t){return this.canvas=e,this.contextId=t,this.state={fillStyle:`#000000`,strokeStyle:`#000000`,font:`10px sans-serif`,globalAlpha:1,lineWidth:1},new Proxy(this,{get(e,t){if(t in e)return e[t];if(t in e.state)return e.state[t];if(typeof t!=`symbol`)return(...n)=>e.call(t,n)},set(e,n,r){return e.state[n]=r,e.canvas.enqueueOperation({op:`contextSetProperty`,contextId:t,prop:n,value:P(r)}),!0}})}async getImageData(e,t,n,r){return await this.canvas.getImageData({contextId:this.contextId,x:e,y:t,width:n,height:r})}toDataURL(e,t){return this.canvas.toDataURL(e,t)}call(e,t){if(e===`measureText`)return{width:String(t[0]??``).length*10};if(e===`createImageData`){let e=t[0],n=t[1];return{width:e,height:n,data:new Uint8ClampedArray(e*n*4)}}let n=An.has(e)?I():void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:F(t),resultId:n}),n)return new Rn(this.canvas,n)}},Vn=class{constructor(e,t,n){return this.canvas=e,this.contextId=t,this.contextType=n,new Proxy(this,{get(e,t){if(t in e)return e[t];if(Object.prototype.hasOwnProperty.call(j,t))return j[t];if(t===`drawingBufferWidth`)return e.canvas.width;if(t===`drawingBufferHeight`)return e.canvas.height;if(typeof t!=`symbol`)return(...n)=>e.call(t,n)}})}call(e,t){switch(e){case`getParameter`:return this.getParameter(t[0]);case`getShaderParameter`:case`getProgramParameter`:return!0;case`getShaderInfoLog`:case`getProgramInfoLog`:return``;case`getError`:return j.NO_ERROR;case`isContextLost`:return!1;case`checkFramebufferStatus`:return j.FRAMEBUFFER_COMPLETE;case`getContextAttributes`:return{};case`getSupportedExtensions`:return[];case`getExtension`:return null;default:break}let n=jn.has(e)||Mn.has(e)?I(`webgl_resource`):void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:F(t),resultId:n}),n)return new Rn(this.canvas,n)}getParameter(e){let{width:t,height:n}=this.canvas;switch(e){case j.VERSION:return`WebGL 1.0`;case j.SHADING_LANGUAGE_VERSION:return`WebGL GLSL ES 1.0`;case j.VENDOR:return`Dimina`;case j.RENDERER:return`Dimina WebGL Proxy`;case j.VIEWPORT:return[0,0,t,n];case j.MAX_VIEWPORT_DIMS:return[t||4096,n||4096];case j.ALIASED_POINT_SIZE_RANGE:return[1,64];case j.ALIASED_LINE_WIDTH_RANGE:return[1,1];case j.COLOR_CLEAR_VALUE:return[0,0,0,0];case j.COLOR_WRITEMASK:case j.DEPTH_WRITEMASK:return!0;case j.COMPRESSED_TEXTURE_FORMATS:return[];case j.MAX_TEXTURE_SIZE:case j.MAX_CUBE_MAP_TEXTURE_SIZE:case j.MAX_RENDERBUFFER_SIZE:return 4096;case j.MAX_VERTEX_ATTRIBS:return 16;case j.MAX_TEXTURE_IMAGE_UNITS:case j.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case j.MAX_COMBINED_TEXTURE_IMAGE_UNITS:return 8;case j.MAX_VERTEX_UNIFORM_VECTORS:case j.MAX_FRAGMENT_UNIFORM_VECTORS:case j.MAX_VARYING_VECTORS:return 128;default:return 0}}},Hn=class{constructor({nodeId:e,bridgeId:t=M(),width:n=300,height:r=150,type:i=`2d`,offscreen:a=!1}){this.__diminaCanvasNode=!0,this.nodeId=e,this.bridgeId=t,this.type=i,this.offscreen=a,this.contexts=new Map,this.pendingOperations=[],this.flushScheduled=!1,this._width=n,this._height=r}get width(){return this._width}set width(e){this._width=e,this.enqueueOperation({op:`setCanvasProperty`,prop:`width`,value:e})}get height(){return this._height}set height(e){this._height=e,this.enqueueOperation({op:`setCanvasProperty`,prop:`height`,value:e})}getContext(e=`2d`,t){let n=String(e).toLowerCase();if(!On.has(n)&&!kn.has(n))return null;if(this.contexts.has(n))return this.contexts.get(n);let r=I(`canvas_context`);this.enqueueOperation({op:`getContext`,contextId:r,contextType:n,attributes:P(t)});let i=kn.has(n)?new Vn(this,r,n):new Bn(this,r);return this.contexts.set(n,i),i}createImage(){return new zn(this,I(`canvas_image`))}requestAnimationFrame(e){let t=Pn++,r=C.store(t=>{n(e)&&e(t)});return N(this.bridgeId,`canvasNodeRequestAnimationFrame`,{nodeId:this.nodeId,requestId:t,callback:r}),t}cancelAnimationFrame(e){N(this.bridgeId,`canvasNodeCancelAnimationFrame`,{nodeId:this.nodeId,requestId:e})}getImageData({contextId:e,x:t,y:n,width:r,height:i}){return new Promise((a,o)=>{let s=C.store(e=>{a(e)});this.enqueueOperation({op:`getImageData`,contextId:e,x:t,y:n,width:r,height:i,callback:s})})}toDataURL(e=`image/png`,t){return new Promise(n=>{let r=C.store(e=>{n(e)});this.enqueueOperation({op:`toDataURL`,mimeType:e,quality:t,callback:r})})}enqueueOperation(e){this.pendingOperations.push(e),!this.flushScheduled&&(this.flushScheduled=!0,Fn(()=>this.flushOperations()))}flushOperations(){if(this.flushScheduled=!1,this.pendingOperations.length===0)return;let e=this.pendingOperations;this.pendingOperations=[],N(this.bridgeId,`canvasNodeFlush`,{nodeId:this.nodeId,operations:e})}};function Un(e,t=M()){return!e||e.__diminaNodeType!==`dimina-canvas-node`?e:new Hn({nodeId:e.nodeId,bridgeId:t,width:e.width,height:e.height,type:e.type})}function Wn(e,t=M()){return Array.isArray(e)?e.map(e=>Wn(e,t)):!e||typeof e!=`object`?e:e.node?{...e,node:Un(e.node,t)}:e}function Gn(e={}){let t=Number(e.width)||300,n=Number(e.height)||150,r=e.type||`2d`,i=I(`offscreen_canvas`),a=M();return N(a,`createOffscreenCanvas`,{nodeId:i,width:t,height:n,type:r}),new Hn({nodeId:i,bridgeId:a,width:t,height:n,type:r,offscreen:!0})}var Kn=t({createSelectorQuery:()=>L});function L(){return new Xn}function qn(){return E.getPageInfo()}function Jn(){let e=qn();return e?.__id__||e?.id}function Yn(){let e=qn();return e?.bridgeId||e?.id}var Xn=class{constructor(){this.__componentId=Jn(),this.__taskQueue=[],this.__cbQueue=[]}in(e){return this.__componentId=e.__id__,this}select(e){return new R(this,this.__componentId,e,!0)}selectAll(e){return new R(this,this.__componentId,e,!1)}selectViewport(){return new R(this,Jn(),``,!0)}__push(e,t,n,r,i){this.__taskQueue.push({moduleId:t,selector:e,single:n,fields:r}),this.__cbQueue.push(i)}exec(e){let t=this,r=Yn();O(`selectorQuery`,{tasks:this.__taskQueue,success:i=>{let a=Wn(i,r)||[];a.forEach((e,r)=>{let i=t.__cbQueue[r];n(i)&&i.call(t,e)}),n(e)&&e.call(t,a)}},`render`)}},R=class{constructor(e,t,n,r){this.__selectorQuery=e,this.__moduleId=t,this.__selector=n,this.__single=r}fields(e,t){return this.__selectorQuery.__push(this.__selector,this.__moduleId,this.__single,e,t),this.__selectorQuery}boundingClientRect(e){return this.fields({id:!0,dataset:!0,rect:!0,size:!0},e)}context(e){return this.fields({context:!0},e)}node(e){return this.fields({node:!0},e)}scrollOffset(e){return this.fields({id:!0,dataset:!0,scrollOffset:!0},e)}},Zn=t({createIntersectionObserver:()=>Qn});function Qn(e,t={}){let{thresholds:n=[0],initialRatio:r=0,observeAll:i=!1}=t;return new $n(e,{thresholds:n,initialRatio:r,observeAll:i})}var $n=class{constructor(e,t){this._component=e,this._options=t,this._relativeInfo=[],this._observerId=null,this._disconnected=!1}relativeTo(e,t={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:e,margins:[`left`,`right`,`top`,`bottom`].map(e=>`${t[e]===void 0?0:t[e]}px`).join(` `)}),this}relativeToViewport(e={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:null,margins:[`left`,`right`,`top`,`bottom`].map(t=>`${e[t]===void 0?0:e[t]}px`).join(` `)}),this}observe(e,t){let n=this,r=C.store(e=>{n._disconnected||(n._observerId=e.observerId),e.info&&t.call(n,e.info)},!0);O(`addIntersectionObserver`,{moduleId:this._component.__id__,targetSelector:e,relativeInfo:this._relativeInfo,options:this._options,success:r},`render`)}disconnect(){O(`removeIntersectionObserver`,{observerId:this._observerId},`render`),this._disconnected=!0}},z=new Map;function B(e){return z.has(e)||z.set(e,{depth:0,scheduled:!1,updates:[],byModuleId:new Map,callbackIds:[]}),z.get(e)}function V(e,t){let r=(Array.isArray(t)?t:[t]).filter(n);if(r.length!==0)return C.store(()=>{r.forEach(t=>t.call(e))})}function er(e){let t=B(e);t.depth++}function tr(e){let t=B(e);t.depth>0&&t.depth--,t.depth===0&&nr(e)}function H(e,t,n,r){let i=B(e),a=i.byModuleId.get(t);if(a)Object.assign(a.data,n);else{let e={moduleId:t,data:{...n}};i.byModuleId.set(t,e),i.updates.push(e)}r&&i.callbackIds.push(r),i.depth===0&&!i.scheduled&&(i.scheduled=!0,Promise.resolve().then(()=>{i.scheduled=!1,i.depth===0&&nr(e)}))}function nr(e){let t=z.get(e);if(!t||t.updates.length===0)return;let n=t.updates,r=t.callbackIds;t.updates=[],t.byModuleId=new Map,t.callbackIds=[],t.scheduled=!1,T.send({type:`ub`,target:`render`,body:{bridgeId:e,updates:n,callbackIds:r}})}function rr(e){let t=e.__mpxProxy?.options?.computed;if(t)for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e.data,n)||(e.data[n]=null)}function U(e){return i(e)?e:Object.entries(e).reduce((e,[t,r])=>t.startsWith(`$`)?e:n(r)?(console.warn(`[service] 值不支持函数引用`,t),e):(Array.isArray(r)?e[t]=r.map(e=>typeof e==`object`&&e?e instanceof Date?e.getTime():U(e):e):r&&typeof r==`object`&&!Array.isArray(r)?r instanceof Date?e[t]=r.getTime():e[t]=U(r):e[t]=r,e),{})}function ir(e){if(e){let t={};for(let r in e){let i=e[r];t[r]=t[r]||{};let a=i&&typeof i==`object`&&Object.prototype.hasOwnProperty.call(i,`type`)?W(i.type):W(i),o=null;if(o=Array.isArray(a)?[...a]:[a],i&&i.optionalTypes){let e=W(i.optionalTypes);Array.isArray(e)?o=[...e]:o.push(e)}t[r].type=o,t[r].type.length>0&&(i&&n(i.value)?t[r].default=i.value():i&&(t[r].default=i.value))}return t}}var ar=new Map([[String,`s`],[Number,`n`],[Boolean,`b`],[Object,`o`],[Array,`a`],[Function,`f`]]);function W(e){return Array.isArray(e)?e.map(e=>W(e)):e===null||e===``?null:ar.get(e)||(console.warn(`[service] ignore unknown props type ${e}`),null)}function or(e,t,n,r,i){let a=new Set;for(let o of e)for(let e in t){if(a.has(e))continue;let s=e.split(`,`).map(e=>e.trim());if(s.includes(o)){a.add(e);let c=t[e],l=s.map(e=>g(n,e));s.length===1?c.call(r,...l,i[o]):c.call(r,...l);continue}if(e===`**`){a.add(e),t[e].call(r,n);continue}let c=e.split(`.`),l=o.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u&&c.length>1){a.add(e);let s=n;for(let e of c)e!==`**`&&(s=s?.[e]);e===o?t[e].call(r,s,i[o]):t[e].call(r,s)}}}function sr(e,t,n,r,i){for(let a in t){let o=t[a],s=a.split(`,`).map(e=>e.trim());if(s.includes(e)){let t=s.map(e=>g(n,e));s.length===1&&s[0]===e?o.call(r,...t,i):o.call(r,...t);continue}if(a===`**`){o.call(r,n);continue}let c=a.split(`.`),l=e.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u){let t=n;for(let e of c)e!==`**`&&(t=t[e]);a===e?o.call(r,t,i):o.call(r,t);continue}let d=a.match(/^(.+)\[(\d+)\]$/);if(d){let t=d[1],i=Number.parseInt(d[2],10);if(t===e.split(`[`)[0]&&n[t]&&n[t][i]!==void 0){o.call(r,n[t][i]);continue}}if(e.startsWith(a)){let e=a.split(`.`).reduce((e,t)=>e&&e[t],n);if(e!==void 0){o.call(r,e);continue}}}}function cr(e={},t=``){let n=t.trim();if(!n)return;let r=n.replace(/-/g,``).toLowerCase(),i=[n,ae(n),oe(n),r];for(let t of i)if(t&&e[t]!==void 0)return e[t]}function G(e,t,n){let r=e.__info__||{};if(r.behaviorObservers)for(let i in r.behaviorObservers){let a=r.behaviorObservers[i];if(!(!Array.isArray(a)||a.length===0))for(let r of t)a.forEach(t=>{sr(r,{[i]:t},e.data,e,n[r])})}}function lr(e,t,n){dr(e,t,n)}function ur(e,t,i){let a=[];for(let o of t){let t=e.__info__.properties?.[o]?.observer,s=e.data[o],c=i[o];r(t)?a.push(()=>e[t]?.(s,c)):n(t)&&a.push(()=>t.call(e,s,c))}return a}function dr(e,t,n){ur(e,t,n).reverse().forEach(e=>e())}function fr(e,t){if(!Array.isArray(t))return;let r=new WeakMap;function i(e,t){let n={...e};for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=n[e],a=t[e];r&&typeof r==`object`&&!Array.isArray(r)&&a&&typeof a==`object`&&!Array.isArray(a)?n[e]=i(r,a):n[e]=a}return n}function a(e,t){if(typeof t==`string`){o(e,t);return}if(!t||typeof t!=`object`||r.has(t))return;r.set(t,!0),Array.isArray(t.behaviors)&&t.behaviors.forEach(t=>a(e,t)),t.properties&&(e.properties={...t.properties,...e.properties}),t.data&&(e.data||={},e.data=i(t.data,e.data));let s=[`created`,`attached`,`ready`,`detached`];e.behaviorLifetimes=e.behaviorLifetimes||{};for(let r of s)n(t[r])&&(e.behaviorLifetimes[r]=e.behaviorLifetimes[r]||[],e.behaviorLifetimes[r].push(t[r]));if(t.observers){e.behaviorObservers=e.behaviorObservers||{};for(let n in t.observers)e.behaviorObservers[n]||(e.behaviorObservers[n]=[]),e.behaviorObservers[n].push(t.observers[n])}if(t.methods&&(e.methods={...t.methods,...e.methods}),t.relations&&(e.relations={...e.relations,...t.relations}),t.export&&(e.export=t.export),t.pageLifetimes){e.behaviorPageLifetimes=e.behaviorPageLifetimes||{};for(let r of[`show`,`hide`,`resize`,`routeDone`])n(t.pageLifetimes[r])&&(e.behaviorPageLifetimes[r]=e.behaviorPageLifetimes[r]||[],e.behaviorPageLifetimes[r].push(t.pageLifetimes[r]))}}function o(e,t){switch(t){case`wx://component-export`:break;case`wx://form-field`:break;case`wx://form-field-button`:break;default:console.warn(`[service] 未知的内置 behavior: ${t}`)}}t.forEach(t=>a(e,t))}function K(e,t,n){let r=e;for(;r&&r.__parentId__;){if(r.__parentId__===t)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}function q(e,t){if(!e||!t)return!1;if(e.startsWith(`#`)){let n=e.slice(1);return t.id===n}if(e.startsWith(`.`)){let n=e.slice(1);return t.__targetInfo__?.class&&t.__targetInfo__.class.split(` `).includes(n)}if(e.startsWith(`[`)&&e.endsWith(`]`)){let n=e.slice(1,-1).match(/^(\w+)(?:=["']?([^"']*)["']?)?$/);if(n){let[,e,r]=n,i=t.__targetInfo__?.dataset||{};return r===void 0?Object.prototype.hasOwnProperty.call(i,e):i[e]===r}return!1}return t.is?t.is.split(`/`).pop()===e||t.is===e:!1}function pr(e,t){if(!e||!Array.isArray(e.dependencies))return!1;for(let n of e.dependencies){if(n in t)return!0;for(let e of Object.keys(t))if(e.startsWith(n+`.`)||e.startsWith(n+`[`)||n.startsWith(e+`.`)||n.startsWith(e+`[`))return!0}return!1}function mr(e,t){if(!(!e||!e.expression)){if(e.isSimple)return g(t,e.expression);try{return Function(`data`,`with(data) { return ${e.expression} }`)(t)}catch(t){console.warn(`[service] 计算表达式失败:`,e.expression,t);return}}}function hr(e,t,n){let r=Object.values(t||{}),i=[];for(let t of r){if(!K(t,e.__id__,r)||t.__parentId__!==e.__id__)continue;let a=t.__info__?.properties||{},o={};for(let r in a){let i=e.__childPropsBindings__?.[t.__id__]?.[r];i&&pr(i,n)&&(o[r]=mr(i,e.data))}Object.keys(o).length>0&&(t.tO?.(o),t.__pendingSyncedProps__=t.__pendingSyncedProps__||{},Object.assign(t.__pendingSyncedProps__,o),i.push({child:t,data:o}))}return i}var gr=[`created`,`attached`,`ready`,`moved`,`detached`,`error`],_r=[`show`,`hide`,`resize`,`routeDone`],vr=class{constructor(e,t){this.initd=!1,this.opts=t,t.targetInfo&&(this.id=t.targetInfo.id,this.dataset=t.targetInfo.dataset,this.__targetInfo__=t.targetInfo),this.is=t.path,this.route=t.path,this.query=t.query,this.renderer=`webview`,this.bridgeId=t.bridgeId,this.id||=t.bridgeId,this.behaviors=e.behaviors,this.data=ce(e.noReferenceData),Object.defineProperty(this,"properties",{get(){return this.data},enumerable:!0,configurable:!1}),this.__isComponent__=e.isComponent,this.__type__=e.type,this.__id__=this.opts.moduleId,this.__info__=e.moduleInfo,this.__eventAttr__=t.eventAttr,this.__pageId__=t.pageId,this.__parentId__=t.parentId,this.__relations__=new Map,this.__relationPaths__=new Map,this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[],this.__pendingInitSetDataCallbacks__=[],this.__childPropsBindings__={},this.__pendingSyncedProps__={},this.__initialPropertyObserversInvoked__=!1}init(){if(this.__isComponent__)for(let e in this.__info__.properties)!Object.prototype.hasOwnProperty.call(this.opts.properties,e)||this.opts.properties[e]===void 0?this.data[e]=this.__info__.properties[e]?.value??null:this.data[e]=this.opts.properties[e];return this.#d(),this.#f(),this.#t(),this.#e(),this.#m().then(()=>{rr(this),T.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],H(this.bridgeId,this.__id__,{},V(this,e))}#e(){this.hasBehavior(`wx://component-export`)&&this.__info__.export&&n(this.__info__.export)&&(this.export=this.__info__.export.bind(this))}#t(){let e=this.__info__.relations;if(!(!e||typeof e!=`object`))for(let[t]of Object.entries(e)){let e=this.#n(t);this.__relationPaths__.set(t,e),this.__relations__.has(t)||this.__relations__.set(t,[])}}#n(e){if(e.startsWith(`./`)){let t=this.is.lastIndexOf(`/`);return t===-1?e.substring(2):`${this.is.substring(0,t)}/${e.substring(2)}`}else if(e.startsWith(`../`)){let t=this.is.split(`/`),n=e.split(`/`),r=t.slice(0,-1);for(let e of n)e===`..`?r.pop():e!==`.`&&r.push(e);return r.join(`/`)}else return e}#r(){let e=this.__info__.relations;if(!e)return;let t=Object.values(Z.instances[this.bridgeId]||{});for(let[n,r]of Object.entries(e)){let{type:e,target:i}=r,a=this.__relationPaths__.get(n),o=t.filter(e=>i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`)).filter(t=>this.#o(t,e)||this.#a(t,e));for(let e of o)this.#c(n,e,r)}this.#i()}#i(){let e=Object.values(Z.instances[this.bridgeId]||{});for(let t of e)t!==this&&t._checkRelationsWithTarget&&t._checkRelationsWithTarget(this)}_checkRelationsWithTarget(e){let t=this.__info__.relations;if(t)for(let[n,r]of Object.entries(t)){let{type:t,target:i}=r,a=this.__relationPaths__.get(n),o=!1;o=i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`);let s=this.#o(e,t),c=this.#a(e,t);o&&(s||c)&&this.#c(n,e,r)}}#a(e,t){if(t!==`descendant`&&t!==`ancestor`)return!1;let n=t===`descendant`?`ancestor`:`descendant`,r=e.__info__?.relations;return r?Object.entries(r).some(([t,r])=>{let i=e.__relationPaths__?.get(t);return r.type===n&&(this.is===i||this.is.endsWith(`/${i}`))}):!1}#o(e,t){let n=Object.values(Z.instances[this.bridgeId]||{});switch(t){case`parent`:return e.__id__===this.__parentId__;case`child`:return e.__parentId__===this.__id__;case`ancestor`:return this.#s(e.__id__,this.__id__,n);case`descendant`:return this.#s(this.__id__,e.__id__,n);default:return!1}}#s(e,t,n){let r=n.find(e=>e.__id__===t);for(;r&&r.__parentId__;){if(r.__parentId__===e)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}#c(e,t,r){let i=this.__relations__.get(e)||[];if(!i.includes(t)&&(i.push(t),this.__relations__.set(e,i),n(r.linked)))try{r.linked.call(this,t)}catch(e){console.error(`[service] relation linked error:`,e)}}#l(e,t,r){let i=this.__relations__.get(e)||[],a=i.indexOf(t);if(a!==-1&&(i.splice(a,1),this.__relations__.set(e,i),n(r.unlinked)))try{r.unlinked.call(this,t)}catch(e){console.error(`[service] relation unlinked error:`,e)}}#u(e,t,r){if(n(r.linkChanged))try{r.linkChanged.call(this,t)}catch(e){console.error(`[service] relation linkChanged error:`,e)}}setData(e,t){let r=U(e),i={};for(let e in r)i[e]=this.data[e],ne(this.data,e,r[e]);if(this.__info__.observers&&or(Object.keys(r),this.__info__.observers,this.data,this,i),G(this,Object.keys(r),i),lr(this,Object.keys(r),i),!this.initd){n(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}if(this.__groupSetDataMode__){for(let e in r)this.__groupSetDataBuffer__[e]=r[e];n(t)&&this.__groupSetDataCallbacks__.push(t);return}let a=hr(this,Z.instances[this.bridgeId],r);H(this.bridgeId,this.__id__,r,V(this,t)),a.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}#d(){gr.forEach(e=>{let t=this.__info__.lifetimes?.[e]||this.__info__[e];n(t)&&(this[e]=t.bind(this))}),this.__isComponent__&&_r.forEach(e=>{let t=this.__info__.pageLifetimes?.[e];n(t)&&(e===`show`?e=`onShow`:e===`hide`&&(e=`onHide`),this[e]=t.bind(this))})}#f(){let e=this.__info__.methods;for(let t in e)n(e[t])&&(this[t]=e[t].bind(this))}#p(){if(!this.__isComponent__||!this.__info__.properties||this.__initialPropertyObserversInvoked__)return;let e=[];for(let t of Object.keys(this.__info__.properties)){let i=this.__info__.properties[t]?.observer,a=this.data[t];r(i)?e.push(()=>this[i]?.(a,void 0)):n(i)&&e.push(()=>i.call(this,a,void 0))}e.forEach(e=>e()),this.__initialPropertyObserversInvoked__=!0}async#m(){this.__isComponent__?(await this.componentCreated(),await this.componentAttached()):(await this.componentCreated(),await this.componentAttached(),await this.onLoad?.(this.opts.query||{})),this.initd=!0}tO(e){let t={};for(let[n,r]of Object.entries(e)){if(this.__pendingSyncedProps__&&Object.prototype.hasOwnProperty.call(this.__pendingSyncedProps__,n)&&a(this.__pendingSyncedProps__[n],r)){this.data[n]=r,delete this.__pendingSyncedProps__[n];continue}t[n]=r}if(Object.keys(t).length===0)return;let n=[],r={};for(let[e,i]of Object.entries(t)){let t=this.data[e];r[e]=t,this.data[e]=i,this.__info__.observers&&n.push(()=>sr(e,this.__info__.observers,this.data,this,t))}n.forEach(e=>e()),G(this,Object.keys(t),Object.fromEntries(Object.keys(t).map(e=>[e,void 0]))),dr(this,Object.keys(t),r)}getPageId(){return this.__id__}hasBehavior(e){let t=function(n){if(!Array.isArray(n))return!1;if(n.includes(e))return!0;for(let e of n)if(e&&e.behaviors&&t(e.behaviors))return!0;return!1};return t(this.behaviors)}createSelectorQuery(){return L().in(this)}selectComponent(e){let t=Object.values(Z.instances[this.bridgeId]),n=t.find(n=>K(n,this.__id__,t)&&q(e,n));return n?n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(Z.instances[this.bridgeId]);return t.filter(n=>K(n,this.__id__,t)&&q(e,n))}selectOwnerComponent(){let e=Object.values(Z.instances[this.bridgeId]);for(let t of e)if(t.id===this.__parentId__)return t;return null}createIntersectionObserver(e){return Qn(this,e)}groupSetData(e){if(!n(e)){console.warn(`[service] groupSetData callback must be a function`);return}this.__groupSetDataMode__=!0,er(this.bridgeId),this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];try{e.call(this)}catch(e){console.error(`[service] groupSetData callback error:`,e)}finally{if(this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__&&Object.keys(this.__groupSetDataBuffer__).length>0){let e=this.__groupSetDataBuffer__,t=this.__groupSetDataCallbacks__;this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];let n=hr(this,Z.instances[this.bridgeId],e);H(this.bridgeId,this.__id__,e,V(this,t)),n.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}else this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];tr(this.bridgeId)}}createMediaQueryObserver(){console.warn(`[service] 暂不支持 createMediaQueryObserver`)}getRelationNodes(e){return e?[...this.__relations__.get(e)||[]]:(console.warn(`[service] getRelationNodes 需要传入关系路径参数`),[])}animate(){console.warn(`[service] 暂不支持 animate`)}clearAnimation(){console.warn(`[service] 暂不支持 clearAnimation`)}async triggerEvent(e,t,n={}){if(!e)return;let r=e.trim(),i=cr(this.__eventAttr__,r);i&&await Z.triggerEvent({bridgeId:this.bridgeId,moduleId:this.__pageId__,methodName:i,event:{type:r,detail:t,currentTarget:{id:this.id,dataset:this.dataset},target:{id:this.id,dataset:this.dataset}}}),n.bubbles&&await Z.instances[this.bridgeId][this.__parentId__]?.triggerEvent(e,t),n.composed,n.capturePhase}pageReady(){this.__isComponent__||this.ready?.()}pageUnload(){this.__isComponent__||this.onUnload?.()}pageScrollTop(e){if(!this.__isComponent__){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.resize?.(e)}componentRouteDone(){this.__info__.behaviorPageLifetimes?.routeDone?.forEach(e=>e.call(this)),this.routeDone?.()}async componentCreated(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.()}async componentAttached(){this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),this.#r()}componentReadied(){this.#p(),this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.()}componentMoved(){this.moved?.();let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=this.__relations__.get(t)||[];for(let r of e)this.#u(t,r,n)}}componentDetached(){let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=[...this.__relations__.get(t)||[]];for(let r of e)this.#l(t,r,n)}this.#h(),this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.initd=!1}#h(){let e=Object.values(Z.instances[this.bridgeId]||{});for(let t of e)if(!(t===this||!t.__relations__))for(let[e,r]of t.__relations__.entries()){let i=r.indexOf(this);if(i!==-1){r.splice(i,1),t.__relations__.set(e,r);let a=t.__info__.relations?.[e];if(a&&n(a.unlinked))try{a.unlinked.call(t,this)}catch(e){console.error(`[service] relation unlinked error:`,e)}}}}componentError(e){this.error?.(e)}},J=class e{static type=`component`;constructor(t,n){this.moduleInfo=t,this.extraInfo=n,this.type=e.type,this.isComponent=this.extraInfo.component,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,fr(this.moduleInfo,this.behaviors),this.noReferenceData=U(this.moduleInfo.data||{})}getProps(){let e=ir(this.moduleInfo.properties);if(Array.isArray(this.moduleInfo.externalClasses)&&this.moduleInfo.externalClasses.length>0){e||={};for(let t of this.moduleInfo.externalClasses)e[t]={type:[`s`],cls:!0}}return e}},yr=class{constructor(e,t){this.initd=!1,this.opts=t,this.is=t.path,this.route=t.path,this.bridgeId=t.bridgeId,this.id=t.bridgeId,this.query=t.query,this.data=ce(e.noReferenceData),this.__type__=e.type,this.__id__=t.moduleId,this.__info__=e.moduleInfo,this.__childPropsBindings__={},this.__pendingInitSetDataCallbacks__=[]}init(){return this.#e(),this.#t().then(()=>{rr(this),T.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],H(this.bridgeId,this.__id__,{},V(this,e))}setData(e,t){let r=U(e),i={},a=this.__info__||{};for(let e in r)i[e]=this.data[e],ne(this.data,e,r[e]);if(a.observers&&or(Object.keys(r),a.observers,this.data,this,i),G(this,Object.keys(r),i),!this.initd){n(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}let o=hr(this,Z.instances[this.bridgeId],r);H(this.bridgeId,this.__id__,r,V(this,t)),o.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}createSelectorQuery(){return L().in(this)}selectComponent(e){let t=Object.values(Z.instances[this.bridgeId]||{}),n=t.find(n=>K(n,this.__id__,t)&&q(e,n));return n?n.hasBehavior&&n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(Z.instances[this.bridgeId]||{});return t.filter(n=>K(n,this.__id__,t)&&q(e,n)).map(e=>e.hasBehavior&&e.hasBehavior(`wx://component-export`)&&e.export?e.export():e)}#e(){for(let e in this.__info__){let t=this.__info__[e];n(t)?this[e]=t.bind(this):this[e]=t}}async#t(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.(),this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),await this.onLoad?.(this.opts.query||{}),this.initd=!0}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageReady(){this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.(),this.onReady?.()}pageUnload(){this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.onUnload?.(),this.initd=!1}pageScrollTop(e){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.onResize?.(e)}},Y=class e{static type=`page`;constructor(t,r){if(this.moduleInfo=t,this.extraInfo=r,this.type=e.type,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,fr(this.moduleInfo,this.behaviors),this.moduleInfo.methods)for(let[e,t]of Object.entries(this.moduleInfo.methods))!(e in this.moduleInfo)&&n(t)&&(this.moduleInfo[e]=t);this.noReferenceData=U(this.moduleInfo.data||{})}},br=class{static type=`app`;constructor(e){this.moduleInfo=e}},X=new class{constructor(){this.staticModules={}}loadResource(e){let{appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a}=e;if(y&&(this.isScriptLoaded=this.isScriptLoaded||{},!this.isScriptLoaded[i])){let e=`${a}${t}/${i}/logic.js`;globalThis.importScripts(e),this.isScriptLoaded[i]=!0}E.setInitId(n),S(`app`),S(r),T.invoke({type:`serviceResourceLoaded`,target:`service`,body:{bridgeId:n}})}createAppModule(e){let t=new br(e);this.staticModules[br.type]=t}createModule(e,t,n){let{path:r,usingComponents:i}=t;if(!this.staticModules[r]){if(i)for(let e of Object.values(i))S(e);if(n===Y.type){let n=new Y(e,t);this.staticModules[r]=n}else if(n===J.type){let n=new J(e,t);this.staticModules[r]=n}else console.error(`[service] createModule ${n} error`)}}getPropsByPath(e){let t={};return this.getComponentProps(t,e),t}getComponentProps(e,t){if(t)for(let n of Object.values(t)){let t=this.staticModules[n];!t||e[n]||(e[n]=t.getProps(),this.getComponentProps(e,t.usingComponents))}}getAppModule(){return this.staticModules[br.type]}getModuleByPath(e){return this.staticModules[e]}},Z=new class{constructor(){this.app=null,this.instances={}}queuePendingEvent(e,t){return e.__pendingRuntimeEvents__=e.__pendingRuntimeEvents__||[],new Promise((n,r)=>{e.__pendingRuntimeEvents__.push({...t,resolve:n,reject:r})})}async flushPendingEvents(e){let t=e?.__pendingRuntimeEvents__||[];e.__pendingRuntimeEvents__=[];for(let e of t)try{let t=await this.dispatchEvent(e);e.resolve(t)}catch(t){e.reject(t)}}async dispatchEvent({instance:e,bridgeId:t,moduleId:r,methodName:i,event:a}){if(n(e[i]))return await e[i](a);console.warn(`[service] triggerEvent ${t} ${r}, is: ${e.is}, method: ${i} is not exist`)}createApp(e){if(this.app){console.log(`[service] app instance already existed`);return}let{scene:t,pagePath:n,query:r}=e,i=X.getAppModule();if(!i){console.log(`[service] app instance is not exist`);return}console.log(`[service] create app instance`),this.app=new Dn(i,{scene:t,path:n,query:r})}appShow(){this.app?.appShow()}appHide(){this.app?.appHide()}stackShow(e){E.pushStack(e)}stackHide(e){E.popStack(e)}createInstance(e){let{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l,stackId:u}=e,d=X.getModuleByPath(r);if(!d){console.error(`[service] ${r} not exist`);return}if(console.log(`[service] create instance ${r}`),this.instances[t]=this.instances[t]||{},d.type===J.type){let e=new vr(d,{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l});return this.instances[t][n]=e,d.isComponent||E.push(e,u),e.init(),e}else if(d.type===Y.type){let e=new yr(d,{bridgeId:t,moduleId:n,path:r,query:i});return this.instances[t][n]=e,E.push(e,u),e.init(),e}else console.error(`[service] ${d.type} instance is not exist.`)}moduleReady(e){let{bridgeId:t,moduleId:n,propBindings:r}=e,i=this.instances[t][n];if(i){if(r&&i.__parentId__){let e=this.instances[t]?.[i.__parentId__];e&&(e.__childPropsBindings__||={},e.__childPropsBindings__[n]=r)}if(i.__type__===J.type){i.componentReadied(),i.__componentReadied__=!0,this.flushPendingEvents(i),i.flushInitSetDataCallbacks?.();let e=this.getPageInstance(t);e&&this.checkAndCallPageReady(t,e.__id__)}}}moduleUnmounted(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(r.__type__===J.type&&r.componentDetached(),delete this.instances[t][n])}pageShow(e){let{bridgeId:t}=e,n=this.instances[t];if(!n)return;let r=[];Object.values(n).forEach(e=>{e&&(e.__type__===Y.type?r.push(e):e.__type__===J.type&&(e.__isComponent__?e.pageShow():r.push(e)))}),r.forEach(e=>{e.pageShow()})}pageReady(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(this.pageShow(e),r.__pageReadyPending__=!0,r.flushInitSetDataCallbacks?.(),this.checkAndCallPageReady(t,n))}getPageInstance(e){let t=this.instances[e];return t?Object.values(t).find(e=>e&&(e.__type__===Y.type||e.__type__===J.type&&!e.__isComponent__)):null}checkAndCallPageReady(e,t){let n=this.instances[e][t];if(!n||!n.__pageReadyPending__)return;let r=this.instances[e];if(!r){n.__pageReadyPending__=!1,n.pageReady();return}Object.values(r).filter(e=>e&&e.__type__===J.type&&e.__isComponent__&&e.initd&&!e.__componentReadied__).length===0&&(n.__pageReadyPending__=!1,n.pageReady())}pageHide(e){let{bridgeId:t}=e,n=this.instances[t],r=[];Object.values(n).forEach(e=>{e&&(e.__type__===Y.type?r.push(e):e.__type__===J.type&&(e.__isComponent__?e.pageHide():r.push(e)))}),r.forEach(e=>{e&&e.pageHide()})}pageUnload(e){let{bridgeId:t}=e,n=this.instances[t];n&&(Object.values(n).forEach(e=>{e&&(e.__type__===J.type&&e.componentDetached(),e.pageUnload())}),E.pop(),delete this.instances[t])}pageScroll(e){let{bridgeId:t,moduleId:n,scrollTop:r}=e,i=this.instances[t][n];i&&i.pageScrollTop({scrollTop:r})}pageResize(e){let{bridgeId:t,size:n}=e,r=this.instances[t];r&&Object.values(r).forEach(e=>{e&&(e.__type__===Y.type?e.pageResize(n):e.__type__===J.type&&(e.__isComponent__,e.pageResize(n)))})}componentError(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&r.__type__===J.type&&r.componentError()}componentRouteDone(e){let{bridgeId:t}=e,n=this.instances[t];n&&Object.values(n).forEach(e=>{e?.__type__===J.type&&e.componentRouteDone()})}async triggerEvent(e){let{bridgeId:t,moduleId:n,methodName:r,event:i}=e;if(r===void 0)return;let a=this.instances[t];if(!a){console.warn(`[service] No instances found for bridgeId: ${t}`);return}let o=a[n];if(!o){console.warn(`[service] triggerEvent ${t} ${n} ${r}, instance is not exist`);return}return o.__type__===J.type&&o.__isComponent__&&!o.__componentReadied__?this.queuePendingEvent(o,{instance:o,bridgeId:t,moduleId:n,methodName:r,event:i}):this.dispatchEvent({instance:o,bridgeId:t,moduleId:n,methodName:r,event:i})}},xr=t({getEnterOptionsSync:()=>Cr,getLaunchOptionsSync:()=>Sr});function Sr(){return Z.app?.options}function Cr(){return Z.app?.options}var wr=t({getLocation:()=>Tr,offLocationChange:()=>Ar,onLocationChange:()=>kr,openLocation:()=>Dr,startLocationUpdate:()=>Er,stopLocationUpdate:()=>Or});function Tr(e){return O(`getLocation`,e)}function Er(e){return O(`startLocationUpdate`,e)}function Dr(e){return O(`openLocation`,e)}function Or(e){return O(`stopLocationUpdate`,e)}function kr(e){e&&O(`onLocationChange`,{success:C.store(e,!0)})}function Ar(e){if(e){let t=C.store(e,!0);O(`offLocationChange`,{success:t}),C.remove(t)}else O(`offLocationChange`),C.remove()}var jr=t({createMapContext:()=>Mr});function Mr(e,t){return new Nr({mapId:e,obj:t})}var Nr=class{constructor(e){this.opts=e}addMarkers(e){return O(`addMarkers`,e)}removeMarkers(e){return O(`removeMarkers`,e)}includePoints(e){return O(`includePoints`,e)}setCenterOffset(e){return O(`setCenterOffset`,e)}getCenterLocation(e){return O(`getCenterLocation`,e)}getScale(e){return O(`getScale`,e)}moveToLocation(e){return O(`moveToLocation`,e)}translateMarker(e){return O(`translateMarker`,e)}addArc(e){return O(`addArc`,e)}removeArc(e){return O(`removeArc`,e)}},Pr=t({createInnerAudioContext:()=>Lr}),Fr=1,Ir=class{constructor(){this._audioId=Fr++,this._src=``,this._startTime=0,this._autoplay=!1,this._loop=!1,this._volume=1,this._playbackRate=1,this._currentTime=0,this._duration=0,this._buffered=0,this._paused=!0,this._listeners={},O(`audioCreate`,{audioId:this._audioId}),O(`audioListen`,{audioId:this._audioId,evtId:`audio_${this._audioId}`,keep:!0,success:e=>this._dispatch(e)})}_dispatch(e){if(!e||typeof e!=`object`)return;this._currentTime=e.currentTime||0,this._duration=e.duration||0,this._buffered=e.buffered||0,this._paused=!!e.paused;let t=this._listeners[e.event];if(t)for(let n of t.slice())n(e)}get src(){return this._src}set src(e){this._src=e,O(`audioSetProp`,{audioId:this._audioId,prop:`src`,value:e,startTime:this._startTime,loop:this._loop,volume:this._volume,playbackRate:this._playbackRate,autoplay:this._autoplay})}get startTime(){return this._startTime}set startTime(e){this._startTime=Number(e)||0,O(`audioSetProp`,{audioId:this._audioId,prop:`startTime`,value:this._startTime})}get autoplay(){return this._autoplay}set autoplay(e){this._autoplay=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`autoplay`,value:this._autoplay})}get loop(){return this._loop}set loop(e){this._loop=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`loop`,value:this._loop})}get volume(){return this._volume}set volume(e){this._volume=Math.max(0,Math.min(1,Number(e)||0)),O(`audioSetProp`,{audioId:this._audioId,prop:`volume`,value:this._volume})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=Number(e)||1,O(`audioSetProp`,{audioId:this._audioId,prop:`playbackRate`,value:this._playbackRate})}get duration(){return this._duration}get currentTime(){return this._currentTime}get paused(){return this._paused}get buffered(){return this._buffered}play(){this._paused=!1,O(`audioPlay`,{audioId:this._audioId,src:this._src})}pause(){this._paused=!0,O(`audioPause`,{audioId:this._audioId})}stop(){this._paused=!0,O(`audioStop`,{audioId:this._audioId})}seek(e){O(`audioSeek`,{audioId:this._audioId,position:Number(e)||0})}destroy(){O(`audioDestroy`,{audioId:this._audioId}),this._listeners={}}_on(e,t){typeof t==`function`&&(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t))}_off(e,t){this._listeners[e]&&(t?this._listeners[e]=this._listeners[e].filter(e=>e!==t):this._listeners[e]=[])}onPlay(e){this._on(`play`,e)}onPause(e){this._on(`pause`,e)}onStop(e){this._on(`stop`,e)}onEnded(e){this._on(`ended`,e)}onError(e){this._on(`error`,e)}onTimeUpdate(e){this._on(`timeUpdate`,e)}onWaiting(e){this._on(`waiting`,e)}onSeeking(e){this._on(`seeking`,e)}onSeeked(e){this._on(`seeked`,e)}onCanplay(e){this._on(`canplay`,e)}offPlay(e){this._off(`play`,e)}offPause(e){this._off(`pause`,e)}offStop(e){this._off(`stop`,e)}offEnded(e){this._off(`ended`,e)}offError(e){this._off(`error`,e)}offTimeUpdate(e){this._off(`timeUpdate`,e)}offWaiting(e){this._off(`waiting`,e)}offSeeking(e){this._off(`seeking`,e)}offSeeked(e){this._off(`seeked`,e)}offCanplay(e){this._off(`canplay`,e)}};function Lr(){return new Ir}var Rr=t({chooseImage:()=>Hr,compressImage:()=>Vr,previewImage:()=>Br,saveImageToPhotosAlbum:()=>zr});function zr(e){return O(`saveImageToPhotosAlbum`,e)}function Br(e){return O(`previewImage`,e)}function Vr(e){return O(`compressImage`,e)}function Hr(e){return O(`chooseImage`,e)}var Ur=t({chooseMedia:()=>Kr,chooseVideo:()=>Gr,createVideoContext:()=>Wr});function Wr(e,t){return new qr({videoId:e,obj:t})}function Gr(e){return O(`chooseVideo`,e)}function Kr(e){return O(`chooseMedia`,e)}var qr=class{constructor(e){this.opts=e}play(){this.invoke(`play`)}pause(){this.invoke(`pause`)}stop(){this.invoke(`stop`)}seek(e){this.invoke(`seek`,{position:e})}playbackRate(e){this.invoke(`playbackRate`,{rate:e})}requestFullScreen(e={}){this.invoke(`requestFullScreen`,e)}exitFullScreen(){this.invoke(`exitFullScreen`)}requestBackgroundPlayback(e={}){this.invoke(`requestBackgroundPlayback`,e)}exitBackgroundPlayback(){this.invoke(`exitBackgroundPlayback`)}exitPictureInPicture(e={}){this.invoke(`exitPictureInPicture`,e)}showStatusBar(){this.invoke(`showStatusBar`)}hideStatusBar(){this.invoke(`hideStatusBar`)}invoke(e,t={}){O(`videoContext`,{type:`native/video`,id:this.opts.videoId,command:e,...t},`render`)}},Jr=t({exitMiniProgram:()=>Qr,navigateBackMiniProgram:()=>Zr,navigateToMiniProgram:()=>Xr,restartMiniProgram:()=>Yr});function Yr(e){return O(`restartMiniProgram`,e)}function Xr(e){return O(`navigateToMiniProgram`,e)}function Zr(e){return O(`navigateBackMiniProgram`,e)}function Qr(e){return O(`exitMiniProgram`,e)}var $r=t({downloadFile:()=>ei});function ei(e){return O(`downloadFile`,e)}var ti=t({request:()=>ni});function ni(e){return O(`request`,e)}var ri=t({uploadFile:()=>si}),ii=1;function ai(){return`upload_${Date.now()}_${ii++}`}function oi(){let e=[];return{add(t){typeof t==`function`&&e.push(t)},remove(t){e=typeof t==`function`?e.filter(e=>e!==t):[]},dispatch(t){for(let n of e.slice())n(t)}}}function si(e={}){let t=ai(),n=oi(),r=oi(),i=C.store(e=>n.dispatch(e),!0,`${t}_progress`),a=C.store(e=>r.dispatch(e),!0,`${t}_headers`),o=e.complete,s=!1,c=e=>{s||(s=!0,C.remove(i),C.remove(a),n.remove(),r.remove(),typeof o==`function`&&o(e))};try{O(`uploadFile`,{...e,uploadId:t,progress:i,headersReceived:a,complete:c})}catch(e){throw c({errMsg:`uploadFile:fail ${e&&e.message?e.message:e}`}),e}return{abort(){s||O(`uploadFileAbort`,{uploadId:t})},onProgressUpdate(e){n.add(e)},offProgressUpdate(e){n.remove(e)},onHeadersReceived(e){r.add(e)},offHeadersReceived(e){r.remove(e)}}}var ci=t({closeSocket:()=>fi,connectSocket:()=>ui,onSocketClose:()=>gi,onSocketError:()=>hi,onSocketMessage:()=>mi,onSocketOpen:()=>pi,sendSocketMessage:()=>di}),li=class{constructor(e){this.socketId=e,this._readyState=0}send(e={}){let{data:t,success:r,fail:i,complete:a,...o}=e,s={socketId:this.socketId,data:t,...o};return n(r)&&(s.success=C.store(r)),n(i)&&(s.fail=C.store(i)),n(a)&&(s.complete=C.store(a)),O(`sendSocketMessage`,s)}close(e={}){let{code:t=1e3,reason:r=``,success:i,fail:a,complete:o,...s}=e,c={socketId:this.socketId,code:t,reason:r,...s};return n(i)&&(c.success=C.store(i)),n(a)&&(c.fail=C.store(a)),n(o)&&(c.complete=C.store(o)),O(`closeSocket`,c)}onOpen(e){if(n(e))return O(`onSocketOpen`,{socketId:this.socketId,callback:C.store(e,!0)})}offOpen(e){return O(`offSocketOpen`,{socketId:this.socketId,callback:e})}onMessage(e){if(n(e))return O(`onSocketMessage`,{socketId:this.socketId,callback:C.store(e,!0)})}offMessage(e){return O(`offSocketMessage`,{socketId:this.socketId,callback:e})}onError(e){if(n(e))return O(`onSocketError`,{socketId:this.socketId,callback:C.store(e,!0)})}offError(e){return O(`offSocketError`,{socketId:this.socketId,callback:e})}onClose(e){if(n(e))return O(`onSocketClose`,{socketId:this.socketId,callback:C.store(e,!0)})}offClose(e){return O(`offSocketClose`,{socketId:this.socketId,callback:e})}get readyState(){return this._readyState}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}};function ui(e={}){let{url:t,header:r={},protocols:i=[],tcpNoDelay:a=!1,perMessageDeflate:o=!1,timeout:s,forceCellularNetwork:c=!1,success:l,fail:u,complete:d,...f}=e;if(!t){let e=Error(`url is required`);throw n(u)&&u(e),n(d)&&d(e),e}let p=`socket_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,m=new li(p),h={socketId:p,url:t,header:r,protocols:i,tcpNoDelay:a,perMessageDeflate:o,timeout:s,forceCellularNetwork:c,...f};return n(l)&&(h.success=C.store(e=>{m._readyState=li.OPEN,l(e)})),n(u)&&(h.fail=C.store(e=>{m._readyState=li.CLOSED,u(e)})),n(d)&&(h.complete=C.store(d)),O(`connectSocket`,h),m}function di(e){return O(`sendSocketMessage`,e)}function fi(e){return O(`closeSocket`,e)}function pi(e){return O(`onSocketOpen`,{callback:C.store(e,!0)})}function mi(e){return O(`onSocketMessage`,{callback:C.store(e,!0)})}function hi(e){return O(`onSocketError`,{callback:C.store(e,!0)})}function gi(e){return O(`onSocketClose`,{callback:C.store(e,!0)})}var _i=t({getAccountInfoSync:()=>vi});function vi(){return O(`getAccountInfoSync`)}var yi=t({authorize:()=>bi});function bi(e){return O(`authorize`,e)}var xi=t({login:()=>Si});function Si(e){return O(`login`,e)}var Ci=t({login:()=>wi});function wi(e){return O(`login`,e)}var Ti=t({getPrivacySetting:()=>Ei});function Ei(e){return O(`getPrivacySetting`,e)}var Di=t({getSetting:()=>ki,openSetting:()=>Oi});function Oi(e){return O(`openSetting`,e)}function ki(e){return O(`getSetting`,e)}var Ai=t({getUserInfo:()=>ji});function ji(e){return O(`getUserInfo`,e)}var Mi=t({requestPayment:()=>Ni});function Ni(e){return O(`requestPayment`,e)}var Pi=t({hideShareMenu:()=>Li,showShareImageMenu:()=>Ii,showShareMenu:()=>Fi});function Fi(e){return O(`shareShareMenu`,e)}function Ii(e){return O(`showShareImageMenu`,e)}function Li(e){return O(`hideShareMenu`,e)}var Ri=t({clearStorage:()=>Ki,clearStorageSync:()=>Hi,getStorage:()=>Wi,getStorageInfo:()=>Ji,getStorageInfoSync:()=>qi,getStorageSync:()=>Bi,removeStorage:()=>Gi,removeStorageSync:()=>Vi,setStorage:()=>Ui,setStorageSync:()=>zi});function zi(...e){return O(`setStorageSync`,e)}function Bi(e){return O(`getStorageSync`,e)}function Vi(e){return O(`removeStorageSync`,e)}function Hi(){return O(`clearStorageSync`)}function Ui(e){return O(`setStorage`,e)}function Wi(e){return O(`getStorage`,e)}function Gi(e){return O(`removeStorage`,e)}function Ki(){return O(`clearStorage`)}function qi(){return O(`getStorageInfoSync`)}function Ji(e){return O(`getStorageInfo`,e)}var Yi=t({createAnimation:()=>Xi});function Xi(e={}){return new Zi(e)}var Zi=class{constructor({duration:e=400,timingFunction:t=`linear`,delay:n=0,transformOrigin:r=`50% 50% 0`}={}){this.actions=[],this.currentTransform={},this.currentStepAnimates=[],this.option={transition:{duration:e,timingFunction:t,delay:n},transformOrigin:r}}export(){let e=this.actions;return this.actions=[],{actions:e}}step(e={}){for(let e of this.currentStepAnimates)e.type===`style`?this.currentTransform[`${e.type}.${e.args[0]}`]=e:this.currentTransform[e.type]=e;return this.actions.push({animates:Object.keys(this.currentTransform).reduce((e,t)=>[].concat(...e,[this.currentTransform[t]]),[]),option:{transformOrigin:e.transformOrigin===void 0?this.option.transformOrigin:e.transformOrigin,transition:{duration:e.duration===void 0?this.option.transition.duration:e.duration,timingFunction:e.timingFunction===void 0?this.option.transition.timingFunction:e.timingFunction,delay:e.delay===void 0?this.option.transition.delay:e.delay}}}),this.currentStepAnimates=[],this}backgroundColor(e){return this.currentStepAnimates.push({type:`style`,args:[`background-color`,e]}),this}bottom(e){return this.currentStepAnimates.push({type:`style`,args:[`bottom`,x(e)]}),this}height(e){return this.currentStepAnimates.push({type:`style`,args:[`height`,x(e)]}),this}left(e){return this.currentStepAnimates.push({type:`style`,args:[`left`,x(e)]}),this}matrix(e=1,t=0,n=0,r=1,i=1,a=1){return this.currentStepAnimates.push({type:`matrix`,args:[e,t,n,r,i,a]}),this}matrix3d(e=1,t=0,n=0,r=0,i=0,a=1,o=0,s=0,c=0,l=0,u=1,d=0,f=0,p=0,m=0,h=1){return this.currentStepAnimates.push({type:`matrix3d`,args:[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}),this}opacity(e){return this.currentStepAnimates.push({type:`style`,args:[`opacity`,e]}),this}right(e){return this.currentStepAnimates.push({type:`style`,args:[`right`,x(e)]}),this}rotate(e=0){return this.currentStepAnimates.push({type:`rotate`,args:[e]}),this}rotate3d(e=0,t=0,n=0,r=0){return this.currentStepAnimates.push({type:`rotate3d`,args:[e,t,n,r]}),this}rotateX(e){return this.currentStepAnimates.push({type:`rotateX`,args:[e]}),this}rotateY(e){return this.currentStepAnimates.push({type:`rotateY`,args:[e]}),this}rotateZ(e){return this.currentStepAnimates.push({type:`rotateZ`,args:[e]}),this}scale(e=1,t=1){return this.currentStepAnimates.push({type:`scale`,args:[e,t]}),this}scale3d(e=1,t=1,n=1){return this.currentStepAnimates.push({type:`scale3d`,args:[e,t,n]}),this}scaleX(e=1){return this.currentStepAnimates.push({type:`scaleX`,args:[e]}),this}scaleY(e=1){return this.currentStepAnimates.push({type:`scaleY`,args:[e]}),this}scaleZ(e=1){return this.currentStepAnimates.push({type:`scaleZ`,args:[e]}),this}skew(e=0,t=0){return this.currentStepAnimates.push({type:`skew`,args:[e,t]}),this}skewX(e=0){return this.currentStepAnimates.push({type:`skewX`,args:[e]}),this}skewY(e=0){return this.currentStepAnimates.push({type:`skewY`,args:[e]}),this}top(e){return this.currentStepAnimates.push({type:`style`,args:[`top`,x(e)]}),this}translate(e=0,t=0){return this.currentStepAnimates.push({type:`translate`,args:[e,t]}),this}translate3d(e=0,t=0,n=0){return this.currentStepAnimates.push({type:`translate3d`,args:[e,t,n]}),this}translateX(e=0){return this.currentStepAnimates.push({type:`translateX`,args:[e]}),this}translateY(e=0){return this.currentStepAnimates.push({type:`translateY`,args:[e]}),this}width(e){return this.currentStepAnimates.push({type:`style`,args:[`width`,x(e)]}),this}},Qi=t({setBackgroundColor:()=>ea,setBackgroundTextStyle:()=>$i});function $i(e){return O(`setBackgroundTextStyle`,e)}function ea(e){return O(`setBackgroundColor`,e)}var ta=t({canvasToTempFilePath:()=>aa,createCanvasContext:()=>ra,createContext:()=>na,createOffscreenCanvas:()=>Gn,drawCanvas:()=>ia});function na(){return new sa}function ra(e,t){return new sa(e,oa(t))}function ia(e={}){let t={...e,moduleId:e.moduleId||oa(e.component)};delete t.component,O(`drawCanvas`,t,`render`)}function aa(e={},t){let n={...e,moduleId:e.moduleId||oa(t||e.component)};return delete n.component,O(`canvasToTempFilePath`,n,`render`)}function oa(e){return e?.__id__||E.getPageInfo()?.id}var sa=class{constructor(e=``,t=null){this.canvasId=e,this.moduleId=t,this.actions=[]}pushAction(e,...t){return this.actions.push({type:e,args:t}),this}getActions(){return this.actions.slice()}draw(e=!1,t){this.canvasId&&(ia({canvasId:this.canvasId,moduleId:this.moduleId,actions:this.getActions(),reserve:e,success:t}),this.actions=[])}beginPath(){return this.pushAction(`beginPath`)}closePath(){return this.pushAction(`closePath`)}moveTo(e,t){return this.pushAction(`moveTo`,e,t)}lineTo(e,t){return this.pushAction(`lineTo`,e,t)}rect(e,t,n,r){return this.pushAction(`rect`,e,t,n,r)}arc(e,t,n,r,i,a=!1){return this.pushAction(`arc`,e,t,n,r,i,a)}quadraticCurveTo(e,t,n,r){return this.pushAction(`quadraticCurveTo`,e,t,n,r)}bezierCurveTo(e,t,n,r,i,a){return this.pushAction(`bezierCurveTo`,e,t,n,r,i,a)}fill(){return this.pushAction(`fill`)}stroke(){return this.pushAction(`stroke`)}clearRect(e,t,n,r){return this.pushAction(`clearRect`,e,t,n,r)}fillText(e,t,n,r){return this.pushAction(`fillText`,e,t,n,r)}drawImage(e,...t){return this.pushAction(`drawImage`,e,...t)}save(){return this.pushAction(`save`)}restore(){return this.pushAction(`restore`)}translate(e,t){return this.pushAction(`translate`,e,t)}rotate(e){return this.pushAction(`rotate`,e)}scale(e,t){return this.pushAction(`scale`,e,t)}setShadow(e,t,n,r){return this.pushAction(`setShadow`,e,t,n,r)}setFillStyle(e){return this.pushAction(`setFillStyle`,e)}setStrokeStyle(e){return this.pushAction(`setStrokeStyle`,e)}setGlobalAlpha(e){return this.pushAction(`setGlobalAlpha`,e)}setLineCap(e){return this.pushAction(`setLineCap`,e)}setLineJoin(e){return this.pushAction(`setLineJoin`,e)}setLineWidth(e){return this.pushAction(`setLineWidth`,e)}setMiterLimit(e){return this.pushAction(`setMiterLimit`,e)}setFontSize(e){return this.pushAction(`setFontSize`,e)}},ca=t({nextTick:()=>fa}),la=[],ua=null;function da(){let e=la;la=[],ua=null;for(let t=0;t<e.length;t++)e[t]()}function fa(e){n(e)&&(la.push(e),ua||=setTimeout(da,0))}var pa=t({disableAlertBeforeUnload:()=>xa,enableAlertBeforeUnload:()=>ba,hideLoading:()=>ya,hideToast:()=>ha,showActionSheet:()=>va,showLoading:()=>_a,showModal:()=>ga,showToast:()=>ma});function ma(e){return O(`showToast`,e)}function ha(e){return O(`hideToast`,e)}function ga(e){return O(`showModal`,e)}function _a(e){return O(`showLoading`,e)}function va(e){return O(`showActionSheet`,e)}function ya(e){return O(`hideLoading`,e)}function ba(e){return O(`enableAlertBeforeUnload`,e)}function xa(e){return O(`disableAlertBeforeUnload`,e)}var Sa=t({getMenuButtonBoundingClientRect:()=>Ca,offMenuButtonBoundingClientRectWeightChange:()=>Ta,onMenuButtonBoundingClientRectWeightChange:()=>wa}),Q=new Set;function Ca(){return O(`getMenuButtonBoundingClientRect`)}function wa(e){n(e)&&Q.add(e)}function Ta(e){n(e)?Q.delete(e):Q.clear()}var Ea=t({hideNavigationBarLoading:()=>Aa,setNavigationBarColor:()=>ka,setNavigationBarTitle:()=>Oa,showNavigationBarLoading:()=>Da});function Da(e){return O(`showNavigationBarLoading`,e)}function Oa(e){return O(`setNavigationBarTitle`,e)}function ka(e){return O(`setNavigationBarColor`,e)}function Aa(e){return O(`hideNavigationBarLoading`,e)}var ja=t({startPullDownRefresh:()=>Na,stopPullDownRefresh:()=>Ma});function Ma(e){return O(`stopPullDownRefresh`,e)}function Na(e){return O(`startPullDownRefresh`,e)}var Pa=t({pageScrollTo:()=>Fa});function Fa(e){return O(`pageScrollTo`,e)}var Ia=t({hideTabBar:()=>Ba,hideTabBarRedDot:()=>Wa,removeTabBarBadge:()=>Ha,setTabBarBadge:()=>Va,setTabBarItem:()=>Ra,setTabBarStyle:()=>La,showTabBar:()=>za,showTabBarRedDot:()=>Ua});function La(e){return O(`setTabBarStyle`,e)}function Ra(e){return O(`setTabBarItem`,e)}function za(e){return O(`showTabBar`,e)}function Ba(e){return O(`hideTabBar`,e)}function Va(e){return O(`setTabBarBadge`,e)}function Ha(e){return O(`removeTabBarBadge`,e)}function Ua(e){return O(`showTabBarRedDot`,e)}function Wa(e){return O(`hideTabBarRedDot`,e)}var Ga=t({onWindowResize:()=>Ka});function Ka(e){e&&O(`onWindowResize`,{success:e})}var qa=Object.assign({"./core/base/app-event/index.js":De,"./core/base/index.js":Ge,"./core/base/performance/index.js":Ye,"./core/base/subpackage/index.js":et,"./core/base/system/index.js":rt,"./core/base/update/index.js":ft,"./core/camera/index.js":bt,"./core/data-analysis/index.js":Ct,"./core/device/bluetooth/index.js":Et,"./core/device/bluetooth-ble/index.js":Rt,"./core/device/clipboard/index.js":Qt,"./core/device/contact/index.js":tn,"./core/device/keyboard/index.js":an,"./core/device/memory/index.js":sn,"./core/device/network/index.js":un,"./core/device/phone/index.js":fn,"./core/device/scan/index.js":mn,"./core/device/vibrate/index.js":gn,"./core/ext/index.js":yn,"./core/file/index.js":Le,"./core/life-cycle/index.js":xr,"./core/location/index.js":wr,"./core/map/index.js":jr,"./core/media/audio/index.js":Pr,"./core/media/image/index.js":Rr,"./core/media/video/index.js":Ur,"./core/navigate/index.js":Jr,"./core/network/download/index.js":$r,"./core/network/request/index.js":ti,"./core/network/upload/index.js":ri,"./core/network/websocket/index.js":ci,"./core/open-api/account-info/index.js":_i,"./core/open-api/authorize/index.js":yi,"./core/open-api/index.js":xi,"./core/open-api/login/index.js":Ci,"./core/open-api/privacy/index.js":Ti,"./core/open-api/setting/index.js":Di,"./core/open-api/user-info/index.js":Ai,"./core/payment/index.js":Mi,"./core/route/index.js":xe,"./core/share/index.js":Pi,"./core/storage/index.js":Ri,"./core/ui/animation/index.js":Yi,"./core/ui/background/index.js":Qi,"./core/ui/canvas/index.js":ta,"./core/ui/custom-component/index.js":ca,"./core/ui/interaction/index.js":pa,"./core/ui/menu/index.js":Sa,"./core/ui/navigation-bar/index.js":Ea,"./core/ui/pull-down-refresh/index.js":ja,"./core/ui/scroll/index.js":Pa,"./core/ui/tab-bar/index.js":Ia,"./core/ui/window/index.js":Ga,"./core/wxml/intersection-observer/index.js":Zn,"./core/wxml/selector-query/index.js":Kn}),$={};for(let e of Object.values(qa))for(let[t,n]of Object.entries(e))$[t]=n;function Ja(e){for(let t of e||[])typeof t!=`string`||Object.prototype.hasOwnProperty.call($,t)||t in Object.prototype||Object.defineProperty($,t,{value:(...e)=>O(t,...e),writable:!0,enumerable:!0,configurable:!0})}var Ya=new Proxy($,{get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`||r!==void 0||t===`webpackJsonp`?r:(...e)=>O(t,...e)},set(e,t,n,r){return Reflect.set(e,t,n,r)}}),Xa=new class{constructor(){this.init()}init(){let e=globalThis.__diminaApiNamespaces||[],t=globalThis.__diminaRegisteredApis||[];if(globalThis.name)try{let n=JSON.parse(globalThis.name);e.length===0&&(e=n.apiNamespaces||[]),t.length===0&&(t=n.registeredApis||[])}catch{}Ja(t);for(let t of[`dd`,`wx`,...e])globalThis[t]=Ya;globalThis.modRequire=S,globalThis.modDefine=fe,globalThis.global={},globalThis.App=e=>X.createAppModule(e),globalThis.Page=e=>{X.createModule(e,globalThis.__extraInfo,Y.type)},globalThis.Component=e=>{X.createModule(e,globalThis.__extraInfo,J.type)},globalThis.Behavior=e=>e,globalThis.getApp=e=>{let t=Z.app;return!t&&e?.allowDefault?{}:t},globalThis.getCurrentPages=()=>E.stack()}},Za={navigateBack:Ee,navigateTo:Te,reLaunch:Ce,redirectTo:we,switchTab:Se};return new class{constructor(){console.log(`[service] init`),this.env=Xa,this.message=T,this.init()}init(){this.message.on(`loadResource`,e=>{let{appId:t,bridgeId:n,pagePath:r,root:i=`.`,baseUrl:a=`/`,hostEnv:o}=e;o&&w.init(o),X.loadResource({appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a})}),this.message.on(`t`,async e=>{let{bridgeId:t,moduleId:n,methodName:r,event:i,success:a}=e;if(r===void 0)return;let o=await Z.triggerEvent({bridgeId:t,moduleId:n,methodName:r,event:i});o!==void 0&&this.message.send({type:`triggerCallback`,target:`render`,body:{bridgeId:t,moduleId:n,success:a,data:o}})}),this.message.on(`triggerCallback`,e=>{let{id:t,args:n}=e;C.invoke(t,n)}),this.onAppMsg(),this.onModuleMsg()}onAppMsg(){this.message.on(`resourceLoaded`,e=>{let{bridgeId:t,scene:n,pagePath:r,query:i,stackId:a}=e;Z.createApp({scene:n,pagePath:r,query:i});let o=X.getModuleByPath(r);if(!o){console.error(`[service] resourceLoaded: module not found, pagePath: ${r}`);return}let s=X.getPropsByPath(o.usingComponents),c=`page_${_()}`;Z.createInstance({bridgeId:t,moduleId:c,path:r,query:i,stackId:a}),T.send({type:`firstRender`,target:`render`,body:{bridgeId:t,pageId:c,pagePath:r,initialProps:s,query:i}})}),this.message.on(`appShow`,()=>{Z.appShow()}),this.message.on(`appHide`,()=>{Z.appHide()}),this.message.on(`stackShow`,({stackId:e})=>{Z.stackShow(e)}),this.message.on(`stackHide`,({stackId:e})=>{Z.stackHide(e)})}onModuleMsg(){this.message.on(`mC`,e=>{Z.createInstance(e)}),this.message.on(`mR`,e=>{Z.moduleReady(e)}),this.message.on(`mU`,e=>{Z.moduleUnmounted(e)}),this.message.on(`pageUnload`,e=>{Z.pageUnload(e)}),this.message.on(`pageShow`,e=>{Z.pageShow(e)}),this.message.on(`pageReady`,e=>{Z.pageReady(e)}),this.message.on(`pageHide`,e=>{Z.pageHide(e)}),this.message.on(`pagePullDownRefresh`,()=>{}),this.message.on(`pageReachBottom`,()=>{}),this.message.on(`pageShareAppMessage`,()=>{}),this.message.on(`pageScroll`,e=>{Z.pageScroll(e)}),this.message.on(`pageResize`,e=>{Z.pageResize(e)}),this.message.on(`onTabItemTap`,()=>{}),this.message.on(`pageRouteDone`,e=>{let{bridgeId:t}=e;Z.componentRouteDone({bridgeId:t})}),this.message.on(`componentError`,e=>{Z.componentError(e)}),this.message.on(`h5SdkAction`,async(e={})=>{let t=e?.name?.replace(/h5/i,``),{url:n}=e?.params?.data?.params||{};if(e.params&&(e.params.data={...e.params?.data,...e.params?.data?.params||{}}),t===`postMessage`&&e.parentWebViewId){let{moduleId:t,attrs:n,params:r}=e,i={detail:{data:[r?.data?.params?.data]}},a=n.message,o=e.parentWebViewId,s=await Z.triggerEvent({bridgeId:o,moduleId:t,methodName:a,event:i});s!==void 0&&this.message.send({type:`triggerCallback`,target:`service`,body:{bridgeId:o,moduleId:t,success:r?.success,data:s}})}Za[t]?.({url:n,...e.params})})}}})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MiniappSnapshotSource } from '../miniapp-snapshot/types.js';
|
|
2
|
-
import { type AppDataSnapshot } from '
|
|
3
|
-
export type { AppDataSnapshot } from '
|
|
2
|
+
import { type AppDataSnapshot } from '@dimina-kit/inspect';
|
|
3
|
+
export type { AppDataSnapshot } from '@dimina-kit/inspect';
|
|
4
4
|
/**
|
|
5
5
|
* The AppData snapshot data source.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clearAppDataSnapshot, setAppDataSnapshot, } from '../runtime/bridge.js';
|
|
2
|
-
import { AppDataAccumulator, decodeOutgoingMessage, decodeWorkerMessage, } from '
|
|
2
|
+
import { AppDataAccumulator, decodeOutgoingMessage, decodeWorkerMessage, } from '@dimina-kit/inspect';
|
|
3
3
|
/**
|
|
4
4
|
* The AppData snapshot data source.
|
|
5
5
|
*
|