PageSourceSearch

https://maang.in/_next/static/chunks/pages/admin/classic-sheets/_c…/CreateUpdateModal-d35dcf3e492cdfdd.js

js maang.in collected 2026-10-10 02:27:25 UTC 5,782 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45902],{85878:function(e,r,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/classic-sheets/_components/CreateUpdateModal",function(){return a(60352)}])},66998:function(e,r,a){"use strict";a.d(r,{v:function(){return t}});var s=a(85893),l=a(20631);function t(e){let{label:r,error:a,leftIcon:t,rightIcon:n,leftIconClassName:d,rightIconClassName:i,className:o,inputClassName:c,id:u,required:m,...f}=e,b=u||(null==r?void 0:r.toLowerCase().replace(/\s+/g,"-"));return(0,s.jsxs)("div",{className:(0,l.cn)("flex flex-col gap-1.5",o),children:[r&&(0,s.jsxs)("label",{htmlFor:b,className:"text-xs font-bold uppercase tracking-wider text-fg-grey-secondary select-none pb-0.5",children:[r,m&&(0,s.jsx)("span",{className:"text-fg-error-default ml-1 font-sans",children:"*"})]}),(0,s.jsxs)("div",{className:"relative flex items-center group",children:[t&&(0,s.jsx)("span",{className:(0,l.cn)("absolute left-4 text-fg-grey-tertiary pointer-events-none transition-colors group-focus-within:text-fg-cyan-default",d),children:t}),(0,s.jsx)("input",{id:b,className:(0,l.cn)("w-full h-11 rounded-md border border-border-grey-minimal bg-surface-surface-default px-4 text-sm text-fg-grey-primary placeholder:text-fg-grey-tertiary shadow-sm","focus:outline-none focus:ring-2 focus:ring-border-cyan-lighter-p focus:border-border-cyan-default","disabled:bg-surface-grey-secondary disabled:text-fg-grey-light-4 disabled:cursor-not-allowed","transition-all duration-200",t&&"pl-12",n&&"pr-12",a&&"border-error-border-default focus:ring-error-border-subtle focus:border-error-border-default",c),...f}),n&&(0,s.jsx)("span",{className:(0,l.cn)("absolute right-4 text-fg-grey-tertiary pointer-events-none transition-colors group-focus-within:text-fg-cyan-default",i),children:n})]}),a&&(0,s.jsx)("p",{className:"text-xs font-medium text-fg-error-default mt-1",children:a})]})}},60352:function(e,r,a){"use strict";a.r(r),a.d(r,{default:function(){return b}});var s=a(85893),l=a(67294),t=a(10584),n=a(30124),d=a(84567),i=a(18470),o=a(88838),c=a(66998),u=a(18973),m=a(16428),f=a(13152);function b(e){let{open:r,mode:a,sheet:b,onClose:p,onSuccess:x}=e,[h]=t.Z.useForm(),g="edit"===a,N=(0,l.useMemo)(()=>g&&b?{id:null==b?void 0:b.id,name:null==b?void 0:b.name,variable_pace:!!(null==b?void 0:b.variable_pace),is_premium:!!(null==b?void 0:b.is_premium),data_json:(0,m.D3)(null==b?void 0:b.data)}:{id:void 0,name:"",variable_pace:!1,is_premium:!1,data_json:""},[g,b]);(0,l.useEffect)(()=>{r&&(h.resetFields(),h.setFieldsValue(N))},[r,N,h]);let y=async e=>{try{let r=(0,m.$u)(e);g&&(null==b?void 0:b.id)!=null&&(r.id=Number(null==b?void 0:b.id)),await f.Z.createOrUpdateSheet(r),u.Z.ShowSuccess(g?"Sheet updated":"Sheet created"),null==p||p(),null==x||x()}catch(e){throw u.Z.ShowError((null==e?void 0:e.message)||"Save failed"),e}};if(!r)return null;let v=async()=>{let e=await h.validateFields();await y(e)};return(0,s.jsx)(o.z,{open:r,onClose:p,title:g?"Update Sheet #".concat(null==b?void 0:b.id):"Create Classic Sheet",description:"Use JSON data format for section/problem structure.",maxWidth:"max-w-5xl",panelClassName:"!rounded-md",bodyClassName:"!px-5 !py-4",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.w,{variant:"secondary",size:"sm",rounded:!1,className:"!rounded-md !px-5 !py-2",onClick:p,children:"Cancel"}),(0,s.jsx)(i.w,{variant:"primary",size:"sm",rounded:!1,className:"!rounded-md !px-5 !py-2",onClick:v,children:g?"Update":"Create"})]}),children:(0,s.jsxs)("div",{className:"max-h-[72vh] overflow-auto custom-scrollbar pr-1",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2 rounded-md border border-border-grey-minimal bg-surface-surface-subtle p-2.5",children:[(0,s.jsxs)("p",{className:"mb-0 text-xs font-semibold text-slate-600",children:["Paste JSON array in ",(0,s.jsx)("span",{className:"font-bold",children:"Problems Data"}),"."]}),(0,s.jsx)(i.w,{variant:"secondary",size:"sm",className:"!rounded-md !px-3",onClick:()=>{try{var e;let r=h.getFieldValue("data_json"),a=JSON.parse(String(r||"")),s=Array.isArray(a)?a:null!==(e=null==a?void 0:a.data)&&void 0!==e?e:a;h.setFieldsValue({data_json:JSON.stringify(s,null,2)}),u.Z.ShowSuccess("JSON formatted")}catch(e){u.Z.ShowError("Invalid JSON - cannot format")}},children:"Format JSON"})]}),(0,s.jsxs)(t.Z,{form:h,layout:"vertical",initialValues:N,className:"space-y-3",children:[g?(0,s.jsx)(t.Z.Item,{label:"ID",name:"id",className:"mb-2",children:(0,s.jsx)(n.default,{disabled:!0,className:"!h-10 !rounded-md !border-border-grey-minimal"})}):null,(0,s.jsx)(t.Z.Item,{label:null,name:"name",className:"mb-0 mt-2",rules:[{required:!0,message:"Sheet name is required"}],children:(0,s.jsx)(c.v,{label:"Sheet Name",required:!0,placeholder:"Enter sheet name"})}),(0,s.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,s.jsx)(t.Z.Item,{name:"variable_pace",valuePropName:"checked",className:"mb-0 rounded-md border border-border-grey-minimal bg-surface-surface-default px-3 py-2",children:(0,s.jsx)(d.Z,{children:"Variable pace"})}),(0,s.jsx)(t.Z.Item,{name:"is_premium",valuePropName:"checked",className:"mb-0 rounded-md border border-border-grey-minimal bg-surface-surface-default px-3 py-2",children:(0,s.jsx)(d.Z,{children:"Premium sheet"})})]}),(0,s.jsx)(t.Z.Item,{label:"Problems Data (JSON)",name:"data_json",className:"mb-0 mt-3",rules:[{required:!0,message:"Problems JSON is required"}],children:(0,s.jsx)(n.default.TextArea,{placeholder:'[{"name":"Section 1","problems":[...]}]',autoSize:{minRows:16,maxRows:30},className:"!rounded-md !border-border-grey-minimal !font-mono !text-xs"})})]})]})})}}},function(e){e.O(0,[41664,10584,84567,24542,49774,92888,40179],function(){return e(e.s=85878)}),_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.