@kit-data-manager/pid-component
Version:
The PID-Component is a web component that can be used to evaluate and display FAIR Digital Objects, PIDs, ORCiDs, and possibly other identifiers in a user-friendly way. It is easily extensible to support other identifier types.
19 lines • 1.37 kB
JavaScript
/*!
*
* Copyright 2024 Karlsruhe Institute of Technology.
*
* 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
*
* 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 CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import{r as n,h as t,H as r}from"./p-19958745.js";const s=class{constructor(t){n(this,t);this.showFlag=true}render(){const n=n=>{const t=[navigator.language.split("-")[0]];const r=n.split("-").length>1?"language":"region";const e=new Intl.DisplayNames(t,{type:r}).of(n.toUpperCase());if(e==n.toUpperCase()){return new Intl.DisplayNames(t,{type:"language"}).of(n.toUpperCase())}if(r==="language"){const t=s(n.split("-")[1]);return`${t}${e}`}return`${s(n)}${e}`};const s=n=>{if(this.showFlag===false)return"";const t=n.toUpperCase().split("").map((n=>127397+n.charCodeAt(0)));return String.fromCodePoint(...t)+" "};return t(r,null,t("span",null,n(this.locale)))}};export{s as locale_visualization};
//# sourceMappingURL=p-9871e391.entry.js.map