1import{g as N,r as u,I as R,J as D,aj as P,p as e,a0 as x,a1 as d,w as o,T as J,v as c,B as f,aX as I,N as V}from"./index-C9IH3k-2.js";import{C as E}from"./HelperMethods-C-ewwU_x.js";import{T as z}from"./TemplateSelector-CFw39_pF.js";import{I as m,T as v,a2 as M,$}from"./TemplateUtil-D1DzmWLm.js";import{n as A}from"./MainApp-BoiAvjMg.js";import"./useTemplateDetails-DA6kn5sZ.js";import"./Wrapper-ChjuDa3w.js";var p={},y;function H(){if(y)return p;y=1,Object.defineProperty(p,"__esModule",{value:!0});var a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 .6.1 1.3.2 1.9A83.99 83.99 0 00457 960c46.4 0 84-37.6 84-84 0-2.1-.1-4.1-.2-6.1.1-.6.2-1.2.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z"}}]},name:"format-painter",theme:"outlined"};return p.default=a,p}var _=H();const q=N(_);function j(){return j=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(a[t]=l[t])}return a},j.apply(this,arguments)}const L=(a,s)=>u.createElement(R,j({},a,{ref:s,icon:q})),U=u.forwardRef(L),{Title:T,Text:h}=J,k=a=>{const{token:s}=D.useToken(),[l]=P.useForm(),[t,w]=u.useState({}),[n,g]=u.useState(!1),O=(r,i,F,B)=>{w(r?.templateData),g(!1)},b=()=>{E(JSON.stringify(t,null,2),"Template details copied to clipboard!").then(()=>{}).catch(r=>{console.error("Error copying to clipboard:",r)})},S=()=>{g(!n),V.info(n?"Showing raw JSON":"Showing beautified view")},C=Object.keys(t).length>0;return e.jsxs(e.Fragment,{children:[e.jsx(m,{variant:"borderless",style:{marginBottom:20},children:e.jsx(z,{form:l,onChange:(r,i,F,B)=>{O(r)}})}),C&&e.jsx(m,{title:e.jsxs(c,{children:[e.jsx($,{}),e.jsx(h,{strong:!0,children:"Template Details"})]}),extra:e.jsxs(c,{children:[e.jsx(o,{title:"Copy template details",children:e.jsx(f,{icon:e.jsx(I,{}),onClick:b,children:"Copy"})}),e.jsx(o,{title:n?"Show raw JSON":"Show beautified view",children:e.jsx(f,{icon:e.jsx(U,{}),onClick:S,type:n?"primary":"default",children:n?"Raw JSON":"Beautify"})})]}),children:n?e.jsxs("div",{className:"beautified-view",children:[e.jsx(x,{gutter:[16,24],children:e.jsxs(d,{span:24,children:[e.jsx(o,{title:"Template name",children:e.jsx(T,{level:4,style:{margin:0},children:t.name})}),e.jsxs(c,{children:[t.language&&e.jsx(o,{title:"Template Language",children:e.jsx(v,{color:"blue",children:t.language})}),t.type&&e.jsxs(o,{title:"Template Type",children:[" ",e.jsx(v,{color:"green",children:t.type})]})]})]})}),e.jsx(M,{}),Object.entries(t).map(([r,i])=>["name","language","type"].includes(r)?null:typeof i=="object"&&i!==null?e.jsx(x,{gutter:[16,16],style:{marginBottom:16},children:e.jsxs(d,{span:24,children:[e.jsx(T,{level:5,style:{marginBottom:8},children:r.charAt(0).toUpperCase()+r.slice(1)}),e.jsx(m,{size:"small",children:e.jsx("pre",{style:{margin:0},children:JSON.stringify(i,null,2)})})]})},r):e.jsxs(x,{gutter:[16,16],style:{marginBottom:8},children:[e.jsx(d,{span:6,children:e.jsxs(h,{strong:!0,children:[r.charAt(0).toUpperCase()+r.slice(1),":"]})}),e.jsx(d,{span:18,children:e.jsx(h,{children:String(i)})})]},r))]}):e.jsx("div",{className:"raw-json-view",children:e.jsxs(c,{orientation:"vertical",style:{width:"100%"},children:[e.jsx("div",{children:e.jsxs(c,{children:[e.jsx(A,{}),e.jsx(h,{strong:!0,children:"Raw JSON:"})]})}),e.jsx(m,{size:"small",style:{background:s.colorBgLayout,maxHeight:"400px",overflow:"auto"},children:e.jsx("pre",{style:{margin:0},children:JSON.stringify(t,null,2)})})]})})})]})};export{k as default};
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.