PageSourceSearch

https://www.embroker.com/wp-content/plugins/embroker-premium-calculator/dist/assets/CalculatorLogic.js

js embroker.com collected 2026-10-02 02:27:50 UTC 6,485 bytes, 1 lines download raw bytes

1import{r as h,j as e}from"./main.js";const j=(t,i)=>{if(t.lookup==="static")return t.row??null;const s=t.lookup.inputIds.map(o=>i[o]??"").join("");return t.lookup.inputIds.some(o=>!i[o])?null:t.rules?.[s]??null},g=t=>{if(typeof window>"u")return null;const i=window.embrokerPremiumCalculatorConfigs?.[t];return i&&i.schema!=null?i:t==="default"&&window.premiumCalculatorData?window.premiumCalculatorData:(console.warn(`Embroker Premium Calculator: No data for config "${t}" (embrokerPremiumCalculatorConfigs / premiumCalculatorData).`),null)},N=t=>t?Object.fromEntries(t.schema.inputs.map(i=>{const s=i.options[0]??"";return[i.id,s]})):{},v=(t="default")=>{const[i]=h.useState(()=>g(t)),[s,a]=h.useState(()=>N(g(t))),o=(c,x)=>{a(l=>({...l,[c]:x}))},n=h.useMemo(()=>i?i.schema.inputs.every(c=>!!s[c.id]):!1,[i,s]),p=h.useMemo(()=>!i||!n?[]:i.schema.coverageLines.map(c=>({line:c,row:j(c,s)})),[i,n,s]);return{data:i,selections:s,handleSelectionChange:o,isComplete:n,coverageResults:p}},y=new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),r=t=>`$${y.format(t)}`,b=(t,i)=>`Similar companies typically pay between ${r(t)} and ${r(i)} for coverage`,C=(t,i)=>`Similar companies typically buy limits of ${r(t)} to ${r(i)}`,S=(t,i)=>`Similar companies typically buy retentions of ${r(t)} to ${r(i)}`,$=t=>{const s={premium:b(t.premium.low,t.premium.high)};return t.limit!=null&&(s.limit=C(t.limit.low,t.limit.high)),t.sir!=null&&(s.sir=S(t.sir.low,t.sir.high)),s},L=(t,i)=>`Similar companies typically buy per-claim limits of ${r(t.low)} to ${r(t.high)} and aggregate-limits of ${r(i.low)} to ${r(i.high)}`,I=(t,i)=>`Similar companies typically buy deductibles of ${r(t)} to ${r(i)}`,k=t=>t.perClaimLimit==null||t.aggregateLimit==null||t.deductible==null?null:{premium:b(t.premium.low,t.premium.high),limitCombined:L(t.perClaimLimit,t.aggregateLimit),deductible:I(t.deductible.low,t.deductible.high)},D="Interactive premium range estimator for directors and officers, employment practices liability, technology errors and omissions, and fiduciary coverage.",F=t=>({"@context":"https://schema.org","@type":"WebApplication",name:t.calculatorName,description:D,applicationCategory:"FinanceApplication",provider:{"@type":"Organization",name:"Embroker",url:"https://www.embroker.com"}}),d="tw-bg-ui-0 tw-border tw-border-ui-200 tw-p-4 tw-rounded-xl tw-shadow-low",u="tw-text-sm tw-font-semibold tw-text-ui-500 tw-mb-2 tw-tracking-wide",w="tw-text-sm tw-text-ui-500 tw-leading-relaxed",P="tw-w-full tw-p-2.5 tw-border tw-border-ui-200 tw-rounded-lg tw-bg-ui-0 tw-text-ui-500 tw-shadow-sm focus:tw-outline-none focus:tw-ring-2 focus:tw-ring-violet-400 focus:tw-border-violet-400",E=t=>t.variant==="lpl"?"lpl":"esp",R=({line:t,row:i,variant:s})=>{if(s==="lpl"){const n=k(i);return n?e.jsxs("div",{className:"tw-grid tw-grid-cols-1 tw-gap-4 md:tw-grid-cols-2",children:[e.jsxs("div",{className:d,children:[e.jsx("h4",{className:u,children:"Premium"}),e.jsx("p",{className:w,children:n.premium})]}),e.jsxs("div",{className:d,children:[e.jsx("h4",{className:u,children:"Limit"}),e.jsx("p",{className:w,children:n.limitCombined})]}),e.jsxs("div",{className:`${d} md:tw-col-span-2`,children:[e.jsx("h4",{className:u,children:"Deductible"}),e.jsx("p",{className:w,children:n.deductible})]})]}):e.jsx("div",{className:"tw-rounded-lg tw-bg-warning-100 tw-p-3 tw-text-sm tw-text-ui-500",role:"status",children:"Incomplete LPL coverage data for this row."})}const a=$(i);return t.id==="fiduciary"?e.jsx("div",{className:"tw-grid tw-grid-cols-1 tw-gap-4",children:e.jsxs("div",{className:d,children:[e.jsx("h4",{className:u,children:"Premium"}),e.jsx("p",{className:w,children:a.premium})]})}):e.jsxs("div",{className:"tw-grid tw-grid-cols-1 tw-gap-4 md:tw-grid-cols-2",children:[e.jsxs("div",{className:d,children:[e.jsx("h4",{className:u,children:"Premium"}),e.jsx("p",{className:w,children:a.premium})]}),a.limit!=null?e.jsxs("div",{className:d,children:[e.jsx("h4",{className:u,children:"Limit"}),e.jsx("p",{className:w,children:a.limit})]}):null,a.sir!=null?e.jsxs("div",{className:`${d} md:tw-col-span-2`,children:[e.jsx("h4",{className:u,children:"SIR"}),e.jsx("p",{className:w,children:a.sir})]}):null]})},M=({configKey:t="default"})=>{const{data:i,selections:s,handleSelectionChange:a,isComplete:o,coverageResults:n}=v(t);if(!i)return e.jsx("div",{className:"tw-p-4 tw-text-ui-500",role:"status",children:"Initializing..."});const p=E(i),c=p==="lpl"?"lg:tw-grid-cols-3":"lg:tw-grid-cols-5",x=F(i);return e.jsxs("div",{className:"tw-max-w-6xl tw-mx-auto",children:[e.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(x)}}),e.jsxs("div",{className:"tw-rounded-4xl tw-border tw-border-ui-200 tw-bg-violet-50 tw-p-6 tw-shadow-medium md:tw-p-8",children:[e.jsx("h2",{className:"tw-text-2xl tw-font-bold tw-text-ui-500 md:tw-text-3xl",children:i.calculatorName}),e.jsxs("section",{className:"tw-rounded-2xl tw-border tw-border-ui-200 tw-border-t-4 tw-border-t-violet-400 tw-bg-ui-0 tw-p-5 tw-shadow-low md:tw-p-6 t
1w-mb-5 sm:tw-my-6","aria-labelledby":"premium-calculator-inputs-heading",children:[e.jsx("h3",{id:"premium-calculator-inputs-heading",className:"tw-text-lg tw-font-semibold tw-text-ui-500",children:"Inputs"}),e.jsx("div",{className:`tw-mt-4 tw-grid tw-grid-cols-1 tw-gap-4 md:tw-grid-cols-2 ${c} sm:tw-py-6`,children:i.schema.inputs.map(l=>e.jsxs("div",{className:"tw-flex tw-flex-col",children:[e.jsx("label",{htmlFor:l.id,className:"tw-mb-1.5 tw-text-sm tw-font-medium tw-text-ui-500",children:l.label}),e.jsx("select",{id:l.id,value:s[l.id]??l.options[0]??"",onChange:m=>a(l.id,m.target.value),className:P,children:l.options.map(m=>e.jsx("option",{value:m,children:m},m))})]},l.id))})]}),o?e.jsx("div",{className:"tw-mt-10 tw-space-y-6",children:n.map(({line:l,row:m})=>{const f=l.shortLabel??l.label;return e.jsxs("section",{className:"tw-rounded-2xl tw-border tw-border-ui-200 tw-border-t-4 tw-border-t-violet-400 tw-bg-ui-0 tw-p-5 tw-shadow-low md:tw-p-6","aria-labelledby":`coverage-heading-${l.id}`,children:[e.jsx("h3",{id:`coverage-heading-${l.id}`,className:"tw-text-lg tw-font-semibold tw-text-ui-500",children:f}),m?e.jsx("div",{className:"tw-mt-4",children:e.jsx(R,{line:l,row:m,variant:p})}):e.jsx("div",{className:"tw-mt-4 tw-rounded-lg tw-bg-warning-100 tw-p-3 tw-text-sm tw-text-ui-500",role:"status",children:"No matching premium found for this combination."})]},l.id)})}):null]})]})};export{M as default};

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.