1"use strict";(self.webpackChunkcox_cms_react=self.webpackChunkcox_cms_react||[]).push([[5798],{25798:function(e,r,s){s.r(r),s.d(r,{default:function(){return R}});var o=s(67099),t=s(21239),i=s(84718),n=s(92040),a=s(46306),l=s(80171),c=s(66570),u=s(81765),d=s(81192),f=s(82402),p=s(45997),g=s(38984),h=s(67973),E=s(2479),R=(0,o.A)(e=>{const{ruleId:r="",ruleExpression:s="",ruleDescription:o="",isInEditor:R=!1,editmode:v=!1,ruleType:T="",ruleName:m="",resultsFalse:C,resultsTrue:P,defaultVariationContent:D,showDefaultContent:F=!1,defaultVariationFragmentPath:O="",trueExpFragmentPath:I="",falseExpFragmentPath:S="",componentTypeRenderer:_}=e,x=R||v||(0,d.ad)(),{udo:N}=(0,a.V6)(),{visitorType:w="",pAddressCapture:A=""}=N,y={offers:[],discounts:[],cinfos:[],success:!1,loading:!1,error:!1},{setFlexOffersContext:X}=(0,i.R$)(),{condition:B="",...M}=(0,h.mb)(s),V=s?M:{},{customerType:b,offerIds:L}=V,{inversionProperties:U,isLocal:k}=(0,f.M)();return(0,t.useEffect)(()=>((async()=>{if(s&&V&&T===n.D2.pricing){if(k&&(null===U||void 0===U||!U.pricing_zip))return void console.log("\u23f3 Waiting for inversion data to load (pricing_zip not yet available)");let o;V.isLocal=k,V.inversionZipcode=k?null===U||void 0===U?void 0:U.pricing_zip:void 0;const t=(0,h.EH)(V);try{if(w?b===n.DX.PROSPECT&&w===n.PB.NONCUSTOMER:R&&b===n.DX.PROSPECT){X({[s]:{...y,loading:!0}}),o=A?await l.A.post(d.JR.FLEX_OFFER_ADDRESS_API,t,{withCredentials:!0}):await l.A.get(d.JR.FLEX_OFFERS_API,{withCredentials:!0,headers:t});const{data:e}=o,{offers:r,success:i,errorMessage:n}=e;if(r){const e=(0,h.eA)(r,L);o.data.offers=e}X({[s]:{...o.data,success:i,loading:!1,error:(null===n||void 0===n?void 0:n.length)>0}})}else if(w?(b===n.DX.PINPOINT||b===n.DX.CUSTOMER)&&w===n.PB.CUSTOMER:R&&(b===n.DX.PINPOINT||b===n.DX.CUSTOMER))if(X({[s]:{...y,loading:!0}}),V.getCurrentSubscription)try{o=await l.A.get(d.JR.CURRENT_SUBSCRIPTION,{withCredentials:!0});const{data:e}=o,{cinfo:r={},success:t=!1}=e,i=[];Object.keys(r).length>0&&i.push(r),X({[s]:{cinfos:i,offers:[],discounts:[],success:t,loading:!1,error:!1}})}catch(e){console.error("\u{1f680}",e),(0,g.vV)("RuleBuilder.fetchFlexOffers.currentSubscription",e),X({[s]:{offers:[],discounts:[],cinfos:[],success:!1,loading:!1,error:!0}})}else{o=await l.A.post(d.JR.FLEX_OFFERS_API,t,{withCredentials:!0});const{data:r}=o,{propositions:i={},success:a=!1,errormessage:c="",unChecked:u={}}=r;if(b===n.DX.PINPOINT){X({[s]:{...i,success:a,loading:!1,error:(null===c||void 0===c?void 0:c.length)>0}});try{const e={Type:"PRESENTED",DateTime:"date_time"},r={DispositionList:(0,p.QY)(null===i||void 0===i?void 0:i.offers,"DispositionList",e)};await l.A.post(d.JR.SET_DISPOSITION,r,{withCredentials:!0})}catch(e){console.error(e),(0,g.vV)("RuleBuilder.fetchFlexOffers.setDisposition",e)}}if(b===n.DX.CUSTOMER){const{errorMessage:e,offers:r}=u;if(r){const e=(0,h.eA)(r,L);u.offers=e}X({[s]:{...u,success:a,loading:!1,error:(null===e||void 0===e?void 0:e.length)>0}})}}}catch(r){X({[s]:{...r,loading:!1,error:!0}}),console.error(r),(0,g.vV)("RuleBuilder.fetchFlexOffers",r)}}})(),()=>{X({})}),[null===U||void 0===U?void 0:U.pricing_zip]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(c.A,{isInEditor:x,ruleId:r,ruleType:T,ruleName:m,ruleDescription:o,ruleExpression:s,trueExpFragmentPath:I,falseExpFragmentPath:S,showDefaultContent:F,defaultVariationFragmentPath:O}),(0,E.jsx)(u.A,{ruleId:r,resultsTrue:P,resultsFalse:C,defaultVariationContent:D,showDefaultContent:F,ruleType:T,condition:B,ruleExpression:s,isInEditor:x,componentTypeRenderer:_,compName:null===e||void 0===e?void 0:e.compName})]})},{compName:"RuleBuilder",showErrorBanner:!0})}}]);
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.