/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/get-orientation@1.1.2/browser.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).getOrientation={})}(this,(function(e){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */var t;(t=e.Orientation||(e.Orientation={}))[t.TOP_LEFT=1]="TOP_LEFT",t[t.TOP_RIGHT=2]="TOP_RIGHT",t[t.BOTTOM_RIGHT=3]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=4]="BOTTOM_LEFT",t[t.LEFT_TOP=5]="LEFT_TOP",t[t.RIGHT_TOP=6]="RIGHT_TOP",t[t.RIGHT_BOTTOM=7]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=8]="LEFT_BOTTOM";const n=new WeakMap;function i(e,t,i){return e instanceof Blob?new Promise(((o,r)=>{let a=n.get(e);a||(a=new FileReader,n.set(e,a)),a.onerror=e=>{a.onerror=null,a.onload=null,r(e)},a.onload=()=>{a.onerror=null,a.onload=null,o(a.result)},a.readAsArrayBuffer(e.slice(t,t+i))})):Promise.resolve(e.slice(t,t+i))}e.getOrientation=function(t){return n=this,o=void 0,a=function*(){if(!(t instanceof ArrayBuffer||t instanceof Blob))throw new TypeError("Unexpected input type");let n=0;const o=function(e){return e instanceof Blob?e.size:e.byteLength}(t);{const r=yield i(t,n,4);n+=r.byteLength;const a=new DataView(r),T=a.getUint16(0),l=a.getUint16(2);if(65496===T){let a=r.slice(2);do{const o=new DataView(a).getUint16(0);if(65505===o){const e=yield i(t,n,8),o=new DataView(e);if(17784===o.getUint16(2)&&26982===o.getUint16(4)&&0===o.getUint16(6)){n+=e.byteLength;break}n+=o.getUint16(0)}else{if(!(65504<=o&&o<=65519))return e.Orientation.TOP_LEFT;{const e=yield i(t,n,2);n+=e.byteLength,n+=new DataView(e).getUint16(0)-2}}a=yield i(t,n,2),n+=a.byteLength}while(n<o)}else{if(!(18761===T&&10752===l||19789===T&&42===l))return e.Orientation.TOP_LEFT;n=0}}const r=yield i(t,n,8),a=new DataView(r),T=18761===a.getUint16(0);n+=a.getUint32(4,T);const l=yield i(t,n,2);n+=l.byteLength;let c=new DataView(l).getUint16(0,T);for(;c-- >0;){const e=yield i(t,n,12);if(n+=e.byteLength,274===new DataView(e).getUint16(0,T)){const t=new DataView(e.slice(8,12)).getUint16(0,T);if(1<=t&&t<=8)return t;throw new Error("Unexpected Orientation Value")}}return e.Orientation.TOP_LEFT},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{l(a.next(e))}catch(e){t(e)}}function T(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(i,T)}l((a=a.apply(n,o||[])).next())}));var n,o,r,a},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=/sm/fc165e64a59581b05e3cd75cef7f80bc9c74ee65de33716ecfaeb1e4556f298f.map