PageSourceSearch

https://ozone-bes-os.vercel.app/_next/static/chunks/pages/purchasing-41c91a26555e18c0.js

js ozone-bes-os.vercel.app collected 2026-10-03 07:28:18 UTC 26,595 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5460],{44936:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var r=n(37876),s=n(48230),i=n.n(s),l=n(14232),a=n(39540),o=n(15137),d=n(50876),u=n(11368),c=n(23256),h=n(5226);let p=()=>({productId:"",quantity:1,unitPrice:0});function m(){let{user:e}=(0,a.As)(),t=(0,h.a)("/api/procurement/suppliers"),n=(0,h.a)("/api/procurement/catalog"),s=(0,h.a)("/api/procurement/requests"),m=(0,h.a)("/api/procurement/orders"),[g,j]=(0,l.useState)(""),[v,f]=(0,l.useState)(""),[S,_]=(0,l.useState)(""),[b,C]=(0,l.useState)("ALL"),[R,N]=(0,l.useState)("ALL"),[E,Z]=(0,l.useState)(1),[T,I]=(0,l.useState)({id:"",code:"",name:"",contactName:"",email:"",phone:"",taxId:"",address:"",paymentTerms:"",creditDays:0,currency:"THB",note:"",leadTimeDays:0}),[A,L]=(0,l.useState)(""),[P,D]=(0,l.useState)(null),[F,O]=(0,l.useState)(""),[w,k]=(0,l.useState)(null),[z,q]=(0,l.useState)("IDLE"),[B,V]=(0,l.useState)(""),[U,$]=(0,l.useState)(""),[M,G]=(0,l.useState)(""),[K,W]=(0,l.useState)(""),[Y,H]=(0,l.useState)([p()]),Q=t.data?.suppliers||[],J=(n.data?.products||[]).filter(e=>e.active),X=s.data?.requests||[],ee=m.data?.orders||[],et=X.filter(e=>"PENDING_APPROVAL"===e.status).length+ee.filter(e=>"PENDING_APPROVAL"===e.status).length,en=ee.filter(e=>"APPROVED"===e.status||"PARTIALLY_RECEIVED"===e.status),er=()=>{t.reload(),n.reload(),s.reload(),m.reload()},es=async(e,t)=>{j(e),f("");try{await t(),er()}catch(e){f(e instanceof Error?e.message:"The Procurement request failed.")}finally{j("")}},ei=()=>{k(null),q("IDLE"),j(""),D(null),O(""),L(""),er()},el=async e=>{q("VERIFYING"),j("supplier-verify");try{if((await (0,d.Rx)(`/api/procurement/suppliers?commandResultKey=${encodeURIComponent(e.key)}`)).supplier)return ei();q("RETRY_ALLOWED"),j(""),f("ยังไม่พบผลคำสั่ง Supplier สามารถส่งคำสั่งเดิมด้วยรหัสเดิมได้ โดยระบบจะไม่สร้างคำสั่งใหม่")}catch{q("RESULT_UNKNOWN"),j(""),f("ยังยืนยันผลคำสั่ง Supplier ไม่ได้ ระบบปิดการแก้ไขไว้ก่อน โปรดตรวจสอบสถานะอีกครั้ง")}},ea=async(e,t=!1)=>{k(e),q("MUTATING"),j("supplier-mutation"),f("");try{await (0,d.Rx)("/api/procurement/suppliers",{method:e.method,body:JSON.stringify(e.payload)}),t&&I({id:"",code:"",name:"",contactName:"",email:"",phone:"",taxId:"",address:"",paymentTerms:"",creditDays:0,currency:"THB",note:"",leadTimeDays:0}),ei()}catch(t){t?.status?(k(null),q("IDLE"),j(""),f(t instanceof Error?t.message:"Supplier request failed")):await el(e)}},eo=async()=>{if("IDLE"!==z)return;let e=crypto.randomUUID(),t=e=>e.trim()?e.trim():null,n={code:T.code,name:T.name,contactName:t(T.contactName),email:t(T.email),phone:t(T.phone),taxId:t(T.taxId),address:t(T.address),paymentTerms:t(T.paymentTerms),creditDays:Number(T.creditDays),currency:t(T.currency),note:t(T.note),leadTimeDays:Number(T.leadTimeDays),reason:A,idempotencyKey:e};await ea({key:e,method:"POST",payload:n},!0)},ed=async e=>{let{id:t,code:n,name:r,contactName:s,email:i,phone:l,taxId:a,address:o,paymentTerms:d,creditDays:u,currency:c,note:h,leadTimeDays:p}=e,m=crypto.randomUUID(),y={id:t,code:n,name:r,contactName:s??null,email:i??null,phone:l??null,taxId:a??null,address:o??null,paymentTerms:d??null,creditDays:u??null,currency:c??null,note:h??null,leadTimeDays:p,expectedVersion:e.version,active:!e.active,reason:F,idempotencyKey:m};await ea({key:m,method:"PATCH",payload:y})},eu=(0,l.useMemo)(()=>Y.reduce((e,t)=>e+Number(t.quantity||0)*Number(t.unitPrice||0),0),[Y]),ec=S.trim().toLocaleLowerCase(),eh=Q.filter(e=>("ALL"===R||"ACTIVE"===R===e.active)&&(!ec||`${e.code} ${e.name} ${e.contactName||""} ${e.email||""}`.toLocaleLowerCase().includes(ec))),ep=X.filter(e=>("ALL"===b||e.status===b)&&(!ec||e.requestNo.toLocaleLowerCase().includes(ec))),em=ee.filter(e=>("ALL"===b||e.status===b)&&(!ec||`${e.orderNo} ${e.supplierCode} ${e.supplierName}`.toLocaleLowerCase().includes(ec))),ey=Math.max(1,Math.ceil(Math.max(eh.length,ep.length,em.length)/10)),ex=e=>e.slice((Math.min(E,ey)-1)*10,10*Math.min(E,ey)),eg=t.loading||n.loading||s.loading||m.loading,ej=t.error||n.error||s.error||m.error;return(0,r.jsx)(c.A,{children:(0,r.jsxs)("main",{style:{minHeight:"100vh",padding:24,color:"#0f172a",background:"#f1f5f9"},children:[(0,r.jsxs)("header",{style:{display:"flex",justifyContent:"space-between",gap:16,marginBottom:18,flexWrap:"wrap"},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{color:"#2563eb",fontSize:11,fontWeight:900,letterSpacing:".14em"},children:"BES OS / PROCUREMENT"}),(0,r.jsx)("h1",{style:{margin:"7px 0 6px",fontSize:36},children:"Procurement Operations"}),(0,r.jsx)("p",{style:{margin:0,color:"#475569"},children:"Editable drafts, controlled approvals, PO receiving and complete audit history."})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[(0,r.jsx)(i(),{href:"/purchasing/reports",style:u.lZ.primaryButton,children:"Reports & controls"}),(0,o._m)(e,"procurement.export")&&(0,r.jsx)("button",{style:u.lZ.secondaryButton,onClick:()=>{let e=[["PO No.","Supplier","Status","SKU","Product","Ordered","Received","Outstanding","Expected date"]];
1en.forEach(t=>t.lines.forEach(n=>e.push([t.orderNo,t.supplierName,t.status,n.sku,n.productName,String(n.quantity),String(n.receivedQuantity),String(n.quantity-n.receivedQuantity),t.expectedDate||""])));let t=e=>{let t=/^[=+\-@]/.test(e.trimStart())?`'${e}`:e;return`"${t.replaceAll('"','""')}"`},n=e.map(e=>e.map(t).join(",")).join("\r\n"),r=URL.createObjectURL(new Blob(["\uFEFF",n],{type:"text/csv;charset=utf-8"})),s=document.createElement("a");s.href=r,s.download="procurement-outstanding.csv",document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)},children:"Export outstanding CSV"})]})]}),(0,r.jsxs)(u.jP,{children:[(v||ej)&&(0,r.jsx)(u.rB,{message:v||ej}),(0,r.jsxs)(u.lo,{children:[(0,r.jsx)("h2",{style:{marginTop:0},children:"Find Procurement records"}),(0,r.jsxs)("div",{style:u.lZ.formGrid,children:[(0,r.jsx)(y,{label:"Search",children:(0,r.jsx)("input",{style:u.lZ.input,value:S,placeholder:"Supplier, PR No. or PO No.",onChange:e=>{_(e.target.value),Z(1)}})}),(0,r.jsx)(y,{label:"Status",children:(0,r.jsxs)("select",{style:u.lZ.input,value:b,onChange:e=>{C(e.target.value),Z(1)},children:[(0,r.jsx)("option",{value:"ALL",children:"All statuses"}),["DRAFT","PENDING_APPROVAL","APPROVED","PARTIALLY_RECEIVED","RECEIVED","REJECTED","CANCELLED","CONVERTED"].map(e=>(0,r.jsx)("option",{value:e,children:e},e))]})})]})]}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(180px,1fr))",gap:12,marginBottom:16},children:[["Suppliers",Q.length],["Purchase requests",X.length],["Pending approval",et],["Open purchase orders",en.length]].map(([e,t])=>(0,r.jsxs)(u.lo,{children:[(0,r.jsx)("span",{style:{color:"#64748b"},children:e}),(0,r.jsx)("strong",{style:{display:"block",marginTop:8,fontSize:30},children:t})]},String(e)))}),eg&&(0,r.jsx)(u.lo,{children:(0,r.jsx)(u.Kj,{title:"Loading Procurement data",detail:"Reading organization-scoped records from Firestore."})}),(0,o._m)(e,"procurement.manage")&&(0,r.jsxs)(u.lo,{children:[(0,r.jsx)("h2",{style:{marginTop:0},children:"Supplier master"}),(0,r.jsxs)("div",{style:u.lZ.formGrid,children:[(0,r.jsx)(y,{label:"Stable ID",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.id,onChange:e=>I({...T,id:e.target.value}),placeholder:"supplier-bes"})}),(0,r.jsx)(y,{label:"รหัส Supplier",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.code,onChange:e=>I({...T,code:e.target.value})})}),(0,r.jsx)(y,{label:"ชื่อบริษัท",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.name,onChange:e=>I({...T,name:e.target.value})})}),(0,r.jsx)(y,{label:"ชื่อผู้ติดต่อ",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.contactName,onChange:e=>I({...T,contactName:e.target.value})})}),(0,r.jsx)(y,{label:"Email",children:(0,r.jsx)("input",{type:"email",style:u.lZ.input,value:T.email,onChange:e=>I({...T,email:e.target.value})})}),(0,r.jsx)(y,{label:"โทรศัพท์",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.phone,onChange:e=>I({...T,phone:e.target.value})})}),(0,r.jsx)(y,{label:"เลขประจำตัวผู้เสียภาษี",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.taxId,onChange:e=>I({...T,taxId:e.target.value})})}),(0,r.jsx)(y,{label:"ที่อยู่",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.address,onChange:e=>I({...T,address:e.target.value})})}),(0,r.jsx)(y,{label:"เงื่อนไขเครดิต",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.paymentTerms,onChange:e=>I({...T,paymentTerms:e.target.value})})}),(0,r.jsx)(y,{label:"จำนวนวันเครดิต",children:(0,r.jsx)("input",{type:"number",min:0,style:u.lZ.input,value:T.creditDays,onChange:e=>I({...T,creditDays:Number(e.target.value)})})}),(0,r.jsx)(y,{label:"สกุลเงิน",children:(0,r.jsx)("input",{maxLength:3,style:u.lZ.input,value:T.currency,onChange:e=>I({...T,currency:e.target.value.toUpperCase()})})}),(0,r.jsx)(y,{label:"Lead time (days)",children:(0,r.jsx)("input",{type:"number",min:0,style:u.lZ.input,value:T.leadTimeDays,onChange:e=>I({...T,leadTimeDays:Number(e.target.value)})})}),(0,r.jsx)(y,{label:"หมายเหตุ",children:(0,r.jsx)("input",{style:u.lZ.input,value:T.note,onChange:e=>I({...T,note:e.target.value})})}),(0,r.jsx)(y,{label:"เหตุผลการเพิ่ม",children:(0,r.jsx)("input",{minLength:10,style:u.lZ.input,value:A,onChange:e=>L(e.target.value)})})]}),(0,r.jsx)("button",{disabled:"IDLE"!==z||A.trim().length<10,style:u.lZ.primaryButton,onClick:()=>void eo(),children:"IDLE"!==z?"กำลังตรวจสอบผล…":"Create supplier"})]}),(0,r.jsxs)(u.lo,{children:[(0,r.jsx)("h2",{style:{marginTop:0},children:"Suppliers"}),(0,r.jsxs)("label",{style:{...u.lZ.field,maxWidth:260,marginBottom:12},children:["กรองสถานะ Supplier",(0,r.jsxs)("select",{style:u.lZ.input,value:R,onChange:e=>N(e.target.value),children:[(0,r.jsx)("option",{value:"ALL",children:"ทั้งหมด"}),(0,r.jsx)("option",{value:"ACTIVE",children:"Active"}),(0,r.jsx)("option",{value:"INACTIVE",children:"Inactive"})]})]}),0===eh.length?(0,r.jsx)(u.Kj,{title:"No matching suppliers",detail
1:"Adjust the search or create an active supplier."}):(0,r.jsxs)("table",{style:u.lZ.table,children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:["Code","Name","Contact","Terms","Lead time","Status","Actions"].map(e=>(0,r.jsx)("th",{style:u.lZ.th,children:e},e))})}),(0,r.jsx)("tbody",{children:ex(eh).map(t=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{style:u.lZ.td,children:t.code}),(0,r.jsx)("td",{style:u.lZ.td,children:t.name}),(0,r.jsx)("td",{style:u.lZ.td,children:t.contactName||t.email||t.phone||"—"}),(0,r.jsx)("td",{style:u.lZ.td,children:t.paymentTerms||"—"}),(0,r.jsxs)("td",{style:u.lZ.td,children:[t.leadTimeDays," days"]}),(0,r.jsx)("td",{style:u.lZ.td,children:t.active?"ACTIVE":"INACTIVE"}),(0,r.jsx)("td",{style:u.lZ.td,children:(0,r.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[(0,r.jsxs)(i(),{style:x,href:`/purchasing/suppliers/${t.id}`,children:[(0,o._m)(e,"procurement.manage")?"Manage":"View details",(0,r.jsx)("span",{"aria-hidden":"true",children:"→"})]}),(0,o._m)(e,"procurement.manage")&&(0,r.jsx)("button",{style:t.active?u.lZ.dangerButton:u.lZ.secondaryButton,disabled:g===`supplier-${t.id}`,onClick:()=>{D(t),O("")},children:t.active?"Deactivate":"Reactivate"})]})})]},t.id))})]})]}),P&&(0,r.jsxs)(u.lo,{children:[(0,r.jsxs)("h2",{children:[P.active?"ยืนยันการปิดใช้งาน":"ยืนยันการเปิดใช้งาน"," ",P.code]}),(0,r.jsx)("p",{children:"ระบบจะตรวจ commitment ล่าสุดจาก Server ก่อนเปลี่ยนสถานะ และจะไม่ส่งคำสั่งซ้ำอัตโนมัติหากเครือข่ายไม่ชัดเจน"}),(0,r.jsx)(y,{label:"เหตุผล (อย่างน้อย 10 ตัวอักษร)",children:(0,r.jsx)("input",{autoFocus:!0,minLength:10,style:u.lZ.input,value:F,onChange:e=>O(e.target.value)})}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("button",{disabled:"IDLE"!==z||F.trim().length<10,style:P.active?u.lZ.dangerButton:u.lZ.primaryButton,onClick:()=>void ed(P),children:"ยืนยัน"}),(0,r.jsx)("button",{disabled:"IDLE"!==z,style:u.lZ.secondaryButton,onClick:()=>D(null),children:"ยกเลิก"})]})]}),w&&("RESULT_UNKNOWN"===z||"VERIFYING"===z)&&(0,r.jsx)("button",{disabled:"VERIFYING"===z,style:u.lZ.secondaryButton,onClick:()=>void el(w),children:"VERIFYING"===z?"กำลังตรวจสอบ…":"ตรวจสอบสถานะ Supplier อีกครั้ง"}),w&&"RETRY_ALLOWED"===z&&(0,r.jsx)("button",{style:u.lZ.secondaryButton,onClick:()=>void ea(w),children:"ส่งคำสั่ง Supplier เดิมอีกครั้ง"}),(0,o._m)(e,"procurement.create")&&(0,r.jsxs)(u.lo,{children:[(0,r.jsx)("h2",{style:{marginTop:0},children:"New Purchase Request"}),(0,r.jsxs)("div",{style:u.lZ.formGrid,children:[(0,r.jsx)(y,{label:"PR No.",children:(0,r.jsx)("input",{style:u.lZ.input,value:B,onChange:e=>V(e.target.value)})}),(0,r.jsx)(y,{label:"Supplier",children:(0,r.jsxs)("select",{style:u.lZ.input,value:U,onChange:e=>$(e.target.value),children:[(0,r.jsx)("option",{value:"",children:"Select supplier"}),Q.filter(e=>e.active).map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.code," - ",e.name]},e.id))]})}),(0,r.jsx)(y,{label:"Required date",children:(0,r.jsx)("input",{type:"date",style:u.lZ.input,value:M,onChange:e=>G(e.target.value)})}),(0,r.jsx)(y,{label:"Note",children:(0,r.jsx)("input",{style:u.lZ.input,value:K,onChange:e=>W(e.target.value)})})]}),Y.map((e,t)=>(0,r.jsxs)("div",{style:{...u.lZ.formGrid,padding:12,marginBottom:10,border:"1px solid #e2e8f0",borderRadius:10},children:[(0,r.jsx)(y,{label:`Product ${t+1}`,children:(0,r.jsxs)("select",{style:u.lZ.input,value:e.productId,onChange:e=>H(n=>n.map((n,r)=>r===t?{...n,productId:e.target.value}:n)),children:[(0,r.jsx)("option",{value:"",children:"Select product"}),J.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.sku," - ",e.name]},e.id))]})}),(0,r.jsx)(y,{label:"Quantity",children:(0,r.jsx)("input",{type:"number",min:1,step:1,style:u.lZ.input,value:e.quantity,onChange:e=>H(n=>n.map((n,r)=>r===t?{...n,quantity:Number(e.target.value)}:n))})}),(0,r.jsx)(y,{label:"Unit price",children:(0,r.jsx)("input",{type:"number",min:0,step:"0.01",style:u.lZ.input,value:e.unitPrice,onChange:e=>H(n=>n.map((n,r)=>r===t?{...n,unitPrice:Number(e.target.value)}:n))})}),Y.length>1&&(0,r.jsx)("button",{style:u.lZ.dangerButton,onClick:()=>H(e=>
1e.filter((e,n)=>n!==t)),children:"Remove"})]},t)),(0,r.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(0,r.jsx)("button",{style:u.lZ.secondaryButton,onClick:()=>H(e=>[...e,p()]),children:"Add line"}),(0,r.jsx)("button",{disabled:"request"===g,style:u.lZ.primaryButton,onClick:()=>void es("request",async()=>{await (0,d.Rx)("/api/procurement/requests",{method:"POST",body:JSON.stringify({requestNo:B,supplierId:U||null,requiredDate:M||null,note:K||null,lines:Y.map(e=>({...e,quantity:Number(e.quantity),unitPrice:Number(e.unitPrice)})),idempotencyKey:crypto.randomUUID()})}),V(""),$(""),G(""),W(""),H([p()])}),children:"request"===g?"Saving...":"Save PR draft"}),(0,r.jsxs)("strong",{children:["Total: ",eu.toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),(0,r.jsxs)(u.lo,{children:[(0,r.jsx)("h2",{style:{marginTop:0},children:"Purchase Requests"}),0===ep.length?(0,r.jsx)(u.Kj,{title:"No matching purchase requests",detail:"Create a draft or adjust the filters."}):(0,r.jsxs)("table",{style:u.lZ.table,children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:["PR No.","Status","Required","Lines","Total","Actions"].map(e=>(0,r.jsx)("th",{style:u.lZ.th,children:e},e))})}),(0,r.jsx)("tbody",{children:ex(ep).map(t=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{style:u.lZ.td,children:(0,r.jsx)("strong",{children:t.requestNo})}),(0,r.jsx)("td",{style:u.lZ.td,children:t.status}),(0,r.jsx)("td",{style:u.lZ.td,children:t.requiredDate||"—"}),(0,r.jsx)("td",{style:u.lZ.td,children:t.lines.length}),(0,r.jsx)("td",{style:u.lZ.td,children:t.totalAmount.toLocaleString()}),(0,r.jsx)("td",{style:u.lZ.td,children:(0,r.jsxs)(i(),{style:x,href:`/purchasing/requests/${t.id}`,children:["DRAFT"===t.status&&(0,o._m)(e,"procurement.edit")?"Edit draft":"View details",(0,r.jsx)("span",{"aria-hidden":"true",children:"→"})]})})]},t.id))})]})]}),(0,r.jsxs)(u.lo,{children:[(0,r.jsx)("h2",{style:{marginTop:0},children:"Purchase Orders"}),0===em.length?(0,r.jsx)(u.Kj,{title:"No matching purchase orders",detail:"Approve a PR and convert it into a PO, or adjust the filters."}):(0,r.jsxs)("table",{style:u.lZ.table,children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:["PO No.","Supplier","Status","Expected","Total","Outstanding","Actions"].map(e=>(0,r.jsx)("th",{style:u.lZ.th,children:e},e))})}),(0,r.jsx)("tbody",{children:ex(em).map(t=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{style:u.lZ.td,children:(0,r.jsx)("strong",{children:t.orderNo})}),(0,r.jsxs)("td",{style:u.lZ.td,children:[t.supplierCode," - ",t.supplierName]}),(0,r.jsx)("td",{style:u.lZ.td,children:t.status}),(0,r.jsx)("td",{style:u.lZ.td,children:t.expectedDate||"—"}),(0,r.jsx)("td",{style:u.lZ.td,children:t.totalAmount.toLocaleString()}),(0,r.jsx)("td",{style:u.lZ.td,children:t.lines.reduce((e,t)=>e+Math.max(0,t.quantity-t.receivedQuantity),0)}),(0,r.jsx)("td",{style:u.lZ.td,children:(0,r.jsxs)(i(),{style:x,href:`/purchasing/orders/${t.id}`,children:["DRAFT"===t.status&&(0,o._m)(e,"procurement.edit")?"Edit draft":"View details",(0,r.jsx)("span",{"aria-hidden":"true",children:"→"})]})})]},t.id))})]})]}),ey>1&&(0,r.jsx)(u.lo,{children:(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)("button",{disabled:E<=1,style:u.lZ.secondaryButton,onClick:()=>Z(e=>Math.max(1,e-1)),children:"Previous"}),(0,r.jsxs)("strong",{children:["Page ",Math.min(E,ey)," of ",ey]}),(0,r.jsx)("button",{disabled:E>=ey,style:u.lZ.secondaryButton,onClick:()=>Z(e=>Math.min(ey,e+1)),children:"Next"})]})})]})]})})}function y({label:e,children:t}){return(0,r.jsxs)("label",{style:u.lZ.field,children:[e,t]})}let x={display:"inline-flex",alignItems:"center",gap:6,minHeight:34,padding:"0 4px",color:"#1d4ed8",textDecoration:"none",fontSize:13,fontWeight:800}},47643:(e,t,n)=>{"use strict";var r=n(99742);n(72552);var s=n(14232),i=s&&"object"==typeof s&&"default"in s?s:{default:s},l=void 0!==r&&r.env&&!0,a=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,s=t.optimizeForSpeed,i=void 0===s?l:s;d(a(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",d("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o=document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.get
1Sheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},n.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},n.insertRule=function(e,t){if(d(a(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return l||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},n.replaceRule=function(e,t){if(this._optimizeForSpeed){var n=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){l||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];d(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},n.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},n.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},n.cssRules=function(){var e=this;return this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},n.makeStyleTag=function(e,t,n){t&&d(a(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var s=document.head||document.getElementsByTagName("head")[0];return n?s.insertBefore(r,n):s.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function d(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var u=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},c={};function h(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return c[r]||(c[r]="jsx-"+u(e+"-"+n)),c[r]}function p(e,t){var n=e+t;return c[n]||(c[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),c[n]}var m=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,s=t.optimizeForSpeed,i=void 0!==s&&s;this._sheet=r||new o({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),r&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,s=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var i=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=i,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var s=h(r,n);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return p(s,e)}):[p(s,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),y=s.createContext(null);y.displayName="StyleSheetContext";var x=i.default.useInsertionEffect||i.default.useLayoutEffect,g=new m;function j(e){var t=g||s.useContext(y);return t&&x(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}j.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},t.style=j},72552:()=>{}
1,92412:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/purchasing",function(){return n(44936)}])},94208:(e,t,n)=>{"use strict";e.exports=n(47643).style}},e=>{e.O(0,[8230,2702,4602,1368,636,6593,8792],()=>e(e.s=92412)),_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.