1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[154],{994:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/editor",function(){return l(9815)}])},6914:function(e,t,l){"use strict";l.d(t,{Z:function(){return a},c:function(){return r}});var o=l(571),i=()=>{let e=document.querySelectorAll(".navigationElement"),t=document.activeElement,l=Array.from(e).indexOf(t),i=(l+1)%e.length;e[i].focus(),(0,o.Z)(e[i].getAttribute("description")||e[i].innerText)},n=e=>{let t=e.target.value,l=t.length,i=e.target.selectionStart;if("ArrowLeft"===e.code?i-=1:"ArrowRight"===e.code&&(i+=1),i<=0){let e=t[0];void 0===e&&(e=""),(0,o.Z)("".concat(e," beginning of the text"))}else if(i>=l)(0,o.Z)("end of the text");else{let e=t[i].trim();(0,o.Z)(e||"space")}},d=e=>{let t=e.target.value,l=t.length,i=e.target.selectionStart,n="".concat(e.key," ");if("Backspace"===e.code?i-=1:e.code,i<=0){let e=t[0];void 0===e&&(e=""),n+="".concat(e," beginning of the text")}else if(i>=l)n+="end of the text";else{let e=t[i].trim();"."===e&&(e="dot"),console.log(e),n+=e||"space"}(0,o.Z)(n)};let r=e=>{var t;(null===(t=e.key)||void 0===t?void 0:t.includes("Arrow"))?n(e):"Enter"===e.key?(0,o.Z)("newline"):"Backspace"===e.key||"Delete"===e.key?d(e):(0,o.Z)(e.key.trim()||"space")};var a=e=>{"Tab"===e.key?(e.preventDefault(),i()):"Enter"===e.key&&(Array.from(document.getElementsByClassName("active")).forEac
1h(e=>{e.classList.remove("active")}),e.target.className+=" active")}},9815:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return h}});var o=l(5893),i=l(5348),n=l(6190),d=l(7294),r=l(571),a=e=>{let{docId:t,text:l}=e,a=(0,i.a)(),{user:s}=a,c=(0,n.e)(),{createDocument:u,updateDocument:b}=c,[f,h]=(0,d.useState)(t);return(0,o.jsx)("button",{className:"navigationElement",id:"save",onClick:e=>{if(e.preventDefault(),l.trim()){if(f)b({$id:f,text:l});else{let e=u({text:l},s.$id);e.then(e=>{h(e)})}(0,r.Z)("Your document is saved")}else(0,r.Z)("Your document is empty")},style:{fontSize:"20px"},children:" Save "})},s={A:{dot:"dot 1",braille:"â "},B:{dot:"dot 1 2",braille:"â "},C:{dot:"dot 1 4",braille:"â "},D:{dot:"dot 1 4 5",braille:"â "},E:{dot:"dot 1 5",braille:"â "},F:{dot:"dot 1 2 4",braille:"â "},G:{dot:"dot 1 2 4 5",braille:"â "},H:{dot:"dot 1 2 5",braille:"â "},I:{dot:"dot 2 4",braille:"â "},J:{dot:"dot 2 4 5",braille:"â "},K:{dot:"dot 1 3",braille:"â
"},L:{dot:"dot 1 2 3",braille:"â "},M:{dot:"dot 1 3 4",braille:"â "},N:{dot:"dot 1 3 4 5",braille:"â "},O:{dot:"dot 1 3 5",braille:"â "},P:{dot:"dot 1 2 3 4",braille:"â "},Q:{dot:"dot 1 2 3 4 5",braille:"â "},R:{dot:"dot 1 2 3 5",braille:"â "},S:{dot:"dot 2 3 4",braille:"â "},T:{dot:"dot 2 3 4 5",braille:"â "},U:{dot:"dot 1 3 6",braille:"â ¥"},V:{dot:"dot 1 2 3 6",braille:"â §"},W:{dot:"dot 2 4 5 6",braille:"â º"},X:{dot:"dot 1 3 4 6",braille:"â "},Y:{dot:"dot 1 3 4 5 6",braille:"â ½"},Z:{dot:"dot 1 3 5 6",braille:"â µ"},0:{dot:"dot 2 4 5 5",braille:"â ¼â "},1:{dot:"dot 1",braille:"â ¼â "},2:{dot:"dot 1 2",braille:"â ¼â "},3:{dot:"dot 1 4",braille:"â ¼â "},4:{dot:"dot 1 4 5",braille:"â ¼â "},5:{dot:"dot 1 5",braille:"â ¼â "},6:{dot:"dot 1 2 4",braille:"â ¼â "},7:{dot:"dot 1 2 4 5",braille:"â ¼â "},8:{dot:"dot 1 2 5",braille:"â ¼â "},9:{dot:"dot 2 4 5 5",braille:"â ¼â "},".":{dot:"dot 3 4 6",braille:"â ²"},",":{dot:"dot 3",braille:"â "},"?":{dot:"dot 2 3 6",braille:"â ¢"},"!":{dot:"dot 1 2 3 5 6",braille:"â "},"'":{dot:"dot 2",braille:"â "},'"':{dot:"dot 2 3 5 6",braille:"â ¶"},"-":{dot:"dot 2 5 6",braille:"â ¤"},"(":{dot:"dot 2 3 6 6",braille:"â â £"},")":{dot:"dot 2 3 6 5 6",braille:"â â "},"/":{dot:"dot 1 2 4 6",braille:"â "},"+":{dot:"dot 1 2 3 5 6",braille:"â "},"=":{dot:"dot 2 3 5 6 6",braille:"â â ¶"},"#":{dot:"dot 3 4 6 6",braille:"⠼⠲"},"@":{dot:"dot 2 3 6 5 6",braille:"â â "},";":{dot:"dot 2 3 6",braille:"â "}},c=l(6914),u=l(1664),b=l.n(u),f=l(1163),h=()=>{var e;let[t,l]=(0,d.useState)(!1),[i,u]=(0,d.useState)(""),[h,m]=(0,d.useState)(""),[v,p]=(0,d.useState)(""),[g,x]=(0,d.useState)(""),y=(0,n.e)(),E=(0,f.useRouter)(),w=(0,d.useRef)(),S=(0,d.useRef)(),{deleteDocument:k,docs:j}=y,N=e=>{let t=[],l=[];return e.split("\n").map(e=>{if(""===e)t=[...t,e],l=[...l,e];else{let o="",i="";e.toUpperCase().split("").forEach(e=>{o+=" "===(e=e.toUpperCase())?e:s[e].braille,i+=" "===e?e:s[e].dot}),t=[...t,o],l=[...l,i]}}),{linesInBraille:t,linesInDot:l}},Z=()=>{let e=window.getSelection().toString();e?x(e):v?t?x(h):x(v):x("Your document is empty.")};return(0,d.useEffect)(()=>(window.addEventListener("keydown",c.Z),document.addEventListener("keypress",c.Z),()=>{window.removeEventListener("keydown",c.Z),document.removeEventListener("keypress",c.Z)}),[]),(0,d.useEffect)(()=>{let e=document.querySelectorAll(".navigationElement");return e.forEach((e,t)=>{e.setAttribute("tabindex",t+1)}),()=>{e.forEach(e=>{e.removeAttribute("tabindex")})}},[]),(0,d.useEffect)(()=>{if(E){let e=E.query.id;j.forEach(t=>{t.$id===e&&p(t.text)})}},[j,E]),(0,d.useEffect)(()=>{t?x("You are in braille view mode"):x("You are in text edit mode")},[t]),(0,d.useEffect)(()=>{let e=new SpeechSynthesisUtterance;e&&(e.rate=.8),e.text=g,e.text&&(speechSynthesis.cancel(),speechSynthesis.speak(e))},[g]),(0,d.useEffect)(()=>{let{linesInBraille:e,linesInDot:t}=N(v);u(e.join("\n")),m(t.join("\n"))},[v]),(0,o.jsxs)("div",{style:{justifyContent:"center",height:"100vh",width:"100%"},children:[(0,o.jsxs)("div",{className:"topBtns",children:[(0,o.jsx)(b(),{href:"/",children:(0,o.jsx)("button",{className:"navigationElement",children:"Home"})}),(0,o.jsx)("button",{className:"navigationElement",id:"toggle",onClick:e=>{e.preventDefault(),l(!t)},style:{fontSize:"20px"},children:" Toggle "}),(0,o.jsx)("button",{className:"navigationElement",id:"play",onClick:e=>{e.preventDefault(),Z()},style:{fontSize:"20px"},children:" Play "}),(0,o.jsx)(a,{docId:E.query.id,text:v}),(null==E?void 0:null===(e=E.query)||void 0===e?void 0:e.id)&&(0,o.jsx)("button",{className:"navigationElement",id:"delete",onClick:e=>{e.preventDefault(),(0,r.Z)("Press enter to confirm delete."),alert("Press enter to confirm delete."),k({$id:E.query.id}),(0,r.Z)("Document deleted. You are being redirected to home page."),E.push("/")},style:{fontSize:"20px"},children:" Delete "})]}),(0,o.jsxs)("div",{style:{justifyContent:"center",height:"100vh",width:"100%"},children:[(0,o.jsx)("h2",{className:"navigationElement",description:"Text editor label",children:" Text editor: "}),t?(0,o.jsx)("textarea",{className:"navigationElement",description:"Braille text box",id:"brailleText",maxLength:"1000",name:"brailleText",onKeyDown:c.c,placeholder:"View in Braille",ref:S,style:{fontSize:"50px",height:"100%",lineHeight:"1",overflow:"hidden",
1width:"100%"},value:i}):(0,o.jsx)("textarea",{className:"navigationElement",description:"English text box",id:"text",onChange:e=>{e.preventDefault();let{value:t}=e.target;p(t);let{linesInBraille:l,linesInDot:o}=N(t);u(l.join("\n")),m(o.join("\n"))},onKeyDown:c.c,maxLength:"1000",name:"text",placeholder:"Type in English",ref:w,style:{fontSize:"50px",height:"100%",lineHeight:"1",overflow:"hidden",width:"100%"},value:v})]})]})}}},function(e){e.O(0,[664,774,888,179],function(){return e(e.s=994)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.