PageSourceSearch

https://login.commonsku.com/dist/react/components-CheckPSInventoryLevelPopup.e7954159.chunk.js

js commonsku.com collected 2026-10-02 03:15:20 UTC 5,015 bytes, 2 lines download raw bytes

1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[1525],{80892(e,t,o){o.d(t,{A:()=>i}),o(41594);var s=o(3602),n=o(22224),r=o(63988);function i(e){const{item_levels:t}=e;return t?(0,r.jsxs)(s.Table,{"data-test-name":"CheckInventoryLevelTable",children:[(0,r.jsx)(s.THead,{style:{border:"none"},children:(0,r.jsxs)(s.TR,{children:[(0,r.jsx)(s.TH,{bg:"white",colSpan:"2",children:"SKU"}),(0,r.jsx)(s.TH,{bg:"white",colSpan:"4",children:"Description"}),(0,r.jsx)(s.TH,{bg:"white",colSpan:"2",children:"Color"}),(0,r.jsx)(s.TH,{bg:"white",colSpan:"1",children:"Size"}),(0,r.jsx)(s.TH,{bg:"white",colSpan:"1",children:"Quantity Available"})]})}),(0,r.jsx)(s.TBody,{style:{border:"none"},children:t?t.map(e=>{const t=(""+(e.quantity_available||"")).includes("Checking"),o=(0,n.toInteger)(e.quantity_available);return(0,r.jsxs)(s.TR,{"data-test-name":"CheckInventoryLevelTable",children:[(0,r.jsx)(s.TD,{colSpan:"2",style:{color:"#000"},children:e.part_id}),(0,r.jsx)(s.TD,{colSpan:"4",style:{color:"#000"},children:e.description}),(0,r.jsx)(s.TD,{colSpan:"2",style:{color:"#000"},children:e.color}),(0,r.jsx)(s.TD,{colSpan:"1",style:{color:"#000"},children:e.size}),(0,r.jsxs)(s.TD,{colSpan:"1",style:{color:0!==o||t?"#000":s.colors.yellow[60]},children:[0===o&&!t&&(0,r.jsx)(s.AlertIcon,{filled:!0,color:s.colors.yellow[60],style:{verticalAlign:"middle",paddingRight:5}}),(0,r.jsx)("span",{style:{fontSize:14},children:t?e.quantity_available:o})]})]},e.part_id)}):null})]}):null}},24789(e,t,o){o.r(t),o.d(t,{GlobalStyle:()=>_,default:()=>m,mapDispatchToProps:()=>g,mapStateToProps:()=>x});var s=o(22224),n=o(41594),r=o(98483),i=o(3602),l=o(26926),c=o(39913),a=o(28027),d=o(61536),p=o(84685),u=o(98114),h=o(80892),y=o(63988);const _=(0,p.DU)();class v extends n.Component{constructor(e){super(e);const t=(0,s.find)((0,s.get)(e.product,"skus",[]),{product_sku_id:e.product_sku_id});this.state={loading:!1,color:"",size:"",item_levels:this.props.item.levels?this.props.item.levels.results:null,skus:t?[t.sku]:[],search_query:""}}componentDidMount(){const{product:e,loadProduct:t}=this.props;e?(this.fetchParts(),this.reloadInventory()):t()}componentDidUpdate(e){const{product_id:t,product:o,loadProduct:s}=this.props;t===e.product_id&&o==e.product||(o?(this.fetchParts(0),this.reloadInventory()):s())}UNSAFE_componentWillReceiveProps(e){this.props.product_id!==e.product_id&&(e.product?(this.fetchParts(),this.reloadInventory()):e.loadProduct())}async fetchParts(e){const{product:t,currency_id:o}=this.props,s=await(0,u.ZR)(t,o,this.state.skus,e);this.setState(s)}async reloadInventory(){const{product:e}=this.props,t=await(0,u.cr)(e.ext_product_id);this.setState(t)}async loadProductSkuIds(e){const t=await this.loadProductSkus(e);return(0,s.map)(t,e=>(0,s.get)(e,["product_sku_id"]))}async loadProductSkus(e){const{product:t,loadProduct:o}=this.props;return await(0,u.w6)(t,o,e)}
1renderLoading(){return(0,y.jsx)(i.Col,{"data-test-name":"CheckPSInventoryLevelPopup.renderLoading",xs:!0,style:{textAlign:"center"},children:(0,y.jsx)(i.Loading,{})})}render(){const{product:e,index:t,currency_id:o="USD",onClosePopup:n,popupBaseZIndex:r}=this.props,l=null!=r?r:a.z,{loading:c,skus:d,inventory:p={},inventoryLoaded:v=!1,search_query:x}=this.state,g=(0,u.lW)(d,o,p,v),m=(0,s.map)(g.filter(e=>{if(!x)return!0;const t=x.toLowerCase();return(e.color||"").toLowerCase().includes(t)||(e.size||"").toLowerCase().includes(t)||(e.sku||"").toLowerCase().includes(t)||(e.inventory||"").toLowerCase().includes(t)||(e.description||"").toLowerCase().includes(t)}),e=>({part_id:e.sku,description:e.description,color:e.color,size:e.size,quantity_available:e.inventory.split(" ")[0].trim()})),S=c?"Fetching Inventory Level":m?"View Inventory Level":"No Inventory Level Available";return(0,y.jsxs)(i.Theme,{"data-test-name":"CheckPSInventoryLevelPopup.render",theme:i.themeOptions,children:[(0,y.jsx)(_,{theme:i.themeOptions}),(0,y.jsx)(i.Popup,{closeOnEsc:!0,title:S,onClose:n,zIndex:l+t,overlayZIndex:l+t,controls:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i.LabeledIconInput,{label:"",Icon:(0,y.jsx)(i.SearchIcon,{color:"#D0D7DC",style:{marginTop:"30%"}}),className:"sku-options-search-query",placeholder:"Filter",value:x,onChange:e=>this.setState({search_query:e.target.value}),style:{margin:0,marginRight:10,width:225,height:54},iconColor:"#D0D7DC",iconLabelStyles:{height:"100%",background:"none"},containerStyle:{display:"inline-block"}}),(0,y.jsx)(i.Button,{variant:"cta",onClick:n,children:"Done"})]}),children:(0,y.jsx)(i.Row,{children:!e||c?this.renderLoading():(0,y.jsx)(h.A,{item_levels:m})})})]})}}const x=(e,t)=>({item:(0,l.zd)(e,{item_id:t.item_id}),product:t.product||e.entities.products[t.product_id]}),g=(e,t)=>({onClosePopup:()=>{e((0,c.fs)())},loadProduct:function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e((0,d.m3)(t.product_id,o))}}),m=(0,r.Ng)(x,g)(v)}}]);
2//# sourceMappingURL=components-CheckPSInventoryLevelPopup.e7954159.chunk.js.map

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.