PageSourceSearch

https://www.501site.com/_next/static/chunks/pages/sections/edit/[sectionId]-9148272e9bc1bab2.js

js 501site.com collected 2026-10-04 14:35:54 UTC 17,645 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6555],{55897:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sections/edit/[sectionId]",function(){return r(63833)}])},95677:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let r=a.default,i={loading:e=>{let{error:t,isLoading:r,pastDelay:o}=e;return null}};e instanceof Promise?i.loader=()=>e:"function"==typeof e?i.loader=e:"object"==typeof e&&(i=o({},i,e)),i=o({},i,t);let d=i.loader,s=()=>null!=d?d().then(l):Promise.resolve(l(()=>null));return(i.loadableGenerated&&delete(i=o({},i,i.loadableGenerated)).loadableGenerated,"boolean"!=typeof i.ssr||i.ssr)?r(o({},i,{loader:s})):(delete i.webpack,delete i.modules,n(r,i))},t.noSSR=n;var o=r(6495).Z,i=r(92648).Z,a=(i(r(67294)),i(r(8976)));function l(e){return{default:(null==e?void 0:e.default)||e}}function n(e,t){return delete t.webpack,delete t.modules,e(t)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},92254:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoadableContext=void 0;var o=(0,r(92648).Z)(r(67294));let i=o.default.createContext(null);t.LoadableContext=i},8976:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(6495).Z,i=(0,r(92648).Z)(r(67294)),a=r(92254);let l=[],n=[],d=!1;function s(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class c{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state=o({},this._state,{error:this._res.error,loaded:this._res.loaded,loading:this._res.loading},e),this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function u(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function l(){if(!o){let t=new c(e,r);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!d){let e=r.webpack?r.webpack():r.modules;e&&n.push(t=>{for(let r of e)if(-1!==t.indexOf(r))return l()})}function s(e,t){!function(){l();let e=i.default.useContext(a.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let n=i.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return i.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),i.default.useMemo(()=>{var t;return n.loading||n.error?i.default.createElement(r.loading,{isLoading:n.loading,pastDelay:n.pastDelay,timedOut:n.timedOut,error:n.error,retry:o.retry}):n.loaded?i.default.createElement((t=n.loaded)&&t.default?t.default:t,e):null},[e,n])}return s.preload=()=>l(),s.displayName="LoadableComponent",i.default.forwardRef(s)}(s,e)}function p(e,t){let r=[];for(;e.length;){let o=e.pop();r.push(o(t))}return Promise.all(r).then(()=>{if(e.length)return p(e,t)})}u.preloadAll=()=>new Promise((e,t)=>{p(l).then(e,t)}),u.preloadReady=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new Promise(t=>{let r=()=>(d=!0,t());p(n,e).then(r,r)})},window.__NEXT_PRELOADREADY=u.preloadReady,t.default=u},3627:function(e,t,r){"use strict";var o=r(5152),i=r.n(o);let a=i()(()=>r.e(6925).then(r.t.bind(r,89521,23)).then(e=>
1e.Editor),{loadableGenerated:{webpack:()=>[89521]},ssr:!1});t.Z=a},61469:function(e,t,r){"use strict";r.d(t,{cP:function(){return i}});var o=r(90948);let i=(0,o.ZP)("div")(e=>{let{theme:t}=e;return{"& .rdw-editor-wrapper":{border:"1px solid ".concat(t.palette.divider),"& .rdw-editor-toolbar":{border:0,marginBottom:0,background:t.palette.background.paper,borderBottom:"1px solid ".concat(t.palette.divider),"& .rdw-fontsize-dropdown":{minWidth:50},"& .rdw-link-modal":{height:"auto"},"& .rdw-colorpicker-modal, & .rdw-link-modal, & .rdw-embedded-modal, & .rdw-emoji-modal, & .rdw-image-modal":{boxShadow:t.shadows[8],borderColor:t.palette.divider,backgroundColor:t.palette.background.paper},"& .rdw-dropdown-optionwrapper":{boxShadow:t.shadows[8],borderColor:t.palette.divider,backgroundColor:t.palette.background.paper,"& .rdw-dropdownoption-highlighted":{backgroundColor:t.palette.action.hover},"& .rdw-dropdownoption-active":{backgroundColor:t.palette.action.selected}},"& .rdw-option-wrapper, & .rdw-dropdown-wrapper":{borderColor:t.palette.divider,background:t.palette.background.paper,"& .rdw-dropdown-carettoopen":{left:"auto",right:"10%",borderTopColor:t.palette.text.disabled},"& .rdw-dropdown-carettoclose":{left:"auto",right:"10%",borderBottomColor:t.palette.text.disabled},..."dark"===t.palette.mode?{"& img":{filter:"invert(1)"}}:{}},"& .rdw-embedded-modal-size-input, & .rdw-image-modal-size-input":{width:"60%",minHeight:30},"& .rdw-link-modal-input, & .rdw-embedded-modal-link-input, & .rdw-image-modal-url-input":{minHeight:38},"& .rdw-link-modal-input, & .rdw-embedded-modal-link-input, & .rdw-image-modal-url-input, & .rdw-embedded-modal-size-input, & .rdw-image-modal-size-input":{fontSize:"1rem",background:"none",padding:t.spacing(0,3.5),color:t.palette.text.primary,borderColor:t.palette.divider,borderRadius:t.shape.borderRadius,"&:focus":{borderColor:t.palette.primary.main},"&::placeholder, &:-ms-input-placeholder, &::-ms-input-placeholder":{color:t.palette.text.disabled}},"& .rdw-link-modal-btn, & .rdw-embedded-modal-btn, & .rdw-image-modal-btn":{border:0,lineHeight:1.71,borderRadius:"5px",letterSpacing:"0.3px",textTransform:"uppercase",fontWeight:t.typography.fontWeightMedium,"&:first-of-type:not([disabled])":{boxShadow:t.shadows[3],color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:hover":{boxShadow:t.shadows[4],backgroundColor:t.palette.primary.dark},"&:active":{boxShadow:t.shadows[3]}},"&:last-child":{boxShadow:t.shadows[3],color:t.palette.secondary.contrastText,backgroundColor:t.palette.secondary.main,"&:hover":{boxShadow:t.shadows[4],backgroundColor:t.palette.secondary.dark},"&:active":{boxShadow:t.shadows[3]}},"&[disabled]":{cursor:"default",boxShadow:"none",color:t.palette.text.disabled,backgroundColor:t.palette.action.disabledBackground}}},"& .rdw-editor-main":{cursor:"text",padding:"0 1rem",minHeight:"10rem",color:t.palette.text.primary,..."rtl"===t.direction?{"& .public-DraftStyleDefault-block":{direction:"ltr !important",textAlign:"left !important"}}:{}}}}});(0,o.ZP)("div")(()=>({"& .rdw-editor-wrapper":{display:"flex",flexDirection:"column-reverse"}})),(0,o.ZP)("div")(()=>({"& .rdw-editor-wrapper, & .rdw-editor-toolbar":{border:"0 !important"}}))},41555:function(e,t,r){"use strict";var o=r(90948),i=r(87357);let a=(0,o.ZP)(i.Z)(e=>{let{theme:t}=e;return{"&.dropzone, & .dropzone":{minHeight:300,display:"flex",flexWrap:"wrap",cursor:"pointer",position:"relative",alignItems:"center",justifyContent:"center",padding:t.spacing(4),borderRadius:t.shape.borderRadius,border:"2px dashed ".concat("light"===t.palette.mode?"rgba(93, 89, 98, 0.22)":"rgba(247, 244, 254, 0.14)"),[t.breakpoints.down("xs")]:{textAlign:"center"},"&:focus":{outline:"none"},"& + .MuiList-root":{padding:0,marginTop:t.spacing(6.25),"& .MuiListItem-root":{display:"flex",justifyContent:"space-between",borderRadius:t.shape.borderRadius,padding:t.spacing(2.5,2.4,2.5,6),border:"1px solid ".concat("light"===t.palette.mode?"rgba(93, 89, 98, 0.14)":"rgba(247, 244, 254, 0.14)"),"& .file-details":{display:"flex",alignItems:"center"},"& .file-preview":{display:"flex",marginRight:t.spacing(3.75),"& svg":{fontSize:"2rem"}},"& img":{width:38,height:38,padding:t.spacing(.75),borderRadius:t.shape.borderRadius,border:"1px solid ".concat("light"===t.palette.mode?"rgba(93, 89, 98, 0.14)":"rgba(247, 244, 254, 0.14)")},"& .file-name":{fontWeight:600},"& + .MuiListItem-root":{marginTop:t.spacing(3.5)}},"& + .buttons":{display:"flex",justifyContent:"flex-end",marginTop:t.spacing(6.25),"& > :first-of-type":{marginRight:t.spacing(3.5)}}},"& img.single-file-image":{objectFit:"cover",position:"absolute",width:"calc(100% - 1rem)",height:"calc(100% - 1rem)",borderRadius:t.shape.borderRadius}}}});t.Z=a},63833:function(e,t,r){"use strict";r.r(t);var o=r(85893),i=r(67294),a=r(11163);r(78963);var l=r(41664),n=r.n(l),d=r(17969),s=r(83321),c=r(90948),u=r(22715),p=r(15861),m=r(87357),h=r(94054),g=r(56815),f=r(86886),b=r(66242),x=r(44267),w=r(98456),y=r(36872),j=r(72890),v=r(50480),Z=r(79878),_=r(16310),k=r(47533),C=r(87536),T=r(86501);r(9041),r(61469),r(3627);var S=r(9473);r(36973);var R=r(3926);let I=(0,c.ZP)(m.Z)(e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",padding:t.spacing(3,4),justifyContent:"space-between",backgroundColor:t.palette.background.default}}),P=(0,c.ZP)("img")(e=>{let{theme:t}=e;return{height:120,marginRight:t.spacing(5),borderRadius:t.shape.borderRadius}}),z=_.Ry().shape({sectionTitle:_.Z_().required(),mediaType:_.Z_().required(),desc:_.Z_().required().max(1e3)}),E={sectionTitle:"",desc:"",apiError:"",mediaType:"",youtubeVideoId:""},D=()=>{let e=(0,a.useRouter)(),[t,r]=(0,i.useState)(!1),[l,c]=(0,i.useState)([]);(0,S.v9)(e=>e.section);let _=(0,i.useRef)(null),D=(0,S.I0)(),O=e.query.sectionId,{reset:M,c
1ontrol:N,setValue:F,setError:L,handleSubmit:V,watch:B,formState:{errors:A,dirtyFields:W}}=(0,C.cI)({defaultValues:E,mode:"onChange",resolver:(0,k.X)(z)}),q=B("mediaType",!1);(0,i.useEffect)(()=>{let e=async()=>{let e=await D((0,d.If)(O));e.payload&&c(e.payload.images),M(e.payload)};O&&e()},[O,M,D]);let H=async t=>{try{r(!0);let o=new FormData;if(o.append("id",O),o.append("sectionTitle",t.sectionTitle),o.append("desc",t.desc),o.append("mediaType",t.mediaType),"image"==t.mediaType){let e=Array.from(_.current.getFiles());e.forEach(e=>{o.append("images",e)}),o.append("youtubeVideoId",""),o.append("sectionImages",JSON.stringify(l))}else o.append("youtubeVideoId",t.youtubeVideoId),o.append("sectionImages",JSON.stringify([]));await D((0,d.$n)(o)).unwrap(),r(!1),T.ZP.success("Record updated successfully"),e.push("/sections/list")}catch(e){console.log(e),r(!1),422==e.status?L(e.field?e.field:"apiError",{message:e.msg}):L(null,{message:e.msg})}},G=async e=>{let t=l.filter(t=>t!==e);c(t)};return(0,o.jsx)(f.ZP,{container:!0,spacing:6,children:(0,o.jsxs)(f.ZP,{item:!0,xs:12,children:[(0,o.jsxs)(I,{children:[(0,o.jsx)(p.Z,{variant:"h6",children:"Edit Section"}),(0,o.jsx)(s.Z,{variant:"contained",color:"secondary",startIcon:(0,o.jsx)(Z.Z,{icon:"mdi:arrow-left"}),component:n(),href:"/sections/list",children:"Back"})]}),(0,o.jsx)(b.Z,{children:(0,o.jsx)(x.Z,{children:(0,o.jsx)(m.Z,{sx:{p:5},children:(0,o.jsxs)("form",{onSubmit:V(H),children:[(0,o.jsxs)(h.Z,{fullWidth:!0,sx:{mb:6},children:[(0,o.jsx)(C.Qr,{name:"sectionTitle",control:N,rules:{required:!0},render:e=>{let{field:{value:t,onChange:r}}=e;return(0,o.jsx)(u.Z,{value:t,label:"Section Title",onChange:r,placeholder:"",error:Boolean(A.sectionTitle)})}}),A.sectionTitle&&(0,o.jsx)(g.Z,{sx:{color:"error.main"},children:A.sectionTitle.message})]}),(0,o.jsxs)(h.Z,{fullWidth:!0,sx:{mb:6},children:[(0,o.jsx)(C.Qr,{name:"desc",control:N,rules:{required:!0},render:e=>{let{field:{value:t,onChange:r}}=e;return(0,o.jsx)(u.Z,{rows:4,multiline:!0,value:t,label:"Description",onChange:r,placeholder:"",error:Boolean(A.shortDesc)})}}),A.desc&&(0,o.jsx)(g.Z,{sx:{color:"error.main"},children:A.desc.message})]}),(0,o.jsxs)(h.Z,{fullWidth:!0,sx:{mb:6},children:[(0,o.jsx)(p.Z,{children:"Media Type"}),(0,o.jsx)(C.Qr,{name:"mediaType",control:N,rules:{required:!0},render:e=>{let{field:{value:t,onChange:r}}=e;return(0,o.jsxs)(j.Z,{row:!0,"aria-label":"controlled",name:"mediaType",value:t,onChange:r,children:[(0,o.jsx)(v.Z,{value:"image",control:(0,o.jsx)(y.Z,{}),label:"Image"}),(0,o.jsx)(v.Z,{value:"video",control:(0,o.jsx)(y.Z,{}),label:"Video"})]})}}),A.mediaType&&(0,o.jsx)(g.Z,{sx:{color:"error.main"},children:A.mediaType.message})]}),q&&"video"==q?(0,o.jsxs)(h.Z,{fullWidth:!0,sx:{mb:6},children:[(0,o.jsx)(C.Qr,{name:"youtubeVideoId",control:N,rules:{required:!0},render:e=>{let{field:{value:t,onChange:r}}=e;return(0,o.jsx)(u.Z,{value:t,label:"Youtube ID",onChange:r,placeholder:"",error:Boolean(A.youtubeVideoId)})}}),A.youtubeVideoId&&(0,o.jsx)(g.Z,{sx:{color:"error.main"},children:A.youtubeVideoId.message})]}):null,q&&"image"==q?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(h.Z,{fullWidth:!0,sx:{mb:6},children:[(0,o.jsx)(p.Z,{variant:"h6",children:"Upload Images"}),(0,o.jsx)(R.Z,{ref:_,maxFiles:"1"}),A.images&&(0,o.jsx)(g.Z,{sx:{color:"error.main"},children:A.images.message})]}),l&&l.map((e,t)=>(0,o.jsxs)(m.Z,{sx:{display:"inline-flex",mb:2.7,position:"relative"},children:[(0,o.jsx)(P,{src:"".concat("https://storefrontv1.s3.us-east-2.amazonaws.com/v1","/sections/").concat(e),alt:"swiper 1"}),(0,o.jsx)(s.Z,{sx:{position:"absolute",right:"10px",color:"#333"},onClick:()=>G(e),children:(0,o.jsx)(Z.Z,{icon:"mdi:remove-circle",fontSize:20})})]},t))]}):null,A.apiError&&(0,o.jsx)(g.Z,{sx:{color:"error.main"},children:A.apiError.message}),(0,o.jsxs)(m.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,o.jsxs)(m.Z,{sx:{m:1,position:"relative"},children:[(0,o.jsx)(s.Z,{size:"large",type:"submit",variant:"contained",sx:{mr:0},disabled:t,children:"Submit"}),t&&(0,o.jsx)(w.Z,{size:24,sx:{color:"#333",position:"absolute",top:"50%",left:"50%",marginTop:"-12px",marginLeft:"-12px"}})]}),(0,o.jsx)(s.Z,{size:"large",variant:"outlined",color:"secondary",component:n(),href:"/sections/list",children:"Cancel"})]})]})})})})]})})};D.acl={action:"all",subject:"website"},t.default=D},3926:function(e,t,r){"use strict";var o=r(85893),i=r(67294),a=r(87357),l=r(78462),n=r(83321),d=r(97212),s=r(90948),c=r(93946),u=r(15861),p=r(79878),m=r(86501),h=r(68901),g=r(41555);r(9473);let f=(0,s.ZP)("img")(e=>{let{theme:t}=e;return{[t.breakpoints.up("md")]:{marginRight:t.spacing(10)},[t.breakpoints.down("md")]:{marginBottom:t.spacing(4)},[t.breakpoints.down("sm")]:{width:250}}}),b=(0,s.ZP)(u.Z)(e=>{let{theme:t}=e;return{marginBottom:t.spacing(5),[t.breakpoints.down("sm")]:{marginBottom:t.spacing(4)}}}),x=(e,t)=>{let{maxFiles:s}=e;(0,i.useImperativeHandle)(t,()=>({getFiles:()=>x}));let[x,w]=(0,i.useState)([]),[y,j]=(0,i.useState)([]),[v,Z]=(0,i.useState)(!1),{getRootProps:_,getInputProps:k}=(0,h.uI)({maxFiles:s||5,maxSize:1e7,accept:{"image/*":[".png",".jpg",".jpeg",".gif",".heic",".heif",".heic-sequence"]},onDrop:async e=>{let t=await Promise.all(e.map(async e=>{if("image/heic"===e.type||"image/heif"===e.type){Z(!0);let t=r(1616),o=await t({blob:e,toType:"image/jpeg"});return Z(!1),URL.createObjectURL(o)}return URL.createObjectURL(e)}));w(e),j(t)},onDropRejected:e=>{console.log(e),m.ZP.error("Please upload valid files with extensions .png, .jpg, .jpeg, .gif and maximum size of 10 MB.",{duration:2e3})}}),C=e=>{let t=x.filter(t=>t.name!==e.name);w([...t]),j(y.filter((t,r)=>x[r].name!==e.name))},T=x.map((e,t)=>(0,o.jsxs)(d.ZP,{children:[(0,o.jsxs)("div",{className:"file-details",children:[(0,o.jsxs)("div",{className:"file-preview",children:[y[t]?(0,o.jsx)("img",{width:38,height:38,alt:e.name,src:y[t]}):null," "]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(u.Z,{className:"file-name",children:e.name}),(0,o.jsx)(u.Z,{className:"file-size",variant:"body2",children:Math.round(e.size/100)/10>1e3?"".concat((Math.round(e.size/100)/1e4).toFixed(1)," mb"):"".concat((Math.round(e.size/100)/10).toFixed(1)," kb")})]})]}),(0,o.jsx)(c.Z,{onClick:()=>C(e),children:(0,o.jsx)(p.Z,{icon:"mdi:close",fontSize:20})})]},e.name)),S=()=>{w([]),j([])};return(0,o.jsx)(g.Z,{children:(0,o.jsxs)(i.Fragment,{children:[(0,o.jsxs)("div",{..._({className:"dropzone"}),disabled:!0,children:[v&&(0,o.jsx)("div",{className:"loading-dropzone"}),(0,o.jsx)("input",{...k()}),(0,o.jsxs)(a.Z,{sx:{display:"flex",flexDirection:["column","column","row"],alignItems:"center"},children:[(0,o.jsx)(f,{width:300,alt:"Upload img",src:"/images/misc/upload.png"}),(0,o.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",textAlign:["center","center","inherit"]},children:[(0,o.jsx)(b,{variant:"h5",children:"Drop files here or click to upload."}),(0,o.jsx)(u.Z,{color:"textSecondary",sx:{fontSize:"14px",mb:1},children:"Supported file formats include JPG, PNG, HEIC, and HEIF."}),(0,o.jsxs)(u.Z,{color:"textSecondary",sx:{fontSize:"14px",mb:1},children:["Max ",s||5," files and max size of 10MB"]})]})]})]}),x.length?(0,o.jsxs)(i.Fragment,{children:[(0,o.jsx)(l.Z,{children:T}),(0,o.jsx)("div",{className:"buttons",children:(0,o.jsx)(n.Z,{color:"error",variant:"outlined",onClick:S,children:"Remove All"})})]}):null]})})};t.Z=(0,i.forwardRef)(x)},36973:function(){},5152:function(e,t,r){e.exports=r(95677)}},function(e){e.O(0,[4838,6886,502,9717,7536,1522,8066,9774,2888,179],function(){return e(e.s=55897)}),_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.