1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6814],{38222:function(e,n,t){t.d(n,{Z:function(){return AbstractConverter}});var s=t(24246),a=t(27378),l=t(23615),i=t.n(l),r=t(39662),c=t(14472),o=t(75746),d=t(81549),u=t(75833),m=t(94417),p=t(64968);function AbstractConverter(e){let{slug:n,name:t,convert:l,inLang:i,outLang:x,buttonLabel:f,example:h,options:g=[],liveMode:v=!0,isEmbed:b=!1}=e,[j,w]=a.useState(4),[y,N]=a.useState(!0),[S,k]=a.useState(v),[C,L]=a.useState(h||""),[z,E]=a.useState(""),[R,M]=a.useState(!0),T=a.useRef(null),O=g.filter(e=>"string"==typeof e),Y=g.filter(e=>"object"==typeof e),A=Y.map(e=>e.value),checkOutputVisible=()=>T.current&&null!==T.current.offsetParent,setOutputText=e=>{E(e),R||L(e)};return a.useEffect(()=>{let handleResize=()=>{let e=checkOutputVisible();M(n=>n!==e?e:n)};return window.addEventListener("resize",handleResize),handleResize(),()=>{window.removeEventListener("resize",handleResize)}},[]),a.useEffect(()=>{if(!C){E("");return}if(!R||!S)return;let e=l(C,j);e!==z&&E(e)},[C,j,y,...A]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.Z,{slug:n,isEmbed:b,title:b?t:"Actions and Settings",className:"h-min",children:(0,s.jsx)("div",{className:"w-full flex justify-center",children:(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"w-full mt-4 flex justify-between",children:[(0,s.jsx)("span",{className:"inline-flex sm:shadow-sm",children:(0,s.jsxs)(d.z,{type:"button",variant:"outline",className:"relative hidden xs:inline-flex items-center gap-x-1.5 rounded-md text-sm hover:z-10 hover:bg-gray-50 focus:z-10",onClick:()=>setOutputText(l(C,j)),disabled:!C||S&&R,children:[(0,s.jsx)(m.Z,{className:"-ml-0.5 h-5 w-5 text-gray-400","aria-hidden":"true"}),f||"Convert"]})}),(0,s.jsxs)("span",{className:"flex space-x-3",children:[(0,s.jsx)(o.Z,{slug:n,description:"Set options for ".concat(i.toUpperCase()," formatting."),options:[...O&&O.includes("indent")?[{type:"number",label:"Indent",value:j,setValue:w}]:[],...Y||[],{type:"switch",label:"Text Wrap",value:y,setValue:N},...v?[{type:"switch",label:"Live Mode",value:S,setValue:k}]:[]]}),(0,s.jsxs)(d.z,{type:"button",variant:"outline",className:"hidden sm:inline-flex relative -ml-px items-center gap-x-1.5 rounded-md text-sm hover:z-10 hover:bg-gray-50 focus:z-10",onClick:()=>{L(""),E("")},children:[(0,s.jsx)(p.Z,{className:"-ml-0.5 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Clear"]})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex justify-between items-center text-sm",children:[(0,s.jsx)("p",{className:"text-gray-600",children:v&&(0,s.jsxs)("span",{children:["Live mode: ",S?"On":"Off"]})}),(0,s.jsxs)("p",{className:"hidden md:block text-gray-400",children:["Text wrap:"," ",y?"enabled":"disabled",O&&O.includes("indent")&&", Indent: ".concat(j),Y&&Y.map(e=>", ".concat(e.label,": ").concat(e.value))]})]})]})})}),(0,s.jsxs)("div",{className:"flex-1 flex w-full gap-8",children:[(0,s.jsx)(u.g,{className:"flex w-full lg:w-1/2 mx-auto ".concat(b?"resize-none":"min-h-[400px]"),placeholder:"Enter ".concat(i.toUpperCase()," here..."),value:C,onChange:e=>L(e.target.value)}),(0,s.jsx)("div",{className:"hidden lg:flex w-full lg:w-1/2 mx-auto ",children:(0,s.jsx)(r.Z,{content:z,lang:x,className:"w-full border border-gray-500 rounded-md ".concat(b?"":"min-h-[400px]"),wrap:y,ref:T})})]})]})}AbstractConverter.propTypes={slug:i().string.isRequired,name:i().string.isRequired,convert:i().func.isRequired,inLang:i().string.isRequired,outLang:i().string.isRequired,buttonLabel:i().string,example:i().string,options:i().arrayOf(i().any),liveMode:i().bool,isEmbed:i().bool}},26814:function(e,n,t){t.r(n),t.d(n,{default:function(){return YamlToXml}});var s=t(24246);t(27378);var a=t(23615),l=t.n(a),i=t(99729),r=t.n(i),c=t(38222),o=t(32945),d=t(42004);function YamlToXml(e){let{slug:n,isEmbed:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.Z,{slug:n,name:"YAML to XML",convert:(e,n)=>{try{return(0,o.vx)(e,n)}catch(e){return(e.message||"Invalid YAML").split("\n")[0]}},inLang:"yaml",outLang:"xml",example:"company: Tech Solutions\nemployees:\n - name: Alice Johnson\n age: 30\n department: Engineering\n skills:\n - JavaScript\n - React\n - Node.js\n - name: Bob Smith\n age: 25\n department: Marketing\n skills:\n - SEO\n - Content Marketing\n - Social Media\n - name: Carol Williams\n age: 28\n department: Sales\n skills:\n - Negotiation\n - CRM\n - Lead Generation\nofficeLocations:\n - city: New York\n address: 123 Main St, New York, NY 10001\n - city: San Francisco\n address: 45681 Market Street, San Francisco, California 94105",options:["indent","wrap"],isEmbed:t}),!t&&""]})}r()((0,d.md)(""),"html",""),YamlToXml.propTypes={slug:l().string.isRequired,isEmbed:l().bool}}}]);
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.