Files
NapCatQQ/.pnpm-store/v3/files/83/12199e100c8874c3dc9921e40f233e177694833e0217da3538e66c1bcb39992d5a990bde965de981110d74196af7425b67ad49a2b60333a5b32e9be9ae7f66
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

71 lines
2.4 KiB
Plaintext

function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isRTL", () => $4d65847630a056a8$export$702d680b21cbd764);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you 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
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // https://en.wikipedia.org/wiki/Right-to-left
const $4d65847630a056a8$var$RTL_SCRIPTS = new Set([
'Arab',
'Syrc',
'Samr',
'Mand',
'Thaa',
'Mend',
'Nkoo',
'Adlm',
'Rohg',
'Hebr'
]);
const $4d65847630a056a8$var$RTL_LANGS = new Set([
'ae',
'ar',
'arc',
'bcc',
'bqi',
'ckb',
'dv',
'fa',
'glk',
'he',
'ku',
'mzn',
'nqo',
'pnb',
'ps',
'sd',
'ug',
'ur',
'yi'
]);
function $4d65847630a056a8$export$702d680b21cbd764(localeString) {
// If the Intl.Locale API is available, use it to get the locale's text direction.
if (Intl.Locale) {
let locale = new Intl.Locale(localeString).maximize();
// Use the text info object to get the direction if possible.
// @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;
if (textInfo) return textInfo.direction === 'rtl';
// Fallback: guess using the script.
// This is more accurate than guessing by language, since languages can be written in multiple scripts.
if (locale.script) return $4d65847630a056a8$var$RTL_SCRIPTS.has(locale.script);
}
// If not, just guess by the language (first part of the locale)
let lang = localeString.split('-')[0];
return $4d65847630a056a8$var$RTL_LANGS.has(lang);
}
//# sourceMappingURL=utils.main.js.map