stand_socotra_policy_transformer 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.stand_underwriter=i():e.stand_underwriter=i()}(this,(()=>{return e={10:e=>{e.exports={is_vacant:function(e){return"No"===e?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home is vacant"}:{decision:"reject",note:"Vacant must be yes or no"}},under_renovation:function(e){return"No"===e?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home is under renovation"}:{decision:"reject",note:"Under renovation must be yes or no"}},plumbing_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Plumbing input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-30,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Plumbing must have been updated in the last 30 years"}):{decision:"reject",note:"Plumbing year must be an integer"}},water_heater_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Water heater input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-10,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Water heater must have been updated in the last 10 years"}):{decision:"reject",note:"Water heater year must be an integer"}},electrical_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Electrical input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-30,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Electrical must have been updated in the last 30 years"}):{decision:"reject",note:"Electrical year must be an integer"}},home_heating_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Home heating input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-30,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Home heating must have been updated in the last 30 years"}):{decision:"reject",note:"Home heating year must be an integer"}},heating_source:function(e){return heating_type_enum=["central gas heat","thermostatically controlled electrical heat","wood","coal","pellet stove"],"string"!=typeof e?{decision:"reject",note:"Home heating year must be a string"}:heating_type_enum.includes(e)?["wood","coal","pellet stove"].includes(e)?{decision:"refer",note:null}:{decision:"accept",note:null}:{decision:"reject",note:"Heat source must be in [central gas heat, thermostatically controlled electrical heat, wood, coal, pellet stove]"}},has_underground_fuel_tank:function(e){return"No"===e?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home has underground fuel tank"}:{decision:"reject",note:"Underground fuel tank must be yes or no"}},has_steel_braided_hose:function(e){return"Yes"===e?{decision:"accept",note:null}:"No"===e?{decision:"refer",note:null}:{decision:"reject",note:"Steel braided hose must be yes or no"}},has_water_shutoff:function(e){return"Yes"===e?{decision:"accept",note:null}:"No"===e?{decision:"refer",note:null}:{decision:"reject",note:"Water shutoff must be yes or no"}},has_circuit_breaker:function(e,i){return"No"===e||i>=1980?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home built before 1980 cannot have circuit breakers"}:{decision:"reject",note:"Circuit breaker must be yes or no"}}}},44:(e,i,t)=>{const{underwrite:o,knockout_names:n}=t(273),{SocotraPayloadConverter:r}=t(991),{entries_v1:s}=t(401),{entries_v2:l}=t(540),a={1:new r(s),2:new r(l)};e.exports={underwrite:o,knockout_names:n,transformer_hash:a}},66:e=>{e.exports={multi_family_unit_count:function(e){return Number.isInteger(e)?e>2?{decision:"reject",note:"We only allow homes with two units or less."}:e<=0?{decision:"reject",note:"Number of units must be greater than 0"}:{decision:"accept",note:null}:{decision:"reject",note:"Number of units must be an integer"}},primary_dwelling_is_insured:function(e){return"No"==e?{decision:"refer",note:null}:"Yes"==e?{decision:"accept",note:null}:{decision:"reject",note:"Primary dwelling insured value must be in ['yes', 'no']"}},full_replacement_value:function(e){return Number.isInteger(e)?e>6e6?{decision:"refer",note:null}:e<2e6?{decision:"reject",note:"We only insure homes greater than $1M"}:{decision:"accept",note:null}:{decision:"reject",note:"Full replacement value must be an integer"}},prior_carrier:function(e){return""===e?{decision:"refer",note:null}:"string"==typeof e?{decision:"accept",note:null}:{decision:"reject",note:"Prior Carrier Must be a string"}},occupation:function(e){return"string"!=typeof e?{decision:"reject",note:"Occupation must be a string"}:["Professional Athlete","Entertainer","Journalist"," Politician"].includes(e)?{decision:"refer",note:null}:{decision:"accept",note:null}}}},78:(e,i,t)=>{const{multi_family_unit_count:o,primary_dwelling_is_insured:n,full_replacement_value:r,prior_carrier:s,occupation:l}=t(66),{wf_variance:a,stand_wf_knockout:c}=t(575),{distance_to_coast:d,pool_features:_,farming_type:u,has_attractive_nuisance:p,degree_of_slope:f,flood_score:m}=t(752),{number_of_dogs:y,dog_history:w,dog_breeds:g,exotic_pets:h,number_of_mortgages:b,number_of_bankruptcies_judgements_or_liens:v,home_business_type:x,home_rental_type:j,same_address:k}=t(729),{is_vacant:N,under_renovation:F,plumbing_last_update_year:S,water_heater_last_update_year:I,electrical_last_update_year:Y,home_heating_last_update_year:V,heating_source:C,has_underground_fuel_tank:E,has_steel_braided_hose:A,has_water_shutoff:D,has_circuit_breaker:q}=t(10),{construction_type:H,siding_material:P,protection_class:O,roof_material:z,foundation_type:G,has_slab_foundation_plumbing:T,fire_protective_devices:M,theft_protective_devices:$,has_class_a_roof:W}=t(479),{check_claims_history:B}=t(529),L={multi_family_unit_count:o,primary_dwelling_insured:n,full_replacement_value:r,prior_carrier:s,wf_variance:a,flood_score:m,distance_to_coast:d,pool_features:_,number_of_dogs:y,dog_history:w,dog_breeds:g,exotic_pets:h,farming_type:u,number_of_mortgages:b,number_of_bankruptcies_judgements_or_liens:v,is_vacant:N,under_renovation:F,plumbing_last_update_year:S,water_heater_last_update_year:I,electrical_last_update_year:Y,home_heating_last_update_year:V,heating_source:C,has_underground_fuel_tank:E,has_steel_braided_hose:A,has_water_shutoff:D,home_business_type:x,has_attractive_nuisance:p,home_rental_type:j,degree_of_slope:f,construction_type:H,siding_material:P,protection_class:O,roof_material:z,foundation_type:G,has_slab_foundation_plumbing:T,fire_protective_devices:M,theft_protective_devices:$,occupation:l};e.exports={knockout:function(e,i){return L.hasOwnProperty(e)?L[e](i):{decision:"question_not_found",note:null}},has_circuit_breaker:q,same_address:k,knockout_names:function(){return Object.keys(L)},stand_wf_knockout:c,has_class_a_roof:W,check_claims_history:B}},273:(e,i,t)=>{const{knockout:o,knockout_names:n,same_address:r,stand_wf_knockout:s,has_circuit_breaker:l,has_class_a_roof:a,check_claims_history:c}=t(78);function d(e){let i=[];for(let t in e)"refer"===e[t]&&i.push(t);return i}function _(e){for(let i in e)if("reject"===e[i])return"reject";for(let i in e)if("refer"===e[i])return"refer";return"accept"}function u(e,i,t,o,n={}){o[i]=e.decision,n[i]=e.note,e.note&&t.push(e.note)}e.exports={underwrite:function(e,i=!0){let t,p={},f=[],m={};for(let t of n())(i||Object.keys(e).includes(t))&&u(o(t,e[t]),t,f,p,m);return(i||"address"in e&&"co_applicant_address"in e)&&u(r(e.address,e.co_applicant_address),"co_applicant_address",f,p,m),(i||"wf_score_mean"in e&&"arf"in e)&&(t=s(e.wf_score_mean,e.arf),u(t.underwriter_result,"wf_score_mean",f,p,m)),(i||"circuit_breaker"in e&&"year_built"in e)&&u(l(e.circuit_breaker,e.year_built),"circuit_breaker",f,p,m),(i||"class_a_roof"in e)&&u(a(e.class_a_roof,t.category),"roof_rating",f,p,m),(i||"claims"in e)&&u(c(e.claims),"claims",f,p,m),{decision:_(p),notes:f,refers:d(p),all_decisions:p,notes_dict:m}},knockout_names:n}},401:(e,i,t)=>{const{SocotraEntry:o}=t(630);entries_v1=[new o("quote_name","quote_name","quote.name"),new o("socotra_config_version","config_version","quote.version"),new o("fire_deductible","wf_deductible","exposure.dwelling.fields",parseFloat),new o("other_deductible","aop_deductible","exposure.dwelling.fields",parseInt),new o("water_deductible","water_deductible","exposure.dwelling.fields",parseInt),new o("square_feet","square_feet","exposure.dwelling.fields",void 0,parseInt),new o("stand_protect_discount","stand_protect_discount","exposure.dwelling.fields"),new o("multi_policy_discount","multi_policy_discount","exposure.dwelling.fields"),new o(void 0,"has_any_claim_history","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("roof_rating","roof_rating","exposure.dwelling.fields"),new o("slab_plumbing","slab_plumbing","exposure.dwelling.fields"),new o("foundation_type","foundation_type","exposure.dwelling.fields"),new o("siding_material","siding_material","exposure.dwelling.fields"),new o("distance_to_fire_department","dist_to_fire_department","exposure.dwelling.fields"),new o("protection_class","protection_class","exposure.dwelling.fields"),new o("purchase_year","property_purchase_year","exposure.dwelling.fields",void 0,parseInt),new o("roof_material","roof_material","exposure.dwelling.fields"),new o("presence_of_fence","fence","exposure.dwelling.fields"),new o("year_built","year_built","exposure.dwelling.fields"),new o("construction_type","construction_type","exposure.dwelling.fields"),new o("water_damage_limit","water_damage_limit","exposure.dwelling.fields"),new o("extended_dwelling_coverage","extended_dwelling_coverage","exposure.dwelling.fields"),new o("sprinkler","sprinkler","exposure.dwelling.fields"),new o("smoke","smoke","exposure.dwelling.fields"),new o("fire_alarm","fire_alarm_type","exposure.dwelling.fields"),new o("fire_ext","fire_ext","exposure.dwelling.fields"),new o("deadbolt","dead_bolt","exposure.dwelling.fields"),new o(void 0,"24_hour_security_guard","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("theft_alarm","theft_alarm_type","exposure.dwelling.fields"),new o("distance_to_neighboring_home","distance_to_nearest_home_ft","exposure.dwelling.fields"),new o("chimney_spark_arrestors","chimney_mesh_cover","exposure.dwelling.fields"),new o("ember_resistant_vents","ember_vents","exposure.dwelling.fields"),new o("enclosed_eaves","enclosed_eaves","exposure.dwelling.fields"),new o("fuel_tank_distance","propane_tank_proximity","exposure.dwelling.fields"),new o("ground_clearance","exterior_clearance","exposure.dwelling.fields"),new o("windows_frame_type","window_frame_type","exposure.dwelling.fields"),new o("windows_type","window_glass_type","exposure.dwelling.fields"),new o("replacement_cost","full_replacement_value","policy.fields",parseInt),new o("street_address","address","policy.fields"),new o("state","state","policy.fields"),new o("is_rental","is_rental","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("has_home_business","home_business","policy.fields"),new o("occupation","occupation","policy.fields"),new o("water_shutoff","water_shutoff_system","policy.fields"),new o("waterflow_alarm","waterflow_alarm","policy.fields"),new o("city","city","policy.fields"),new o("electrical_updated_year","electrical_last_updated","policy.fields"),new o("coverage_b","coverage_b","policy.fields",parseInt),new o("coverage_c","coverage_c","policy.fields",parseInt),new o("coverage_a","coverage_a","policy.fields",parseInt),new o("retrofitted","retrofit_1997","policy.fields"),new o("roof_replacement_year","roof_replaced_year","policy.fields"),new o("seismic_shutoff","seismic_shutoff","policy.fields"),new o("coverage_f","coverage_f","policy.fields"),new o("first_street_score","first_street_wf_score","policy.fields",parseInt),new o("degree_of_slope","degrees_of_slope","policy.fields"),new o("number_of_bankrupcies","bankruptcies_judgements_liens","policy.fields"),new o("coverage_d","coverage_d","policy.fields",parseInt),new o("coverage_e","coverage_e","policy.fields"),new o("gre_wf_score","gre_wf_score","policy.fields",parseFloat),new o("state","state","policy.fields"),new o("has_steel_braided_hoses","steel_braided_hoses","policy.fields"),new o("core_logic_wf_score","core_logic_score","policy.fields",parseInt),new o(void 0,"channel","policy.fields",(e=>{}),(e=>"Broker")),new o(void 0,"coverageForm","policy.fields",(e=>{}),(e=>"HO-5 Comprehensive")),new o("zip","zip","policy.fields"),new o("has_underground_fuel_tank","underground_fuel_tank","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("attractive_nuisance","has_attractive_nuisance","policy.fields"),new o("zesty_l2","zesty_l2","policy.fields",parseInt),new o("zesty_l1","zesty_l1","policy.fields",parseInt),new o("water_heater_update_year","water_heaters_last_updated","policy.fields"),new o("plumbing_updated_year","plumbing_last_updated","policy.fields"),new o("home_heating_update_year","home_heater_last_updated","policy.fields",void 0,(e=>""===e?null:e)),new o("insured_dob","date_of_birth","policy.fields"),new o("gre_arf","arf","policy.fields",parseFloat),new o("insured_dob","date_of_birth","policy.fields"),new o("flood_score","first_street_flood_score","policy.fields"),new o("home_heating_source","heating_source","policy.fields"),new o("horses","has_horses","policy.fields"),new o("metal_fittings_toilet_supply_line","metal_fittings","policy.fields"),new o("is_under_renovation","renovation","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("previous_insurance_company","pastCarrier","policy.fields"),new o("previous_policy_expiration_date","prevPolicyExpiration","policy.fields"),new o("previous_premium","prevPolicyPremium","policy.fields",void 0,parseInt),new o("fireshed_ID","fireshed_id","policy.fields"),new o("fireshed_code","fireshed_code","policy.fields"),new o("fireshed_capacity","fireshed_capacity","policy.fields",parseFloat),new o("county","county","policy.fields"),new o("ensemble_mean","wf_score_mean","policy.fields",parseFloat),new o("ensemble_variance","wf_score_variance","policy.fields",parseFloat),new o("wildfire_category","wf_score_category","policy.fields"),new o("has_additional_insured","has_co_applicant","policy.fields"),new o("months_unoccupied","months_unoccupied","policy.fields",(e=>null==e?"0":e)),new o("multifamily_unit_count","multi_family_unit_count","policy.fields",void 0,parseInt),new o("spouse_first_name","has_co_applicant","policy.fields",(e=>null),(e=>e?"Yes":"No")),new o("spouse_first_name","co_applicant_first_name","policy.fields"),new o("spouse_last_name","co_applicant_last_name","policy.fields"),new o("spouse_email","co_applicant_email","policy.fields"),new o("spouse_phone_number","co_applicant_phone_number","policy.fields"),new o("number_of_mortgages","num_mortgages","policy.fields"),new o("past_liens","bankruptcies_judgements_liens","policy.fields"),new o("property_id","retool_property_id","policy.fields"),new o("primary_dwelling_insured","primary_insured_by_stand","policy.fields",(e=>e||"Yes")),new o("lat","latitude","policy.fields",parseFloat),new o("lng","longitude","policy.fields",parseFloat),new o("count_of_solar_panels","has_solar_panels","exposure.dwelling.fields",...function(){let e={0:"No","1+":"Yes"},i={No:0,Yes:"1+"};return[e=>i[e],i=>e[i]]}()),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_id","producerId","policy.fields"),new o("producer_email","producerEmail","policy.fields"),new o("producer_name","producerName","policy.fields"),new o("producer_ascend_id","producer_ascend_id","policy.fields"),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_phone_number","producer_phone_number","policy.fields"),new o("producer_state","producer_state","policy.fields"),new o("producer_commission","commissionRate","policy.fields"),new o("producer_zip","producer_zip","policy.fields"),new o("producer_city","producer_city","policy.fields"),new o("producer_street_address","producer_street_address","policy.fields"),new o("producer_street_address2","producer_street_address_2","policy.fields"),new o("broker_license_number","distributor_license_number","policy.fields"),new o("broker_name","distributor_name","policy.fields"),new o("premium_calculated","indicated_policy_cost","policy.fields"),new o("withdrawal_reasons","withdrawal_reason","policy.fields.array"),new o("rejection_reasons","declination_reason","policy.fields.array"),new o("competing_carrier","competing_carrier","policy.fields"),new o("competing_pricing","competing_pricing","policy.fields"),new o("stand_second_approval","stand_second_approval","policy.fields"),new o("fronting_carrier_approval","fronting_carrier_approval","policy.fields"),new o("reinsurance_carrier_approved","reinsurance_carrier_approved","policy.fields"),new o("reinsurance_rate","reinsurance_rate","policy.fields"),new o("start_date","startTimestamp","effective_date"),new o("payment_schedule","paymentScheduleName","payment_schedule")],e.exports={entries_v1}},479:e=>{e.exports={construction_type:function(e){return"string"!=typeof e?{decision:"reject",note:"Construction type must be a string"}:["Concrete","Frame","Log","Masonry","Mobile / Manufactured","Steel","Modular"].includes(e)?["Concrete","Frame","Masonry","Steel"].includes(e)?{decision:"accept",note:null}:{decision:"reject",note:"Construction type not supported"}:{decision:"reject",note:"Construction type must be one of [Concrete, Frame, Log, Masonry, Mobile / Manufactured, Steel, Modular]"}},siding_material:function(e){return"string"!=typeof e?{decision:"reject",note:"Siding material must be a string"}:["Adobe","Aluminum / Steel","Asbestos","Brick / Masonry Veneer","Brick / Stone - Solid","Cement Fiber","Clapboard","Exterior Insulation Finishing System (EIFS)","Log","Stone Veneer","Stucco","Vinyl","Wood","Other - above descriptions do not apply"].includes(e)?["Log","Asbestos","Exterior Insulation Finishing System (EIFS)"].includes(e)?{decision:"reject",note:"Siding material not supported"}:"Wood"!==e?{decision:"accept",note:null}:void 0:{decision:"reject",note:"Siding material must be one of [Adobe, Aluminum / Steel, Asbestos, Brick / Masonry Veneer, Brick / Stone - Solid, Cement Fiber, Clapboard, Exterior Insulation Finishing System (EIFS), Log, Stone Veneer, Stucco, Vinyl, Wood, Other - above descriptions do not apply]"}},protection_class:function(e){let i=["1","2","3","4","5","6","7","8","8B","1Y","2Y","3Y","4Y","5Y","6Y","7Y","8Y","9","1X","2X","3X","4X","5X","6X","7X","8X","9","10","10W"];return"string"!=typeof e?{decision:"reject",note:"Protection class must be a string"}:i.includes(e)?["9","10"].includes(e)?{decision:"reject",note:"Protection class not supported"}:{decision:"accept",note:null}:{decision:"reject",note:`Protection class must be one of ${i}`}},roof_material:function(e){let i=["Architecture Shingles","Asphalt Fiberglass Composite","Clay-Tile-Slate","Concrete Tile","Corrugated Steel - Metal","Flat Foam Composite"," Flat Membrane","Flat Tar Gravel","Other","Wood Shake","Wood Shingle"];return"string"!=typeof e?{decision:"reject",note:"Roof material must be a string"}:i.includes(e)?["Wood Shake","Wood Shingle"].includes(e)?{decision:"reject",note:"Roof material not supported"}:{decision:"accept",note:null}:{decision:"reject",note:`Roof material must be one of ${i}`}},has_class_a_roof:function(e,i){return"string"!=typeof e?{decision:"reject",note:"Has class a roof must be a string"}:["Yes","No"].includes(e)?"Yes"===e||["A","B"].includes(i)?{decision:"accept",note:null}:{decision:"reject",note:"Homes in this wildfire category must have class a roofs"}:{decision:"reject",note:"Has class a roof must be Yes or No"}},foundation_type:function(e){let i=["Basement Finished","Basement Partially Finished","Basement Unfinished","Crawlspace","Other","Piers","Pilings","Stilts","Slab"];return"string"!=typeof e?{decision:"reject",note:"Foundation type must be a string"}:i.includes(e)?"Other"==e?{decision:"refer",note:null}:["Piers","Pilings","Stilts"].includes(e)?{decision:"reject",note:"Foundation type not supported"}:{decision:"accept",note:null}:{decision:"reject",note:`Foundation type must be one of ${i}`}},has_slab_foundation_plumbing:function(e){return"string"!=typeof e?{decision:"reject",note:"Has slab foundation plumbing must be a string"}:["Yes","No"].includes(e)?"Yes"===e?{decision:"reject",note:"Homes with slab foundation plumbing are not allowed"}:{decision:"accept",note:null}:{decision:"reject",note:"Has slab foundation plumbing must be Yes or No"}},fire_protective_devices:function(e){if(!Array.isArray(e))return{decision:"reject",note:"Fire protective devices must be a list"};let i=["Local","Central","Direct","Sprinkler","Fire Ext","Smoke","No"];return e.every((e=>i.includes(e)))?e.includes("Direct")||e.includes("Central")?{decision:"accept",note:null}:{decision:"reject",note:"Insufficient fire devices"}:{decision:"reject",note:`Unrecognized fire device type. Valid devices: ${i}`}},theft_protective_devices:function(e){return Array.isArray(e)?(device_types=["Dead Bolt","Local","Central","Direct","24 Hour Security Guard","No"],e.every((e=>device_types.includes(e)))?e.includes("Central")||e.includes("Direct")||e.includes("24 Hour Security Guard")?{decision:"accept",note:null}:{decision:"reject",note:"Insufficient theft device"}:{decision:"reject",note:`Unrecognized theft device type. Valid devices: ${device_types}`}):{decision:"reject",note:"Theft protective devices must be a list"}}}},529:e=>{e.exports={check_claims_history:function(e){if(!e)return{decision:"reject",note:"For Claims use empty instead of null"};let i=new Date,t=new Date,o=new Date;t.setFullYear(i.getFullYear()-5),o.setFullYear(i.getFullYear()-3);let n=e.filter((e=>e.date>t)),r=e.filter((e=>e.date>o));return n.length>2?{decision:"reject",note:"To many claims in the past 5 years"}:r.length>1?{decision:"reject",note:"To many claims in the past 3 years"}:{decision:"accept",note:null}}}},540:(e,i,t)=>{const{SocotraEntry:o}=t(630);entries_v2=[new o("quote_name","quote_name","quote.name"),new o("socotra_config_version","config_version","quote.version"),new o("fire_deductible","wf_deductible","exposure.dwelling.fields",parseFloat),new o("other_deductible","aop_deductible","exposure.dwelling.fields",parseInt),new o("water_deductible","water_deductible","exposure.dwelling.fields",parseInt),new o("square_feet","square_feet","exposure.dwelling.fields",void 0,parseInt),new o("stand_protect_discount","stand_protect_discount","exposure.dwelling.fields"),new o("multi_policy_discount","multi_policy_discount","exposure.dwelling.fields"),new o(void 0,"has_any_claim_history","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("roof_rating","roof_rating","exposure.dwelling.fields"),new o("slab_plumbing","slab_plumbing","exposure.dwelling.fields"),new o("foundation_type","foundation_type","exposure.dwelling.fields"),new o("siding_material","siding_material","exposure.dwelling.fields"),new o("distance_to_fire_department","dist_to_fire_department","exposure.dwelling.fields"),new o("protection_class","protection_class","exposure.dwelling.fields"),new o("purchase_year","property_purchase_year","exposure.dwelling.fields",void 0,parseInt),new o("roof_material","roof_material","exposure.dwelling.fields"),new o("presence_of_fence","fence","exposure.dwelling.fields"),new o("year_built","year_built","exposure.dwelling.fields"),new o("construction_type","construction_type","exposure.dwelling.fields"),new o("water_damage_limit","water_damage_limit","exposure.dwelling.fields"),new o("extended_dwelling_coverage","extended_dwelling_coverage","exposure.dwelling.fields"),new o("sprinkler","sprinkler","exposure.dwelling.fields"),new o("smoke","smoke","exposure.dwelling.fields"),new o("fire_alarm","fire_alarm_type","exposure.dwelling.fields"),new o("fire_ext","fire_ext","exposure.dwelling.fields"),new o("deadbolt","dead_bolt","exposure.dwelling.fields"),new o(void 0,"24_hour_security_guard","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("theft_alarm","theft_alarm_type","exposure.dwelling.fields"),new o("distance_to_neighboring_home","distance_to_nearest_home_ft","exposure.dwelling.fields"),new o("chimney_spark_arrestors","chimney_mesh_cover","exposure.dwelling.fields"),new o("ember_resistant_vents","ember_vents","exposure.dwelling.fields"),new o("enclosed_eaves","enclosed_eaves","exposure.dwelling.fields"),new o("fuel_tank_distance","propane_tank_proximity","exposure.dwelling.fields"),new o("ground_clearance","exterior_clearance","exposure.dwelling.fields"),new o("windows_frame_type","window_frame_type","exposure.dwelling.fields"),new o("windows_type","window_glass_type","exposure.dwelling.fields"),new o("replacement_cost","full_replacement_value","policy.fields",parseInt),new o("street_address","address","policy.fields"),new o("state","state","policy.fields"),new o("is_rental","is_rental","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("has_home_business","home_business","policy.fields"),new o("occupation","occupation","policy.fields"),new o("water_shutoff","water_shutoff_system","policy.fields"),new o("waterflow_alarm","waterflow_alarm","policy.fields"),new o("city","city","policy.fields"),new o("electrical_updated_year","electrical_last_updated","policy.fields"),new o("coverage_b","coverage_b","policy.fields",parseInt),new o("coverage_c","coverage_c","policy.fields",parseInt),new o("coverage_a","coverage_a","policy.fields",parseInt),new o("retrofitted","retrofit_1997","policy.fields"),new o("roof_replacement_year","roof_replaced_year","policy.fields"),new o("seismic_shutoff","seismic_shutoff","policy.fields"),new o("coverage_f","coverage_f","policy.fields"),new o("first_street_score","first_street_wf_score","policy.fields",parseInt),new o("degree_of_slope","degrees_of_slope","policy.fields"),new o("number_of_bankrupcies","bankruptcies_judgements_liens","policy.fields"),new o("coverage_d","coverage_d","policy.fields",parseInt),new o("coverage_e","coverage_e","policy.fields"),new o("gre_wf_score","gre_wf_score","policy.fields",parseFloat),new o("state","state","policy.fields"),new o("has_steel_braided_hoses","steel_braided_hoses","policy.fields"),new o("core_logic_wf_score","core_logic_score","policy.fields",parseInt),new o(void 0,"channel","policy.fields",(e=>{}),(e=>"Broker")),new o(void 0,"coverageForm","policy.fields",(e=>{}),(e=>"HO-5 Comprehensive")),new o("zip","zip","policy.fields"),new o("has_underground_fuel_tank","underground_fuel_tank","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("attractive_nuisance","has_attractive_nuisance","policy.fields"),new o("zesty_l2","zesty_l2","policy.fields",parseInt),new o("zesty_l1","zesty_l1","policy.fields",parseInt),new o("water_heater_update_year","water_heaters_last_updated","policy.fields"),new o("plumbing_updated_year","plumbing_last_updated","policy.fields"),new o("home_heating_update_year","home_heater_last_updated","policy.fields",void 0,(e=>""===e?null:e)),new o("insured_dob","date_of_birth","policy.fields"),new o("gre_arf","arf","policy.fields",parseFloat),new o("insured_dob","date_of_birth","policy.fields"),new o("flood_score","first_street_flood_score","policy.fields"),new o("home_heating_source","heating_source","policy.fields"),new o("horses","has_horses","policy.fields"),new o("metal_fittings_toilet_supply_line","metal_fittings","policy.fields"),new o("is_under_renovation","renovation","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("previous_insurance_company","pastCarrier","policy.fields"),new o("previous_policy_expiration_date","prevPolicyExpiration","policy.fields"),new o("previous_premium","prevPolicyPremium","policy.fields",void 0,parseInt),new o("fireshed_ID","fireshed_id","policy.fields"),new o("fireshed_code","fireshed_code","policy.fields"),new o("fireshed_capacity","fireshed_capacity","policy.fields",parseFloat),new o("county","county","policy.fields"),new o("ensemble_mean","wf_score_mean","policy.fields",parseFloat),new o("ensemble_variance","wf_score_variance","policy.fields",parseFloat),new o("wildfire_category","wf_score_category","policy.fields"),new o("has_additional_insured","has_co_applicant","policy.fields"),new o("months_unoccupied","months_unoccupied","policy.fields",(e=>null==e?"0":e)),new o("multifamily_unit_count","multi_family_unit_count","policy.fields",void 0,parseInt),new o("spouse_first_name","has_co_applicant","policy.fields",(e=>null),(e=>e?"Yes":"No")),new o("spouse_first_name","co_applicant_first_name","policy.fields"),new o("spouse_last_name","co_applicant_last_name","policy.fields"),new o("spouse_email","co_applicant_email","policy.fields"),new o("spouse_phone_number","co_applicant_phone_number","policy.fields"),new o("number_of_mortgages","num_mortgages","policy.fields"),new o("past_liens","bankruptcies_judgements_liens","policy.fields"),new o("property_id","retool_property_id","policy.fields"),new o("primary_dwelling_insured","primary_insured_by_stand","policy.fields",(e=>e||"Yes")),new o("lat","latitude","policy.fields",parseFloat),new o("lng","longitude","policy.fields",parseFloat),new o("count_of_solar_panels","has_solar_panels","exposure.dwelling.fields",...function(){let e={0:"No","1+":"Yes"},i={No:0,Yes:"1+"};return[e=>i[e],i=>e[i]]}()),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_id","producerId","policy.fields"),new o("producer_email","producerEmail","policy.fields"),new o("producer_name","producerName","policy.fields"),new o("producer_ascend_id","producer_ascend_id","policy.fields"),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_phone_number","producer_phone_number","policy.fields"),new o("producer_state","producer_state","policy.fields"),new o("producer_commission","commissionRate","policy.fields"),new o("producer_zip","producer_zip","policy.fields"),new o("producer_city","producer_city","policy.fields"),new o("producer_street_address","producer_street_address","policy.fields"),new o("producer_street_address2","producer_street_address_2","policy.fields"),new o("broker_license_number","distributor_license_number","policy.fields"),new o("broker_name","distributor_name","policy.fields"),new o("premium_calculated","indicated_policy_cost","policy.fields"),new o("withdrawal_reasons","withdrawal_reason","policy.fields.array"),new o("rejection_reasons","declination_reason","policy.fields.array"),new o("competing_carrier","competing_carrier","policy.fields"),new o("competing_pricing","competing_pricing","policy.fields"),new o("stand_second_approval","stand_second_approval","policy.fields"),new o("fronting_carrier_approval","fronting_carrier_approval","policy.fields"),new o("reinsurance_carrier_approved","reinsurance_carrier_approved","policy.fields"),new o("reinsurance_rate","reinsurance_rate","policy.fields"),new o("is_agreed_value","is_agreed_value","policy.fields"),new o("is_difference_in_condition","is_difference_in_condition","policy.fields"),new o("lead_source","lead_source","policy.fields",(e=>null)),new o("start_date","startTimestamp","effective_date"),new o("payment_schedule","paymentScheduleName","payment_schedule")],e.exports={entries_v2}},575:e=>{e.exports={stand_wf_knockout:function(e,i){return e<0||i<0?{category:"",underwriter_result:{decision:"reject",note:"Mean and ARF must be positive numbers"}}:Number.isFinite(i)&&Number.isFinite(e)?e>=.7?{category:"D",underwriter_result:{decision:"reject",note:"Stand WF mean must be less than or equal to 0.7"}}:i>=8?{category:"C",underwriter_result:{decision:"refer",note:null}}:i>=5||e>=.2?{category:"C",underwriter_result:{decision:"accept",note:null}}:e>=.1?{category:"B",underwriter_result:{decision:"accept",note:null}}:{category:"A",underwriter_result:{decision:"accept",note:null}}:{category:"",underwriter_result:{decision:"reject",note:"ARF must be a number"}}},wf_variance:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Variance must be a positive number."}:e<=.09?{decision:"accept",note:null}:{decision:"refer",note:null}:{decision:"reject",note:"Variance must be a number."}}}},630:e=>{const i=Object.freeze(["policy.fields","policy.fields.array","exposure.dwelling.fields","policy.group","policy","exposure.dwelling.group","quote.name","effective_date","payment_schedule","quote.version"]);e.exports={SocotraEntry:class{constructor(e,t,o,n=e=>e,r=e=>e){if(!i.includes(o))throw new Error(`Unsupported Socotra Location: ${o}`);this.retool_id=e,this.socotra_id=t,this.socotra_location=o,this.to_scotra_func=r,this.to_retool_func=n}socotra_create_response(e,i){let t=this.to_scotra_func(e[this.retool_id]);if(this.socotra_location.includes("policy.fields"))i.fieldValues[this.socotra_id]=t;else if("exposure.dwelling.fields"===this.socotra_location)i.exposures[0].fieldValues[this.socotra_id]=t;else if("quote.name"===this.socotra_location);else if("effective_date"===this.socotra_location){const e=new Date(`${t}T00:00:00-08:00`),o=e.getTime();i.policyStartTimestamp=o;const n=new Date(e);n.setFullYear(e.getFullYear()+1),i.policyEndTimestamp=n.getTime()}else if("payment_schedule"===this.socotra_location)["upfront","quarterly"].includes(t)&&(i.paymentScheduleName=t);else{if("quote.version"!==this.socotra_location)throw new Error(`Location Not implemented: ${JSON.stringify(this)}`);i.configVersion=t}}retool_response(e,i){let t,o;if(this.socotra_location.includes("policy.fields"))t=e.characteristics.fieldValues[this.socotra_id];else{if("exposure.dwelling.fields"!==this.socotra_location){if("quote.name"===this.socotra_location)return void(i[this.retool_id]=e.name);if("effective_date"===this.socotra_location){let t=parseInt(e.characteristics[this.socotra_id])/1e3;var n=new Date(0);return n.setUTCSeconds(t),void(i[this.retool_id]=`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`)}if("payment_schedule"===this.socotra_location)return void(i[this.retool_id]=e[this.socotra_id]);if("quote.version"==this.socotra_location)return;throw new Error(`Location Not implemented: ${JSON.stringify(this)}`)}t=e.exposures.find((e=>"dwelling"===e.name)).characteristics.at(-1).fieldValues[this.socotra_id]}o=this.socotra_location.includes("array")?t:t?.[0]??null,o=this.to_retool_func(o),i[this.retool_id]=o}socotra_update(e,i){let t=this.to_scotra_func(e[this.retool_id]);if(this.socotra_location.includes("policy.fields"))i.fieldValues[this.socotra_id]=t;else if("exposure.dwelling.fields"===this.socotra_location)i.updateExposures[0].fieldValues[this.socotra_id]=t;else if("quote.name"===this.socotra_location)i.name=t;else if("effective_date"===this.socotra_location){const e=new Date(`${t}T00:00:00-08:00`);i.policyStartTimestamp=e.getTime();const o=new Date(e);o.setFullYear(e.getFullYear()+1),i.policyEndTimestamp=o.getTime()}else{if("payment_schedule"!==this.socotra_location){if("quote.version"===this.socotra_location)return;throw new Error(`Location Not implemented: ${JSON.stringify(this)}`)}["upfront","quarterly"].includes(t)&&(i.paymentScheduleName=t)}}static build_group(e,i){return{name:i}}static socotra_create_policy_template(e){return{policyholderLocator:e,productName:"homeowners",finalize:!1,paymentScheduleName:"upfront",exposures:[{exposureName:"dwelling",perils:[{name:"wildfire_expense",fieldValues:{},fieldGroups:[]},{name:"fire_following_earthquake",fieldValues:{},fieldGroups:[]},{name:"liability",fieldValues:{},fieldGroups:[]},{name:"other",fieldValues:{},fieldGroups:[]},{name:"theft",fieldValues:{},fieldGroups:[]},{name:"water_cat",fieldValues:{},fieldGroups:[]},{name:"water_excluding_cat",fieldValues:{},fieldGroups:[]},{name:"wildfire",fieldValues:{},fieldGroups:[]},{name:"wind_cat",fieldValues:{},fieldGroups:[]},{name:"wind_excluding_cat",fieldValues:{},fieldGroups:[]},{name:"fire",fieldValues:{},fieldGroups:[]},{name:"fac_prem",fieldValues:{},fieldGroups:[]},{name:"minimum_premium",fieldValues:{},fieldGroups:[]}],fieldValues:{},fieldGroups:[]}],fieldValues:{},fieldGroups:[],configVersion:-1}}static socotra_create_update_template(e){return{updateExposures:[{exposureLocator:e,fieldValues:{},fieldGroups:[]}],fieldValues:{}}}}}},729:e=>{e.exports={number_of_dogs:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Number of dogs must be a positive number."}:e<4?{decision:"accept",note:null}:{decision:"reject",note:"Owner has 4 or more dogs"}:{decision:"reject",note:"Number of dogs must be a number."}},dog_history:function(e){return"Yes"==e?{decision:"reject",note:"Has a dog with a history of aggressive behavior"}:"No"==e?{decision:"accept",note:null}:{decision:"reject",note:"Dog has history must be Yes or No."}},dog_breeds:function(e){return Array.isArray(e)?e.every((e=>"non-guard dog of other breeds"===e))?{decision:"accept",note:null}:{decision:"reject",note:"Dog of given breed not allowed"}:{decision:"reject",note:"Dog breed must be a list"}},exotic_pets:function(e){return"Yes"==e?{decision:"reject",note:"Has an exotic pet"}:"No"==e?{decision:"accept",note:null}:{decision:"reject",note:"Has exotic pet must be Yes or No."}},number_of_mortgages:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Number of mortgages must be a positive number."}:e<2?{decision:"accept",note:null}:{decision:"refer",note:null}:{decision:"reject",note:"Number of mortgages must be a number."}},number_of_bankruptcies_judgements_or_liens:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Number of bankruptcies, judgements, or liens must be a positive number"}:0===e?{decision:"accept",note:null}:{decision:"reject",note:"Has bankruptcies, judgements, or liens"}:{decision:"reject",note:"Number of bankruptcies, judgements, or liens must be a number"}},home_business_type:function(e){return"string"!=typeof e?{decision:"reject",note:"Home business type must be a string"}:["yes - day care","yes - other","no"].includes(e)?"no"==e?{decision:"accept",note:null}:"yes - day care"==e?{decision:"reject",note:"Cannot insure daycare"}:{decision:"refer",note:null}:{decision:"reject",note:"Home business type must be in [yes - day care, yes - other, no]"}},home_rental_type:function(e){return"string"!=typeof e?{decision:"reject",note:"Home rental type must be a string"}:["short-term rentals less than 6 months of the year","short term rentals more than 6 months of the year","timeshare","no"].includes(e)?"no"==e?{decision:"accept",note:null}:["short-term rentals less than 6 months of the year","timeshare"].includes(e)?{decision:"refer",note:null}:{decision:"reject",note:"Cannot insure rentals longer than 6 months"}:{decision:"reject",note:"Home rental type must be in [short-term rentals less than 6 months of the year, short term rentals more than 6 months of the year, timeshare, no]"}},same_address:function(e,i){return e===i?{decision:"accept",note:null}:{decision:"reject",note:"Co-Applicant must have same address as Applicant."}}}},752:e=>{e.exports={distance_to_coast:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Distance to coast must be a positive number."}:e>.19?{decision:"accept",note:null}:{decision:"refer",note:null}:{decision:"reject",note:"Distance to coast must be a number."}},pool_features:function(e){if(!Array.isArray(e))return{decision:"reject",note:"Pool features must be a list."};let i=e.includes("Inground")&&(e.includes("Electric retractable safety cover")||e.includes("Fenced with self-locking gate"));return i=i||e.includes("Above Ground")&&e.includes("Retractable/removable ladder"),e.includes("Diving Board")||e.includes("Slide")?{decision:"refer",note:null}:i?{decision:"accept",note:null}:{decision:"refer",note:null}},farming_type:function(e){let i=["Farming activities produce income","Incidental or hobby farming","Vineyard","None"];return"string"!=typeof e?{decision:"reject",note:"Farming type must be a string"}:i.includes(e)?"Vineyard"==e?{decision:"refer",note:null}:"Farming activities produce income"==e?{decision:"reject",note:"Cannot insure commercial farms"}:{decision:"accept",note:null}:{decision:"reject",note:`Farming type must be in [${i}]`}},has_attractive_nuisance:function(e){return"Yes"==e?{decision:"refer",note:null}:"No"==e?{decision:"accept",note:null}:{decision:"reject",note:"Has attractive nuisance must be Yes or No."}},degree_of_slope:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Degree of slope must be a positive number."}:e>30?{decision:"reject",note:"Slope greater than 30 degrees"}:{decision:"accept",note:null}:{decision:"reject",note:"Degree of slope must be a number."}},flood_score:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Flood score must be a positive number."}:e<9?{decision:"accept",note:null}:{decision:"reject",note:"Flood risk is too high"}:{decision:"reject",note:"Flood score must be a number."}}}},991:(e,i,t)=>{const{SocotraEntry:o}=t(630);e.exports={SocotraPayloadConverter:class{constructor(e){this.entries=e}policy_holder_payload(e){let i=[],t=["owner_first_name","owner_last_name","owner_email"];for(const o of t)e[o]||i.push(o);if(0==i.length){let i={first_name:e.owner_first_name,last_name:e.owner_last_name,email:e.owner_email,phone_number:e.owner_phone_number,mailing_street_address:e.mailing_street_address,mailing_street_address_2:e.mailing_street_address2,mailing_city:e.mailing_city,mailing_state:e.mailing_state,mailing_zip:e.mailing_zip,ofac_date:e.ofac_date_pulled,ofac_reason:e.ofac_reason,ofac_outcome:e.ofac_outcome};return{status:"success",error_message:"",payload:{completed:!0,values:this.stripNoneValues(i,!0,!0,!1)}}}return{payload:{},status:"error",error_message:`must include the following fields [${i}]`}}new_policy_payload(e,i){let t=o.socotra_create_policy_template(i);return this.entries.forEach((i=>{i.socotra_create_response(e,t)})),{payload:this.stripNoneValues(t,!0,!0,!0),error_message:"",status:"success"}}quote_to_retool_payload(e){let i={};return this.entries.forEach((t=>{t.retool_response(e,i)})),{payload:this.stripNoneValues(i,!1,!0,!1),error_message:"",status:"success"}}retool_to_quote_updated(e,i){let t=this.quote_to_retool_payload(i).payload;Object.keys(e).forEach((i=>{if(Array.isArray(e[i])){let o=e[i],n=t[i];JSON.stringify(o)===JSON.stringify(n)&&delete e[i]}else t[i]===e[i]&&delete e[i]}));let n=i.exposures.find((e=>"dwelling"===e.name)).locator,r=o.socotra_create_update_template(n);return this.entries.forEach((i=>{Object.keys(e).includes(i.retool_id)&&i.socotra_update(e,r)})),r=this.stripNoneValues(r,!0,!0,!1),0===Object.keys(r.updateExposures[0].fieldValues).length&&delete r.updateExposures,0===Object.keys(r.fieldValues).length&&delete r.fieldValues,{payload:r,error_message:"",status:"success"}}stripNoneValues(e,i,t,o){return i&&(e=this.stripNulls(e,(e=>null==e))),t&&(e=this.stripNulls(e,(e=>void 0===e))),o&&(e=this.stripNulls(e,(e=>Number.isNaN(e)))),e}stripNulls(e,i){let t=e=>this.stripNulls(e,i);return Array.isArray(e)?e.map(t).filter((e=>!i(e))):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map((([e,i])=>[e,t(i)])).filter((([e,t])=>!i(t)))):e}}}}},i={},function t(o){var n=i[o];if(void 0!==n)return n.exports;var r=i[o]={exports:{}};return e[o](r,r.exports,t),r.exports}(44);var e,i}));
1
+ !function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.stand_underwriter=i():e.stand_underwriter=i()}(this,(()=>{return e={10:e=>{e.exports={is_vacant:function(e){return"No"===e?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home is vacant"}:{decision:"reject",note:"Vacant must be yes or no"}},under_renovation:function(e){return"No"===e?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home is under renovation"}:{decision:"reject",note:"Under renovation must be yes or no"}},plumbing_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Plumbing input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-30,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Plumbing must have been updated in the last 30 years"}):{decision:"reject",note:"Plumbing year must be an integer"}},water_heater_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Water heater input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-10,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Water heater must have been updated in the last 10 years"}):{decision:"reject",note:"Water heater year must be an integer"}},electrical_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Electrical input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-30,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Electrical must have been updated in the last 30 years"}):{decision:"reject",note:"Electrical year must be an integer"}},home_heating_last_update_year:function(e){return Number.isInteger(e)?e<1600||e>3e3?{decision:"reject",note:"Home heating input should be the year it was last updated not the age"}:(year_threshold=(new Date).getFullYear()-30,e>=year_threshold?{decision:"accept",note:null}:{decision:"reject",note:"Home heating must have been updated in the last 30 years"}):{decision:"reject",note:"Home heating year must be an integer"}},heating_source:function(e){return heating_type_enum=["central gas heat","thermostatically controlled electrical heat","wood","coal","pellet stove"],"string"!=typeof e?{decision:"reject",note:"Home heating year must be a string"}:heating_type_enum.includes(e)?["wood","coal","pellet stove"].includes(e)?{decision:"refer",note:null}:{decision:"accept",note:null}:{decision:"reject",note:"Heat source must be in [central gas heat, thermostatically controlled electrical heat, wood, coal, pellet stove]"}},has_underground_fuel_tank:function(e){return"No"===e?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home has underground fuel tank"}:{decision:"reject",note:"Underground fuel tank must be yes or no"}},has_steel_braided_hose:function(e){return"Yes"===e?{decision:"accept",note:null}:"No"===e?{decision:"refer",note:null}:{decision:"reject",note:"Steel braided hose must be yes or no"}},has_water_shutoff:function(e){return"Yes"===e?{decision:"accept",note:null}:"No"===e?{decision:"refer",note:null}:{decision:"reject",note:"Water shutoff must be yes or no"}},has_circuit_breaker:function(e,i){return"No"===e||i>=1980?{decision:"accept",note:null}:"Yes"===e?{decision:"reject",note:"Home built before 1980 cannot have circuit breakers"}:{decision:"reject",note:"Circuit breaker must be yes or no"}}}},44:(e,i,t)=>{const{underwrite:o,knockout_names:n}=t(273),{SocotraPayloadConverter:r}=t(991),{entries_v1:s}=t(401),{entries_v2:l}=t(540),a={1:new r(s),2:new r(l)};e.exports={underwrite:o,knockout_names:n,transformer_hash:a}},66:e=>{e.exports={multi_family_unit_count:function(e){return Number.isInteger(e)?e>2?{decision:"reject",note:"We only allow homes with two units or less."}:e<=0?{decision:"reject",note:"Number of units must be greater than 0"}:{decision:"accept",note:null}:{decision:"reject",note:"Number of units must be an integer"}},primary_dwelling_is_insured:function(e){return"No"==e?{decision:"refer",note:null}:"Yes"==e?{decision:"accept",note:null}:{decision:"reject",note:"Primary dwelling insured value must be in ['yes', 'no']"}},full_replacement_value:function(e){return Number.isInteger(e)?e>6e6?{decision:"refer",note:null}:e<2e6?{decision:"reject",note:"We only insure homes greater than $1M"}:{decision:"accept",note:null}:{decision:"reject",note:"Full replacement value must be an integer"}},prior_carrier:function(e){return""===e?{decision:"refer",note:null}:"string"==typeof e?{decision:"accept",note:null}:{decision:"reject",note:"Prior Carrier Must be a string"}},occupation:function(e){return"string"!=typeof e?{decision:"reject",note:"Occupation must be a string"}:["Professional Athlete","Entertainer","Journalist"," Politician"].includes(e)?{decision:"refer",note:null}:{decision:"accept",note:null}}}},78:(e,i,t)=>{const{multi_family_unit_count:o,primary_dwelling_is_insured:n,full_replacement_value:r,prior_carrier:s,occupation:l}=t(66),{wf_variance:a,stand_wf_knockout:c}=t(575),{distance_to_coast:d,pool_features:_,farming_type:u,has_attractive_nuisance:p,degree_of_slope:f,flood_score:m}=t(752),{number_of_dogs:y,dog_history:w,dog_breeds:g,exotic_pets:h,number_of_mortgages:b,number_of_bankruptcies_judgements_or_liens:v,home_business_type:x,home_rental_type:j,same_address:k}=t(729),{is_vacant:N,under_renovation:F,plumbing_last_update_year:S,water_heater_last_update_year:I,electrical_last_update_year:Y,home_heating_last_update_year:V,heating_source:C,has_underground_fuel_tank:E,has_steel_braided_hose:A,has_water_shutoff:D,has_circuit_breaker:q}=t(10),{construction_type:H,siding_material:P,protection_class:O,roof_material:z,foundation_type:G,has_slab_foundation_plumbing:T,fire_protective_devices:M,theft_protective_devices:$,has_class_a_roof:W}=t(479),{check_claims_history:B}=t(529),L={multi_family_unit_count:o,primary_dwelling_insured:n,full_replacement_value:r,prior_carrier:s,wf_variance:a,flood_score:m,distance_to_coast:d,pool_features:_,number_of_dogs:y,dog_history:w,dog_breeds:g,exotic_pets:h,farming_type:u,number_of_mortgages:b,number_of_bankruptcies_judgements_or_liens:v,is_vacant:N,under_renovation:F,plumbing_last_update_year:S,water_heater_last_update_year:I,electrical_last_update_year:Y,home_heating_last_update_year:V,heating_source:C,has_underground_fuel_tank:E,has_steel_braided_hose:A,has_water_shutoff:D,home_business_type:x,has_attractive_nuisance:p,home_rental_type:j,degree_of_slope:f,construction_type:H,siding_material:P,protection_class:O,roof_material:z,foundation_type:G,has_slab_foundation_plumbing:T,fire_protective_devices:M,theft_protective_devices:$,occupation:l};e.exports={knockout:function(e,i){return L.hasOwnProperty(e)?L[e](i):{decision:"question_not_found",note:null}},has_circuit_breaker:q,same_address:k,knockout_names:function(){return Object.keys(L)},stand_wf_knockout:c,has_class_a_roof:W,check_claims_history:B}},273:(e,i,t)=>{const{knockout:o,knockout_names:n,same_address:r,stand_wf_knockout:s,has_circuit_breaker:l,has_class_a_roof:a,check_claims_history:c}=t(78);function d(e){let i=[];for(let t in e)"refer"===e[t]&&i.push(t);return i}function _(e){for(let i in e)if("reject"===e[i])return"reject";for(let i in e)if("refer"===e[i])return"refer";return"accept"}function u(e,i,t,o,n={}){o[i]=e.decision,n[i]=e.note,e.note&&t.push(e.note)}e.exports={underwrite:function(e,i=!0){let t,p={},f=[],m={};for(let t of n())(i||Object.keys(e).includes(t))&&u(o(t,e[t]),t,f,p,m);return(i||"address"in e&&"co_applicant_address"in e)&&u(r(e.address,e.co_applicant_address),"co_applicant_address",f,p,m),(i||"wf_score_mean"in e&&"arf"in e)&&(t=s(e.wf_score_mean,e.arf),u(t.underwriter_result,"wf_score_mean",f,p,m)),(i||"circuit_breaker"in e&&"year_built"in e)&&u(l(e.circuit_breaker,e.year_built),"circuit_breaker",f,p,m),(i||"class_a_roof"in e)&&u(a(e.class_a_roof,t.category),"roof_rating",f,p,m),(i||"claims"in e)&&u(c(e.claims),"claims",f,p,m),{decision:_(p),notes:f,refers:d(p),all_decisions:p,notes_dict:m}},knockout_names:n}},401:(e,i,t)=>{const{SocotraEntry:o}=t(630);entries_v1=[new o("quote_name","quote_name","quote.name"),new o("socotra_config_version","config_version","quote.version"),new o("fire_deductible","wf_deductible","exposure.dwelling.fields",parseFloat),new o("other_deductible","aop_deductible","exposure.dwelling.fields",parseInt),new o("water_deductible","water_deductible","exposure.dwelling.fields",parseInt),new o("square_feet","square_feet","exposure.dwelling.fields",void 0,parseInt),new o("stand_protect_discount","stand_protect_discount","exposure.dwelling.fields"),new o("multi_policy_discount","multi_policy_discount","exposure.dwelling.fields"),new o(void 0,"has_any_claim_history","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("roof_rating","roof_rating","exposure.dwelling.fields"),new o("slab_plumbing","slab_plumbing","exposure.dwelling.fields"),new o("foundation_type","foundation_type","exposure.dwelling.fields"),new o("siding_material","siding_material","exposure.dwelling.fields"),new o("distance_to_fire_department","dist_to_fire_department","exposure.dwelling.fields"),new o("protection_class","protection_class","exposure.dwelling.fields"),new o("purchase_year","property_purchase_year","exposure.dwelling.fields",void 0,parseInt),new o("roof_material","roof_material","exposure.dwelling.fields"),new o("presence_of_fence","fence","exposure.dwelling.fields"),new o("year_built","year_built","exposure.dwelling.fields"),new o("construction_type","construction_type","exposure.dwelling.fields"),new o("water_damage_limit","water_damage_limit","exposure.dwelling.fields"),new o("extended_dwelling_coverage","extended_dwelling_coverage","exposure.dwelling.fields"),new o("sprinkler","sprinkler","exposure.dwelling.fields"),new o("smoke","smoke","exposure.dwelling.fields"),new o("fire_alarm","fire_alarm_type","exposure.dwelling.fields"),new o("fire_ext","fire_ext","exposure.dwelling.fields"),new o("deadbolt","dead_bolt","exposure.dwelling.fields"),new o(void 0,"24_hour_security_guard","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("theft_alarm","theft_alarm_type","exposure.dwelling.fields"),new o("distance_to_neighboring_home","distance_to_nearest_home_ft","exposure.dwelling.fields"),new o("chimney_spark_arrestors","chimney_mesh_cover","exposure.dwelling.fields"),new o("ember_resistant_vents","ember_vents","exposure.dwelling.fields"),new o("enclosed_eaves","enclosed_eaves","exposure.dwelling.fields"),new o("fuel_tank_distance","propane_tank_proximity","exposure.dwelling.fields"),new o("ground_clearance","exterior_clearance","exposure.dwelling.fields"),new o("windows_frame_type","window_frame_type","exposure.dwelling.fields"),new o("windows_type","window_glass_type","exposure.dwelling.fields"),new o("replacement_cost","full_replacement_value","policy.fields",parseInt),new o("street_address","address","policy.fields"),new o("state","state","policy.fields"),new o("is_rental","is_rental","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("has_home_business","home_business","policy.fields"),new o("occupation","occupation","policy.fields"),new o("water_shutoff","water_shutoff_system","policy.fields"),new o("waterflow_alarm","waterflow_alarm","policy.fields"),new o("city","city","policy.fields"),new o("electrical_updated_year","electrical_last_updated","policy.fields"),new o("coverage_b","coverage_b","policy.fields",parseInt),new o("coverage_c","coverage_c","policy.fields",parseInt),new o("coverage_a","coverage_a","policy.fields",parseInt),new o("retrofitted","retrofit_1997","policy.fields"),new o("roof_replacement_year","roof_replaced_year","policy.fields"),new o("seismic_shutoff","seismic_shutoff","policy.fields"),new o("coverage_f","coverage_f","policy.fields"),new o("first_street_score","first_street_wf_score","policy.fields",parseInt),new o("degree_of_slope","degrees_of_slope","policy.fields"),new o("number_of_bankrupcies","bankruptcies_judgements_liens","policy.fields"),new o("coverage_d","coverage_d","policy.fields",parseInt),new o("coverage_e","coverage_e","policy.fields"),new o("gre_wf_score","gre_wf_score","policy.fields",parseFloat),new o("state","state","policy.fields"),new o("has_steel_braided_hoses","steel_braided_hoses","policy.fields"),new o("core_logic_wf_score","core_logic_score","policy.fields",parseInt),new o(void 0,"channel","policy.fields",(e=>{}),(e=>"Broker")),new o(void 0,"coverageForm","policy.fields",(e=>{}),(e=>"HO-5 Comprehensive")),new o("zip","zip","policy.fields"),new o("has_underground_fuel_tank","underground_fuel_tank","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("attractive_nuisance","has_attractive_nuisance","policy.fields"),new o("zesty_l2","zesty_l2","policy.fields",parseInt),new o("zesty_l1","zesty_l1","policy.fields",parseInt),new o("water_heater_update_year","water_heaters_last_updated","policy.fields"),new o("plumbing_updated_year","plumbing_last_updated","policy.fields"),new o("home_heating_update_year","home_heater_last_updated","policy.fields",void 0,(e=>""===e?null:e)),new o("insured_dob","date_of_birth","policy.fields"),new o("gre_arf","arf","policy.fields",parseFloat),new o("insured_dob","date_of_birth","policy.fields"),new o("flood_score","first_street_flood_score","policy.fields"),new o("home_heating_source","heating_source","policy.fields"),new o("horses","has_horses","policy.fields"),new o("metal_fittings_toilet_supply_line","metal_fittings","policy.fields"),new o("is_under_renovation","renovation","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("previous_insurance_company","pastCarrier","policy.fields"),new o("previous_policy_expiration_date","prevPolicyExpiration","policy.fields"),new o("previous_premium","prevPolicyPremium","policy.fields",void 0,parseInt),new o("fireshed_ID","fireshed_id","policy.fields"),new o("fireshed_code","fireshed_code","policy.fields"),new o("fireshed_capacity","fireshed_capacity","policy.fields",parseFloat),new o("county","county","policy.fields"),new o("ensemble_mean","wf_score_mean","policy.fields",parseFloat),new o("ensemble_variance","wf_score_variance","policy.fields",parseFloat),new o("wildfire_category","wf_score_category","policy.fields"),new o("has_additional_insured","has_co_applicant","policy.fields"),new o("months_unoccupied","months_unoccupied","policy.fields",(e=>null==e?"0":e)),new o("multifamily_unit_count","multi_family_unit_count","policy.fields",void 0,parseInt),new o("spouse_first_name","has_co_applicant","policy.fields",(e=>null),(e=>e?"Yes":"No")),new o("spouse_first_name","co_applicant_first_name","policy.fields"),new o("spouse_last_name","co_applicant_last_name","policy.fields"),new o("spouse_email","co_applicant_email","policy.fields"),new o("spouse_phone_number","co_applicant_phone_number","policy.fields"),new o("number_of_mortgages","num_mortgages","policy.fields"),new o("past_liens","bankruptcies_judgements_liens","policy.fields"),new o("property_id","retool_property_id","policy.fields"),new o("primary_dwelling_insured","primary_insured_by_stand","policy.fields",(e=>e||"Yes")),new o("lat","latitude","policy.fields",parseFloat),new o("lng","longitude","policy.fields",parseFloat),new o("count_of_solar_panels","has_solar_panels","exposure.dwelling.fields",...function(){let e={0:"No","1+":"Yes"},i={No:0,Yes:"1+"};return[e=>i[e],i=>e[i]]}()),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_id","producerId","policy.fields"),new o("producer_email","producerEmail","policy.fields"),new o("producer_name","producerName","policy.fields"),new o("producer_ascend_id","producer_ascend_id","policy.fields"),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_phone_number","producer_phone_number","policy.fields"),new o("producer_state","producer_state","policy.fields"),new o("producer_commission","commissionRate","policy.fields"),new o("producer_zip","producer_zip","policy.fields"),new o("producer_city","producer_city","policy.fields"),new o("producer_street_address","producer_street_address","policy.fields"),new o("producer_street_address2","producer_street_address_2","policy.fields"),new o("broker_license_number","distributor_license_number","policy.fields"),new o("broker_name","distributor_name","policy.fields"),new o("premium_calculated","indicated_policy_cost","policy.fields"),new o("withdrawal_reasons","withdrawal_reason","policy.fields.array"),new o("rejection_reasons","declination_reason","policy.fields.array"),new o("competing_carrier","competing_carrier","policy.fields"),new o("competing_pricing","competing_pricing","policy.fields"),new o("stand_second_approval","stand_second_approval","policy.fields"),new o("fronting_carrier_approval","fronting_carrier_approval","policy.fields"),new o("reinsurance_carrier_approved","reinsurance_carrier_approved","policy.fields"),new o("reinsurance_rate","reinsurance_rate","policy.fields"),new o("start_date","startTimestamp","effective_date"),new o("payment_schedule","paymentScheduleName","payment_schedule")],e.exports={entries_v1}},479:e=>{e.exports={construction_type:function(e){return"string"!=typeof e?{decision:"reject",note:"Construction type must be a string"}:["Concrete","Frame","Log","Masonry","Mobile / Manufactured","Steel","Modular"].includes(e)?["Concrete","Frame","Masonry","Steel"].includes(e)?{decision:"accept",note:null}:{decision:"reject",note:"Construction type not supported"}:{decision:"reject",note:"Construction type must be one of [Concrete, Frame, Log, Masonry, Mobile / Manufactured, Steel, Modular]"}},siding_material:function(e){return"string"!=typeof e?{decision:"reject",note:"Siding material must be a string"}:["Adobe","Aluminum / Steel","Asbestos","Brick / Masonry Veneer","Brick / Stone - Solid","Cement Fiber","Clapboard","Exterior Insulation Finishing System (EIFS)","Log","Stone Veneer","Stucco","Vinyl","Wood","Other - above descriptions do not apply"].includes(e)?["Log","Asbestos","Exterior Insulation Finishing System (EIFS)"].includes(e)?{decision:"reject",note:"Siding material not supported"}:"Wood"!==e?{decision:"accept",note:null}:void 0:{decision:"reject",note:"Siding material must be one of [Adobe, Aluminum / Steel, Asbestos, Brick / Masonry Veneer, Brick / Stone - Solid, Cement Fiber, Clapboard, Exterior Insulation Finishing System (EIFS), Log, Stone Veneer, Stucco, Vinyl, Wood, Other - above descriptions do not apply]"}},protection_class:function(e){let i=["1","2","3","4","5","6","7","8","8B","1Y","2Y","3Y","4Y","5Y","6Y","7Y","8Y","9","1X","2X","3X","4X","5X","6X","7X","8X","9","10","10W"];return"string"!=typeof e?{decision:"reject",note:"Protection class must be a string"}:i.includes(e)?["9","10"].includes(e)?{decision:"reject",note:"Protection class not supported"}:{decision:"accept",note:null}:{decision:"reject",note:`Protection class must be one of ${i}`}},roof_material:function(e){let i=["Architecture Shingles","Asphalt Fiberglass Composite","Clay-Tile-Slate","Concrete Tile","Corrugated Steel - Metal","Flat Foam Composite"," Flat Membrane","Flat Tar Gravel","Other","Wood Shake","Wood Shingle"];return"string"!=typeof e?{decision:"reject",note:"Roof material must be a string"}:i.includes(e)?["Wood Shake","Wood Shingle"].includes(e)?{decision:"reject",note:"Roof material not supported"}:{decision:"accept",note:null}:{decision:"reject",note:`Roof material must be one of ${i}`}},has_class_a_roof:function(e,i){return"string"!=typeof e?{decision:"reject",note:"Has class a roof must be a string"}:["Yes","No"].includes(e)?"Yes"===e||["A","B"].includes(i)?{decision:"accept",note:null}:{decision:"reject",note:"Homes in this wildfire category must have class a roofs"}:{decision:"reject",note:"Has class a roof must be Yes or No"}},foundation_type:function(e){let i=["Basement Finished","Basement Partially Finished","Basement Unfinished","Crawlspace","Other","Piers","Pilings","Stilts","Slab"];return"string"!=typeof e?{decision:"reject",note:"Foundation type must be a string"}:i.includes(e)?"Other"==e?{decision:"refer",note:null}:["Piers","Pilings","Stilts"].includes(e)?{decision:"reject",note:"Foundation type not supported"}:{decision:"accept",note:null}:{decision:"reject",note:`Foundation type must be one of ${i}`}},has_slab_foundation_plumbing:function(e){return"string"!=typeof e?{decision:"reject",note:"Has slab foundation plumbing must be a string"}:["Yes","No"].includes(e)?"Yes"===e?{decision:"reject",note:"Homes with slab foundation plumbing are not allowed"}:{decision:"accept",note:null}:{decision:"reject",note:"Has slab foundation plumbing must be Yes or No"}},fire_protective_devices:function(e){if(!Array.isArray(e))return{decision:"reject",note:"Fire protective devices must be a list"};let i=["Local","Central","Direct","Sprinkler","Fire Ext","Smoke","No"];return e.every((e=>i.includes(e)))?e.includes("Direct")||e.includes("Central")?{decision:"accept",note:null}:{decision:"reject",note:"Insufficient fire devices"}:{decision:"reject",note:`Unrecognized fire device type. Valid devices: ${i}`}},theft_protective_devices:function(e){return Array.isArray(e)?(device_types=["Dead Bolt","Local","Central","Direct","24 Hour Security Guard","No"],e.every((e=>device_types.includes(e)))?e.includes("Central")||e.includes("Direct")||e.includes("24 Hour Security Guard")?{decision:"accept",note:null}:{decision:"reject",note:"Insufficient theft device"}:{decision:"reject",note:`Unrecognized theft device type. Valid devices: ${device_types}`}):{decision:"reject",note:"Theft protective devices must be a list"}}}},529:e=>{e.exports={check_claims_history:function(e){if(!e)return{decision:"reject",note:"For Claims use empty instead of null"};let i=new Date,t=new Date,o=new Date;t.setFullYear(i.getFullYear()-5),o.setFullYear(i.getFullYear()-3);let n=e.filter((e=>e.date>t)),r=e.filter((e=>e.date>o));return n.length>2?{decision:"reject",note:"To many claims in the past 5 years"}:r.length>1?{decision:"reject",note:"To many claims in the past 3 years"}:{decision:"accept",note:null}}}},540:(e,i,t)=>{const{SocotraEntry:o}=t(630);entries_v2=[new o("quote_name","quote_name","quote.name"),new o("socotra_config_version","config_version","quote.version"),new o("fire_deductible","wf_deductible","exposure.dwelling.fields",parseFloat),new o("other_deductible","aop_deductible","exposure.dwelling.fields",parseInt),new o("water_deductible","water_deductible","exposure.dwelling.fields",parseInt),new o("square_feet","square_feet","exposure.dwelling.fields",void 0,parseInt),new o("stand_protect_discount","stand_protect_discount","exposure.dwelling.fields"),new o("multi_policy_discount","multi_policy_discount","exposure.dwelling.fields"),new o(void 0,"has_any_claim_history","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("roof_rating","roof_rating","exposure.dwelling.fields"),new o("slab_plumbing","slab_plumbing","exposure.dwelling.fields"),new o("foundation_type","foundation_type","exposure.dwelling.fields"),new o("siding_material","siding_material","exposure.dwelling.fields"),new o("distance_to_fire_department","dist_to_fire_department","exposure.dwelling.fields"),new o("protection_class","protection_class","exposure.dwelling.fields"),new o("purchase_year","property_purchase_year","exposure.dwelling.fields",void 0,parseInt),new o("roof_material","roof_material","exposure.dwelling.fields"),new o("presence_of_fence","fence","exposure.dwelling.fields"),new o("year_built","year_built","exposure.dwelling.fields"),new o("construction_type","construction_type","exposure.dwelling.fields"),new o("water_damage_limit","water_damage_limit","exposure.dwelling.fields"),new o("extended_dwelling_coverage","extended_dwelling_coverage","exposure.dwelling.fields"),new o("sprinkler","sprinkler","exposure.dwelling.fields"),new o("smoke","smoke","exposure.dwelling.fields"),new o("fire_alarm","fire_alarm_type","exposure.dwelling.fields"),new o("fire_ext","fire_ext","exposure.dwelling.fields"),new o("deadbolt","dead_bolt","exposure.dwelling.fields"),new o(void 0,"24_hour_security_guard","exposure.dwelling.fields",(e=>{}),(e=>"No")),new o("theft_alarm","theft_alarm_type","exposure.dwelling.fields"),new o("distance_to_neighboring_home","distance_to_nearest_home_ft","exposure.dwelling.fields"),new o("chimney_spark_arrestors","chimney_mesh_cover","exposure.dwelling.fields"),new o("ember_resistant_vents","ember_vents","exposure.dwelling.fields"),new o("enclosed_eaves","enclosed_eaves","exposure.dwelling.fields"),new o("fuel_tank_distance","propane_tank_proximity","exposure.dwelling.fields"),new o("ground_clearance","exterior_clearance","exposure.dwelling.fields"),new o("windows_frame_type","window_frame_type","exposure.dwelling.fields"),new o("windows_type","window_glass_type","exposure.dwelling.fields"),new o("replacement_cost","full_replacement_value","policy.fields",parseInt),new o("street_address","address","policy.fields"),new o("state","state","policy.fields"),new o("is_rental","is_rental","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("has_home_business","home_business","policy.fields"),new o("occupation","occupation","policy.fields"),new o("water_shutoff","water_shutoff_system","policy.fields"),new o("waterflow_alarm","waterflow_alarm","policy.fields"),new o("city","city","policy.fields"),new o("electrical_updated_year","electrical_last_updated","policy.fields"),new o("coverage_b","coverage_b","policy.fields",parseInt),new o("coverage_c","coverage_c","policy.fields",parseInt),new o("coverage_a","coverage_a","policy.fields",parseInt),new o("retrofitted","retrofit_1997","policy.fields"),new o("roof_replacement_year","roof_replaced_year","policy.fields"),new o("seismic_shutoff","seismic_shutoff","policy.fields"),new o("coverage_f","coverage_f","policy.fields"),new o("bellweather_wf_score","bellweather_wf_score","policy.fields"),new o("first_street_score","first_street_wf_score","policy.fields",parseInt),new o("degree_of_slope","degrees_of_slope","policy.fields"),new o("number_of_bankrupcies","bankruptcies_judgements_liens","policy.fields"),new o("coverage_d","coverage_d","policy.fields",parseInt),new o("coverage_e","coverage_e","policy.fields"),new o("gre_wf_score","gre_wf_score","policy.fields",parseFloat),new o("state","state","policy.fields"),new o("has_steel_braided_hoses","steel_braided_hoses","policy.fields"),new o("core_logic_wf_score","core_logic_score","policy.fields",parseInt),new o(void 0,"channel","policy.fields",(e=>{}),(e=>"Broker")),new o(void 0,"coverageForm","policy.fields",(e=>{}),(e=>"HO-5 Comprehensive")),new o("zip","zip","policy.fields"),new o("has_underground_fuel_tank","underground_fuel_tank","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("attractive_nuisance","has_attractive_nuisance","policy.fields"),new o("zesty_l2","zesty_l2","policy.fields",parseInt),new o("zesty_l1","zesty_l1","policy.fields",parseInt),new o("water_heater_update_year","water_heaters_last_updated","policy.fields"),new o("plumbing_updated_year","plumbing_last_updated","policy.fields"),new o("home_heating_update_year","home_heater_last_updated","policy.fields",void 0,(e=>""===e?null:e)),new o("insured_dob","date_of_birth","policy.fields"),new o("gre_arf","arf","policy.fields",parseFloat),new o("insured_dob","date_of_birth","policy.fields"),new o("flood_score","first_street_flood_score","policy.fields"),new o("home_heating_source","heating_source","policy.fields"),new o("horses","has_horses","policy.fields"),new o("metal_fittings_toilet_supply_line","metal_fittings","policy.fields"),new o("is_under_renovation","renovation","policy.fields"),new o("pool_type","swimming_pool_type","policy.fields"),new o("residence_type","dwelling_use_type","policy.fields"),new o("previous_insurance_company","pastCarrier","policy.fields"),new o("previous_policy_expiration_date","prevPolicyExpiration","policy.fields"),new o("previous_premium","prevPolicyPremium","policy.fields",void 0,parseInt),new o("fireshed_ID","fireshed_id","policy.fields"),new o("fireshed_code","fireshed_code","policy.fields"),new o("fireshed_capacity","fireshed_capacity","policy.fields",parseFloat),new o("county","county","policy.fields"),new o("ensemble_mean","wf_score_mean","policy.fields",parseFloat),new o("ensemble_variance","wf_score_variance","policy.fields",parseFloat),new o("wildfire_category","wf_score_category","policy.fields"),new o("has_additional_insured","has_co_applicant","policy.fields"),new o("months_unoccupied","months_unoccupied","policy.fields",(e=>null==e?"0":e)),new o("multifamily_unit_count","multi_family_unit_count","policy.fields",void 0,parseInt),new o("spouse_first_name","has_co_applicant","policy.fields",(e=>null),(e=>e?"Yes":"No")),new o("spouse_first_name","co_applicant_first_name","policy.fields"),new o("spouse_last_name","co_applicant_last_name","policy.fields"),new o("spouse_email","co_applicant_email","policy.fields"),new o("spouse_phone_number","co_applicant_phone_number","policy.fields"),new o("number_of_mortgages","num_mortgages","policy.fields"),new o("past_liens","bankruptcies_judgements_liens","policy.fields"),new o("property_id","retool_property_id","policy.fields"),new o("primary_dwelling_insured","primary_insured_by_stand","policy.fields",(e=>e||"Yes")),new o("lat","latitude","policy.fields",parseFloat),new o("lng","longitude","policy.fields",parseFloat),new o("count_of_solar_panels","has_solar_panels","exposure.dwelling.fields",...function(){let e={0:"No","1+":"Yes"},i={No:0,Yes:"1+"};return[e=>i[e],i=>e[i]]}()),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_id","producerId","policy.fields"),new o("producer_email","producerEmail","policy.fields"),new o("producer_name","producerName","policy.fields"),new o("producer_ascend_id","producer_ascend_id","policy.fields"),new o("producer_license_number","producer_license_number","policy.fields"),new o("producer_phone_number","producer_phone_number","policy.fields"),new o("producer_state","producer_state","policy.fields"),new o("producer_commission","commissionRate","policy.fields"),new o("producer_zip","producer_zip","policy.fields"),new o("producer_city","producer_city","policy.fields"),new o("producer_street_address","producer_street_address","policy.fields"),new o("producer_street_address2","producer_street_address_2","policy.fields"),new o("broker_license_number","distributor_license_number","policy.fields"),new o("broker_name","distributor_name","policy.fields"),new o("premium_calculated","indicated_policy_cost","policy.fields"),new o("withdrawal_reasons","withdrawal_reason","policy.fields.array"),new o("rejection_reasons","declination_reason","policy.fields.array"),new o("competing_carrier","competing_carrier","policy.fields"),new o("competing_pricing","competing_pricing","policy.fields"),new o("stand_second_approval","stand_second_approval","policy.fields"),new o("fronting_carrier_approval","fronting_carrier_approval","policy.fields"),new o("reinsurance_carrier_approved","reinsurance_carrier_approved","policy.fields"),new o("reinsurance_rate","reinsurance_rate","policy.fields"),new o("is_agreed_value","is_agreed_value","policy.fields"),new o("is_difference_in_condition","is_difference_in_condition","policy.fields"),new o("lead_source","lead_source","policy.fields",(e=>null)),new o("start_date","startTimestamp","effective_date"),new o("payment_schedule","paymentScheduleName","payment_schedule")],e.exports={entries_v2}},575:e=>{e.exports={stand_wf_knockout:function(e,i){return e<0||i<0?{category:"",underwriter_result:{decision:"reject",note:"Mean and ARF must be positive numbers"}}:Number.isFinite(i)&&Number.isFinite(e)?e>=.7?{category:"D",underwriter_result:{decision:"reject",note:"Stand WF mean must be less than or equal to 0.7"}}:i>=8?{category:"C",underwriter_result:{decision:"refer",note:null}}:i>=5||e>=.2?{category:"C",underwriter_result:{decision:"accept",note:null}}:e>=.1?{category:"B",underwriter_result:{decision:"accept",note:null}}:{category:"A",underwriter_result:{decision:"accept",note:null}}:{category:"",underwriter_result:{decision:"reject",note:"ARF must be a number"}}},wf_variance:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Variance must be a positive number."}:e<=.09?{decision:"accept",note:null}:{decision:"refer",note:null}:{decision:"reject",note:"Variance must be a number."}}}},630:e=>{const i=Object.freeze(["policy.fields","policy.fields.array","exposure.dwelling.fields","policy.group","policy","exposure.dwelling.group","quote.name","effective_date","payment_schedule","quote.version"]);e.exports={SocotraEntry:class{constructor(e,t,o,n=e=>e,r=e=>e){if(!i.includes(o))throw new Error(`Unsupported Socotra Location: ${o}`);this.retool_id=e,this.socotra_id=t,this.socotra_location=o,this.to_scotra_func=r,this.to_retool_func=n}socotra_create_response(e,i){let t=this.to_scotra_func(e[this.retool_id]);if(this.socotra_location.includes("policy.fields"))i.fieldValues[this.socotra_id]=t;else if("exposure.dwelling.fields"===this.socotra_location)i.exposures[0].fieldValues[this.socotra_id]=t;else if("quote.name"===this.socotra_location);else if("effective_date"===this.socotra_location){const e=new Date(`${t}T00:00:00-08:00`),o=e.getTime();i.policyStartTimestamp=o;const n=new Date(e);n.setFullYear(e.getFullYear()+1),i.policyEndTimestamp=n.getTime()}else if("payment_schedule"===this.socotra_location)["upfront","quarterly"].includes(t)&&(i.paymentScheduleName=t);else{if("quote.version"!==this.socotra_location)throw new Error(`Location Not implemented: ${JSON.stringify(this)}`);i.configVersion=t}}retool_response(e,i){let t,o;if(this.socotra_location.includes("policy.fields"))t=e.characteristics.fieldValues[this.socotra_id];else{if("exposure.dwelling.fields"!==this.socotra_location){if("quote.name"===this.socotra_location)return void(i[this.retool_id]=e.name);if("effective_date"===this.socotra_location){let t=parseInt(e.characteristics[this.socotra_id])/1e3;var n=new Date(0);return n.setUTCSeconds(t),void(i[this.retool_id]=`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`)}if("payment_schedule"===this.socotra_location)return void(i[this.retool_id]=e[this.socotra_id]);if("quote.version"==this.socotra_location)return;throw new Error(`Location Not implemented: ${JSON.stringify(this)}`)}t=e.exposures.find((e=>"dwelling"===e.name)).characteristics.at(-1).fieldValues[this.socotra_id]}o=this.socotra_location.includes("array")?t:t?.[0]??null,o=this.to_retool_func(o),i[this.retool_id]=o}socotra_update(e,i){let t=this.to_scotra_func(e[this.retool_id]);if(this.socotra_location.includes("policy.fields"))i.fieldValues[this.socotra_id]=t;else if("exposure.dwelling.fields"===this.socotra_location)i.updateExposures[0].fieldValues[this.socotra_id]=t;else if("quote.name"===this.socotra_location)i.name=t;else if("effective_date"===this.socotra_location){const e=new Date(`${t}T00:00:00-08:00`);i.policyStartTimestamp=e.getTime();const o=new Date(e);o.setFullYear(e.getFullYear()+1),i.policyEndTimestamp=o.getTime()}else{if("payment_schedule"!==this.socotra_location){if("quote.version"===this.socotra_location)return;throw new Error(`Location Not implemented: ${JSON.stringify(this)}`)}["upfront","quarterly"].includes(t)&&(i.paymentScheduleName=t)}}static build_group(e,i){return{name:i}}static socotra_create_policy_template(e){return{policyholderLocator:e,productName:"homeowners",finalize:!1,paymentScheduleName:"upfront",exposures:[{exposureName:"dwelling",perils:[{name:"wildfire_expense",fieldValues:{},fieldGroups:[]},{name:"fire_following_earthquake",fieldValues:{},fieldGroups:[]},{name:"liability",fieldValues:{},fieldGroups:[]},{name:"other",fieldValues:{},fieldGroups:[]},{name:"theft",fieldValues:{},fieldGroups:[]},{name:"water_cat",fieldValues:{},fieldGroups:[]},{name:"water_excluding_cat",fieldValues:{},fieldGroups:[]},{name:"wildfire",fieldValues:{},fieldGroups:[]},{name:"wind_cat",fieldValues:{},fieldGroups:[]},{name:"wind_excluding_cat",fieldValues:{},fieldGroups:[]},{name:"fire",fieldValues:{},fieldGroups:[]},{name:"fac_prem",fieldValues:{},fieldGroups:[]},{name:"minimum_premium",fieldValues:{},fieldGroups:[]}],fieldValues:{},fieldGroups:[]}],fieldValues:{},fieldGroups:[],configVersion:-1}}static socotra_create_update_template(e){return{updateExposures:[{exposureLocator:e,fieldValues:{},fieldGroups:[]}],fieldValues:{}}}}}},729:e=>{e.exports={number_of_dogs:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Number of dogs must be a positive number."}:e<4?{decision:"accept",note:null}:{decision:"reject",note:"Owner has 4 or more dogs"}:{decision:"reject",note:"Number of dogs must be a number."}},dog_history:function(e){return"Yes"==e?{decision:"reject",note:"Has a dog with a history of aggressive behavior"}:"No"==e?{decision:"accept",note:null}:{decision:"reject",note:"Dog has history must be Yes or No."}},dog_breeds:function(e){return Array.isArray(e)?e.every((e=>"non-guard dog of other breeds"===e))?{decision:"accept",note:null}:{decision:"reject",note:"Dog of given breed not allowed"}:{decision:"reject",note:"Dog breed must be a list"}},exotic_pets:function(e){return"Yes"==e?{decision:"reject",note:"Has an exotic pet"}:"No"==e?{decision:"accept",note:null}:{decision:"reject",note:"Has exotic pet must be Yes or No."}},number_of_mortgages:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Number of mortgages must be a positive number."}:e<2?{decision:"accept",note:null}:{decision:"refer",note:null}:{decision:"reject",note:"Number of mortgages must be a number."}},number_of_bankruptcies_judgements_or_liens:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Number of bankruptcies, judgements, or liens must be a positive number"}:0===e?{decision:"accept",note:null}:{decision:"reject",note:"Has bankruptcies, judgements, or liens"}:{decision:"reject",note:"Number of bankruptcies, judgements, or liens must be a number"}},home_business_type:function(e){return"string"!=typeof e?{decision:"reject",note:"Home business type must be a string"}:["yes - day care","yes - other","no"].includes(e)?"no"==e?{decision:"accept",note:null}:"yes - day care"==e?{decision:"reject",note:"Cannot insure daycare"}:{decision:"refer",note:null}:{decision:"reject",note:"Home business type must be in [yes - day care, yes - other, no]"}},home_rental_type:function(e){return"string"!=typeof e?{decision:"reject",note:"Home rental type must be a string"}:["short-term rentals less than 6 months of the year","short term rentals more than 6 months of the year","timeshare","no"].includes(e)?"no"==e?{decision:"accept",note:null}:["short-term rentals less than 6 months of the year","timeshare"].includes(e)?{decision:"refer",note:null}:{decision:"reject",note:"Cannot insure rentals longer than 6 months"}:{decision:"reject",note:"Home rental type must be in [short-term rentals less than 6 months of the year, short term rentals more than 6 months of the year, timeshare, no]"}},same_address:function(e,i){return e===i?{decision:"accept",note:null}:{decision:"reject",note:"Co-Applicant must have same address as Applicant."}}}},752:e=>{e.exports={distance_to_coast:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Distance to coast must be a positive number."}:e>.19?{decision:"accept",note:null}:{decision:"refer",note:null}:{decision:"reject",note:"Distance to coast must be a number."}},pool_features:function(e){if(!Array.isArray(e))return{decision:"reject",note:"Pool features must be a list."};let i=e.includes("Inground")&&(e.includes("Electric retractable safety cover")||e.includes("Fenced with self-locking gate"));return i=i||e.includes("Above Ground")&&e.includes("Retractable/removable ladder"),e.includes("Diving Board")||e.includes("Slide")?{decision:"refer",note:null}:i?{decision:"accept",note:null}:{decision:"refer",note:null}},farming_type:function(e){let i=["Farming activities produce income","Incidental or hobby farming","Vineyard","None"];return"string"!=typeof e?{decision:"reject",note:"Farming type must be a string"}:i.includes(e)?"Vineyard"==e?{decision:"refer",note:null}:"Farming activities produce income"==e?{decision:"reject",note:"Cannot insure commercial farms"}:{decision:"accept",note:null}:{decision:"reject",note:`Farming type must be in [${i}]`}},has_attractive_nuisance:function(e){return"Yes"==e?{decision:"refer",note:null}:"No"==e?{decision:"accept",note:null}:{decision:"reject",note:"Has attractive nuisance must be Yes or No."}},degree_of_slope:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Degree of slope must be a positive number."}:e>30?{decision:"reject",note:"Slope greater than 30 degrees"}:{decision:"accept",note:null}:{decision:"reject",note:"Degree of slope must be a number."}},flood_score:function(e){return Number.isFinite(e)?e<0?{decision:"reject",note:"Flood score must be a positive number."}:e<9?{decision:"accept",note:null}:{decision:"reject",note:"Flood risk is too high"}:{decision:"reject",note:"Flood score must be a number."}}}},991:(e,i,t)=>{const{SocotraEntry:o}=t(630);e.exports={SocotraPayloadConverter:class{constructor(e){this.entries=e}policy_holder_payload(e){let i=[],t=["owner_first_name","owner_last_name","owner_email"];for(const o of t)e[o]||i.push(o);if(0==i.length){let i={first_name:e.owner_first_name,last_name:e.owner_last_name,email:e.owner_email,phone_number:e.owner_phone_number,mailing_street_address:e.mailing_street_address,mailing_street_address_2:e.mailing_street_address2,mailing_city:e.mailing_city,mailing_state:e.mailing_state,mailing_zip:e.mailing_zip,ofac_date:e.ofac_date_pulled,ofac_reason:e.ofac_reason,ofac_outcome:e.ofac_outcome};return{status:"success",error_message:"",payload:{completed:!0,values:this.stripNoneValues(i,!0,!0,!1)}}}return{payload:{},status:"error",error_message:`must include the following fields [${i}]`}}new_policy_payload(e,i){let t=o.socotra_create_policy_template(i);return this.entries.forEach((i=>{i.socotra_create_response(e,t)})),{payload:this.stripNoneValues(t,!0,!0,!0),error_message:"",status:"success"}}quote_to_retool_payload(e){let i={};return this.entries.forEach((t=>{t.retool_response(e,i)})),{payload:this.stripNoneValues(i,!1,!0,!1),error_message:"",status:"success"}}retool_to_quote_updated(e,i){let t=this.quote_to_retool_payload(i).payload;Object.keys(e).forEach((i=>{if(Array.isArray(e[i])){let o=e[i],n=t[i];JSON.stringify(o)===JSON.stringify(n)&&delete e[i]}else t[i]===e[i]&&delete e[i]}));let n=i.exposures.find((e=>"dwelling"===e.name)).locator,r=o.socotra_create_update_template(n);return this.entries.forEach((i=>{Object.keys(e).includes(i.retool_id)&&i.socotra_update(e,r)})),r=this.stripNoneValues(r,!0,!0,!1),0===Object.keys(r.updateExposures[0].fieldValues).length&&delete r.updateExposures,0===Object.keys(r.fieldValues).length&&delete r.fieldValues,{payload:r,error_message:"",status:"success"}}stripNoneValues(e,i,t,o){return i&&(e=this.stripNulls(e,(e=>null==e))),t&&(e=this.stripNulls(e,(e=>void 0===e))),o&&(e=this.stripNulls(e,(e=>Number.isNaN(e)))),e}stripNulls(e,i){let t=e=>this.stripNulls(e,i);return Array.isArray(e)?e.map(t).filter((e=>!i(e))):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map((([e,i])=>[e,t(i)])).filter((([e,t])=>!i(t)))):e}}}}},i={},function t(o){var n=i[o];if(void 0!==n)return n.exports;var r=i[o]={exports:{}};return e[o](r,r.exports,t),r.exports}(44);var e,i}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stand_socotra_policy_transformer",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Stands internal javascipt module for executing underwritting",
5
5
  "main": "dist/stand_underwriter.js",
6
6
  "scripts": {
@@ -66,7 +66,7 @@ entries_v2 = [
66
66
  new SocotraEntry("roof_replacement_year", "roof_replaced_year", "policy.fields"),
67
67
  new SocotraEntry("seismic_shutoff", "seismic_shutoff", "policy.fields"),
68
68
  new SocotraEntry("coverage_f", "coverage_f", "policy.fields"),
69
- new SocotraEntry("bellweather_wf_score", "bellweather_wf_score", "policy.fields", parseFloat),
69
+ new SocotraEntry("bellweather_wf_score", "bellweather_wf_score", "policy.fields"),
70
70
  new SocotraEntry("first_street_score", "first_street_wf_score", "policy.fields", parseInt),
71
71
  new SocotraEntry("degree_of_slope", "degrees_of_slope", "policy.fields"),
72
72
  new SocotraEntry("number_of_bankrupcies", "bankruptcies_judgements_liens", "policy.fields"),