Files
kapp/4981.js
T
2026-05-12 16:58:11 -03:00

105 lines
3.8 KiB
JavaScript

(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([[4981],{
/***/ 64981:
/*!*******************************************************************************!*\
!*** ./node_modules/@capawesome/capacitor-screen-orientation/dist/esm/web.js ***!
\*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "ScreenOrientationWeb": () => (/* binding */ ScreenOrientationWeb)
/* harmony export */ });
/* harmony import */ var _Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 71670);
/* harmony import */ var _capacitor_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @capacitor/core */ 26549);
/* harmony import */ var _definitions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./definitions */ 75748);
class ScreenOrientationWeb extends _capacitor_core__WEBPACK_IMPORTED_MODULE_1__.WebPlugin {
constructor() {
var _this;
super();
_this = this;
this.isSupported = 'orientation' in screen;
this.handleOrientationChange = /*#__PURE__*/(0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
const result = yield _this.getCurrentOrientation();
const changeEvent = {
type: result.type
};
_this.notifyListeners('screenOrientationChange', changeEvent);
});
if (this.isSupported) {
screen.orientation.addEventListener('change', this.handleOrientationChange);
}
}
lock(options) {
var _this2 = this;
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
if (!_this2.isSupported) {
_this2.throwUnsupportedError();
}
yield screen.orientation.lock(options.type);
})();
}
unlock() {
var _this3 = this;
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
if (!_this3.isSupported) {
_this3.throwUnsupportedError();
}
screen.orientation.unlock();
})();
}
getCurrentOrientation() {
var _this4 = this;
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
if (!_this4.isSupported) {
_this4.throwUnsupportedError();
}
switch (screen.orientation.type) {
case 'landscape-primary':
return {
type: _definitions__WEBPACK_IMPORTED_MODULE_2__.OrientationType.LANDSCAPE_PRIMARY
};
case 'landscape-secondary':
return {
type: _definitions__WEBPACK_IMPORTED_MODULE_2__.OrientationType.LANDSCAPE_SECONDARY
};
case 'portrait-secondary':
return {
type: _definitions__WEBPACK_IMPORTED_MODULE_2__.OrientationType.PORTRAIT_SECONDARY
};
default:
return {
type: _definitions__WEBPACK_IMPORTED_MODULE_2__.OrientationType.PORTRAIT_PRIMARY
};
}
})();
}
throwUnsupportedError() {
throw this.unavailable('Screen Orientation API not available in this browser.');
}
}
/***/ })
}])
//# sourceMappingURL=4981.js.map