it-tools/dist/client/assets/chunks/chunk-05ffcba3.js
2024-04-28 00:48:29 +08:00

1 line
2.2 KiB
JavaScript

import{b as T}from"./chunk-a740628f.js";import{d as C,r as x,c as v,j as g,D as w,m as n,l as s,q as l,S as c,E as _,z as f,F as j,K as k}from"./chunk-449c23a2.js";import{_ as E}from"./chunk-6deddc2e.js";import{u as y}from"./chunk-767079b6.js";import"./chunk-9a43cce8.js";import"./chunk-340feaf0.js";function F(r){return r.split("").map(o=>`&#${o.charCodeAt(0)};`).join("")}function h(r){return r.replace(/&#(\d+);/g,(o,u)=>String.fromCharCode(u))}const z={"mt-2":"",flex:"","justify-center":""},B={"mt-2":"",flex:"","justify-center":""},H=C({__name:"text-to-unicode",setup(r){const o=x(""),u=v(()=>o.value.trim()===""?"":F(o.value)),{copy:b}=y({source:u}),i=x(""),a=v(()=>i.value.trim()===""?"":h(i.value)),{copy:U}=y({source:a});return(N,e)=>{const d=E,p=k,m=T;return g(),w(j,null,[n(m,{title:"Text to Unicode"},{default:s(()=>[n(d,{value:l(o),"onUpdate:value":e[0]||(e[0]=t=>c(o)?o.value=t:null),multiline:"",placeholder:"e.g. 'Hello Avengers'",label:"Enter text to convert to unicode",autosize:"",autofocus:"","raw-text":"","test-id":"text-to-unicode-input"},null,8,["value"]),n(d,{value:l(u),"onUpdate:value":e[1]||(e[1]=t=>c(u)?u.value=t:null),label:"Unicode from your text",multiline:"","raw-text":"",readonly:"","mt-2":"",placeholder:"The unicode representation of your text will be here","test-id":"text-to-unicode-output"},null,8,["value"]),_("div",z,[n(p,{disabled:!l(u),onClick:e[2]||(e[2]=t=>l(b)())},{default:s(()=>[f(" Copy unicode to clipboard ")]),_:1},8,["disabled"])])]),_:1}),n(m,{title:"Unicode to Text"},{default:s(()=>[n(d,{value:l(i),"onUpdate:value":e[3]||(e[3]=t=>c(i)?i.value=t:null),multiline:"",placeholder:"Input Unicode",label:"Enter unicode to convert to text",autosize:"","raw-text":"","test-id":"unicode-to-text-input"},null,8,["value"]),n(d,{value:l(a),"onUpdate:value":e[4]||(e[4]=t=>c(a)?a.value=t:null),label:"Text from your Unicode",multiline:"","raw-text":"",readonly:"","mt-2":"",placeholder:"The text representation of your unicode will be here","test-id":"unicode-to-text-output"},null,8,["value"]),_("div",B,[n(p,{disabled:!l(a),onClick:e[5]||(e[5]=t=>l(U)())},{default:s(()=>[f(" Copy text to clipboard ")]),_:1},8,["disabled"])])]),_:1})],64)}}});export{H as default};