@dimina-kit/devkit 0.1.2-dev.20260728080958 → 0.1.2-dev.20260728095034
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/fe/dimina-fe-container/assets/index.css +1 -1
- package/fe/dimina-fe-container/assets/index.js +6 -7
- package/fe/dimina-fe-container/assets/pageFrame.css +1 -1
- package/fe/dimina-fe-container/assets/pageFrame.js +947 -23
- package/fe/dimina-fe-container/assets/service.js +2 -2
- package/fe/dimina-fe-container/dimina-version.json +2 -2
- package/fe/dimina-fe-container/pageFrame.html +1 -1
- package/package.json +2 -2
|
@@ -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&&n.every(n=>a(e[n],t[n]))}function o(e){return e===`__proto__`}function
|
|
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}b.async=async e=>new Promise((t,n)=>{try{t(b(e))}catch(t){n(Error(`${t.message}: Failed to initialize asynchronous loading for module '${e}'`))}});var x=new class{constructor(){this.callbacks={}}store(e,t,n=p()){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]})}},oe=`__dimina_data_function_reference__`,se=1;function ce(e){return{[oe]:e,version:se}}function le(e){return typeof e==`object`&&!!e&&e.version===se&&typeof e[oe]==`string`&&Object.keys(e).length===2}function ue(e){return le(e)?e[oe]:void 0}function de(e,{mapFunction:t,mapReference:n}={},r=new WeakMap){if(typeof e==`function`)return t?t(e):e;if(typeof e!=`object`||!e)return e;if(le(e))return n?n(e):e;if(e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e))return e;if(!Array.isArray(e)){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e}if(r.has(e))return r.get(e);let i=Array.isArray(e)?[]:{};r.set(e,i);for(let a of Object.keys(e))i[a]=de(e[a],{mapFunction:t,mapReference:n},r);return i}var fe=new Set([String,Number,Boolean,Object,Array,null]);function pe(e){return fe.has(e)}function me(e){return e===String?``:e===Number?0:e===Boolean?!1:e===Array?[]:null}function he(e){return Array.isArray(e)?e.filter(pe):[]}function ge(e){let t,n=[],r;return pe(e)?t=e:e&&typeof e==`object`&&(t=e.type,n=he(e.optionalTypes),r=e.value),pe(t)||(t=n[0]??null),r===void 0&&(r=me(t)),{type:t,optionalTypes:n,value:y(r)}}function _e(e){return Array.isArray(e)}function ve(e){return _e(e)&&e?.constructor?.name===Array.name}function ye(e,t){return e===String?typeof t==`string`:e===Number?Number.isFinite(t):e===Boolean?typeof t==`boolean`:e===Object?t!==null&&t?.constructor===Object:e===Array?ve(t):t!==void 0}function S(e,t){typeof e==`function`&&e(t)}function be(e,t,{absent:n=!1,warn:r}={}){if(n)return y(e.value);for(let n of e.optionalTypes||[])if(ye(n,t))return t;let i=e.type;if(i===String)return t==null?(S(r,`property received type-uncompatible value: expected <String> but get null value. Used empty string instead.`),``):(typeof t==`object`&&S(r,`property received type-uncompatible value: expected <String> but got object-typed value. Forcely converted.`),String(t));if(i===Number){try{if(Number.isFinite(Number(t)))return Number(t)}catch{}return S(r,`property received type-uncompatible value: expected <Number> but ${typeof t==`number`?`got NaN or Infinity`:`got non-number value`}. Used 0 instead.`),0}return i===Boolean?!!t:i===Array?_e(t)?t:(S(r,`property received type-uncompatible value: expected <Array> but got non-array value. Used empty array instead.`),[]):i===Object?typeof t==`object`?t:(S(r,`property received type-uncompatible value: expected <Object> but got non-object value. Used null instead.`),null):t===void 0?null:t}var C=new class{constructor(){this.listeners=new Set,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},this.listeners.forEach(t=>t(e,this.snapshot))}onUpdate(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get(e){return this.active?this.snapshot[e]??null:null}getSystemInfo(){return this.get(`systemInfo`)}getMenuRect(){return this.get(`menuRect`)}};function xe(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 Se=new WeakMap,Ce=new Map;function we(e){let t=Se.get(e);if(t)return Ce.set(t,e),t;let n;do n=`data-function-${p()}`;while(Ce.has(n));return Se.set(e,n),Ce.set(n,e),n}function Te(e){return Ce.get(e)}function Ee(e){return de(e,{mapFunction(e){return ce(we(e))}})}function De(e){return de(e,{mapReference(e){return Te(ue(e))||e}})}var w=new class e{constructor(){this.event=xe(),this.init()}init(){_?globalThis.onmessage=e=>{this.handleMsg(e.data)}:DiminaServiceBridge.onMessage=this.handleMsg.bind(this)}handleMsg(e){let t=De(e);console.log(`[service] receive msg: `,_?t:JSON.stringify(t));let{type:n,body:r}=t;this.event.emit(n,r)}on(e,t){this.event.on(e,t)}off(e){this.event.off(e)}send(t){return _?e.prototype.send=function(e){let t=Ee(e);t.method=`publish`,globalThis.postMessage(t)}:e.prototype.send=function(e){let t=Ee(e);return DiminaServiceBridge.publish(t.body.bridgeId||``,t)},this.send(t)}invoke(t){return _?e.prototype.invoke=function(e){e.method=`invoke`,globalThis.postMessage(e)}:e.prototype.invoke=function(e){return DiminaServiceBridge.invoke(e)},this.invoke(t)}},T=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()}remove(e){for(let t=this.#e.length-1;t>=0;t--){let n=this.#e[t].pages,r=n.findIndex(t=>t.id===e);if(r!==-1){n.splice(r,1);return}}}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 Oe(e,t){if(!e)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}var ke={getWindowInfo:()=>Oe(C.getSystemInfo(),[`pixelRatio`,`screenWidth`,`screenHeight`,`windowWidth`,`windowHeight`,`statusBarHeight`,`safeArea`,`screenTop`]),getSystemInfoSync:()=>C.getSystemInfo(),getAppBaseInfo:()=>Oe(C.getSystemInfo(),[`SDKVersion`,`enableDebug`,`host`,`language`,`version`,`theme`,`fontSizeScaleFactor`,`fontSizeSetting`]),getDeviceInfo:()=>Oe(C.getSystemInfo(),[`abi`,`benchmarkLevel`,`brand`,`model`,`platform`,`system`]),getMenuButtonBoundingClientRect:()=>C.getMenuRect()},Ae=new Set([`connectSocket`,`downloadFile`,`loadSubpackage`,`preDownloadSubpackage`,`request`,`uploadFile`]),je=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 Me(e){return Object.prototype.hasOwnProperty.call(e,`success`)||Object.prototype.hasOwnProperty.call(e,`fail`)||Object.prototype.hasOwnProperty.call(e,`complete`)}function Ne(e,t){return Ae.has(e)||typeof e==`string`&&e.endsWith(`Sync`)?!1:t!==void 0||je.has(e)}function Pe(e,t,n){let r={type:`invokeAPI`,target:n,body:{name:e,bridgeId:T.getPageInfo().id,params:t}};return n===`container`?w.invoke(r):w.send(r)}function Fe(e,t,n){return new Promise((r,i)=>{let a,o,s=()=>{x.remove(a),x.remove(o)};a=x.store(e=>{s(),r(e)}),o=x.store(e=>{s(),i(e)}),t.success=a,t.fail=o;try{Pe(e,t,n)}catch(e){s(),i(e)}})}function E(e,t,r=`container`){let i=ke[e];if(r===`container`&&i){let e=i();if(e)return e}let a;if(t===void 0){if(Ne(e,t))return Fe(e,{},r);a=t}else if(typeof t==`string`||Array.isArray(t))a=t;else if(n(t))a={success:x.store(t,!0)};else if(Me(t)){let{success:e,fail:r,complete:i,keep:o,evtId:s,...c}=t;a=c,s!==void 0&&(a.evtId=s),n(e)?a.success=x.store(e,o,s):a.success=e,n(r)&&(a.fail=x.store(r,o,s)),n(i)&&(a.complete=x.store(i,o,s))}else{let{keep:n,...i}=t;if(delete i.evtId,!n&&Ne(e,t))return a={...i},Fe(e,a,r);a=i}return Pe(e,a,r)}var Ie=t({navigateBack:()=>Ve,navigateTo:()=>Be,reLaunch:()=>Re,redirectTo:()=>ze,switchTab:()=>Le});function Le(e){return e.url=te(T.getPageInfo().route,e.url),E(`switchTab`,e)}function Re(e){return e.url=te(T.getPageInfo().route,e.url),E(`reLaunch`,e)}function ze(e){let t=te(T.getPageInfo().route,e.url);if(T.getPageInfo().route!==t)return e.url=t,E(`redirectTo`,e)}function Be(e){return e.url=te(T.getPageInfo().route,e.url),E(`navigateTo`,e)}function Ve(e){return E(`navigateBack`,e)}var He=t({offAppHide:()=>Je,offAppShow:()=>qe,offError:()=>We,onAppHide:()=>Ke,onAppRoute:()=>Ze,onAppShow:()=>Ge,onError:()=>Ue,onPageNotFound:()=>Xe,onUnhandledRejection:()=>Ye});function Ue(e){return E(`onError`,e)}function We(e){return E(`offError`,e)}function Ge(e){return E(`onAppShow`,e)}function Ke(e){return E(`onAppHide`,e)}function qe(e){return E(`offAppShow`,e)}function Je(e){return E(`offAppHide`,e)}function Ye(){}function Xe(){}function Ze(){}var Qe=t({USER_DATA_PATH:()=>$e,fileSystemManagerAPINames:()=>nt,getFileSystemManager:()=>it}),$e=`difile://`,et=`not supported by the dimina runtime`;function D(e){throw Error(`FileSystemManager.${e} ${et}`)}function O(e,t={}){let{fail:n,complete:r}=t;n?.({errMsg:`${e}:fail ${et}`}),r?.()}var tt=class{access(e){O(`access`,e)}accessSync(){D(`accessSync`)}stat(e){O(`stat`,e)}statSync(){D(`statSync`)}readFile(e){O(`readFile`,e)}readFileSync(){D(`readFileSync`)}writeFile(e){O(`writeFile`,e)}writeFileSync(){D(`writeFileSync`)}appendFile(e){O(`appendFile`,e)}appendFileSync(){D(`appendFileSync`)}copyFile(e){O(`copyFile`,e)}copyFileSync(){D(`copyFileSync`)}rename(e){O(`rename`,e)}renameSync(){D(`renameSync`)}unlink(e){O(`unlink`,e)}unlinkSync(){D(`unlinkSync`)}mkdir(e){O(`mkdir`,e)}mkdirSync(){D(`mkdirSync`)}rmdir(e){O(`rmdir`,e)}rmdirSync(){D(`rmdirSync`)}readdir(e){O(`readdir`,e)}readdirSync(){D(`readdirSync`)}getFileInfo(e){O(`getFileInfo`,e)}saveFile(e){O(`saveFile`,e)}saveFileSync(){D(`saveFileSync`)}getSavedFileList(e){O(`getSavedFileList`,e)}removeSavedFile(e){O(`removeSavedFile`,e)}truncate(e){O(`truncate`,e)}truncateSync(){D(`truncateSync`)}unzip(e){O(`unzip`,e)}open(e){O(`open`,e)}openSync(){D(`openSync`)}close(e){O(`close`,e)}closeSync(){D(`closeSync`)}read(e){O(`read`,e)}readSync(){D(`readSync`)}write(e){O(`write`,e)}writeSync(){D(`writeSync`)}fstat(e){O(`fstat`,e)}fstatSync(){D(`fstatSync`)}ftruncate(e){O(`ftruncate`,e)}ftruncateSync(){D(`ftruncateSync`)}readCompressedFile(e){O(`readCompressedFile`,e)}readCompressedFileSync(){D(`readCompressedFileSync`)}readZipEntry(e){O(`readZipEntry`,e)}},nt=Object.getOwnPropertyNames(tt.prototype).filter(e=>e!==`constructor`),rt;function it(){return rt||=new tt,rt}var at=[`applyUpdate`,`onCheckForUpdate`,`onUpdateFailed`,`onUpdateReady`],ot=t({canIUse:()=>ut,env:()=>st}),st={USER_DATA_PATH:`difile://usr`},ct=new Set([`nextTick`,`getUpdateManager`,`UpdateManager`,...at.map(e=>`UpdateManager.${e}`),`getPerformance`,`getFileSystemManager`,`FileSystemManager`,...nt.map(e=>`FileSystemManager.${e}`)]),lt={createUDPSocket:`UDPSocket.bind`,UDPSocket:`UDPSocket.bind`,createTCPSocket:`TCPSocket.connect`,TCPSocket:`TCPSocket.connect`};function ut(e){if(ct.has(e))return!0;try{return E(`canIUse`,Object.hasOwn(lt,e)?lt[e]:e)===!0}catch(t){return console.warn(`[canIUse] check ${e} error:`,t),!1}}var dt=t({getPerformance:()=>ft});function ft(){return pt.getInstance()}var pt=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one Performance instance.`);this.entryList=new mt,e.#e=this}static getInstance(){return e.#e||=new e,e.#e}createObserver(e){return new ht(this,e)}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}},mt=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}},ht=class{constructor(e,t){this.performance=e,this.entryTypes=[],this.callback=t,this.observerId=null,this.callbackId=null,this.connected=!1}observe(e={}){this.disconnect(),this.connected=!0,this.entryTypes=Array.isArray(e.entryTypes)?e.entryTypes:[],this.callbackId=x.store((e={})=>{if(e.observerId&&(this.observerId=e.observerId,!this.connected)){E(`removePerformanceObserver`,{observerId:e.observerId},`render`),x.remove(this.callbackId),this.callbackId=null;return}let t=e?.data?.entryList?JSON.parse(e.data.entryList):[];this.connected&&t.length>0&&(this.performance.entryList.push(t),this.notify(t))},!0),E(`addPerformanceObserver`,{entryTypes:this.entryTypes,success:this.callbackId},`render`)}notify(e){if(this.connected){let t=new mt;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})),typeof this.callback==`function`&&this.callback(t)}}disconnect(){this.connected=!1,this.observerId&&E(`removePerformanceObserver`,{observerId:this.observerId},`render`),this.callbackId&&this.observerId&&x.remove(this.callbackId),this.observerId=null,this.callbackId=null}},gt=t({loadSubpackage:()=>vt,preDownloadSubpackage:()=>_t});function _t(e){return E(`preDownloadSubpackage`,e)}function vt(e){return E(`loadSubpackage`,e)}var yt=t({getAppBaseInfo:()=>Dt,getDeviceInfo:()=>Ot,getSystemInfo:()=>wt,getSystemInfoAsync:()=>Et,getSystemInfoSync:()=>Tt,getWindowInfo:()=>St,offThemeChange:()=>At,onThemeChange:()=>kt,openAppAuthorizeSetting:()=>Ct,openSystemBluetoothSetting:()=>xt}),bt=new Set;C.onUpdate(e=>{let t=e.systemInfo?.theme;t&&bt.forEach(e=>e({theme:t}))});function xt(e){return E(`openSystemBluetoothSetting`,e)}function St(e){return E(`getWindowInfo`,e)}function Ct(e){return E(`openAppAuthorizeSetting`,e)}function wt(e){return new Promise(t=>{t(E(`getSystemInfo`,e))})}function Tt(){return E(`getSystemInfoSync`)}function Et(e){return E(`getSystemInfoAsync`,e)}function Dt(){return E(`getAppBaseInfo`)}function Ot(){return E(`getDeviceInfo`)}function kt(e){n(e)&&bt.add(e)}function At(e){n(e)?bt.delete(e):bt.clear()}var jt=t({getUpdateManager:()=>Lt}),Mt=`onUpdateStatusChange`,Nt=`updatefail`,Pt=`updateready`,Ft=`noupdate`,It=`updating`;function Lt(){return Rt.getInstance()}var Rt=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=[],w.on(Mt,e=>this.handleUpdateStatusChange(e)),e.#e=this}handleUpdateStatusChange(e={}){let{event:t}=e;if(t===Nt){this.updateFailed=!0,this.emit(this.updateFailedListeners);return}if(t===Pt){let e=this.checkForUpdateResult?.hasUpdate!==!0,t=!this.updateReady;this.updateReady=!0,this.checkForUpdateResult={hasUpdate:!0},e&&this.emit(this.checkForUpdateListeners,this.checkForUpdateResult),t&&this.emit(this.updateReadyListeners);return}if(t===It){this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}if(t===Ft){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,E(`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())}};Rt.getInstance();var zt=t({createCameraContext:()=>Bt});function Bt(){return new Vt}var Vt=class{takePhoto(e={}){return E(`takePhoto`,e)}startRecord(e={}){return E(`startRecordCamera`,e)}stopRecord(e={}){return E(`stopRecordCamera`,e)}},Ht=t({reportAnalytics:()=>Ut,reportEvent:()=>Wt});function Ut(...e){return E(`reportAnalytics`,e)}function Wt(e,t){return E(`reportAnalytics`,{eventId:e,data:t})}var Gt=`__diminaArrayBufferBase64`,k=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Kt=(()=>{let e={};for(let t=0;t<64;t++)e[k[t]]=t;return e})();function qt(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function Jt(e){return qt(e)?e:e&&e.buffer&&qt(e.buffer)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function Yt(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=k[t[r]>>2],n+=k[(t[r]&3)<<4|t[r+1]>>4],n+=k[(t[r+1]&15)<<2|t[r+2]>>6],n+=k[t[r+2]&63];return r<t.length&&(n+=k[t[r]>>2],r+1<t.length?(n+=k[(t[r]&3)<<4|t[r+1]>>4],n+=`${k[(t[r+1]&15)<<2]}=`):n+=`${k[(t[r]&3)<<4]}==`),n}function Xt(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=Kt[t[e]],o=Kt[t[e+1]],s=t[e+2]===`=`?0:Kt[t[e+2]],c=t[e+3]===`=`?0:Kt[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function Zt(e){let t=Jt(e);return t?{[Gt]:Yt(t)}:e}function Qt(e){return e&&typeof e==`object`&&e.__diminaArrayBufferBase64!==void 0?Xt(e[Gt]):e}function $t(e){if(!e||typeof e!=`object`)return e;let t={};for(let[n,r]of Object.entries(e.serviceData||{}))t[n]=Qt(r);return{...e,advertisData:Qt(e.advertisData),serviceData:t}}function en(e){return!e||!Array.isArray(e.devices)?e:{...e,devices:e.devices.map($t)}}function tn(e){return!e||typeof e!=`object`?e:{...e,value:Qt(e.value)}}function nn(e,t){if(!e||typeof e!=`object`)return e;let n={...e};return typeof e.success==`function`&&(n.success=n=>e.success(t(n))),typeof e.complete==`function`&&(n.complete=n=>e.complete(t(n))),n}function rn(e,t,{prepare:n=e=>e,transform:r=e=>e}={}){let i=E(e,n(nn(t,r)));return i&&typeof i.then==`function`?i.then(r):i}function A(e,t,n=e=>e){let r=new Map;return{on(t){if(typeof t!=`function`||r.has(t))return;let i=x.store(e=>t(n(e)),!0);return r.set(t,i),E(e,{callbackId:i,success:i,keep:!0})},off(e){if(typeof e==`function`){let n=r.get(e);return n?(r.delete(e),x.remove(n),E(t,{callbackId:n,keep:!0})):void 0}for(let e of r.values())x.remove(e);return r.clear(),E(t)}}}var an=t({closeBluetoothAdapter:()=>vn,getBluetoothAdapterState:()=>_n,getBluetoothDevices:()=>gn,getConnectedBluetoothDevices:()=>hn,isBluetoothDevicePaired:()=>yn,makeBluetoothPair:()=>bn,offBluetoothAdapterStateChange:()=>mn,offBluetoothDeviceFound:()=>pn,onBluetoothAdapterStateChange:()=>fn,onBluetoothDeviceFound:()=>dn,openBluetoothAdapter:()=>un,startBluetoothDevicesDiscovery:()=>ln,stopBluetoothDevicesDiscovery:()=>cn}),on=A(`onBluetoothDeviceFound`,`offBluetoothDeviceFound`,en),sn=A(`onBluetoothAdapterStateChange`,`offBluetoothAdapterStateChange`);function cn(e){return E(`stopBluetoothDevicesDiscovery`,e)}function ln(e){return E(`startBluetoothDevicesDiscovery`,e)}function un(e){return E(`openBluetoothAdapter`,e)}function dn(e){return on.on(e)}function fn(e){return sn.on(e)}function pn(e){return on.off(e)}function mn(e){return sn.off(e)}function hn(e){return rn(`getConnectedBluetoothDevices`,e,{transform:en})}function gn(e){return rn(`getBluetoothDevices`,e,{transform:en})}function _n(e){return E(`getBluetoothAdapterState`,e)}function vn(e){return E(`closeBluetoothAdapter`,e)}function yn(e){return E(`isBluetoothDevicePaired`,e)}function bn(e){return E(`makeBluetoothPair`,e)}var xn=t({closeBLEConnection:()=>Ln,createBLEConnection:()=>In,getBLEDeviceCharacteristics:()=>Fn,getBLEDeviceRSSI:()=>Pn,getBLEDeviceServices:()=>Nn,getBLEMTU:()=>Rn,notifyBLECharacteristicValueChange:()=>Mn,offBLECharacteristicValueChange:()=>jn,offBLEConnectionStateChange:()=>An,offBLEMTUChange:()=>Bn,onBLECharacteristicValueChange:()=>kn,onBLEConnectionStateChange:()=>On,onBLEMTUChange:()=>zn,readBLECharacteristicValue:()=>Dn,setBLEMTU:()=>En,writeBLECharacteristicValue:()=>Tn}),Sn=A(`onBLEConnectionStateChange`,`offBLEConnectionStateChange`),Cn=A(`onBLECharacteristicValueChange`,`offBLECharacteristicValueChange`,tn),wn=A(`onBLEMTUChange`,`offBLEMTUChange`);function Tn(e){return rn(`writeBLECharacteristicValue`,e,{prepare(e){return e&&typeof e==`object`?{...e,value:Zt(e.value)}:e}})}function En(e){return E(`setBLEMTU`,e)}function Dn(e){return E(`readBLECharacteristicValue`,e)}function On(e){return Sn.on(e)}function kn(e){return Cn.on(e)}function An(e){return Sn.off(e)}function jn(e){return Cn.off(e)}function Mn(e){return E(`notifyBLECharacteristicValueChange`,e)}function Nn(e){return E(`getBLEDeviceServices`,e)}function Pn(e){return E(`getBLEDeviceRSSI`,e)}function Fn(e){return E(`getBLEDeviceCharacteristics`,e)}function In(e){return E(`createBLEConnection`,e)}function Ln(e){return E(`closeBLEConnection`,e)}function Rn(e){return E(`getBLEMTU`,e)}function zn(e){return wn.on(e)}function Bn(e){return wn.off(e)}var Vn=t({getClipboardData:()=>Un,setClipboardData:()=>Hn});function Hn(e){return E(`setClipboardData`,e)}function Un(e){return E(`getClipboardData`,e)}var Wn=t({addPhoneContact:()=>Kn,chooseContact:()=>Gn});function Gn(e){return E(`chooseContact`,e)}function Kn(e){return E(`addPhoneContact`,e)}var qn=t({hideKeyboard:()=>Jn});function Jn(e){return E(`hideKeyboard`,e)}var Yn=t({offMemoryWarning:()=>Zn,onMemoryWarning:()=>Xn});function Xn(e){return E(`onMemoryWarning`,e)}function Zn(e){return E(`offMemoryWarning`,e)}var Qn=t({getNetworkType:()=>$n});function $n(e){return E(`getNetworkType`,e)}var er=t({makePhoneCall:()=>tr});function tr(e){return E(`makePhoneCall`,e)}var nr=t({scanCode:()=>rr});function rr(e){return E(`scanCode`,e)}var ir=t({offUserCaptureScreen:()=>sr,onUserCaptureScreen:()=>or}),ar=A(`onUserCaptureScreen`,`offUserCaptureScreen`),j;function or(e){if(typeof e==`function`)return j&&j!==e&&ar.off(j),j=e,ar.on(e)}function sr(e){if(!(typeof e==`function`&&e!==j))return j=void 0,ar.off(e)}var cr=t({vibrateLong:()=>ur,vibrateShort:()=>lr});function lr(e){return E(`vibrateShort`,e)}function ur(e){return E(`vibrateLong`,e)}var dr=t({extBridge:()=>fr,extOffBridge:()=>mr,extOnBridge:()=>pr,offLoginStatusChanged:()=>gr,onLoginStatusChanged:()=>hr});function fr({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),E(e,{module:t,data:r,keep:r.isSustain??!0,success:c,fail:l,complete:u})}function pr({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}`;E(i,{evtId:i,keep:r,success:n})}function mr({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}let r=`${t}_${e}`;E(r,{evtId:r,success:n})}function hr(e){w.on(`notifyLoginStatusChanged`,t=>{e?.(t)})}function gr(){w.off(`notifyLoginStatusChanged`)}var _r=new WeakSet;function vr(e,t,r){if(e&&(typeof e==`object`||typeof e==`function`)&&!_r.has(e)){_r.add(e);try{n(e.componentError)&&e.componentError(t)}catch(e){console.error(`[service] error lifetime error:`,e)}finally{_r.delete(e)}}console.error(`[service] ${r} error:`,t)}function M(e,t,r=[],i=`callback`,a=!0){if(n(t))try{return t.apply(e,r)}catch(t){a?vr(e,t,i):console.error(`[service] ${i} error:`,t);return}}function N(e,t,n=[],r=`callback`,i=!0){for(let a of t||[])M(e,a,n,r,i)}var yr=[`onLaunch`,`onShow`,`onHide`],br=[`globalData`],xr=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(){yr.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)yr.includes(t)||br.includes(t)||(n(e[t])?this[t]=e[t].bind(this):this[t]=e[t])}invokeSomeLifecycle(){M(this,this.onLaunch,[this.options],`onLaunch`),M(this,this.onShow,[this.options],`onShow`)}appShow(){M(this,this.onShow,[this.options],`onShow`)}appHide(){M(this,this.onHide,[],`onHide`)}},Sr=new Set([`2d`]),Cr=new Set([`webgl`,`experimental-webgl`,`webgl2`]),wr=new Set([`createLinearGradient`,`createPattern`,`createRadialGradient`]),Tr=new Map([[`createBuffer`,`buffer`],[`createFramebuffer`,`framebuffer`],[`createProgram`,`program`],[`createQuery`,`query`],[`createRenderbuffer`,`renderbuffer`],[`createSampler`,`sampler`],[`createShader`,`shader`],[`createTexture`,`texture`],[`createTransformFeedback`,`transformFeedback`],[`createVertexArray`,`vertexArray`],[`fenceSync`,`sync`]]),Er=new Map([[`getAttribLocation`,`attribLocation`],[`getUniformLocation`,`uniformLocation`]]),Dr=new Map([[`deleteBuffer`,`buffer`],[`deleteFramebuffer`,`framebuffer`],[`deleteProgram`,`program`],[`deleteQuery`,`query`],[`deleteRenderbuffer`,`renderbuffer`],[`deleteSampler`,`sampler`],[`deleteShader`,`shader`],[`deleteSync`,`sync`],[`deleteTexture`,`texture`],[`deleteTransformFeedback`,`transformFeedback`],[`deleteVertexArray`,`vertexArray`]]),Or=new Map([[`isBuffer`,`buffer`],[`isFramebuffer`,`framebuffer`],[`isProgram`,`program`],[`isQuery`,`query`],[`isRenderbuffer`,`renderbuffer`],[`isSampler`,`sampler`],[`isShader`,`shader`],[`isSync`,`sync`],[`isTexture`,`texture`],[`isTransformFeedback`,`transformFeedback`],[`isVertexArray`,`vertexArray`]]),kr={alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:`default`,failIfMajorPerformanceCaveat:!1,desynchronized:!1},Ar=new Map,P={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};function jr(e){let t=String(e).toLowerCase();return t===`experimental-webgl`?`webgl`:t}function Mr(e,t){!e||!t||Ar.set(e,t)}function Nr(e){return Ar.get(e)||null}function Pr(e,t){return e&&e[jr(t)]||null}function F(e){if(e==null)return e;if(Array.isArray(e))return e.map(e=>F(e));if(typeof e!=`object`)return e;if(e.__canvasTypedArray){if(e.__canvasTypedArray===`DataView`)return new DataView(new Uint8Array(e.data||[]).buffer);let t=globalThis[e.__canvasTypedArray];return typeof t==`function`?new t(e.data||[]):e.data||[]}let t={};for(let[n,r]of Object.entries(e))t[n]=F(r);return t}w.on(`canvasCapabilities`,({bridgeId:e,capabilities:t})=>{Mr(e,t)}),w.on(`resourceLoaded`,({bridgeId:e,canvasCapabilities:t})=>{Mr(e,t)});var Fr=1,Ir=1;function Lr(){let e=T.getPageInfo();return e?.bridgeId||e?.id||``}function I(e,t){if(e===void 0)return t;let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function Rr(e,t,n){w.send({type:`invokeAPI`,target:`render`,body:{bridgeId:e,name:t,params:n}})}function zr(e){Promise.resolve().then(e)}function Br(e){return Object.prototype.toString.call(e)===`[object Object]`}function Vr(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 L(e){if(e==null)return e;if(e.__canvasResourceId)return{__canvasResourceId:e.__canvasResourceId};if(e.__diminaCanvasNode)return{__canvasNodeId:e.nodeId};let t=Vr(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=>L(e));if(Br(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=L(r);return t}return e}function R(e){return Array.from(e).map(e=>L(e))}function z(e=`canvas_resource`){return`${e}_${p()}`}var B=class{constructor(e,t,n=`resource`,r={}){return this.__canvasResourceId=t,this.__canvasProxyValue=Fr++,this.canvas=e,this.resourceType=n,this.metadata=r,this.deleted=!1,new Proxy(this,{get(e,n){if(n in e){let t=e[n];return typeof t==`function`?t.bind(e):t}if(typeof n!=`symbol`)return(...r)=>{e.canvas.enqueueOperation({op:`resourceCall`,resourceId:t,method:n,args:R(r)})}}})}valueOf(){return this.__canvasProxyValue}toString(){return String(this.__canvasProxyValue)}markDeleted(){this.deleted=!0}updateMetadata(e={}){Object.assign(this.metadata,e)}},Hr=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=x.store((e={})=>{this.width=e.width||this.width,this.height=e.height||this.height,n(this.onload)&&this.onload(e)}),r=x.store((e={})=>{n(this.onerror)&&this.onerror(e)});this.canvas.enqueueOperation({op:`imageSetSrc`,imageId:this.imageId,src:e,onload:t,onerror:r})}},Ur=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:L(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=wr.has(e)?z():void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:R(t),resultId:n}),n)return new B(this.canvas,n)}},Wr=class{constructor(e,t,n,r={}){return this.context=e,this.name=t,this.__canvasResourceId=n,this.constants=r.constants||{},new Proxy(this,{get(e,t){if(t in e){let n=e[t];return typeof n==`function`?n.bind(e):n}if(Object.prototype.hasOwnProperty.call(e.constants,t))return e.constants[t];if(typeof t!=`symbol`)return(...n)=>e.call(t,n)}})}call(e,t){let n,r;if(e.startsWith(`create`))r=z(`webgl_extension_resource`),n=new B(this.context.canvas,r,`${this.name}:${e}`),this.context.resources.set(r,n);else if(e.startsWith(`delete`)&&t[0]?.markDeleted)t[0].markDeleted();else if(e.startsWith(`is`)&&t[0]instanceof B)return!t[0].deleted;return this.context.canvas.enqueueOperation({op:`extensionCall`,contextId:this.context.contextId,extensionId:this.__canvasResourceId,method:e,args:R(t),resultId:r}),n}},Gr=class{constructor(e,t,n,r,i){return this.canvas=e,this.contextId=t,this.contextType=n,this.requestedAttributes={...kr,...Br(r)?r:{}},this.capabilities=null,this.resources=new Map,this.extensions=new Map,this.properties=new Map,this.state=new Map,this.enabledCapabilities=new Set,this.errors=[],this.queryResults=new Map,this.contextLost=!1,this.creationFailed=!1,this.hasActualCapabilities=!1,this.initializeState(),this.updateCapabilities(i),new Proxy(this,{get(e,t){if(t in e){let n=e[t];return typeof n==`function`?n.bind(e):n}if(e.properties.has(t))return e.properties.get(t);if(Object.prototype.hasOwnProperty.call(e.capabilities?.constants||{},t))return e.capabilities.constants[t];if(Object.prototype.hasOwnProperty.call(P,t))return P[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)},set(e,n,r){return e.properties.set(n,r),e.canvas.enqueueOperation({op:`contextSetProperty`,contextId:t,prop:n,value:L(r)}),!0}})}initializeState(){let{width:e,height:t}=this.canvas;this.state.set(P.VIEWPORT,[0,0,e,t]),this.state.set(P.SCISSOR_BOX,[0,0,e,t]),this.state.set(P.COLOR_CLEAR_VALUE,new Float32Array([0,0,0,0])),this.state.set(P.COLOR_WRITEMASK,[!0,!0,!0,!0]),this.state.set(P.DEPTH_CLEAR_VALUE,1),this.state.set(P.DEPTH_WRITEMASK,!0),this.state.set(P.DEPTH_FUNC,P.LESS),this.state.set(P.STENCIL_CLEAR_VALUE,0),this.state.set(P.LINE_WIDTH,1),this.state.set(P.CULL_FACE_MODE,P.BACK),this.state.set(P.FRONT_FACE,P.CCW),this.state.set(P.ACTIVE_TEXTURE,P.TEXTURE0),this.state.set(P.PACK_ALIGNMENT,4),this.state.set(P.UNPACK_ALIGNMENT,4),this.state.set(P.CURRENT_PROGRAM,null),this.state.set(P.ARRAY_BUFFER_BINDING,null),this.state.set(P.ELEMENT_ARRAY_BUFFER_BINDING,null),this.state.set(P.TEXTURE_BINDING_2D,null),this.state.set(P.FRAMEBUFFER_BINDING,null),this.state.set(P.RENDERBUFFER_BINDING,null)}updateCapabilities(e,t=!1){if(!e)return;let n=F(e),r={...this.capabilities?.extensions||{}};for(let[e,t]of Object.entries(n.extensions||{}))r[e]={...r[e]||{},...t,constants:{...r[e]?.constants||{},...t.constants||{}}};this.capabilities={...this.capabilities||{},...n,constants:{...this.capabilities?.constants||{},...n.constants||{}},parameters:{...this.capabilities?.parameters||{},...n.parameters||{}},extensions:r,shaderPrecisionFormats:{...this.capabilities?.shaderPrecisionFormats||{},...n.shaderPrecisionFormats||{}}},this.hasActualCapabilities||=t,typeof this.capabilities.contextLost==`boolean`&&(this.contextLost=this.capabilities.contextLost)}applyFeedback(e={}){e.success===!1?(this.creationFailed=!0,this.contextLost=!0,this.canvas.handleContextCreationFailure(this.contextId,this.contextType,e.statusMessage)):e.capabilities&&this.updateCapabilities(e.capabilities,!0),typeof e.contextLost==`boolean`&&(this.contextLost=e.contextLost);for(let t of e.errors||[])this.queueError(t);for(let t of e.resources||[])this.resources.get(t.resourceId)?.updateMetadata(F(t.metadata));for(let t of e.queries||[])this.queryResults.set(t.key,this.deserializeFeedbackValue(t.value))}deserializeFeedbackValue(e){if(e?.__canvasResourceId)return this.resources.get(e.__canvasResourceId)||null;if(Array.isArray(e))return e.map(e=>this.deserializeFeedbackValue(e));if(e&&typeof e==`object`&&!e.__canvasTypedArray){let t={};for(let[n,r]of Object.entries(e))t[n]=this.deserializeFeedbackValue(r);return t}return F(e)}queueError(e){e&&e!==P.NO_ERROR&&!this.errors.includes(e)&&this.errors.push(e)}queryKey(e,t){return`${e}:${JSON.stringify(R(t))}`}requestQuery(e,t,n=null){let r=this.queryKey(e,t);return this.canvas.enqueueOperation({op:`contextQuery`,contextId:this.contextId,method:e,args:R(t),key:r}),this.queryResults.has(r)?this.queryResults.get(r):n}createResource(e,t,n){let r=z(`webgl_${n}`),i={};n===`shader`?(i.shaderType=t[0],i.source=``,i.compileStatus=!1,i.infoLog=``):n===`program`&&(i.attachedShaders=[],i.linkStatus=!1,i.validateStatus=!1,i.infoLog=``);let a=new B(this.canvas,r,n,i);return this.resources.set(r,a),this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:R(t),resultId:r}),a}call(e,t){switch(e){case`getParameter`:return this.getParameter(t[0]);case`getShaderParameter`:return this.getShaderParameter(t[0],t[1]);case`getProgramParameter`:return this.getProgramParameter(t[0],t[1]);case`getShaderInfoLog`:return t[0]?.metadata?.infoLog||``;case`getProgramInfoLog`:return t[0]?.metadata?.infoLog||``;case`getShaderSource`:return t[0]?.metadata?.source||null;case`getAttachedShaders`:return t[0]?.metadata?.attachedShaders?.slice()||[];case`getError`:return this.errors.shift()||(this.canvas.enqueueOperation({op:`contextFeedback`,contextId:this.contextId}),P.NO_ERROR);case`isContextLost`:return this.canvas.enqueueOperation({op:`contextFeedback`,contextId:this.contextId}),this.contextLost;case`isEnabled`:return this.enabledCapabilities.has(t[0]);case`checkFramebufferStatus`:return this.requestQuery(e,t,P.FRAMEBUFFER_COMPLETE);case`getContextAttributes`:return{...this.hasActualCapabilities&&this.capabilities?.contextAttributes?this.capabilities.contextAttributes:this.requestedAttributes};case`getSupportedExtensions`:return(this.capabilities?.supportedExtensions||[]).slice();case`getExtension`:return this.getExtension(t[0]);case`getShaderPrecisionFormat`:return this.getShaderPrecisionFormat(t[0],t[1]);case`getActiveAttrib`:case`getActiveUniform`:case`getBufferParameter`:case`getFramebufferAttachmentParameter`:case`getRenderbufferParameter`:case`getTexParameter`:case`getUniform`:case`getVertexAttrib`:case`getVertexAttribOffset`:return this.requestQuery(e,t);default:break}let n=Tr.get(e)||Er.get(e);if(n)return this.createResource(e,t,n);if(Or.has(e)){let n=t[0];return n instanceof B&&n.resourceType===Or.get(e)&&!n.deleted}Dr.has(e)&&t[0]?.markDeleted&&t[0].markDeleted(),this.updateState(e,t);let r={op:`contextCall`,contextId:this.contextId,method:e,args:R(t)};e===`compileShader`?(t[0]?.updateMetadata({compileStatus:!0}),r.feedback=`shader`):e===`linkProgram`||e===`validateProgram`?(t[0]?.updateMetadata(e===`linkProgram`?{linkStatus:!0}:{validateStatus:!0}),r.feedback=`program`):e===`readPixels`&&ArrayBuffer.isView(t[6])?(r.typedArrayUpdateId=this.canvas.registerTypedArrayUpdate(t[6]),r.typedArrayArgIndex=6):e===`getBufferSubData`&&ArrayBuffer.isView(t[2])&&(r.typedArrayUpdateId=this.canvas.registerTypedArrayUpdate(t[2]),r.typedArrayArgIndex=2),this.canvas.enqueueOperation(r)}updateState(e,t){switch(e){case`viewport`:this.state.set(P.VIEWPORT,t.slice(0,4));break;case`scissor`:this.state.set(P.SCISSOR_BOX,t.slice(0,4));break;case`clearColor`:this.state.set(P.COLOR_CLEAR_VALUE,new Float32Array(t.slice(0,4)));break;case`colorMask`:this.state.set(P.COLOR_WRITEMASK,t.slice(0,4).map(Boolean));break;case`clearDepth`:this.state.set(P.DEPTH_CLEAR_VALUE,t[0]);break;case`depthMask`:this.state.set(P.DEPTH_WRITEMASK,!!t[0]);break;case`depthFunc`:this.state.set(P.DEPTH_FUNC,t[0]);break;case`clearStencil`:this.state.set(P.STENCIL_CLEAR_VALUE,t[0]);break;case`lineWidth`:this.state.set(P.LINE_WIDTH,t[0]);break;case`cullFace`:this.state.set(P.CULL_FACE_MODE,t[0]);break;case`frontFace`:this.state.set(P.FRONT_FACE,t[0]);break;case`activeTexture`:this.state.set(P.ACTIVE_TEXTURE,t[0]);break;case`pixelStorei`:this.state.set(t[0],t[1]);break;case`enable`:this.enabledCapabilities.add(t[0]);break;case`disable`:this.enabledCapabilities.delete(t[0]);break;case`useProgram`:this.state.set(P.CURRENT_PROGRAM,t[0]||null);break;case`bindBuffer`:t[0]===P.ARRAY_BUFFER?this.state.set(P.ARRAY_BUFFER_BINDING,t[1]||null):t[0]===P.ELEMENT_ARRAY_BUFFER&&this.state.set(P.ELEMENT_ARRAY_BUFFER_BINDING,t[1]||null);break;case`bindTexture`:t[0]===P.TEXTURE_2D&&this.state.set(P.TEXTURE_BINDING_2D,t[1]||null);break;case`bindFramebuffer`:this.state.set(P.FRAMEBUFFER_BINDING,t[1]||null);break;case`bindRenderbuffer`:this.state.set(P.RENDERBUFFER_BINDING,t[1]||null);break;case`shaderSource`:t[0]?.updateMetadata({source:String(t[1]??``)});break;case`attachShader`:{let e=t[0]?.metadata?.attachedShaders;e&&t[1]&&!e.includes(t[1])&&e.push(t[1]);break}case`detachShader`:{let e=t[0]?.metadata?.attachedShaders,n=e?.indexOf(t[1])??-1;n>=0&&e.splice(n,1);break}default:break}}getParameter(e){if(this.state.has(e)){let t=this.state.get(e);return ArrayBuffer.isView(t)||Array.isArray(t)?t.slice():t}let t=this.capabilities?.parameters||{};return Object.prototype.hasOwnProperty.call(t,e)?F(t[e]):this.requestQuery(`getParameter`,[e])}getShaderParameter(e,t){if(!(e instanceof B)||e.resourceType!==`shader`)return null;switch(t){case P.DELETE_STATUS:return e.deleted;case P.SHADER_TYPE:return e.metadata.shaderType;case P.COMPILE_STATUS:return!!e.metadata.compileStatus;default:return this.requestQuery(`getShaderParameter`,[e,t])}}getProgramParameter(e,t){if(!(e instanceof B)||e.resourceType!==`program`)return null;switch(t){case P.DELETE_STATUS:return e.deleted;case P.LINK_STATUS:return!!e.metadata.linkStatus;case P.VALIDATE_STATUS:return!!e.metadata.validateStatus;case P.ATTACHED_SHADERS:return e.metadata.attachedShaders.length;default:return this.requestQuery(`getProgramParameter`,[e,t])}}getShaderPrecisionFormat(e,t){let n=`${e}:${t}`,r=this.capabilities?.shaderPrecisionFormats?.[n];return r?{...r}:this.requestQuery(`getShaderPrecisionFormat`,[e,t])}getExtension(e){let t=String(e||``),n=(this.capabilities?.supportedExtensions||[]).find(e=>e.toLowerCase()===t.toLowerCase());if(!n)return null;if(this.extensions.has(n))return this.extensions.get(n);let r=z(`webgl_extension`),i=this.capabilities?.extensions?.[n]||{},a=new Wr(this,n,r,i);return this.extensions.set(n,a),this.canvas.enqueueOperation({op:`getExtension`,contextId:this.contextId,extensionId:r,name:n}),a}},Kr=class{constructor({nodeId:e,bridgeId:t=Lr(),width:n=300,height:r=150,type:i=`2d`,offscreen:a=!1,webglCapabilities:o}){this.__diminaCanvasNode=!0,this.nodeId=e,this.bridgeId=t,this.type=i,this.offscreen=a,this.webglCapabilities=o||Nr(t),this.contexts=new Map,this.contextsById=new Map,this.activeContextType=null,this.eventListeners=new Map,this.pendingTypedArrayUpdates=new Map,this.pendingOperations=[],this.flushScheduled=!1,this._width=I(n,300),this._height=I(r,150)}get width(){return this._width}set width(e){this._width=I(e,300),this.enqueueOperation({op:`setCanvasProperty`,prop:`width`,value:this._width})}get height(){return this._height}set height(e){this._height=I(e,150),this.enqueueOperation({op:`setCanvasProperty`,prop:`height`,value:this._height})}getContext(e=`2d`,t){let n=String(e).toLowerCase(),r=jr(n),i=Cr.has(n);if(!Sr.has(r)&&!i||this.activeContextType&&this.activeContextType!==r)return null;if(this.contexts.has(r))return this.contexts.get(r);let a=i?Pr(this.webglCapabilities,r):null;if(i&&a?.supported===!1)return null;let o=z(`canvas_context`);this.enqueueOperation({op:`getContext`,contextId:o,contextType:n,attributes:L(t)});let s=i?new Gr(this,o,r,t,a):new Ur(this,o);return this.activeContextType=r,this.contexts.set(r,s),this.contextsById.set(o,s),s}addEventListener(e,t){n(t)&&(this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t))}removeEventListener(e,t){this.eventListeners.get(e)?.delete(t)}dispatchEvent(e){if(!e?.type)return!0;let t=!1,r={...e,target:this,currentTarget:this,preventDefault(){t=!0,this.defaultPrevented=!0}};for(let t of this.eventListeners.get(e.type)||[])t.call(this,r);let i=this[`on${e.type}`];return n(i)&&i.call(this,r),!t}notifyContextCreationError(e=`WebGL context creation failed`){this.dispatchEvent({type:`webglcontextcreationerror`,statusMessage:e})}handleContextCreationFailure(e,t,n){let r=this.contextsById.get(e);this.contexts.get(t)===r&&(this.contexts.delete(t),this.activeContextType=null),this.contextsById.delete(e),this.notifyContextCreationError(n)}registerTypedArrayUpdate(e){let t=z(`canvas_typed_array_update`);return this.pendingTypedArrayUpdates.set(t,e),t}applyFlushFeedback(e={}){for(let[t,n]of Object.entries(e.contexts||{}))this.contextsById.get(t)?.applyFeedback?.(n);for(let t of e.typedArrays||[]){let e=this.pendingTypedArrayUpdates.get(t.id);if(e&&ArrayBuffer.isView(e)){let n=F(t.value);ArrayBuffer.isView(n)?e.set(n.subarray(0,e.length)):Array.isArray(n)&&e.set(n.slice(0,e.length))}this.pendingTypedArrayUpdates.delete(t.id)}}createImage(){return new Hr(this,z(`canvas_image`))}requestAnimationFrame(e){let t=Ir++,r=x.store(t=>{n(e)&&e(t)});return Rr(this.bridgeId,`canvasNodeRequestAnimationFrame`,{nodeId:this.nodeId,requestId:t,callback:r}),t}cancelAnimationFrame(e){Rr(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=x.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=x.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,zr(()=>this.flushOperations()))}flushOperations(){if(this.flushScheduled=!1,this.pendingOperations.length===0)return;let e=this.pendingOperations;this.pendingOperations=[];let t=e.some(e=>e.op===`getContext`||e.op===`contextQuery`||e.op===`contextFeedback`||e.feedback||e.typedArrayUpdateId)?x.store(e=>this.applyFlushFeedback(e)):void 0;Rr(this.bridgeId,`canvasNodeFlush`,{nodeId:this.nodeId,operations:e,feedback:t})}};function qr(e,t=Lr()){return!e||e.__diminaNodeType!==`dimina-canvas-node`?e:(Mr(t,e.webglCapabilities),new Kr({nodeId:e.nodeId,bridgeId:t,width:e.width,height:e.height,type:e.type,webglCapabilities:e.webglCapabilities}))}function Jr(e,t=Lr()){return Array.isArray(e)?e.map(e=>Jr(e,t)):!e||typeof e!=`object`?e:e.node?{...e,node:qr(e.node,t)}:e}function Yr(e={}){let t=I(e.width,300),n=I(e.height,150),r=e.type||`2d`,i=z(`offscreen_canvas`),a=Lr();return Rr(a,`createOffscreenCanvas`,{nodeId:i,width:t,height:n,type:r}),new Kr({nodeId:i,bridgeId:a,width:t,height:n,type:r,offscreen:!0,webglCapabilities:Nr(a)})}var Xr=t({createSelectorQuery:()=>Zr});function Zr(){return new ti}function Qr(){return T.getPageInfo()}function $r(){let e=Qr();return e?.__id__||e?.id}function ei(){let e=Qr();return e?.bridgeId||e?.id}var ti=class{constructor(){this.__componentId=$r(),this.__taskQueue=[],this.__cbQueue=[]}in(e){return this.__componentId=e.__id__,this}select(e){return new ni(this,this.__componentId,e,!0)}selectAll(e){return new ni(this,this.__componentId,e,!1)}selectViewport(){return new ni(this,$r(),``,!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=ei();E(`selectorQuery`,{tasks:this.__taskQueue,success:i=>{let a=Jr(i,r)||[];a.forEach((e,r)=>{let i=t.__cbQueue[r];n(i)&&i.call(t,e)}),n(e)&&e.call(t,a)}},`render`)}},ni=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)}},ri=t({createIntersectionObserver:()=>ii});function ii(e,t={}){let{thresholds:n=[0],initialRatio:r=0,observeAll:i=!1}=t;return new ai(e,{thresholds:n,initialRatio:r,observeAll:i})}var ai=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=x.store(e=>{n._disconnected||(n._observerId=e.observerId),e.info&&t.call(n,e.info)},!0);E(`addIntersectionObserver`,{moduleId:this._component.__id__,targetSelector:e,relativeInfo:this._relativeInfo,options:this._options,success:r},`render`)}disconnect(){E(`removeIntersectionObserver`,{observerId:this._observerId},`render`),this._disconnected=!0}},oi=t({createMediaQueryObserver:()=>ci});function si(e={}){let t={};for(let n of[`minWidth`,`maxWidth`,`width`,`minHeight`,`maxHeight`,`height`]){let r=Number(e[n]);Number.isFinite(r)&&r>=0&&(t[n]=r)}return typeof e.orientation==`string`&&/^[-_a-z0-9]+$/i.test(e.orientation)&&(t.orientation=e.orientation),t}function ci(e,t={}){return new li(e,t)}var li=class{constructor(e,t){this._component=e,this._options=t,this._observerId=null,this._callbackId=null,this._disconnected=!1}observe(e,t){if(!n(t))throw TypeError(`MediaQueryObserver.observe listener must be a function`);if(this._observerId!==null)throw Error(`MediaQueryObserver.observe can only be called once`);this._disconnected=!1,this._callbackId=x.store((e={})=>{if(e.observerId&&(this._observerId=e.observerId,this._disconnected)){E(`removeMediaQueryObserver`,{observerId:e.observerId},`render`),x.remove(this._callbackId),this._callbackId=null;return}!this._disconnected&&typeof e.matches==`boolean`&&t.call(this,{matches:e.matches})},!0),E(`addMediaQueryObserver`,{moduleId:this._component.__id__,condition:si(e),options:this._options,success:this._callbackId},`render`)}disconnect(){this._disconnected=!0,E(`removeMediaQueryObserver`,{observerId:this._observerId},`render`),this._callbackId&&this._observerId&&(x.remove(this._callbackId),this._callbackId=null)}};function ui(e){if(typeof e!=`string`||e.length===0)return null;let t=[],n=``,r=0,i=()=>{n.length>0&&(t.push(n),n=``)};for(;r<e.length;){let a=e[r];if(a===`\\`){let t=e[r+1];if(t===`.`||t===`[`||t===`]`||t===`\\`){n+=t,r+=2;continue}n+=a,r++;continue}if(a===`.`){i(),r++;continue}if(a===`[`){if(t.length===0&&n.length===0)return null;i();let a=e.indexOf(`]`,r+1);if(a===-1)return null;let o=e.slice(r+1,a);if(!/^\d+$/.test(o))return null;t.push(Number(o)),r=a+1;continue}if(a===`]`)return null;n+=a,r++}return i(),t.length>0?t:null}function di(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e],i=t[e+1],a=Object.prototype.hasOwnProperty.call(r,n);typeof i==`number`?(!a||!Array.isArray(r[n]))&&(r[n]=[]):(!a||r[n]===null||typeof r[n]!=`object`||Array.isArray(r[n]))&&(r[n]={}),r=r[n]}r[t[t.length-1]]=n}function fi(e,t){return e.length<=t.length&&e.every((e,n)=>e===t[n])}function pi(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){if(e===`**`){n.push({path:[],wildcard:!0});continue}let t=e.endsWith(`.**`),r=ui(t?e.slice(0,-3):e);r&&n.push({path:r,wildcard:t})}return n}function mi(e,t){return e.wildcard&&e.path.length===0?!0:e.wildcard&&fi(e.path,t)||fi(t,e.path)}function hi(e){let t=[];if(Array.isArray(e.behaviorObserverList)&&e.behaviorObserverList.length>0)for(let{key:n,observer:r}of e.behaviorObserverList)t.push({expression:n,observer:r});else for(let[n,r]of Object.entries(e.behaviorObservers||{}))for(let e of r||[])t.push({expression:n,observer:e});for(let[n,r]of Object.entries(e.observers||{}))t.push({expression:n,observer:r});return t.map(e=>({...e,paths:pi(e.expression)}))}function gi(e,t,r=e.data,i=e.__info__||{}){for(let a of hi(i)){if(!n(a.observer)||!a.paths.some(e=>t.some(t=>mi(e,t))))continue;let i=a.paths.map(({path:e})=>e.length===0?r:f(r,e));M(e,a.observer,i,`data observer`)}}function _i(e,t){let n={};for(let r of t)n[r.key]=f(e.data,r.path);return n}function vi(e,t){let n=e.__info__?.properties||{};return t.flatMap(e=>{let t=e.path[0];return typeof t!=`string`||!Object.prototype.hasOwnProperty.call(n,t)?[]:[{propertyName:t,oldValue:e.path.length===1?e.oldValue:void 0,path:e.path,value:e.value}]})}function yi(e,t,r){if(!t||typeof t!=`object`||Array.isArray(t))return console.warn(`[service] setData data must be an object`),null;let i=!e.__dataUpdateTransaction__,a=e.__dataUpdateTransaction__||{changes:[],pendingPaths:[],callbacks:[]};e.__dataUpdateTransaction__=a,n(r)&&a.callbacks.push(r);for(let r of Object.keys(t)){let i=ui(r);if(!i){console.warn(`[service] invalid setData path: ${r}`);continue}let o=y(t[r]);i.length===1&&e.__propertySchemas__?.[i[0]]&&n(e.normalizePropertyValues)&&(o=e.normalizePropertyValues({[i[0]]:o})[i[0]]);let s=i.length===1?e.data[i[0]]:void 0;di(e.data,i,o),a.changes.push({key:r,path:i,oldValue:s,value:o}),a.pendingPaths.push(i)}if(!i)return null;try{for(;a.pendingPaths.length>0;){let t=a.pendingPaths;a.pendingPaths=[],gi(e,t)}}finally{delete e.__dataUpdateTransaction__}return{callbacks:a.callbacks,changedData:_i(e,a.changes),changes:a.changes.map(e=>({path:e.path,value:e.value})),propertyChanges:vi(e,a.changes)}}function V(e,t){let i=e.__info__?.properties||{};for(let a of t){let t=i[a.propertyName],o=t?.observer,s=a.path,c=Object.prototype.hasOwnProperty.call(a,`value`)?a.value:s.length===1?e.data[a.propertyName]:f(e.data,s);s.length===1&&c===a.oldValue&&!t?.observeAssignments||(r(o)?M(e,e[o],[c,a.oldValue,s],`property observer`):n(o)&&M(e,o,[c,a.oldValue,s],`property observer`))}}var bi=new Map;function xi(e){return bi.has(e)||bi.set(e,{depth:0,scheduled:!1,updates:[],byModuleId:new Map,callbackIds:[]}),bi.get(e)}function H(e,t){let r=(Array.isArray(t)?t:[t]).filter(n);if(r.length!==0)return x.store(()=>{r.forEach(t=>M(e,t,[],`setData callback`))})}function Si(e){let t=xi(e);t.depth++}function Ci(e){let t=xi(e);t.depth>0&&t.depth--,t.depth===0&&Ti(e)}function wi(e,t=[]){let n=t.length>0?t:Object.entries(e).flatMap(([e,t])=>{let n=ui(e);return n?[{path:n,value:t}]:[]}),r=JSON.parse(JSON.stringify(Ee({data:e,changes:n})));return{data:r.data||{},changes:(r.changes||[]).filter(e=>Object.prototype.hasOwnProperty.call(e,`value`))}}function U(e,t,n,r,i=[]){let a=xi(e),o=a.byModuleId.get(t),s=wi(n,i);if(o)Object.assign(o.data,s.data),o.changes.push(...s.changes);else{let e={moduleId:t,data:s.data,changes:s.changes};a.byModuleId.set(t,e),a.updates.push(e)}r&&a.callbackIds.push(r),a.depth===0&&!a.scheduled&&(a.scheduled=!0,Promise.resolve().then(()=>{a.scheduled=!1,a.depth===0&&Ti(e)}))}function Ti(e){let t=bi.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,w.send({type:`ub`,target:`render`,body:{bridgeId:e,updates:n,callbackIds:r}})}function Ei(e){return i(e)||n(e)?e:e instanceof Date?e.getTime():Array.isArray(e)?e.map(e=>Ei(e)):typeof e==`object`?Object.entries(e).reduce((e,[t,n])=>(t.startsWith(`$`)||(e[t]=Ei(n)),e),{}):e}function Di(e){if(e){let t={};for(let n in e){let r=ge(e[n]);t[n]={type:[r.type,...r.optionalTypes].map(ki),default:r.value}}return t}}var Oi=new Map([[String,`s`],[Number,`n`],[Boolean,`b`],[Object,`o`],[Array,`a`]]);function ki(e){return Array.isArray(e)?e.map(e=>ki(e)):e===null||e===``?null:Oi.get(e)||(console.warn(`[service] ignore unknown props type ${e}`),null)}function Ai(e={},t=``){let n=t.trim();if(!n)return;let r=n.replace(/-/g,``).toLowerCase(),i=[n,m(n),h(n),r];for(let t of i)if(t&&e[t]!==void 0){let n=e[t];if(typeof n==`string`)return{bind:n};if(n&&typeof n==`object`)return n}}function ji(e,t){if(!Array.isArray(t))return;let r=new WeakMap,i=new WeakSet,a=e.properties,o=e.data,s=e.methods,c=e.relations,l=Object.prototype.hasOwnProperty.call(e,`export`),u=e.export,d,f,p,m,h;function g(e,t){let n=Array.isArray(e)?[...e]:{...e};for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=n[e],i=t[e];typeof r==`object`&&typeof i==`object`&&i&&!Array.isArray(i)?n[e]=g(r,i):n[e]=i}return n}function _(e,t){if(typeof t==`string`){ee(e,t);return}if(!t||typeof t!=`object`||i.has(t))return;i.add(t);let a=r.has(t);if(Array.isArray(t.behaviors)&&t.behaviors.forEach(t=>_(e,t)),t.properties&&(d={...d,...t.properties}),t.data&&(f=g(f||{},t.data)),!a){r.set(t,!0);let i=[`created`,`attached`,`ready`,`moved`,`detached`,`error`];e.behaviorLifetimes=e.behaviorLifetimes||{};for(let r of i){let i=t.lifetimes?.[r]||t[r];n(i)&&(e.behaviorLifetimes[r]=e.behaviorLifetimes[r]||[],e.behaviorLifetimes[r].push(i))}if(t.observers){e.behaviorObservers=e.behaviorObservers||{},e.behaviorObserverList=e.behaviorObserverList||[];for(let n in t.observers)e.behaviorObservers[n]||(e.behaviorObservers[n]=[]),e.behaviorObservers[n].push(t.observers[n]),e.behaviorObserverList.push({key:n,observer:t.observers[n]})}}if(t.methods&&(p={...p,...t.methods}),t.relations&&(m={...m,...t.relations}),t.export&&(h=t.export),!a&&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]))}i.delete(t)}function ee(e,t){switch(t){case`wx://component-export`:break;case`wx://form-field`:d={...d,name:{type:String},value:{type:null}};break;case`wx://form-field-group`:case`wx://form-field-button`:case`wx://label-target`:case`wx://style-filter`:case`wx://request-filter`:break;default:console.warn(`[service] 未知的内置 behavior: ${t}`)}}t.forEach(t=>_(e,t)),(d||a)&&(e.properties={...d,...a}),(f||o)&&(e.data=g(f||{},o||{})),(p||s)&&(e.methods={...p,...s}),(m||c)&&(e.relations={...m,...c}),l?e.export=u:h&&(e.export=h)}function W(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 Mi(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 Ni(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 Pi(e,t){if(!(!e||!e.expression)){if(e.isSimple)return f(t,e.expression);try{return Function(`data`,`with(data) { return ${e.expression} }`)(t)}catch(t){console.warn(`[service] 计算表达式失败:`,e.expression,t);return}}}function Fi(e,t,n){let r=Object.values(t||{}),i=[];for(let t of r){if(!W(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&&Ni(i,n)&&(o[r]=y(Pi(i,e.data)))}if(Object.keys(o).length>0){let e=t.normalizePropertyValues?.(o,{applyFilter:!1})||o,n=t.tO?.(e)||t.normalizePropertyValues?.(e)||e;t.__pendingSyncedProps__=t.__pendingSyncedProps__||{},Object.assign(t.__pendingSyncedProps__,e),i.push({child:t,data:n})}}return i}var Ii=[`created`,`attached`,`ready`,`moved`,`detached`,`error`],Li=[`show`,`hide`,`resize`,`routeDone`],Ri=class e{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=y(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.__eventPath__=null,this.__pageId__=t.pageId,this.__parentId__=t.parentId,this.__isCustomTabBar__=t.isCustomTabBar===!0,this.__relations__=new Map,this.__relationPaths__=new Map,this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[],this.__pendingInitSetDataCallbacks__=[],this.__childPropsBindings__={},this.__pendingSyncedProps__={},this.__initialPropertyObserversInvoked__=!1,this.__initialPropertyNames__=new Set(t.propertyNames||Object.keys(t.properties||{})),this.__initialPropertyChanges__=[],this.__initialPropertyValues__={},this.__propertySchemas__=Object.fromEntries(Object.entries(this.__info__.properties||{}).map(([e,t])=>[e,ge(t)]))}init({deferInitialData:e=!1}={}){if(this.#d(),this.__isComponent__){let e=this.opts.properties||{};for(let[t,n]of Object.entries(this.__propertySchemas__)){let r=be(n,void 0,{absent:!0});if(this.data[t]=r,this.__initialPropertyNames__.has(t)){let n=this.normalizePropertyValue(t,e[t],{applyFilter:!1});this.__initialPropertyValues__[t]=n,this.__initialPropertyChanges__.push({propertyName:t,oldValue:void 0,path:[t],value:n})}}}this.#u(),this.#t(),this.#e(),this.#m(),e||this.sendInitialData()}sendInitialData(){this.__initialDataSent__||(this.__initialDataSent__=!0,w.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__=[],U(this.bridgeId,this.__id__,{},H(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(J.instances[this.bridgeId]||{}).filter(e=>e===this||!e.__isComponent__||e.__componentAttached__||e.__componentAttaching__);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.#a(t,e));for(let e of o)this.#s(n,e,r)}this.#i()}#i(){let e=Object.values(J.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}`),o&&this.#a(e,t)&&this.#s(n,e,r)}}#a(e,t){let n=Object.values(J.instances[this.bridgeId]||{});switch(t){case`parent`:return e.__id__===this.__parentId__;case`child`:return e.__parentId__===this.__id__;case`ancestor`:return this.#o(e.__id__,this.__id__,n);case`descendant`:return this.#o(this.__id__,e.__id__,n);default:return!1}}#o(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}#s(e,t,n){let r=this.__relations__.get(e)||[];r.includes(t)||(r.push(t),this.__relations__.set(e,r),M(this,n.linked,[t],`relation linked callback`))}#c(e,t,n){let r=this.__relations__.get(e)||[],i=r.indexOf(t);i!==-1&&(r.splice(i,1),this.__relations__.set(e,r),M(this,n.unlinked,[t],`relation unlinked callback`))}#l(e,t,n){M(this,n.linkChanged,[t],`relation linkChanged callback`)}setData(e,t){let n=yi(this,e,t);if(!n)return;if(!this.initd){this.__pendingInitSetDataCallbacks__.push(...n.callbacks),V(this,n.propertyChanges);return}if(this.__groupSetDataMode__){for(let e of Object.keys(n.changedData))this.__groupSetDataBuffer__[e]=n.changedData[e];this.__groupSetDataChanges__.push(...n.changes),this.__groupSetDataCallbacks__.push(...n.callbacks),V(this,n.propertyChanges);return}let r=Fi(this,J.instances[this.bridgeId],n.changedData);U(this.bridgeId,this.__id__,n.changedData,H(this,n.callbacks),n.changes),r.forEach(({child:e,data:t})=>{U(this.bridgeId,e.__id__,t)}),V(this,n.propertyChanges)}#u(){Ii.forEach(e=>{let t=this.__info__.lifetimes?.[e]||this.__info__[e];n(t)&&(this[e]=t.bind(this))}),this.__isComponent__&&Li.forEach(e=>{let t=this.__info__.pageLifetimes?.[e];n(t)&&(e===`show`?e=`onShow`:e===`hide`&&(e=`onHide`),this[e]=t.bind(this))})}#d(){let e=this.__info__.methods;for(let t in e)n(e[t])&&(this[t]=e[t].bind(this))}#f(){if(!this.__isComponent__||!this.__info__.properties||this.__initialPropertyObserversInvoked__)return;let e=this.__initialPropertyChanges__.map(e=>e.path);e.length>0&&(gi(this,e),V(this,this.__initialPropertyChanges__)),this.__initialPropertyObserversInvoked__=!0}#p(){for(let[e,t]of Object.entries(this.__initialPropertyValues__)){let n=this.data[e],r=this.normalizePropertyValue(e,t,{oldValue:n});this.data[e]=r;let i=this.__initialPropertyChanges__.find(t=>t.propertyName===e);i&&(i.oldValue=n,i.value=r)}}#m(){this.__isComponent__?(this.componentCreated(),this.#p(),this.#f()):(this.componentCreated(),this.componentAttached(),M(this,this.onLoad,[this.opts.query||{}],`onLoad`)),this.initd=!0}tO(e){let t=typeof this.normalizePropertyValues==`function`?this.normalizePropertyValues(e,{applyFilter:!1}):e,n={},r={};for(let[e,i]of Object.entries(t)){if(this.__pendingSyncedProps__&&Object.prototype.hasOwnProperty.call(this.__pendingSyncedProps__,e)&&a(this.__pendingSyncedProps__[e],i)){this.hasPropertyFilter?.(e)||(this.data[e]=i),r[e]=this.data[e],delete this.__pendingSyncedProps__[e];continue}let t=typeof this.normalizePropertyValue==`function`?this.normalizePropertyValue(e,i):i;n[e]=t,r[e]=t}if(Object.keys(n).length===0)return r;let i=[],o=[];for(let[e,t]of Object.entries(n)){let n=this.data[e];this.data[e]=t,o.push([e]),i.push({propertyName:e,oldValue:n,path:[e],value:t})}return gi(this,o),V(this,i),r}hasPropertyFilter(e){let t=this.__info__.properties?.[e];return!!t&&typeof t==`object`&&t.filter!=null}normalizePropertyValue(e,t,{absent:r=!1,applyFilter:i=!0,oldValue:a=this.data[e],path:o=[e]}={}){let s=this.__propertySchemas__[e];if(!s)return t;let c=be(s,t,{absent:r});if(r||!i||!this.hasPropertyFilter(e))return c;let l=this.__info__.properties[e],u=n(l.filter)?l.filter:this.__info__.methods?.[l.filter];if(!n(u))return c;let d=M(this,u,[c,a,o],`property filter`);return d===void 0?c:d}normalizePropertyValues(e,{applyFilter:t=!0}={}){let n={};for(let[r,i]of Object.entries(e||{}))n[r]=this.normalizePropertyValue(r,i,{applyFilter:t});return n}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 Zr().in(this)}selectComponent(e){let t=Object.values(J.instances[this.bridgeId]),n=t.find(n=>W(n,this.__id__,t)&&Mi(e,n));return n?n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(J.instances[this.bridgeId]);return t.filter(n=>W(n,this.__id__,t)&&Mi(e,n))}selectOwnerComponent(){let e=Object.values(J.instances[this.bridgeId]);for(let t of e)if(t.id===this.__parentId__)return t;return null}createIntersectionObserver(e){return ii(this,e)}groupSetData(e){if(!n(e)){console.warn(`[service] groupSetData callback must be a function`);return}this.__groupSetDataMode__=!0,Si(this.bridgeId),this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];try{M(this,e,[],`groupSetData callback`)}finally{if(this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__&&Object.keys(this.__groupSetDataBuffer__).length>0){let e=this.__groupSetDataBuffer__,t=this.__groupSetDataCallbacks__,n=this.__groupSetDataChanges__;this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];let r=Fi(this,J.instances[this.bridgeId],e);U(this.bridgeId,this.__id__,e,H(this,t),n),r.forEach(({child:e,data:t})=>{U(this.bridgeId,e.__id__,t)})}else this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];Ci(this.bridgeId)}}createMediaQueryObserver(e){return ci(this,e)}getRelationNodes(e){let t=this.__relations__.get(e);return t?[...t]:null}animate(e,t,r,i,a){n(i)&&(a=i,i=void 0),E(`componentAnimate`,{moduleId:this.__id__,selector:e,keyframes:t,duration:r,timeline:i,success:a},`render`)}clearAnimation(e,t,r){n(t)&&(r=t,t={}),E(`componentClearAnimation`,{moduleId:this.__id__,selector:e,options:t||{},success:r},`render`)}async triggerEvent(t,n,r={}){if(!t)return;let i=t.trim();if(!i)return;let a={bubbles:r.bubbles===!0,composed:r.composed===!0,capturePhase:r.capturePhase===!0},o={id:this.id,dataset:this.dataset||{}},s=!1,c=!1,l={type:i,timeStamp:Date.now(),detail:n,bubbles:a.bubbles,composed:a.composed,currentTarget:null,target:o,preventDefault(){c=!0},stopPropagation(){s=!0}};Object.defineProperty(l,"defaultPrevented",{enumerable:!0,get:()=>c});let u=e.prototype.getCustomEventPath.call(this,a.composed),d=async(e,t)=>{let n=Ai(e.eventAttr,i);if(!n)return;let r=t?n.captureCatch??n.captureBind:n.catch??n.bind;if(!r)return;l.currentTarget=e.currentTarget;let a=await J.triggerEvent({bridgeId:this.bridgeId,moduleId:e.moduleId,methodName:r,event:l});(t?n.captureCatch:n.catch)&&l.stopPropagation(),a===!1&&(l.preventDefault(),l.stopPropagation())};if(a.capturePhase)for(let e=u.length-1;e>=0&&!s;e--)await d(u[e],!0);if(s)return;let f=a.bubbles?u:u.slice(0,1);for(let e of f)if(await d(e,!1),s)break}getCustomEventPath(e){let t=[{moduleId:this.__pageId__,eventAttr:this.__eventAttr__||{},currentTarget:{id:this.id,dataset:this.dataset||{}}}];if(Array.isArray(this.__eventPath__)){let n=this.__eventPath__.filter(e=>e?.moduleId).map(e=>{let t=e.isComponentHost&&e.nodeModuleId?J.instances[this.bridgeId]?.[e.nodeModuleId]:null;return{moduleId:e.moduleId,nodeModuleId:e.nodeModuleId,isComponentHost:e.isComponentHost===!0,eventAttr:e.eventAttr||{},currentTarget:{id:t?.id??e.targetInfo?.id,dataset:t?.dataset||e.targetInfo?.dataset||{}}}}),r=J.instances[this.bridgeId]||{},i=new Set([this.__id__]),a=0,o=r[this.__parentId__];for(;o?.__isComponent__&&!i.has(o.__id__);){i.add(o.__id__);let e=n.findIndex(e=>e.isComponentHost&&e.nodeModuleId===o.__id__);if(e>=0)a=Math.max(a,e+1);else if(Object.keys(o.__eventAttr__||{}).length>0){let e=-1;for(let t=0;t<n.length;t++)n[t].moduleId===o.__id__&&(e=t);let t=Math.max(a,e+1);n.splice(t,0,{moduleId:o.__pageId__,nodeModuleId:o.__id__,isComponentHost:!0,eventAttr:o.__eventAttr__,currentTarget:{id:o.id,dataset:o.dataset||{}}}),a=t+1}o=r[o.__parentId__]}for(let r of n)(e||r.moduleId===this.__pageId__)&&t.push(r);return t}let n=J.instances[this.bridgeId]||{},r=new Set([this.__id__]),i=n[this.__parentId__];for(;i?.__isComponent__&&!r.has(i.__id__);)r.add(i.__id__),(e||i.__pageId__===this.__pageId__)&&t.push({moduleId:i.__pageId__,eventAttr:i.__eventAttr__||{},currentTarget:{id:i.id,dataset:i.dataset||{}}}),i=n[i.__parentId__];return t}pageReady(){this.__isComponent__||M(this,this.ready,[],`ready lifetime`)}pageUnload(){this.__isComponent__||M(this,this.onUnload,[],`onUnload`)}pageScrollTop(e){if(!this.__isComponent__){let{scrollTop:t}=e;M(this,this.onPageScroll,[{scrollTop:t}],`onPageScroll`)}}pagePullDownRefresh(){this.__isComponent__||M(this,this.onPullDownRefresh,[],`onPullDownRefresh`)}pageReachBottom(){this.__isComponent__||M(this,this.onReachBottom,[],`onReachBottom`)}pageShareAppMessage(e={}){if(!this.__isComponent__)return M(this,this.onShareAppMessage,[e],`onShareAppMessage`)}pageTabItemTap(e={}){this.__isComponent__||M(this,this.onTabItemTap,[e],`onTabItemTap`)}pageShow(){N(this,this.__info__.behaviorPageLifetimes?.show,[],`page show lifetime`),M(this,this.onShow,[],`page show lifetime`)}pageHide(){N(this,this.__info__.behaviorPageLifetimes?.hide,[],`page hide lifetime`),M(this,this.onHide,[],`page hide lifetime`)}pageResize(e){N(this,this.__info__.behaviorPageLifetimes?.resize,[e],`page resize lifetime`),M(this,this.resize,[e],`page resize lifetime`)}componentRouteDone(){N(this,this.__info__.behaviorPageLifetimes?.routeDone,[],`page routeDone lifetime`),M(this,this.routeDone,[],`page routeDone lifetime`)}componentCreated(){N(this,this.__info__.behaviorLifetimes?.created,[],`created lifetime`),M(this,this.created,[],`created lifetime`)}componentAttached(){N(this,this.__info__.behaviorLifetimes?.attached,[],`attached lifetime`),M(this,this.attached,[],`attached lifetime`),this.#r()}componentReadied(){N(this,this.__info__.behaviorLifetimes?.ready,[],`ready lifetime`),M(this,this.ready,[],`ready lifetime`)}componentMoved(){N(this,this.__info__.behaviorLifetimes?.moved,[],`moved lifetime`),M(this,this.moved,[],`moved lifetime`);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)}}componentDetached(){this.__componentAttached__=!1,N(this,this.__info__.behaviorLifetimes?.detached,[],`detached lifetime`),M(this,this.detached,[],`detached lifetime`);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.#c(t,r,n)}this.#h(),this.initd=!1}#h(){let e=Object.values(J.instances[this.bridgeId]||{});for(let t of e)if(!(t===this||!t.__relations__))for(let[e,n]of t.__relations__.entries()){let r=n.indexOf(this);if(r!==-1){n.splice(r,1),t.__relations__.set(e,n);let i=t.__info__.relations?.[e];M(t,i?.unlinked,[this],`relation unlinked callback`)}}}componentError(e){N(this,this.__info__.behaviorLifetimes?.error,[e],`error lifetime`,!1),M(this,this.error,[e],`error lifetime`,!1)}},G=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,ji(this.moduleInfo,this.behaviors),this.noReferenceData=Ei(this.moduleInfo.data||{})}getProps(){let e=Di(this.moduleInfo.properties),t=Array.isArray(this.behaviors)?this.behaviors.filter(e=>typeof e==`string`&&e.startsWith(`wx://`)):[];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 t.length&&(e||={},e.__diminaMeta={builtinBehaviors:t}),e}},zi=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=y(e.noReferenceData),this.__type__=e.type,this.__id__=t.moduleId,this.__info__=e.moduleInfo,this.__childPropsBindings__={},this.__pendingInitSetDataCallbacks__=[]}init({deferInitialData:e=!1}={}){this.#e(),this.#t(),e||this.sendInitialData()}sendInitialData(){this.__initialDataSent__||(this.__initialDataSent__=!0,w.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__=[],U(this.bridgeId,this.__id__,{},H(this,e))}setData(e,t){let n=yi(this,e,t);if(!n)return;if(!this.initd){this.__pendingInitSetDataCallbacks__.push(...n.callbacks);return}let r=Fi(this,J.instances[this.bridgeId],n.changedData);U(this.bridgeId,this.__id__,n.changedData,H(this,n.callbacks),n.changes),r.forEach(({child:e,data:t})=>{U(this.bridgeId,e.__id__,t)})}createSelectorQuery(){return Zr().in(this)}getTabBar(){let e=Object.values(J.instances[this.bridgeId]||{});return e.find(t=>t?.__isComponent__&&t.__isCustomTabBar__&&W(t,this.__id__,e))||null}selectComponent(e){let t=Object.values(J.instances[this.bridgeId]||{}),n=t.find(n=>W(n,this.__id__,t)&&Mi(e,n));return n?n.hasBehavior&&n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(J.instances[this.bridgeId]||{});return t.filter(n=>W(n,this.__id__,t)&&Mi(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}}#t(){N(this,this.__info__.behaviorLifetimes?.created,[],`created lifetime`),M(this,this.created,[],`created lifetime`),N(this,this.__info__.behaviorLifetimes?.attached,[],`attached lifetime`),M(this,this.attached,[],`attached lifetime`),M(this,this.onLoad,[this.opts.query||{}],`onLoad`),this.initd=!0}pageShow(){N(this,this.__info__.behaviorPageLifetimes?.show,[],`page show lifetime`),M(this,this.onShow,[],`onShow`)}pageHide(){N(this,this.__info__.behaviorPageLifetimes?.hide,[],`page hide lifetime`),M(this,this.onHide,[],`onHide`)}pageReady(){N(this,this.__info__.behaviorLifetimes?.ready,[],`ready lifetime`),M(this,this.ready,[],`ready lifetime`),M(this,this.onReady,[],`onReady`)}pageUnload(){N(this,this.__info__.behaviorLifetimes?.detached,[],`detached lifetime`),M(this,this.detached,[],`detached lifetime`),M(this,this.onUnload,[],`onUnload`),this.initd=!1}pageScrollTop(e){let{scrollTop:t}=e;M(this,this.onPageScroll,[{scrollTop:t}],`onPageScroll`)}pagePullDownRefresh(){M(this,this.onPullDownRefresh,[],`onPullDownRefresh`)}pageReachBottom(){M(this,this.onReachBottom,[],`onReachBottom`)}pageShareAppMessage(e={}){return M(this,this.onShareAppMessage,[e],`onShareAppMessage`)}pageTabItemTap(e={}){M(this,this.onTabItemTap,[e],`onTabItemTap`)}pageResize(e){N(this,this.__info__.behaviorPageLifetimes?.resize,[e],`page resize lifetime`),M(this,this.onResize,[e],`onResize`)}},K=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,ji(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=Ei(this.moduleInfo.data||{})}},Bi=class{static type=`app`;constructor(e){this.moduleInfo=e}},q=new class{constructor(){this.staticModules={}}loadResource(e){let{appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a,resourceLoadId:o}=e;if(_&&(this.isScriptLoaded=this.isScriptLoaded||{},!this.isScriptLoaded[i])){let e=`${a}${t}/${i}/logic.js`;globalThis.importScripts(e),this.isScriptLoaded[i]=!0}T.setInitId(n),b(`app`),b(r),w.invoke({type:`serviceResourceLoaded`,target:`service`,body:{bridgeId:n,resourceLoadId:o}})}createAppModule(e){let t=new Bi(e);this.staticModules[Bi.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))b(e);if(n===K.type){let n=new K(e,t);this.staticModules[r]=n}else if(n===G.type){let n=new G(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[Bi.type]}getModuleByPath(e){return this.staticModules[e]}},J=new class{constructor(){this.app=void 0,this.defaultApp={},this.appLaunchOptions={},this.instances={},this.pageStates=new Map}setAppLaunchOptions(e){this.app||(this.appLaunchOptions=e)}getApp(e={}){return e.allowDefault?this.app||this.defaultApp:this.app}getPageState(e){return this.pageStates.has(e)||this.pageStates.set(e,{hidden:!1,pendingReady:!1,pendingShow:!1,ready:!1,shown:!1}),this.pageStates.get(e)}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=this.appLaunchOptions){if(this.app){console.log(`[service] app instance already existed`);return}let{scene:t,pagePath:n,query:r}=e||{},i=q.getAppModule();if(!i){console.log(`[service] app instance is not exist`);return}console.log(`[service] create app instance`),Object.assign(i.moduleInfo,this.defaultApp),this.defaultApp={},this.app=new xr(i,{scene:t,path:n,query:r})}appShow(){this.app?.appShow()}appHide(){this.app?.appHide()}stackShow(e){T.pushStack(e)}stackHide(e){T.popStack(e)}createInstance(e){let{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,propertyNames:l,targetInfo:u,stackId:d,isCustomTabBar:f=!1,deferInitialData:p=!1}=e,m=q.getModuleByPath(r);if(!m){console.error(`[service] ${r} not exist`);return}if(console.log(`[service] create instance ${r}`),this.instances[t]=this.instances[t]||{},m.type===G.type){let e=new Ri(m,{bridgeId:t,moduleId:n,path:r,isCustomTabBar:f,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,propertyNames:l,targetInfo:u});this.instances[t][n]=e,m.isComponent||T.push(e,d),e.init({deferInitialData:p});let h=this.getPageState(t);return!m.isComponent&&h.pendingShow&&!h.hidden&&this.pageShow({bridgeId:t,moduleId:n}),e}else if(m.type===K.type){let e=new zi(m,{bridgeId:t,moduleId:n,path:r,query:i});this.instances[t][n]=e,T.push(e,d),e.init({deferInitialData:p});let a=this.getPageState(t);return a.pendingShow&&!a.hidden&&this.pageShow({bridgeId:t,moduleId:n}),e}else console.error(`[service] ${m.type} instance is not exist.`)}moduleAttached(e){let{bridgeId:t,moduleId:n,parentId:r}=e,i=this.instances[t]?.[n];if(!i||i.__type__!==G.type||!i.__isComponent__||i.__componentAttached__||i.__componentAttaching__)return;r&&this.instances[t]?.[r]&&(i.__parentId__=r);let a=this.instances[t]?.[i.__parentId__];if(a?.__isComponent__&&!a.__componentAttached__){i.__componentAttachPending__=!0;return}i.__componentAttachPending__=!1,i.__componentAttaching__=!0;try{i.__componentAttached__=!0,i.componentAttached(),i.__componentAttaching__=!1,this.getPageState(t).shown&&!i.__pageShown__&&(i.__pageShown__=!0,i.pageShow());let e=Object.values(this.instances[t]||{}).filter(e=>e?.__parentId__===n&&e.__componentAttachPending__);for(let n of e)this.moduleAttached({bridgeId:t,moduleId:n.__id__});if(i.__pendingReadyOpts__){let e=i.__pendingReadyOpts__;delete i.__pendingReadyOpts__,this.moduleReady(e)}}finally{i.__componentAttaching__=!1}}moduleReady(e){let{bridgeId:t,moduleId:n,propBindings:r,eventPath:i}=e,a=this.instances[t]?.[n];if(a){if(Array.isArray(i)&&(a.__eventPath__=i),r&&a.__parentId__){let e=this.instances[t]?.[a.__parentId__];e&&(e.__childPropsBindings__||={},e.__childPropsBindings__[n]=r)}if(a.__type__===G.type){if(a.__isComponent__&&!a.__componentAttached__){a.__pendingReadyOpts__=e;return}if(a.__componentReadied__)return;if(Object.values(this.instances[t]||{}).some(e=>e?.__isComponent__&&e.__componentAttached__&&!e.__componentReadied__&&this.isDescendantInstance(e,a,t))){a.__pendingReadyOpts__=e;return}a.__componentReadied__=!0,a.componentReadied(),this.flushPendingEvents(a),a.flushInitSetDataCallbacks?.();let n=this.getPageInstance(t);n&&this.checkAndCallPageReady(t,n.__id__);let r=this.instances[t]?.[a.__parentId__];for(;r?.__isComponent__;){if(r.__pendingReadyOpts__){let e=r.__pendingReadyOpts__;delete r.__pendingReadyOpts__,this.moduleReady(e)}r=this.instances[t]?.[r.__parentId__]}}}}isDescendantInstance(e,t,n){let r=e;for(;r?.__parentId__;){if(r.__parentId__===t.__id__)return!0;r=this.instances[n]?.[r.__parentId__]}return!1}moduleUnmounted(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t]?.[n];r&&(r.__type__===G.type&&(!r.__isComponent__||r.__componentAttached__)&&!r.__componentDetached__&&(r.componentDetached(),r.__componentDetached__=!0),delete this.instances[t][n])}pageShow(e){let{bridgeId:t}=e,n=this.getPageState(t);if(n.hidden=!1,n.pendingShow=!0,!this.instances[t])return;let r=this.getPageInstance(t);if(!r?.initd)return;if(n.shown){n.pendingShow=!1;return}n.shown=!0,n.pendingShow=!1;let i=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===K.type?i.push(e):e.__type__===G.type&&(e.__isComponent__?e.__componentAttached__&&!e.__pageShown__&&(e.__pageShown__=!0,e.pageShow()):i.push(e)))}),i.forEach(e=>{e.pageShow()}),n.pendingReady&&this.pageReady({...e,moduleId:r.__id__})}pageReady(e){let{bridgeId:t,moduleId:n}=e,r=this.getPageState(t);r.pendingReady=!0;let i=this.instances[t]?.[n];i&&(r.hidden||!r.shown||r.ready||(i.__pageReadyPending__=!0,i.flushInitSetDataCallbacks?.(),this.checkAndCallPageReady(t,n)))}getPageInstance(e){let t=this.instances[e];return t?Object.values(t).find(e=>e&&(e.__type__===K.type||e.__type__===G.type&&!e.__isComponent__)):null}checkAndCallPageReady(e,t){let n=this.getPageState(e),r=this.instances[e]?.[t];if(!r||!r.__pageReadyPending__||!n.shown||n.ready)return;let i=this.instances[e];if(!i){r.__pageReadyPending__=!1,n.pendingReady=!1,n.ready=!0,r.pageReady();return}Object.values(i).filter(e=>e&&e.__type__===G.type&&e.__isComponent__&&e.initd&&!e.__componentReadied__).length===0&&(r.__pageReadyPending__=!1,n.pendingReady=!1,n.ready=!0,r.pageReady())}pageHide(e){let{bridgeId:t}=e,n=this.getPageState(t);if(n.hidden=!0,n.pendingShow=!1,!n.shown||(n.shown=!1,!this.instances[t]))return;let r=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===K.type?r.push(e):e.__type__===G.type&&(e.__isComponent__?e.__componentAttached__&&e.__pageShown__&&(e.__pageShown__=!1,e.pageHide()):r.push(e)))}),r.forEach(e=>{e&&e.pageHide()})}pageUnload(e){let{bridgeId:t}=e;if(!this.instances[t])return;let n=this.getInstancesInTreeOrder(t);this.getInstancesInTreeOrder(t,{postOrder:!0}).filter(e=>e?.__type__===G.type&&e.__isComponent__).forEach(e=>{e.__componentAttached__&&!e.__componentDetached__&&(e.componentDetached(),e.__componentDetached__=!0)}),n.forEach(e=>{e&&(e.__type__===G.type&&!e.__isComponent__&&!e.__componentDetached__&&(e.componentDetached(),e.__componentDetached__=!0),e.pageUnload())}),T.remove(t),delete this.instances[t],this.pageStates.delete(t)}getInstancesInTreeOrder(e,{postOrder:t=!1}={}){let n=Object.values(this.instances[e]||{}).filter(Boolean),r=new Map(n.map(e=>[e.__id__,e])),i=new Map,a=[];for(let e of n)if(e.__parentId__&&r.has(e.__parentId__)){let t=i.get(e.__parentId__)||[];t.push(e),i.set(e.__parentId__,t)}else a.push(e);let o=[],s=new Set,c=e=>{if(!(!e||s.has(e))){s.add(e),t||o.push(e);for(let t of i.get(e.__id__)||[])c(t);t&&o.push(e)}};return a.forEach(c),n.forEach(c),o}pageScroll(e){let{bridgeId:t,moduleId:n,scrollTop:r}=e,i=this.instances[t]?.[n];i&&i.pageScrollTop({scrollTop:r})}pagePullDownRefresh({bridgeId:e}){this.getPageInstance(e)?.pagePullDownRefresh()}pageReachBottom({bridgeId:e}){this.getPageInstance(e)?.pageReachBottom()}pageShareAppMessage({bridgeId:e,...t}){return this.getPageInstance(e)?.pageShareAppMessage(t)}pageTabItemTap({bridgeId:e,...t}){this.getPageInstance(e)?.pageTabItemTap(t)}pageResize(e){let{bridgeId:t,size:n}=e;if(!this.instances[t])return;let r=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===K.type?r.push(e):e.__type__===G.type&&(e.__isComponent__?e.__componentAttached__&&e.pageResize(n):r.push(e)))}),r.forEach(e=>e.pageResize(n))}componentError(e){let{bridgeId:t,moduleId:n,error:r}=e,i=this.instances[t]?.[n];i&&i.__type__===G.type&&i.componentError(r)}componentRouteDone(e){let{bridgeId:t}=e;this.instances[t]&&this.getInstancesInTreeOrder(t).forEach(e=>{e?.__type__===G.type&&(!e.__isComponent__||e.__componentAttached__)&&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__===G.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})}},Vi=t({getEnterOptionsSync:()=>Ui,getLaunchOptionsSync:()=>Hi});function Hi(){return J.app?.options}function Ui(){return J.app?.options}var Wi=t({getLocation:()=>Gi,offLocationChange:()=>Xi,onLocationChange:()=>Yi,openLocation:()=>qi,startLocationUpdate:()=>Ki,stopLocationUpdate:()=>Ji});function Gi(e){return E(`getLocation`,e)}function Ki(e){return E(`startLocationUpdate`,e)}function qi(e){return E(`openLocation`,e)}function Ji(e){return E(`stopLocationUpdate`,e)}function Yi(e){e&&E(`onLocationChange`,{success:x.store(e,!0)})}function Xi(e){if(e){let t=x.store(e,!0);E(`offLocationChange`,{success:t}),x.remove(t)}else E(`offLocationChange`),x.remove()}var Zi=t({createMapContext:()=>Qi});function Qi(e,t){return new $i({mapId:e,obj:t})}var $i=class{constructor(e){this.opts=e}addMarkers(e){return this.invoke(`addMarkers`,e)}removeMarkers(e){return this.invoke(`removeMarkers`,e)}includePoints(e){return this.invoke(`includePoints`,e)}setCenterOffset(e){return this.invoke(`setCenterOffset`,e)}getCenterLocation(e){return this.invoke(`getCenterLocation`,e)}getScale(e){return this.invoke(`getScale`,e)}moveToLocation(e){return this.invoke(`moveToLocation`,e)}translateMarker(e){return this.invoke(`translateMarker`,e)}addArc(e){return this.invoke(`addArc`,e)}removeArc(e){return this.invoke(`removeArc`,e)}invoke(e,t={}){return E(e,{mapId:this.opts.mapId,...t})}},ea=t({createInnerAudioContext:()=>ra}),ta=1,na=class{constructor(){this._audioId=ta++,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={},E(`audioCreate`,{audioId:this._audioId}),E(`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,E(`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,E(`audioSetProp`,{audioId:this._audioId,prop:`startTime`,value:this._startTime})}get autoplay(){return this._autoplay}set autoplay(e){this._autoplay=!!e,E(`audioSetProp`,{audioId:this._audioId,prop:`autoplay`,value:this._autoplay})}get loop(){return this._loop}set loop(e){this._loop=!!e,E(`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)),E(`audioSetProp`,{audioId:this._audioId,prop:`volume`,value:this._volume})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=Number(e)||1,E(`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,E(`audioPlay`,{audioId:this._audioId,src:this._src})}pause(){this._paused=!0,E(`audioPause`,{audioId:this._audioId})}stop(){this._paused=!0,E(`audioStop`,{audioId:this._audioId})}seek(e){E(`audioSeek`,{audioId:this._audioId,position:Number(e)||0})}destroy(){E(`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 ra(){return new na}var ia=t({chooseImage:()=>ca,compressImage:()=>sa,previewImage:()=>oa,saveImageToPhotosAlbum:()=>aa});function aa(e){return E(`saveImageToPhotosAlbum`,e)}function oa(e){return E(`previewImage`,e)}function sa(e){return E(`compressImage`,e)}function ca(e){return E(`chooseImage`,e)}var la=t({chooseMedia:()=>fa,chooseVideo:()=>da,createVideoContext:()=>ua});function ua(e,t){return new pa({videoId:e,obj:t})}function da(e){return E(`chooseVideo`,e)}function fa(e){return E(`chooseMedia`,e)}var pa=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={}){E(`videoContext`,{type:`native/video`,id:this.opts.videoId,command:e,...t},`render`)}},ma=t({exitMiniProgram:()=>va,navigateBackMiniProgram:()=>_a,navigateToMiniProgram:()=>ga,restartMiniProgram:()=>ha});function ha(e){return E(`restartMiniProgram`,e)}function ga(e){return E(`navigateToMiniProgram`,e)}function _a(e){return E(`navigateBackMiniProgram`,e)}function va(e){return E(`exitMiniProgram`,e)}var ya=t({downloadFile:()=>ba});function ba(e){return E(`downloadFile`,e)}var xa=`__diminaArrayBufferBase64`,Y=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Sa=Object.fromEntries([...Y].map((e,t)=>[e,t]));function Ca(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function wa(e){return Ca(e)?e:e&&Ca(e.buffer)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function Ta(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=Y[t[r]>>2],n+=Y[(t[r]&3)<<4|t[r+1]>>4],n+=Y[(t[r+1]&15)<<2|t[r+2]>>6],n+=Y[t[r+2]&63];return r<t.length&&(n+=Y[t[r]>>2],r+1<t.length?(n+=Y[(t[r]&3)<<4|t[r+1]>>4],n+=`${Y[(t[r+1]&15)<<2]}=`):n+=`${Y[(t[r]&3)<<4]}==`),n}function Ea(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=Sa[t[e]],o=Sa[t[e+1]],s=t[e+2]===`=`?0:Sa[t[e+2]],c=t[e+3]===`=`?0:Sa[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function Da(e){let t=wa(e);return t?{[xa]:Ta(t)}:e}function Oa(e){if(!e||typeof e!=`object`)return e;let t=e.message;return!t||typeof t!=`object`||t.__diminaArrayBufferBase64===void 0?e:{...e,message:Ea(t[xa])}}function ka(e){return`${e}_${Date.now()}_${Math.random().toString(36).slice(2,11)}`}function X(e,t,n={}){return E(e,{socketId:t,...n,keep:!0})}function Z(e,t,n={},r=e=>e){let i=new Set,a,o;function s(){if(!a)return;let e=a;a=void 0,x.remove(e),E(t,{...n,callbackId:e,keep:!0})}return{on(t){if(!(typeof t!=`function`||i.has(t))&&(i.add(t),!a))return a=x.store(e=>{let t=r(e);for(let e of[...i])e(t);o?.()},!0),E(e,{...n,callbackId:a,success:a,keep:!0})},off(e){if(typeof e==`function`?i.delete(e):i.clear(),i.size===0)return s()},dispose({notifyNative:e=!1}={}){if(i.clear(),e)return s();a&&x.remove(a),a=void 0},hasListeners(){return i.size>0},setAfterEmit(e){o=e}}}var Aa=t({offLocalServiceDiscoveryStop:()=>Ra,offLocalServiceFound:()=>Ba,offLocalServiceLost:()=>Ha,offLocalServiceResolveFail:()=>Wa,onLocalServiceDiscoveryStop:()=>La,onLocalServiceFound:()=>za,onLocalServiceLost:()=>Va,onLocalServiceResolveFail:()=>Ua,startLocalServiceDiscovery:()=>Fa,stopLocalServiceDiscovery:()=>Ia}),ja=Z(`onLocalServiceDiscoveryStop`,`offLocalServiceDiscoveryStop`),Ma=Z(`onLocalServiceFound`,`offLocalServiceFound`),Na=Z(`onLocalServiceLost`,`offLocalServiceLost`),Pa=Z(`onLocalServiceResolveFail`,`offLocalServiceResolveFail`);function Fa(e={}){return E(`startLocalServiceDiscovery`,e)}function Ia(e={}){return E(`stopLocalServiceDiscovery`,e)}function La(e){return ja.on(e)}function Ra(e){return ja.off(e)}function za(e){return Ma.on(e)}function Ba(e){return Ma.off(e)}function Va(e){return Na.on(e)}function Ha(e){return Na.off(e)}function Ua(e){return Pa.on(e)}function Wa(e){return Pa.off(e)}var Ga=t({request:()=>Ka});function Ka(e){return E(`request`,e)}var qa=t({createTCPSocket:()=>Ya}),Ja=class{constructor(e){this.socketId=e,this.events={bindWifi:Z(`TCPSocket.onBindWifi`,`TCPSocket.offBindWifi`,{socketId:e}),close:Z(`TCPSocket.onClose`,`TCPSocket.offClose`,{socketId:e}),connect:Z(`TCPSocket.onConnect`,`TCPSocket.offConnect`,{socketId:e}),error:Z(`TCPSocket.onError`,`TCPSocket.offError`,{socketId:e}),message:Z(`TCPSocket.onMessage`,`TCPSocket.offMessage`,{socketId:e},Oa)},this.events.close.setAfterEmit(()=>{for(let e of Object.values(this.events))e.dispose()})}bindWifi(e={}){return X(`TCPSocket.bindWifi`,this.socketId,e)}close(){let e=X(`TCPSocket.close`,this.socketId);for(let[e,t]of Object.entries(this.events))(e!==`close`||!t.hasListeners())&&t.dispose();return e}connect(e={}){return X(`TCPSocket.connect`,this.socketId,e)}write(e){return X(`TCPSocket.write`,this.socketId,{data:Da(e)})}onBindWifi(e){return this.events.bindWifi.on(e)}offBindWifi(e){return this.events.bindWifi.off(e)}onClose(e){return this.events.close.on(e)}offClose(e){return this.events.close.off(e)}onConnect(e){return this.events.connect.on(e)}offConnect(e){return this.events.connect.off(e)}onError(e){return this.events.error.on(e)}offError(e){return this.events.error.off(e)}onMessage(e){return this.events.message.on(e)}offMessage(e){return this.events.message.off(e)}};function Ya(){return new Ja(ka(`tcp`))}var Xa=t({createUDPSocket:()=>Qa}),Za=class{constructor(e){this.socketId=e,this.events={close:Z(`UDPSocket.onClose`,`UDPSocket.offClose`,{socketId:e}),error:Z(`UDPSocket.onError`,`UDPSocket.offError`,{socketId:e}),listening:Z(`UDPSocket.onListening`,`UDPSocket.offListening`,{socketId:e}),message:Z(`UDPSocket.onMessage`,`UDPSocket.offMessage`,{socketId:e},Oa)},this.events.close.setAfterEmit(()=>{for(let e of Object.values(this.events))e.dispose()})}bind(e=0){return X(`UDPSocket.bind`,this.socketId,{port:e})}close(){let e=X(`UDPSocket.close`,this.socketId);for(let[e,t]of Object.entries(this.events))(e!==`close`||!t.hasListeners())&&t.dispose();return e}connect(e={}){return X(`UDPSocket.connect`,this.socketId,e)}send(e={}){return this.sendWithName(`UDPSocket.send`,e)}write(e={}){return this.sendWithName(`UDPSocket.write`,e)}setTTL(e){return X(`UDPSocket.setTTL`,this.socketId,{ttl:e})}onClose(e){return this.events.close.on(e)}offClose(e){return this.events.close.off(e)}onError(e){return this.events.error.on(e)}offError(e){return this.events.error.off(e)}onListening(e){return this.events.listening.on(e)}offListening(e){return this.events.listening.off(e)}onMessage(e){return this.events.message.on(e)}offMessage(e){return this.events.message.off(e)}sendWithName(e,t){return X(e,this.socketId,{...t,message:Da(t.message)})}};function Qa(){return new Za(ka(`udp`))}var $a=t({uploadFile:()=>ro}),eo=1;function to(){return`upload_${Date.now()}_${eo++}`}function no(){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 ro(e={}){let t=to(),n=no(),r=no(),i=x.store(e=>n.dispatch(e),!0,`${t}_progress`),a=x.store(e=>r.dispatch(e),!0,`${t}_headers`),o=e.complete,s=!1,c=e=>{s||(s=!0,x.remove(i),x.remove(a),n.remove(),r.remove(),typeof o==`function`&&o(e))};try{E(`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||E(`uploadFileAbort`,{uploadId:t})},onProgressUpdate(e){n.add(e)},offProgressUpdate(e){n.remove(e)},onHeadersReceived(e){r.add(e)},offHeadersReceived(e){r.remove(e)}}}var io=t({closeSocket:()=>co,connectSocket:()=>oo,offSocketClose:()=>_o,offSocketError:()=>ho,offSocketMessage:()=>po,offSocketOpen:()=>uo,onSocketClose:()=>go,onSocketError:()=>mo,onSocketMessage:()=>fo,onSocketOpen:()=>lo,sendSocketMessage:()=>so});function Q(e,t,r={}){let i=new Map;return{on(t){if(!n(t)||i.has(t))return;let a=x.store(e=>t(e),!0);i.set(t,a);try{return E(e,{...r,callback:a,keep:!0})}catch(e){throw i.delete(t),x.remove(a),e}},off(e){if(n(e)){let n=i.get(e);return n?(i.delete(e),x.remove(n),E(t,{...r,callback:n,keep:!0})):void 0}for(let e of i.values())x.remove(e);return i.clear(),E(t,{...r,keep:!0})}}}var ao=class{constructor(e){this.socketId=e,this._readyState=0,this._events={open:Q(`onSocketOpen`,`offSocketOpen`,{socketId:e}),message:Q(`onSocketMessage`,`offSocketMessage`,{socketId:e}),error:Q(`onSocketError`,`offSocketError`,{socketId:e}),close:Q(`onSocketClose`,`offSocketClose`,{socketId:e})}}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=x.store(r)),n(i)&&(s.fail=x.store(i)),n(a)&&(s.complete=x.store(a)),E(`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=x.store(i)),n(a)&&(c.fail=x.store(a)),n(o)&&(c.complete=x.store(o)),E(`closeSocket`,c)}onOpen(e){return this._events.open.on(e)}offOpen(e){return this._events.open.off(e)}onMessage(e){return this._events.message.on(e)}offMessage(e){return this._events.message.off(e)}onError(e){return this._events.error.on(e)}offError(e){return this._events.error.off(e)}onClose(e){return this._events.close.on(e)}offClose(e){return this._events.close.off(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}},$={open:Q(`onSocketOpen`,`offSocketOpen`),message:Q(`onSocketMessage`,`offSocketMessage`),error:Q(`onSocketError`,`offSocketError`),close:Q(`onSocketClose`,`offSocketClose`)};function oo(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 ao(p),h={socketId:p,url:t,header:r,protocols:i,tcpNoDelay:a,perMessageDeflate:o,timeout:s,forceCellularNetwork:c,...f};return n(l)&&(h.success=x.store(e=>{m._readyState=ao.OPEN,l(e)})),n(u)&&(h.fail=x.store(e=>{m._readyState=ao.CLOSED,u(e)})),n(d)&&(h.complete=x.store(d)),E(`connectSocket`,h),m}function so(e){return E(`sendSocketMessage`,e)}function co(e){return E(`closeSocket`,e)}function lo(e){return $.open.on(e)}function uo(e){return $.open.off(e)}function fo(e){return $.message.on(e)}function po(e){return $.message.off(e)}function mo(e){return $.error.on(e)}function ho(e){return $.error.off(e)}function go(e){return $.close.on(e)}function _o(e){return $.close.off(e)}var vo=t({getAccountInfoSync:()=>yo});function yo(){return E(`getAccountInfoSync`)}var bo=t({authorize:()=>xo});function xo(e){return E(`authorize`,e)}var So=t({login:()=>Co});function Co(e){return E(`login`,e)}var wo=t({login:()=>To});function To(e){return E(`login`,e)}var Eo=t({getPrivacySetting:()=>Do});function Do(e){return E(`getPrivacySetting`,e)}var Oo=t({getSetting:()=>Ao,openSetting:()=>ko});function ko(e){return E(`openSetting`,e)}function Ao(e){return E(`getSetting`,e)}var jo=t({getUserInfo:()=>Mo});function Mo(e){return E(`getUserInfo`,e)}var No=t({requestPayment:()=>Po});function Po(e){return E(`requestPayment`,e)}var Fo=t({hideShareMenu:()=>Ro,showShareImageMenu:()=>Lo,showShareMenu:()=>Io});function Io(e){return E(`shareShareMenu`,e)}function Lo(e){return E(`showShareImageMenu`,e)}function Ro(e){return E(`hideShareMenu`,e)}var zo=t({clearStorage:()=>qo,clearStorageSync:()=>Uo,getStorage:()=>Go,getStorageInfo:()=>Yo,getStorageInfoSync:()=>Jo,getStorageSync:()=>Vo,removeStorage:()=>Ko,removeStorageSync:()=>Ho,setStorage:()=>Wo,setStorageSync:()=>Bo});function Bo(...e){return E(`setStorageSync`,e)}function Vo(e){return E(`getStorageSync`,e)}function Ho(e){return E(`removeStorageSync`,e)}function Uo(){return E(`clearStorageSync`)}function Wo(e){return E(`setStorage`,e)}function Go(e){return E(`getStorage`,e)}function Ko(e){return E(`removeStorage`,e)}function qo(){return E(`clearStorage`)}function Jo(){return E(`getStorageInfoSync`)}function Yo(e){return E(`getStorageInfo`,e)}var Xo=t({createAnimation:()=>Zo});function Zo(e={}){return new Qo(e)}var Qo=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`,v(e)]}),this}height(e){return this.currentStepAnimates.push({type:`style`,args:[`height`,v(e)]}),this}left(e){return this.currentStepAnimates.push({type:`style`,args:[`left`,v(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`,v(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`,v(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`,v(e)]}),this}},$o=t({setBackgroundColor:()=>ts,setBackgroundTextStyle:()=>es});function es(e){return E(`setBackgroundTextStyle`,e)}function ts(e){return E(`setBackgroundColor`,e)}var ns=t({canvasToTempFilePath:()=>os,createCanvasContext:()=>is,createContext:()=>rs,createOffscreenCanvas:()=>Yr,drawCanvas:()=>as});function rs(){return new cs}function is(e,t){return new cs(e,ss(t))}function as(e={}){let t={...e,moduleId:e.moduleId||ss(e.component)};delete t.component,E(`drawCanvas`,t,`render`)}function os(e={},t){let n={...e,moduleId:e.moduleId||ss(t||e.component)};return delete n.component,E(`canvasToTempFilePath`,n,`render`)}function ss(e){return e?.__id__||T.getPageInfo()?.id}var cs=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&&(as({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)}},ls=t({nextTick:()=>ps}),us=[],ds=null;function fs(){let e=us;us=[],ds=null;for(let t=0;t<e.length;t++)e[t]()}function ps(e){n(e)&&(us.push(e),ds||=setTimeout(fs,0))}var ms=t({disableAlertBeforeUnload:()=>Ss,enableAlertBeforeUnload:()=>xs,hideLoading:()=>bs,hideToast:()=>gs,showActionSheet:()=>ys,showLoading:()=>vs,showModal:()=>_s,showToast:()=>hs});function hs(e){return E(`showToast`,e)}function gs(e){return E(`hideToast`,e)}function _s(e){return E(`showModal`,e)}function vs(e){return E(`showLoading`,e)}function ys(e){return E(`showActionSheet`,e)}function bs(e){return E(`hideLoading`,e)}function xs(e){return E(`enableAlertBeforeUnload`,e)}function Ss(e){return E(`disableAlertBeforeUnload`,e)}var Cs=t({getMenuButtonBoundingClientRect:()=>Ts,offMenuButtonBoundingClientRectWeightChange:()=>Ds,onMenuButtonBoundingClientRectWeightChange:()=>Es}),ws=new Set;C.onUpdate(e=>{e.menuRect&&ws.forEach(t=>t(e.menuRect))});function Ts(){return E(`getMenuButtonBoundingClientRect`)}function Es(e){n(e)&&ws.add(e)}function Ds(e){n(e)?ws.delete(e):ws.clear()}var Os=t({hideHomeButton:()=>Ns,hideNavigationBarLoading:()=>Ms,setNavigationBarColor:()=>js,setNavigationBarTitle:()=>As,showNavigationBarLoading:()=>ks});function ks(e){return E(`showNavigationBarLoading`,e)}function As(e){return E(`setNavigationBarTitle`,e)}function js(e){return E(`setNavigationBarColor`,e)}function Ms(e){return E(`hideNavigationBarLoading`,e)}function Ns(e){return E(`hideHomeButton`,e)}var Ps=t({startPullDownRefresh:()=>Is,stopPullDownRefresh:()=>Fs});function Fs(e){return E(`stopPullDownRefresh`,e)}function Is(e){return E(`startPullDownRefresh`,e)}var Ls=t({pageScrollTo:()=>Rs});function Rs(e){return E(`pageScrollTo`,e)}var zs=t({hideTabBar:()=>Us,hideTabBarRedDot:()=>qs,removeTabBarBadge:()=>Gs,setTabBarBadge:()=>Ws,setTabBarItem:()=>Vs,setTabBarStyle:()=>Bs,showTabBar:()=>Hs,showTabBarRedDot:()=>Ks});function Bs(e){return E(`setTabBarStyle`,e)}function Vs(e){return E(`setTabBarItem`,e)}function Hs(e){return E(`showTabBar`,e)}function Us(e){return E(`hideTabBar`,e)}function Ws(e){return E(`setTabBarBadge`,e)}function Gs(e){return E(`removeTabBarBadge`,e)}function Ks(e){return E(`showTabBarRedDot`,e)}function qs(e){return E(`hideTabBarRedDot`,e)}var Js=t({onWindowResize:()=>Ys});function Ys(e){e&&E(`onWindowResize`,{success:e})}var Xs=Object.assign({"./core/base/app-event/index.js":He,"./core/base/index.js":ot,"./core/base/performance/index.js":dt,"./core/base/subpackage/index.js":gt,"./core/base/system/index.js":yt,"./core/base/update/index.js":jt,"./core/camera/index.js":zt,"./core/data-analysis/index.js":Ht,"./core/device/bluetooth/index.js":an,"./core/device/bluetooth-ble/index.js":xn,"./core/device/clipboard/index.js":Vn,"./core/device/contact/index.js":Wn,"./core/device/keyboard/index.js":qn,"./core/device/memory/index.js":Yn,"./core/device/network/index.js":Qn,"./core/device/phone/index.js":er,"./core/device/scan/index.js":nr,"./core/device/screen/index.js":ir,"./core/device/vibrate/index.js":cr,"./core/ext/index.js":dr,"./core/file/index.js":Qe,"./core/life-cycle/index.js":Vi,"./core/location/index.js":Wi,"./core/map/index.js":Zi,"./core/media/audio/index.js":ea,"./core/media/image/index.js":ia,"./core/media/video/index.js":la,"./core/navigate/index.js":ma,"./core/network/download/index.js":ya,"./core/network/mdns/index.js":Aa,"./core/network/request/index.js":Ga,"./core/network/tcp/index.js":qa,"./core/network/udp/index.js":Xa,"./core/network/upload/index.js":$a,"./core/network/websocket/index.js":io,"./core/open-api/account-info/index.js":vo,"./core/open-api/authorize/index.js":bo,"./core/open-api/index.js":So,"./core/open-api/login/index.js":wo,"./core/open-api/privacy/index.js":Eo,"./core/open-api/setting/index.js":Oo,"./core/open-api/user-info/index.js":jo,"./core/payment/index.js":No,"./core/route/index.js":Ie,"./core/share/index.js":Fo,"./core/storage/index.js":zo,"./core/ui/animation/index.js":Xo,"./core/ui/background/index.js":$o,"./core/ui/canvas/index.js":ns,"./core/ui/custom-component/index.js":ls,"./core/ui/interaction/index.js":ms,"./core/ui/menu/index.js":Cs,"./core/ui/navigation-bar/index.js":Os,"./core/ui/pull-down-refresh/index.js":Ps,"./core/ui/scroll/index.js":Ls,"./core/ui/tab-bar/index.js":zs,"./core/ui/window/index.js":Js,"./core/wxml/intersection-observer/index.js":ri,"./core/wxml/media-query-observer/index.js":oi,"./core/wxml/selector-query/index.js":Xr}),Zs={};for(let e of Object.values(Xs))for(let[t,n]of Object.entries(e))Zs[t]=n;function Qs(e){for(let t of e||[])typeof t!=`string`||Object.prototype.hasOwnProperty.call(Zs,t)||t in Object.prototype||Object.defineProperty(Zs,t,{value:(...e)=>E(t,...e),writable:!0,enumerable:!0,configurable:!0})}var $s=new Proxy(Zs,{get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`||r!==void 0||t===`webpackJsonp`?r:(...e)=>E(t,...e)},set(e,t,n,r){return Reflect.set(e,t,n,r)}}),ec=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{}Qs(t);for(let t of[`dd`,`wx`,...e])globalThis[t]=$s;globalThis.modRequire=b,globalThis.modDefine=ae,globalThis.global={},globalThis.App=(e={})=>{q.createAppModule(e),J.createApp()},globalThis.Page=e=>{q.createModule(e,globalThis.__extraInfo,K.type)},globalThis.Component=e=>{q.createModule(e,globalThis.__extraInfo,G.type)},globalThis.Behavior=e=>e,globalThis.getApp=e=>J.getApp(e),globalThis.getCurrentPages=()=>T.stack()}},tc={navigateBack:Ve,navigateTo:Be,reLaunch:Re,redirectTo:ze,switchTab:Le};return new class{constructor(){console.log(`[service] init`),this.env=ec,this.message=w,this.init()}init(){this.message.on(`loadResource`,e=>{let{appId:t,bridgeId:n,pagePath:r,root:i=`.`,baseUrl:a=`/`,hostEnv:o,query:s,resourceLoadId:c,scene:l}=e;o&&C.init(o),J.setAppLaunchOptions({scene:l,pagePath:r,query:s}),q.loadResource({appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a,resourceLoadId:c})}),this.message.on(`hostEnvUpdate`,e=>{C.update(e)}),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 J.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;x.invoke(t,n)}),this.message.on(`componentInvokeAPI`,e=>{let{apiName:t,bridgeId:n,callbacks:r={},params:i={}}=e,a,o,s=(e,t)=>{e&&this.message.send({type:`triggerCallback`,target:`render`,body:{bridgeId:n,data:t,success:e}})};r.success&&(a=x.store(e=>s(r.success,e))),r.fail&&(o=x.store(e=>s(r.fail,e)));let c=x.store(e=>{s(r.complete,e),x.remove(a),x.remove(o)});this.message.invoke({type:`invokeAPI`,target:`container`,body:{name:t,bridgeId:n,params:{...i,complete:c,fail:o,success:a}}})}),this.message.on(`resourceLoadFailed`,({bridgeId:e,pagePath:t,errors:n=[]})=>{console.error(`[service] resourceLoadFailed: bridgeId: ${e}, pagePath: ${t}, errors: ${n.join(`; `)}`)}),this.onAppMsg(),this.onModuleMsg()}onAppMsg(){this.message.on(`resourceLoaded`,e=>{let{bridgeId:t,pagePath:n,query:r,stackId:i}=e,a=q.getModuleByPath(n);if(!a){console.error(`[service] resourceLoaded: module not found, pagePath: ${n}`);return}let o=q.getPropsByPath(a.usingComponents),s=`page_${p()}`,c=J.createInstance({bridgeId:t,moduleId:s,path:n,query:r,stackId:i,deferInitialData:!0});w.send({type:`firstRender`,target:`render`,body:{bridgeId:t,pageId:s,pagePath:n,initialProps:o,query:r}}),c?.sendInitialData()}),this.message.on(`appShow`,()=>{J.appShow()}),this.message.on(`appHide`,()=>{J.appHide()}),this.message.on(`stackShow`,({stackId:e})=>{J.stackShow(e)}),this.message.on(`stackHide`,({stackId:e})=>{J.stackHide(e)})}onModuleMsg(){this.message.on(`mC`,e=>{J.createInstance(e)}),this.message.on(`mA`,e=>{J.moduleAttached(e)}),this.message.on(`mR`,e=>{J.moduleReady(e)}),this.message.on(`mU`,e=>{J.moduleUnmounted(e)}),this.message.on(`pageUnload`,e=>{J.pageUnload(e)}),this.message.on(`pageShow`,e=>{J.pageShow(e)}),this.message.on(`pageReady`,e=>{J.pageReady(e)}),this.message.on(`pageHide`,e=>{J.pageHide(e)}),this.message.on(`pagePullDownRefresh`,e=>{J.pagePullDownRefresh(e)}),this.message.on(`pageReachBottom`,e=>{J.pageReachBottom(e)}),this.message.on(`pageShareAppMessage`,e=>{let t=J.pageShareAppMessage(e);e?.success&&this.message.send({type:`triggerCallback`,target:`container`,body:{bridgeId:e.bridgeId,id:e.success,args:[t],data:t}})}),this.message.on(`pageScroll`,e=>{J.pageScroll(e)}),this.message.on(`pageResize`,e=>{J.pageResize(e)}),this.message.on(`onTabItemTap`,e=>{J.pageTabItemTap(e)}),this.message.on(`pageRouteDone`,e=>{let{bridgeId:t}=e;J.componentRouteDone({bridgeId:t})}),this.message.on(`componentError`,e=>{J.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 J.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}})}tc[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,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"diminaGitHash": "
|
|
3
|
-
"inputFingerprint": "
|
|
2
|
+
"diminaGitHash": "5281d391505c2eba34f45ec1f91c806e65727ee4",
|
|
3
|
+
"inputFingerprint": "e852d4f85b3e3141d2a230d465452b674efe1af07710fcc1faa18e648cb9035b"
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"/><title>pageFrame</title><script type="module" crossorigin src="/assets/pageFrame.js"></script><link rel="stylesheet" crossorigin href="/assets/pageFrame.css"><body
|
|
1
|
+
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"/><title>pageFrame</title><script type="module" crossorigin src="/assets/pageFrame.js"></script><link rel="stylesheet" crossorigin href="/assets/pageFrame.css"><body></body></head></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimina-kit/devkit",
|
|
3
|
-
"version": "0.1.2-dev.
|
|
3
|
+
"version": "0.1.2-dev.20260728095034",
|
|
4
4
|
"description": "Development toolkit for Dimina mini-apps with H5 container preview",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dimina",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"cors": "^2.8.6",
|
|
67
67
|
"express": "^5.2.1",
|
|
68
68
|
"open": "^11.0.0",
|
|
69
|
-
"@dimina-kit/compiler": "0.0.2-dev.
|
|
69
|
+
"@dimina-kit/compiler": "0.0.2-dev.20260728095034"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|