PageSourceSearch

https://rl-remodeling.com/_next/static/chunks/8739.8e69374186ed7855.js

js rl-remodeling.com collected 2026-10-08 00:54:13 UTC 5,871 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8739],{8739:function(e,t,l){"use strict";l.r(t);var a=l(5893),i=l(7294),s=l(3636),r=l.n(s);t.default=e=>{let{onSuccess:t}=e,[l,s]=(0,i.useState)([]),[n,d]=(0,i.useState)(!1),[o,c]=(0,i.useState)(""),updateGallery=(e,t,a)=>{let i=[...l];i[e]={...i[e],[t]:a},s(i)},removeGallery=e=>{let t=l.filter((t,l)=>l!==e);s(t)},handleSubmit=async()=>{if(0===l.length){alert("Please add at least one gallery item.");return}let e=l.filter(e=>{var t;return null===(t=e.title)||void 0===t?void 0:t.trim()});if(0===e.length){alert("Please provide titles for the gallery items.");return}d(!0);try{let l=await fetch("/api/admin/galleries/bulk-upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({galleries:e})});if(l.ok){let e=await l.json();alert("Successfully created ".concat(e.galleries.length," gallery items.")),s([]),t()}else{let e=await l.json();alert("Failed to create galleries: ".concat(e.message))}}catch(e){console.error("Bulk upload error:",e),alert("Failed to create galleries. Please try again.")}finally{d(!1)}};return(0,a.jsxs)("div",{className:r().bulkUpload,children:[(0,a.jsxs)("div",{className:r().header,children:[(0,a.jsx)("h2",{children:"Bulk Upload Galleries"}),(0,a.jsx)("p",{children:"Add multiple gallery items at once"})]}),(0,a.jsxs)("div",{className:r().methods,children:[(0,a.jsxs)("div",{className:r().methodCard,children:[(0,a.jsx)("h3",{children:"Manual Entry"}),(0,a.jsxs)("div",{className:r().actions,children:[(0,a.jsx)("button",{onClick:()=>{s([...l,{title:"",Subtitle:"",Category:"",image:"",Video:null}])},children:"Add New Item"}),(0,a.jsx)("button",{onClick:()=>{let e=prompt('Enter pattern (e.g., "KITCHEN PROJECT {0}" for numbered items):'),t=parseInt(prompt("How many items?")||"0");if(!e||!t)return;let a=Array.from({length:t},(t,l)=>({title:e.replace("{0}",(l+1).toString()),Subtitle:"",Category:"Generated",image:"",Video:null}));s([...l,...a])},children:"Generate from Pattern"})]})]}),(0,a.jsxs)("div",{className:r().methodCard,children:[(0,a.jsx)("h3",{children:"CSV Import"}),(0,a.jsxs)("div",{className:r().csvSection,children:[(0,a.jsx)("textarea",{placeholder:"CSV format example:\n".concat("title,subtitle,category,image\nKITCHEN PROJECTS,Modern Kitchen Renovations,Kitchen,/images/kitchen.jpg\nBATHROOM PROJECTS,Luxury Bathroom Remodels,Bathroom,/images/bathroom.jpg\n2 STORY ADU WITH POOL-TARZANA,Complete home addition,Addition,/images/adu.jpg"),value:o,onChange:e=>c(e.target.value),rows:6}),(0,a.jsx)("button",{onClick:()=>{try{let e=o.trim().split("\n"),t=e[0].split(",").map(e=>e.trim()),a=e.slice(1).map(e=>{let l=e.split(",").map(e=>e.trim()),a={};return t.forEach((e,t)=>{let i=l[t]||"";switch(e.toLowerCase()){case"title":a.title=i;break;case"subtitle":a.Subtitle=i;break;case"category":a.Category=i;break;case"image":a.image=i}}),a});s([...l,...a]),c("")}catch(e){alert("Error parsing CSV. Please check the format.")}},disabled:!o.trim(),children:"Import from CSV"})]})]})]}),l.length>0&&(0,a.jsxs)("div",{className:r().galleryList,children:[(0,a.jsxs)("h3",{children:["Gallery Items (",l.length,")"]}),(0,a.jsx)("div",{className:r().items,children:l.map((e,t)=>(0,a.jsxs)("div",{className:r().item,children:[(0,a.jsxs)("div",{className:r().itemHeader,children:[(0,a.jsxs)("span",{children:["Item ",t+1]}),(0,a.jsx)("button",{onClick:()=>removeGallery(t),className:r().removeBtn,children:"\xd7"})]}),(0,a.jsxs)("div",{className:r().fields,children:[(0,a.jsxs)("div",{className:r().field,children:[(0,a.jsx)("label",{children:"Title *"}),(0,a.jsx)("input",{type:"text",value:e.title||"",onChange:e=>updateGallery(t,"title",e.target.value),placeholder:"e.g., KITCHEN PROJECTS or 2 STORY ADU-TARZANA"})]}),(0,a.jsxs)("div",{className:r().field,children:[(0,a.jsx)("label",{children:"Subtitle"}),(0,a.jsx)("input",{type:"text",value:e.Subtitle||"",onChange:e=>updateGallery(t,"Subtitle",e.target.value),placeholder:"Brief description"})]}),(0,a.jsxs)("div",{className:r().field,children:[(0,a.jsx)("label",{children:"Category"}),(0,a.jsxs)("select",{value:e.Category||"",onChange:e=>updateGallery(t,"Category",e.target.value),children:[(0,a.jsx)("option",{value:"",children:"Select Category"}),(0,a.jsx)("option",{value:"Kitchen",children:"Kitchen"}),(0,a.jsx)("option",{value:"Bathroom",children:"Bathroom"}),(0,a.jsx)("option",{value:"Addition",children:"Addition"}),(0,a.jsx)("option",{value:"Backyard",children:"Backyard"}),(0,a.jsx)("option",{value:"New Construction",children:"New Construction"}),(0,a.jsx)("option",{value:"Other",children:"Other"})]})]}),(0,a.jsxs)("div",{className:r().field,children:[(0,a.jsx)("label",{children:"Image URL"}),(0,a.jsx)("input",{type:"text",value:e.image||"",onChange:e=>updateGallery(t,"image",e.target.value),placeholder:"/images/project.
1jpg"})]})]})]},t))}),(0,a.jsx)("div",{className:r().submitSection,children:(0,a.jsx)("button",{onClick:handleSubmit,disabled:n,className:r().submitBtn,children:n?"Uploading...":"Create ".concat(l.length," Gallery Items")})})]}),0===l.length&&(0,a.jsx)("div",{className:r().emptyState,children:(0,a.jsx)("p",{children:"No gallery items added yet. Use one of the methods above to get started."})})]})}},3636:function(e){e.exports={bulkUpload:"BulkUpload_bulkUpload__PwUir",header:"BulkUpload_header__QEqqG",methods:"BulkUpload_methods__7bXKk",methodCard:"BulkUpload_methodCard__KVOiU",actions:"BulkUpload_actions__5h2Of",csvSection:"BulkUpload_csvSection__GhIww",galleryList:"BulkUpload_galleryList__xRH8L",items:"BulkUpload_items__umfxU",item:"BulkUpload_item__H3j_j",itemHeader:"BulkUpload_itemHeader__MbyvE",removeBtn:"BulkUpload_removeBtn__y3DeP",fields:"BulkUpload_fields__q1XHH",field:"BulkUpload_field__Y4__b",submitSection:"BulkUpload_submitSection__Kc_hl",submitBtn:"BulkUpload_submitBtn__ImHBf",emptyState:"BulkUpload_emptyState__zpQXc"}}}]);

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.