PageSourceSearch

https://www.projectread.ai/_next/static/chunks/pages/dev/playground/converter-754becf72ca2e093.js

js projectread.ai collected 2026-09-24 10:36:08 UTC 12,005 bytes, 1 lines download raw bytes

1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="35e2f85d-e253-4ce3-9484-bcaa245ee3d6",t._sentryDebugIdIdentifier="sentry-dbid-35e2f85d-e253-4ce3-9484-bcaa245ee3d6")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([["5968"],{21723:function(t,e,r){t=r.nmd(t),(window.__NEXT_P=window.__NEXT_P||[]).push(["/dev/playground/converter",function(){return r(34574)}]),t.hot&&t.hot.dispose(function(){window.__NEXT_P.push(["/dev/playground/converter"])})},53058:function(t,e,r){"use strict";r.d(e,{I:()=>a});var o=r(97496),n=r(11823);let i=["checked","onChange","value","id","name","disabled"],a=t=>{let{label:e,description:r,className:a,...l}=t,[d,c]=Object.keys(l).reduce((t,e)=>{let[r,o]=t;return(i.includes(e)?r:o)[e]=l[e],[r,o]},[{},{}]);return(0,o.BX)("label",{css:{...n.r.titleS,display:"flex",alignItems:"flex-start",gap:12,cursor:"pointer"},className:a,...c,children:[(0,o.tZ)("input",{...d,type:"checkbox",css:{marginTop:"0.2em",accentColor:n.r.colors.n80,"&:checked":{backgroundColor:n.r.colors.n80,borderColor:n.r.colors.n80}}}),(0,o.BX)("div",{css:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:[(0,o.tZ)("div",{css:{userSelect:"none"},children:e}),r&&(0,o.tZ)("div",{css:n.r.bodyS,children:r})]})]})}},16258:function(t,e,r){"use strict";r.d(e,{BK:()=>c,MR:()=>s,yt:()=>d});var o=r(97496),n=r(95931),i=r(53058),a=r(56480),l=r(11823);let d=t=>{let{label:e,identifier:r,hint:d,error:c,children:s,labelStyles:h,className:u,...p}=t,m=n.Children.toArray(s).some(t=>(0,n.isValidElement)(t)&&t.type===i.I);return(0,o.BX)("div",{css:{"--input-border-color":c?l.r.colors.red100:void 0,marginBlock:16},className:u?"form-input ".concat(u):"form-input",...p,children:[!m&&(0,o.tZ)("label",{htmlFor:r,css:[l.r.label,h],children:e}),s,(c||d)&&(0,o.BX)("div",{css:{...l.r.bodyS,display:"flex",gap:8,alignItems:"baseline",margin:"4px 2px 0",svg:{flexShrink:0,fontSize:16,color:l.r.colors.red100,translate:"0 3px",marginTop:-3}},children:[c&&(0,o.tZ)(a.G,{}),(0,o.tZ)("span",{children:c||d})]})]})},c=t=>{let{name:e,description:r,children:n,...i}=t;return(0,o.BX)("div",{css:{marginBlock:16,borderBlock:"1px solid ".concat(l.r.colors.n10),paddingBlock:8,"&:first-child, & + &":{borderTop:0,paddingBlockStart:0}},...i,children:[(0,o.tZ)("h3",{css:{...l.r.titleS,color:l.r.colors.n80},children:e}),r&&(0,o.tZ)("p",{css:{...l.r.bodyS,marginBlockStart:"0.5em"},children:r}),n]})},s=t=>{let{cols:e,breakpoint:r,children:n,...i}=t;return(0,o.tZ)("div",{css:{display:"grid",gridTemplateColumns:"repeat(".concat(e,", 1fr)"),gap:16,marginBlock:16,"& > .form-input":{marginBlock:0},[r||l.r.mobile]:{gridTemplateColumns:"1fr"}},...i,children:n})}},51976:function(t,e,r){"use strict";r.d(e,{T:()=>i,o:()=>a});var o=r(97496),n=r(11823);let i={borderRadius:4,border:"1px solid var(--input-border-color, ".concat(n.r.colors.n30,")"),width:"100%",padding:"0.75em 1em",fontSize:14,fontWeight:500,background:n.r.colors.n0,color:n.r.colors.n70,transition:"border-color 0.2s","&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 50px ".concat(n.r.colors.n0," inset"),WebkitTextFillColor:n.r.colors.n70},"&:focus, &:focus-within":{outline:"none",borderColor:n.r.colors.n50},"&::placeholder":{color:n.r.colors.n40}},a=t=>(0,o.tZ)("input",{css:i,...t})},25791:function(t,e,r){"use strict";r.d(e,{Z:()=>i});var o=r(97496),n=r(11823);let i=t=>{let{as:e,title:r,titleElement:i="h1",pad:a,max:l,children:d,...c}=t,s="boolean"==typeof a&&a?{"--cardPadding":"32px",[n.r.mobile]:{"--cardPadding":"24px"},[n.r.mobileSmall]:{"--cardPadding":"16px"}}:{"--cardPadding":"".concat(a||0,"px")};return(0,o.BX)(null!=e?e:"div",{css:{...s,marginInline:"auto",maxWidth:"min(100%, calc(100vw - 40px), ".concat(null!=l?l:720,"px)"),color:n.r.colors.n70,background:n.r.colors.n10,borderRadius:10,boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.025)",padding:"var(--cardPadding)"},...c,children:[r&&(0,o.tZ)(i,{css:{...n.r.titleM,fontSize:20,color:n.r.colors.n80,paddingBottom:12,borderBottom:"1px solid ".concat(n.r.colors.n30),marginBottom:24},children:r}),d]})}},97451:function(t,e,r){"use strict";r.d(e,{d:()=>c});var o=r(97496),n=r(16024),i=r.n(n),a=r(12122),l=r(75619),d=r(24829);let c=t=>{let{title:e,description:r,noIndex:n,canonicalUrl:c,image:s}=t,h=e.includes("Project Read")?e:"".concat(e," \xb7 Project Read");(null==c?void 0:c.startsWith("/"))&&(c=new URL(c,l._n).toString());let u=s&&"string"!=typeof s?(0,a.ZA)({...d.dJ.parse(s),baseUrl:l.NZ,width:1200,height:800}):{src:null!=s?s:"".concat(l._n,"og-image.jpg"),width:void 0,height:void 0};return(0,o.BX)(i(),{children:[(0,o.tZ)("title",{children:h}),(0,o.tZ)("meta",{name:"og:title",content:h}),r&&(0,o.tZ)("meta",{name:"description",content:r}),r&&(0,o.tZ)("meta",{name:"og:description",content:r}),(0,o.tZ)("meta",{property:"og:image",content:u.src}),u.width&&(0,o.tZ)("meta",{property:"og:image:width",content:"".concat(u.width)},"width"),u.height&&(0,o.tZ)("meta",{property:"og:image:height",content:"".concat(u.height)},"height"),n&&(0,o.tZ)("meta",{name:"robots",content:"noindex"}),c&&(0,o.tZ)("link",{rel:"canonical",content:c})]})}},34574:function(t,e,r){"use strict";r.r(e),r.d(e,{default:()=>y,__N_SSP:()=>x});var o=r(97496),n=r(40006),i=r(20178),a=r.n(i),l=r(95931),d=r(4622),c=r(99168),s=r(38815),h=r(16258),u=r(51976),p=r(25791),m=r(97451),f=r(79748);let g=new Map([["hh","h"],["axr","ax r"],["dx","t"],["wh","w"]]),b=new Map([["eɪ","EY"],["aɪ","AY"],["oʊ","OW"],["aʊ","AW"],["ɔɪ","OY"],["tʃ","CH"],["dʒ","JH"],["t̬","DX"],["ɾ","DX"],["d̪","D"],["t̪","T"],["p","P"],["b","B"],["t","T"],["d","D"],["k","K"],["g","G"],["ɡ","G"],["f","F"],["v","V"],["θ","TH"],["\xf0","DH"],["s","S"],["z","Z"],["ʃ","SH"],["ʒ","ZH"],["h","HH"],["m","M"],["n","N"],["ɲ","N"],["ŋ","NG"],["l","L"],["ɫ","L"],["r","R"],["ɹ","R"],["ɜr","ER"],["ɝ","ER"],["ər","A
1XR"],["ɚ","AXR"],["j","Y"],["w","W"],["ʍ","WH"],["ɔ","AO"],["ɑ","AA"],["ɒ","AA"],["i","IY"],["u","UW"],["e","EH"],["ɛ","EH"],["ɪ","IH"],["ʊ","UH"],["ʌ","AH"],["ə","AX"],["\xe6","AE"]]),w=/[ .ˈˌː]+/g;var x=!0;let y=(0,n.j5)(()=>{let[t,e]=(0,l.useState)(""),[r,n]=(0,l.useState)(null);return(0,o.BX)(o.HY,{children:[(0,o.tZ)(m.d,{title:"Phoneme Format Converter \xb7 Playground",noIndex:!0}),(0,o.tZ)("div",{css:{maxWidth:720,margin:"50px auto 8px"},children:(0,o.BX)(a(),{href:"/dev/playground",css:{transition:"transform 0.2s ease-out",":hover":{transform:"translateY(-1px)"}},children:["← ",(0,o.tZ)("small",{children:"Back to the playground"})]})}),(0,o.BX)(p.Z,{title:"Phoneme Format Converter",pad:!0,css:{marginTop:0},children:[(0,o.tZ)("p",{children:"Right now this only convers from IPA to SAPI Phonemes, but in the future we could add additional formats or change the direction."}),(0,o.BX)("form",{onSubmit:e=>{e.preventDefault();try{let e;n((e=t,(t=>{let e=[],r=0;for(t=t.replaceAll(w,"").normalize("NFC");r<t.length;){let o=!1;for(let[n,i]of b.entries())if(t.startsWith(n,r)){e.push(i),r+=n.length,o=!0;break}if(!o)throw Error('IPA phoneme "'.concat(t[r],'" not found in the conversion table'))}return e.join(" ")})(e).toLowerCase().replaceAll(/\d+/g,"").split(" ").map(t=>{var e;return null!=(e=g.get(t))?e:t}).join(" ")))}catch(t){n(null),d.Am.error("Invalid input: ".concat((0,f.Y)(t)))}},children:[(0,o.tZ)(h.yt,{identifier:"input",label:"IPA Input",children:(0,o.tZ)(u.o,{name:"input",id:"input",minLength:1,maxLength:50,value:t,onChange:t=>{e(t.target.value)},autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",spellCheck:!1})}),r&&(0,o.BX)("div",{css:{marginBlock:24,display:"flex",alignItems:"center",gap:12},children:[r," ",(0,o.tZ)(s.q,{value:r,iconOnly:!0})]}),(0,o.tZ)(c.zx,{type:"submit",children:"Convert"})]})]})]})})},24829:function(t,e,r){"use strict";r.d(e,{CN:()=>l,KM:()=>i,cN:()=>h,dJ:()=>s,sm:()=>u,x4:()=>n});var o=r(49677);let n=o.Ry({_key:o.Z_(),_type:o.Z_()}),i=t=>void 0,a=o.IX(o.Ry({_type:o.Z_()})),l=o.PG(t=>a.parse(t));o.Z_().regex(/^file(?:-[\da-z]+){2}$/);let d=o.Z_().regex(/^image-[\da-z]+-\d+x\d+-[\da-z]+$/),c=o.Ry({asset:o.Ry({_id:d}).or(o.Ry({_ref:d})),crop:o.Ry({bottom:o.Rx(),left:o.Rx(),right:o.Rx(),top:o.Rx()}).optional(),hotspot:o.Ry({x:o.Rx(),y:o.Rx()}).optional()}),s=c.transform(t=>{let{asset:e,...r}=t;return{...r,id:"_id"in e?e._id:e._ref}}),h=c.extend({altText:o.Z_().default("")}).transform(t=>{let{asset:e,altText:r,...o}=t;return{alt:r,...o,id:"_id"in e?e._id:e._ref}}),u=o.Ry({text:o.Z_(),url:o.Z_(),newTab:o.O7().default(!0)})},12122:function(t,e,r){"use strict";r.d(e,{ZA:()=>a,fY:()=>l,kB:()=>d});var o=/^image-([\da-f]+)-(\d+x\d+)-(\w+)$/,n=t=>{let e=o.exec(t),[,r,n,i]=e??[];if(!e||!r||!n||!i)throw Error(`Could not parse image ID "${t}"`);let[a,l]=n.split("x").map(t=>Number.parseInt(t,10));if(Number.isNaN(a)||Number.isNaN(l)||!a||!l)throw Error(`Invalid dimensions "${n}"`);return{assetId:r,dimensions:{height:l,width:a,aspectRatio:a/l},format:i}},i=t=>{let e=t.lastIndexOf("-");return t.slice(6,e)+"."+t.slice(e+1)},a=({baseUrl:t,...e})=>{let{metadata:r,...o}=s({...e,options:{includeMetadata:!0}});if(!r)throw Error("Missing image output metadata");return{src:`${t}${i(e.id)}?${f(o)}`,width:r.outputDimensions.width,height:r.outputDimensions.height}},l=({id:t,mode:e="contain",width:r,height:o,hotspot:n,crop:a,baseUrl:l,...d})=>{let{w:h,h:u}=s({id:t,mode:e,width:r,height:o,hotspot:n,crop:a}),p=`${l}${i(t)}`;return Array.from(new Set(c(h).map(r=>{let o=Math.round(h*r),i=u&&Math.round(u*r);if(r<1&&o<50)return null;let l=s({id:t,mode:e,width:o,height:i,hotspot:n,crop:a,...d});return`${p}?${f(l)} ${l.w}w`}).filter(t=>!!t)))},d=({id:t,baseUrl:e})=>{let{assetId:r,dimensions:o,format:i}=n(t);return{src:`${e}${r}-${o.width}x${o.height}.${i}`,width:o.width,height:o.height}},c=t=>t<160?[.5,1,2]:t<750?[.5,1,1.5,2]:t<1400?[.25,.5,.75,1,1.5,2]:[.25,.5,.75,1,1.25,1.5,1.75,2],s=({id:t,mode:e="contain",width:r,height:o,hotspot:i,crop:a,queryParams:l,options:{includeMetadata:d=!1}={}})=>{let c=n(t).dimensions,{width:s,height:f,aspectRatio:g}=a?p(c,a):c;if(r||(o?(r=Math.round(o*g),o=void 0):r=Math.round(s/2)),"cover"!==e||r&&o&&r/o!==g?"contain"===e&&o&&(r=Math.min(r,Math.round(o*g)),o=void 0):e="contain",r>s||o&&o>f){let t=o?r/o:g;t>=g?(r=s,o=o&&Math.round(r/t)):r=Math.round((o=f)*t)}let b={w:r,q:75,fit:"max",...l};if(b.fm||(b.auto="format"),a&&(b.rect=m(c,a)),"cover"===e)if(b.fit="
1crop",o&&(b.h=o),i){let t=a?(i.x-a.left)/(1-a.left-a.right):i.x,e=a?(i.y-a.top)/(1-a.top-a.bottom):i.y;b["fp-x"]=u(h(t,0,1),3),b["fp-y"]=u(h(e,0,1),3)}else b.crop="entropy";if(d){let t=o??Math.round(r/g);b.metadata={sourceDimensions:c,outputDimensions:{width:r,height:t,aspectRatio:r/t}}}return b},h=(t,e,r)=>Math.max(e,Math.min(r,t)),u=(t,e)=>Math.round(t*Math.pow(10,e))/Math.pow(10,e),p=(t,e)=>{if(e.left+e.right>=1||e.top+e.bottom>=1)throw Error(`Invalid crop: ${JSON.stringify(e)}; crop values must be less than 1`);let r=Math.round(t.width*(1-e.left-e.right)),o=Math.round(t.height*(1-e.top-e.bottom));return{width:r,height:o,aspectRatio:r/o}},m=(t,e)=>{let{width:r,height:o}=p(t,e);return[Math.round(e.left*t.width),Math.round(e.top*t.height),r,o].join(",")},f=t=>new URLSearchParams(Object.entries(t).sort(([t],[e])=>t.localeCompare(e)).map(([t,e])=>[t,String(e)])).toString().replace(/%2C/g,",")},40006:function(t,e,r){"use strict";r.d(e,{j5:()=>l,wZ:()=>a});var o=r(74380),n=r(66040),i=r(78694);function a(t,e=[]){return async function(...r){let o=await t(...r),n=e.map(t=>{let e=o[t];return delete o[t],e}),{json:a,meta:l}=i.ZP.serialize(o);return l&&(a._superjson=l),e.forEach((t,e)=>{let r=n[e];void 0!==r&&(a[t]=r)}),{...o,...a}}}function l(t){function e(e){return(0,o.jsx)(t,{...function(t){let{_superjson:e,...r}=t;return i.ZP.deserialize({json:r,meta:e})}(e)})}return n(e,t),e}}},function(t){t.O(0,["2203","344","6909","8808","9174"],function(){return t(t.s=21723)}),_N_E=t.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.