"use strict";const r=require("../../../../../../common/vendor.js"),a={data(){return{systemInfo:null,cssSafeAreaInsetBottom:-1,isReadyDestroy:!1}},computed:{windowTop(){return this.systemInfo&&this.systemInfo.windowTop||0},safeAreaBottom(){if(!this.systemInfo)return 0;let e=0;return e=Math.max(this.cssSafeAreaInsetBottom,0),e},isOldWebView(){try{const e=r.index.getSystemInfoSync().system.split(" "),t=e[0],o=parseInt(e[1]);if(t==="iOS"&&o<=10||t==="Android"&&o<=6)return!0}catch{return!1}return!1},zSlots(){return this.$slots}},beforeDestroy(){this.isReadyDestroy=!0},unmounted(){this.isReadyDestroy=!0},methods:{updateFixedLayout(){this.fixed&&this.$nextTick(()=>{this.systemInfo=r.index.getSystemInfoSync()})},_getNodeClientRect(e,t=!0,o=!1){if(this.isReadyDestroy)return Promise.resolve(!1);let s=t?r.index.createSelectorQuery().in(t===!0?this:t):r.index.createSelectorQuery();return o?s.select(e).scrollOffset():s.select(e).boundingClientRect(),new Promise((i,u)=>{s.exec(n=>{i(n&&n!=""&&n!=null&&n.length?n:!1)})})},_updateLeftAndRightWidth(e,t){this.$nextTick(()=>{setTimeout(()=>{["left","right"].map(s=>{this._getNodeClientRect(`.${t}-${s}`).then(i=>{this.$set(e,s,i?i[0].width+"px":"0px")})})},0)})},_getCssSafeAreaInsetBottom(e){this._getNodeClientRect(".zp-safe-area-inset-bottom").then(t=>{this.cssSafeAreaInsetBottom=t?t[0].height:-1,t&&e&&e()})}}};exports.commonLayoutModule=a;
